Re: [PATCH 5/8] exofs: dir_inode and directory operations

From: Evgeniy Polyakov
Date: Sun Mar 15 2009 - 14:37:49 EST


On Sun, Mar 15, 2009 at 08:10:36PM +0200, Boaz Harrosh (bharrosh@xxxxxxxxxxx) wrote:
> >>> + atomic_inc(&inode->i_count);
> >>> +
> >>> + ret = exofs_async_op(or, create_done, inode, oi->i_cred);
> >>> + if (ret) {
> >>> + atomic_dec(&inode->i_count);
> >> igrab()/iput()?
> >>
> >
> > Thanks, makes much more sense. Sorry leftovers from 2.6.10
> >
>
> It's the same at ext2. I looked at the igrab()/iput() code it does some extra
> locks which I'm afraid of at this stage. I'll postpone this to the next (next)
> merge window, after I ran with it for a while.

It does not allow to work with to be freed inode, getting that it is
fresh inode, things should be ok just to increase the reference counter,
but iput() may highlight problems if inode's reference counter can be
decreased, and apparently it can not since otherwise increment would not
be added around exofs_async_op().

What if exofs_async_op() drops a reference and returns error? inode will
not be freed and will not be placed into to be freed list, which in turn
will break accounting and potentially prevent superblock freeing.

--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/