]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fuse: add need_resched() before unlocking bucket
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 14 Jan 2026 14:53:40 +0000 (15:53 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 16 Jan 2026 18:15:14 +0000 (19:15 +0100)
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>
fs/fuse/dir.c

index c9922af79dfac374774b90cadf9f71db6ebf6f97..93bde5b8c181dbee298d61bb6becec4a236b1f28 100644 (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);