[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: add FUSE_S_FAIL_IMMEDIATELY check in pcs_fuse_submit()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Feb 4 12:27:45 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.10
------>
commit 563571084bb3a15296b1eb6345abb95b388341f2
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date:   Mon Feb 4 12:27:43 2019 +0300

    fs/fuse kio: add FUSE_S_FAIL_IMMEDIATELY check in pcs_fuse_submit()
    
    Fuse file with FUSE_S_FAIL_IMMEDIATELY state should not allow to execute new
    requests. But in case of kio requests it doesn't work because the status check
    is located behind kio.op->req_send(). To fix this let's add the status check
    in pcs_fuse_submit().
    
    Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index c5e9956e3dca..55a11a3a925a 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -990,6 +990,11 @@ static void pcs_fuse_submit(struct pcs_fuse_cluster *pfc, struct fuse_req *req,
 
 submit:
 	spin_lock(&di->kq_lock);
+	if (req->ff && test_bit(FUSE_S_FAIL_IMMEDIATELY, &req->ff->ff_state)) {
+		spin_unlock(&di->kq_lock);
+		req->out.h.error = -EIO;
+		goto error;
+	}
 	list_add_tail(&req->list, &di->kq);
 	spin_unlock(&di->kq_lock);
 



More information about the Devel mailing list