diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-12-09 06:27:51 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-01-18 01:46:06 +0300 |
commit | 1c9be84a9074b2b91c0db6b88174145504acf0ef (patch) | |
tree | 3f9730128a07edb4b5efab31909f6c70a3314974 /fs/ext4/fast_commit.c | |
parent | 58cf9c383c5c686668082f83f7e0f3e0bd5cc2e3 (diff) | |
download | linux-1c9be84a9074b2b91c0db6b88174145504acf0ef.tar.xz |
make take_dentry_name_snapshot() lockless
Use ->d_seq instead of grabbing ->d_lock; in case of shortname dentries
that avoids any stores to shared data objects and in case of long names
we are down to (unavoidable) atomic_inc on the external_name refcount.
Makes the thing safer as well - the areas where ->d_seq is held odd are
all nested inside the areas where ->d_lock is held, and the latter are
much more numerous.
NOTE: now that there is a lockless path where we might try to grab
a reference to an already doomed external_name instance, it is no
longer possible for external_name.u.count and external_name.u.head
to share space (kudos to Linus for spotting that).
To reduce the noise this commit just make external_name.u a struct
(instead of union); the next commit will dissolve it.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/fast_commit.c')
0 files changed, 0 insertions, 0 deletions