[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: freeing, allocating and free blocks in Ext3

Alexander Viro wrote:
> ...
> Notice that ext2 is also somewhat fishy. Right now I'm merging
> a bunch of ext2 patches and fixing dquot problems required
> reorganization of ext2_new_block(). I'm doing the following:
>         * _always_ decrement free blocks counters before allocation.
>           Goes both for fs-wide one and for per-group (once we've
>           chosen the group).
>         * if allocation fails for any reason - increment them.
>         * ditto for quota allocation - we grab quota for our block and
>           for prealloc ones in the very beginning and release the
>           leftovers in the end.

Sounds sane.

> As the matter of fact, with the current code I can get rid of
> lock_super() on the block/inode allocation/freeing. Invariant:
> free {block,inode} counters are always less or equal the actual
> number of free objects. Moreover, with a little work we can
> get rid of BKL in the whole block allocation path, but that's
> another story...

Ah. lock_super().  I nearly fell out of my tree when I saw that
thing.  ext3 has lock_journal(), which is a clone.  Did I hear
a rumour that you had a replacement for lock_super() coded up?

Also, have you chosen an appropriate place for clearing BH_New?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]