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

Submitted by Konstantin Khorenko on July 25, 2018, 3:08 p.m.

Details

Message ID 201807251508.w6PF8xjJ018674@finist_ce7.work
State New
Series "fuse kio: kio must not fail when not being able to claim a file"
Headers show

Commit Message

Konstantin Khorenko July 25, 2018, 3:08 p.m.
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 acbe9caccc520889ec7b0f27c7b42af00653929e
Author: Alexey Kuznetsov <kuznet@virtuozzo.com>
Date:   Wed Jul 25 18:08:59 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@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 3ff07397820e..033f3589aa70 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;
 	}
@@ -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;

Comments

Konstantin Khorenko July 25, 2018, 3:12 p.m.
dropped

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 07/25/2018 06:08 PM, Konstantin Khorenko wrote:
> 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 acbe9caccc520889ec7b0f27c7b42af00653929e
> Author: Alexey Kuznetsov <kuznet@virtuozzo.com>
> Date:   Wed Jul 25 18:08:59 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@virtuozzo.com>
> ---
>  fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> index 3ff07397820e..033f3589aa70 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;
>  	}
> @@ -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;
> .
>