fuse kio: Return possibility to handle files served in userspace

Submitted by Kirill Tkhai on Oct. 10, 2018, 4:43 p.m.

Details

Message ID 153918941309.16572.15715002556834412796.stgit@localhost.localdomain
State New
Series "fuse kio: Return possibility to handle files served in userspace"
Headers show

Commit Message

Kirill Tkhai Oct. 10, 2018, 4:43 p.m.
Fallback to old behavior, when !fi->private files are
served in userspace.

https://pmc.acronis.com/browse/VSTOR-15947

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c |    8 ++++++--
 1 file changed, 6 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 cd059b28d940..14bed318d139 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1073,8 +1073,10 @@  static int pcs_kio_classify_req(struct fuse_conn *fc, struct fuse_req *req, bool
 	case FUSE_SETATTR: {
 		struct fuse_setattr_in const *inarg = req->in.args[0].value;
 
-		if (unlikely(!fi || !fi->private))
+		if (unlikely(!fi))
 			goto fail;
+		if (!fi->private)
+			return 1;
 		if (!(inarg->valid & FATTR_SIZE))
 			return 1;
 		if (lk)
@@ -1096,8 +1098,10 @@  static int pcs_kio_classify_req(struct fuse_conn *fc, struct fuse_req *req, bool
 		return 1;
 	}
 
-	if (unlikely(!fi || !fi->private))
+	if (unlikely(!fi))
 		goto fail;
+	if (!fi->private)
+		return 1;
 
 	return 0;
 

Comments

Pavel Butsykin Oct. 10, 2018, 4:59 p.m.
On 10.10.2018 19:43, Kirill Tkhai wrote:
> Fallback to old behavior, when !fi->private files are
> served in userspace.
> 
> https://pmc.acronis.com/browse/VSTOR-15947
> 
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

Acked-by: Pavel Butsykin <pbutsykin@virtuozzo.com>

> ---
>   fs/fuse/kio/pcs/pcs_fuse_kdirect.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> index cd059b28d940..14bed318d139 100644
> --- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> +++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
> @@ -1073,8 +1073,10 @@ static int pcs_kio_classify_req(struct fuse_conn *fc, struct fuse_req *req, bool
>   	case FUSE_SETATTR: {
>   		struct fuse_setattr_in const *inarg = req->in.args[0].value;
>   
> -		if (unlikely(!fi || !fi->private))
> +		if (unlikely(!fi))
>   			goto fail;
> +		if (!fi->private)
> +			return 1;
>   		if (!(inarg->valid & FATTR_SIZE))
>   			return 1;
>   		if (lk)
> @@ -1096,8 +1098,10 @@ static int pcs_kio_classify_req(struct fuse_conn *fc, struct fuse_req *req, bool
>   		return 1;
>   	}
>   
> -	if (unlikely(!fi || !fi->private))
> +	if (unlikely(!fi))
>   		goto fail;
> +	if (!fi->private)
> +		return 1;
>   
>   	return 0;
>   
>