fuse: add need_resched() before unlocking bucket

In fuse_dentry_tree_work() no need to unlock/lock dentry_hash[i].lock on
each iteration.

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Link: https://patch.msgid.link/20260114145344.468856-4-mszeredi@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Miklos Szeredi 2026-01-14 15:53:40 +01:00 committed by Christian Brauner
parent 1e2c1af1be
commit 09f7a43ae5
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -177,9 +177,11 @@ static void fuse_dentry_tree_work(struct work_struct *work)
fd->dentry->d_flags |= DCACHE_OP_DELETE;
spin_unlock(&fd->dentry->d_lock);
d_dispose_if_unused(fd->dentry, &dispose);
spin_unlock(&dentry_hash[i].lock);
cond_resched();
spin_lock(&dentry_hash[i].lock);
if (need_resched()) {
spin_unlock(&dentry_hash[i].lock);
cond_resched();
spin_lock(&dentry_hash[i].lock);
}
} else
break;
node = rb_first(&dentry_hash[i].tree);