mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ashish Samant <ashish.samant@oracle.com>
To: Seth Forshee <seth.forshee@canonical.com>,
	Miklos Szeredi <miklos@szeredi.hu>
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [fuse-devel] [PATCH] fuse: Fix fuse_get_user_pages() return value
Date: Tue, 19 Apr 2016 15:57:52 -0700	[thread overview]
Message-ID: <5716B7F0.8000304@oracle.com> (raw)
In-Reply-To: <1461105785-83223-1-git-send-email-seth.forshee@canonical.com>

Hi Seth,
On 04/19/2016 03:43 PM, Seth Forshee wrote:
> fuse_direct_io() expects this to return either 0 or a negative
> error code, but on success it may return a positive value.
> fuse_direct_io() may return this same value when the subsequent
> I/O operation doesn't transfer any data, which means that it will
> return a positive value when no bytes were transferred. This is
> obviously problematic.
>
> Fix fuse_get_user_pages() to return 0 on success. This will in
> turn make it so that fuse_direct_io() returns 0 if no bytes are
> transferred.
>
> Fixes: 742f992708df ("fuse: return patrial success from fuse_direct_io()")
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> ---
>   fs/fuse/file.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index b5c616c5ec98..78af5c0996b8 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1295,7 +1295,7 @@ static int fuse_get_user_pages(struct fuse_req *req, struct iov_iter *ii,
>   
>   	*nbytesp = nbytes;
>   
> -	return ret;
> +	return ret < 0 ? ret : 0;
>   }
>   
>   static inline int fuse_iter_npages(const struct iov_iter *ii_p)


I have already sent a patch to the list that does exactly the same thing :)

https://sourceforge.net/p/fuse/mailman/message/34966327/

Thanks,
Ashish

  reply	other threads:[~2016-04-19 22:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 22:43 Seth Forshee
2016-04-19 22:57 ` Ashish Samant [this message]
2016-04-20 15:43   ` [fuse-devel] " Seth Forshee
2016-04-25 11:03     ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5716B7F0.8000304@oracle.com \
    --to=ashish.samant@oracle.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=seth.forshee@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome