Skip to content

Commit 42815f8

Browse files
Hou TaoMiklos Szeredi
authored andcommitted
fuse: set FR_PENDING atomically in fuse_resend()
When fuse_resend() moves the requests from processing lists to pending list, it uses __set_bit() to set FR_PENDING bit in req->flags. Using __set_bit() is not safe, because other functions may update req->flags concurrently (e.g., request_wait_answer() may call set_bit(FR_INTERRUPTED, &flags)). Fix it by using set_bit() instead. Fixes: 760eac7 ("fuse: Introduce a new notification type for resend pending requests") Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 9fe2a03 commit 42815f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fuse/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ static void fuse_resend(struct fuse_conn *fc)
18131813
spin_unlock(&fc->lock);
18141814

18151815
list_for_each_entry_safe(req, next, &to_queue, list) {
1816-
__set_bit(FR_PENDING, &req->flags);
1816+
set_bit(FR_PENDING, &req->flags);
18171817
/* mark the request as resend request */
18181818
req->in.h.unique |= FUSE_UNIQUE_RESEND;
18191819
}

0 commit comments

Comments
 (0)