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

Linus Torvalds
2002-06-03T19:35:17Z

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.

Linus