[Devel] [PATCH RHEL7 COMMIT] fuse kio: kio must not fail when not being able to claim a file

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jul 25 18:12:45 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.9.1.vz7.63.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.9.1.vz7.63.2
------>
commit bfa3902256f4dacb3d7e76ad1e4bcbabaff047d1
Author: Alexey Kuznetsov <kuznet at virtuozzo.com>
Date:   Wed Jul 25 18:12:45 2018 +0300

    fuse kio: kio must not fail when not being able to claim a file
    
    Affects: https://jira.sw.ru/browse/PSBM-86866
    
    Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
    Reviewed-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 3ff07397820e..ab4219c0ac86 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -202,8 +202,8 @@ static int fuse_pcs_getfileinfo(struct fuse_conn *fc, struct file *file,
 	fuse_request_send(fc, req);
 
 	if (req->out.h.error || outarg->result) {
-		printk("%s:%d h.err:%d result:%d\n", __FUNCTION__, __LINE__,
-		       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;
 		fuse_put_request(fc, req);
 		return err;
@@ -250,7 +250,7 @@ static int fuse_pcs_kdirect_claim_op(struct fuse_conn *fc, struct file *file,
 	req->out.args[0].value = outarg;
 	fuse_request_send(fc, req);
 	if (req->out.h.error || outarg->result) {
-		printk("%s:%d h.err:%d result:%d\n", __FUNCTION__, __LINE__,
+		TRACE("h.err:%d result:%d\n",
 		       req->out.h.error, outarg->result);
 		err = req->out.h.error ? req->out.h.error : outarg->result;
 	}
@@ -270,7 +270,7 @@ static int kpcs_do_file_open(struct fuse_conn *fc, struct file *file, struct ino
 
 	ret = fuse_pcs_getfileinfo(fc, file, &info);
 	if (ret)
-		return ret;
+		return ret == -EOPNOTSUPP ? 0 : ret;
 
 	if (info.sys.map_type != PCS_MAP_PLAIN) {
 		TRACE("Unsupported map_type:%x, ignore\n", info.sys.map_type);
@@ -305,7 +305,8 @@ static int kpcs_do_file_open(struct fuse_conn *fc, struct file *file, struct ino
 		pcs_mapping_invalidate(&di->mapping);
 		pcs_mapping_deinit(&di->mapping);
 		kfree(di);
-		return ret;
+		/* Claim error means we cannot claim, just that */
+		return 0;
 	}
 	/* TODO: Propper initialization of dentry should be here!!! */
 	fi->private = di;


More information about the Devel mailing list