linux/Documentation
Al Viro 2f42f1eb90 Call retain_dentry() with refcount 0
Instead of bumping it from 0 to 1, calling retain_dentry(), then
decrementing it back to 0 (with ->d_lock held all the way through),
just leave refcount at 0 through all of that.

It will have a visible effect for ->d_delete() - now it can be
called with refcount 0 instead of 1 and it can no longer play
silly buggers with dropping/regaining ->d_lock.  Not that any
in-tree instances tried to (it's pretty hard to get right).

Any out-of-tree ones will have to adjust (assuming they need any
changes).

Note that we do not need to extend rcu-critical area here - we have
verified that refcount is non-negative after having grabbed ->d_lock,
so nobody will be able to free dentry until they get into __dentry_kill(),
which won't happen until they manage to grab ->d_lock.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2023-11-25 02:33:56 -05:00
..
2023-11-09 13:37:28 -08:00
2023-11-10 12:22:14 -08:00
2023-11-06 15:06:06 -08:00
2023-11-04 08:07:19 -10:00
2023-11-03 15:15:47 -10:00
2023-10-30 20:30:49 -10:00
2023-11-01 15:28:33 -10:00
2023-10-23 19:38:22 +01:00
2023-11-06 15:06:06 -08:00
2023-11-03 16:00:42 -10:00
2023-10-31 16:37:07 -04:00