[Devel] [PATCH 2/2] fuse kio: Differ fuse_pcs_kdirect_claim_op() return values

Kirill Tkhai ktkhai at virtuozzo.com
Thu Oct 11 18:00:08 MSK 2018


Fail open in case of fuse_get_req() was failed,
and leave it successful in case of vstorage-mount
said we can't claim file by kio (e.g., file will
be served by userspace).

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index f221001519c3..d56cbc542542 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -293,7 +293,7 @@ static int fuse_pcs_kdirect_claim_op(struct fuse_conn *fc, struct file *file,
 	if (req->out.h.error || outarg->result) {
 		TRACE("h.err:%d result:%d\n",
 		       req->out.h.error, outarg->result);
-		err = req->out.h.error ? req->out.h.error : outarg->result;
+		err = -EOPNOTSUPP;
 	}
 
 	fuse_put_request(fc, req);
@@ -347,7 +347,7 @@ static int kpcs_do_file_open(struct fuse_conn *fc, struct file *file, struct ino
 		pcs_mapping_deinit(&di->mapping);
 		kfree(di);
 		/* Claim error means we cannot claim, just that */
-		return 0;
+		return (ret == -EOPNOTSUPP ? 0: ret);
 	}
 	/* TODO: Propper initialization of dentry should be here!!! */
 	fi->private = di;



More information about the Devel mailing list