Re: [RFC] iput() cleanup (was Re: [patch 12/16] fix race between writeback and unlink)

Chris Mason
2002-06-03T19:51:13Z

On Mon, 2002-06-03 at 15:34, Linus Torvalds wrote:
>
> On 3 Jun 2002, Chris Mason wrote:
> >
> > Now that is kinda neat, calling it with the inode lock held lets me move
> > some things out of reiserfs_file_release which need i_sem, and move them
> > into a less expensive drop_inode call without grabbing the semaphore.
>
> CAREFUL!
>
> If you make real per-FS use of this, and aren't just using the standard
> ones, you need to be very very careful. In particular, you get called with
> the inode lock held, but you would have to drop the lock yourself after
> having removed the inode from the hash chains etc. I'd like people to
> avoid playing too many games in this area, the locking and the exact
> semantics of "drop_inode" are rather nasty.

Right, I don't want too much in there. There are a few things I need to
do when I know nobody else is messing with the inode, and I'm using
i_sem to provide that now. put_inode doesn't do what I need because
knfsd might iget his way into the mess.

I'm talking a very limited set of operations followed by calling the
generic functions. I might not do it at all if I can't get them safe
when called under the spin lock.

-chris