[vz7] fuse: fuse_request_send_background() must clear FR_PENDING

Submitted by Maxim Patlasov on Dec. 6, 2017, 1:58 a.m.

Details

Message ID 151252546349.15515.3128542213121534450.stgit@maxim-thinkpad
State New
Series "fuse: fuse_request_send_background() must clear FR_PENDING"
Headers show

Commit Message

Maxim Patlasov Dec. 6, 2017, 1:58 a.m.
Any caller who wants to request_end() a request before
fuse_dev_do_read() has seen it, must clear FR_PENDING
bit explicitly.

fuse_abort_iqueue() already does so, fuse_request_send_background()
must do it as well. Otherwise request_end() hits WARN_ON.

https://jira.sw.ru/browse/PSBM-78342
https://jira.sw.ru/browse/PSBM-74661
https://jira.sw.ru/browse/PSBM-74660
https://jira.sw.ru/browse/PSBM-74226

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/dev.c |    1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 3427eddcfb1..7d74782c6f4 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -542,6 +542,7 @@  void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req)
 		BUG_ON(req->in.h.opcode != FUSE_READ);
 		req->out.h.error = -EIO;
 		__clear_bit(FR_BACKGROUND, &req->flags);
+		__clear_bit(FR_PENDING, &req->flags);
 		list_del_init(&req->list);
 		spin_unlock(&fc->lock);
 		request_end(fc, req);

Comments

Konstantin Khorenko Dec. 6, 2017, 2:16 p.m.
Please consider this to RK.

https://readykernel.com/

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 12/06/2017 04:58 AM, Maxim Patlasov wrote:
> Any caller who wants to request_end() a request before
> fuse_dev_do_read() has seen it, must clear FR_PENDING
> bit explicitly.
>
> fuse_abort_iqueue() already does so, fuse_request_send_background()
> must do it as well. Otherwise request_end() hits WARN_ON.
>
> https://jira.sw.ru/browse/PSBM-78342
> https://jira.sw.ru/browse/PSBM-74661
> https://jira.sw.ru/browse/PSBM-74660
> https://jira.sw.ru/browse/PSBM-74226
>
> Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
> ---
>  fs/fuse/dev.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index 3427eddcfb1..7d74782c6f4 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -542,6 +542,7 @@ void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req)
>  		BUG_ON(req->in.h.opcode != FUSE_READ);
>  		req->out.h.error = -EIO;
>  		__clear_bit(FR_BACKGROUND, &req->flags);
> +		__clear_bit(FR_PENDING, &req->flags);
>  		list_del_init(&req->list);
>  		spin_unlock(&fc->lock);
>  		request_end(fc, req);
>
> .
>