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

Pavel Butsykin pbutsykin at virtuozzo.com
Thu Jan 24 16:12:44 MSK 2019


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>
---
Note:
applies on top of "[PATCH v2] fs/fuse kio: invalidate files for kio"

 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 da4b5fba03fb..3ca1ce2d6bd5 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -986,6 +986,11 @@ error:
 
 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);
 
-- 
2.15.1



More information about the Devel mailing list