mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
fuse: set FR_PENDING atomically in fuse_resend()
[ Upstream commit42815f8ac5] 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:760eac73f9("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5268241b41
commit
a0c290ddc2
@@ -1813,7 +1813,7 @@ static void fuse_resend(struct fuse_conn *fc)
|
|||||||
spin_unlock(&fc->lock);
|
spin_unlock(&fc->lock);
|
||||||
|
|
||||||
list_for_each_entry_safe(req, next, &to_queue, list) {
|
list_for_each_entry_safe(req, next, &to_queue, list) {
|
||||||
__set_bit(FR_PENDING, &req->flags);
|
set_bit(FR_PENDING, &req->flags);
|
||||||
/* mark the request as resend request */
|
/* mark the request as resend request */
|
||||||
req->in.h.unique |= FUSE_UNIQUE_RESEND;
|
req->in.h.unique |= FUSE_UNIQUE_RESEND;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user