On Thu 02-10-25 17:36:49, Al Viro wrote:
On Thu, Oct 02, 2025 at 05:55:07PM +0200, Jan Kara wrote:
diff --git a/fs/dcache.c b/fs/dcache.c index 65cc11939654..3ec21f9cedba 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2557,6 +2557,8 @@ struct dentry *d_alloc_parallel(struct dentry *parent, spin_lock(&parent->d_lock); new->d_parent = dget_dlock(parent); hlist_add_head(&new->d_sib, &parent->d_children);
- if (parent->d_flags & DCACHE_DISCONNECTED)
spin_unlock(&parent->d_lock);new->d_flags |= DCACHE_DISCONNECTED;
Not a good place for that |=, IMO...
The second place I was considering was a bit earlier where we set DCACHE_PAR_LOOKUP in new->d_flags but then I've decided to put this under parent's d_lock so that parent->d_flags cannot change under us. But in principle that race is harmless so do you prefer to move this setting out of parent->d_lock critical section?
Honza