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

Linus Torvalds (torvalds@transmeta.com)
Mon, 3 Jun 2002 12:34:30 -0700 (PDT)


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

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