Skip to content

Commit 09f7a43

Browse files
Miklos Szeredibrauner
authored andcommitted
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>
1 parent 1e2c1af commit 09f7a43

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

fs/fuse/dir.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ static void fuse_dentry_tree_work(struct work_struct *work)
177177
fd->dentry->d_flags |= DCACHE_OP_DELETE;
178178
spin_unlock(&fd->dentry->d_lock);
179179
d_dispose_if_unused(fd->dentry, &dispose);
180-
spin_unlock(&dentry_hash[i].lock);
181-
cond_resched();
182-
spin_lock(&dentry_hash[i].lock);
180+
if (need_resched()) {
181+
spin_unlock(&dentry_hash[i].lock);
182+
cond_resched();
183+
spin_lock(&dentry_hash[i].lock);
184+
}
183185
} else
184186
break;
185187
node = rb_first(&dentry_hash[i].tree);

0 commit comments

Comments
 (0)