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

Submitted by Kirill Tkhai on Oct. 11, 2018, 3 p.m.

Details

Message ID 153927000698.9811.17789028066965051359.stgit@localhost.localdomain
State New
Series "Series without cover letter"
Headers show

Commit Message

Kirill Tkhai Oct. 11, 2018, 3 p.m.
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@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c |    4 ++--
 1 file changed, 2 insertions(+), 2 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 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;

Comments

Pavel Butsykin Oct. 11, 2018, 3:20 p.m.
On 11.10.2018 18:00, Kirill Tkhai wrote:
> 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@virtuozzo.com>

Reviewed-by: Pavel Butsykin <pbutsykin@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;
>