linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Kirill Smelkov <kirr@nexedi.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>,
	Han-Wen Nienhuys <hanwen@google.com>,
	Jakob Unterwurzacher <jakobunt@gmail.com>,
	Kirill Tkhai <ktkhai@virtuozzo.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	fuse-devel <fuse-devel@lists.sourceforge.net>,
	stable <stable@vger.kernel.org>
Subject: Re: [RESEND4, PATCH 1/2] fuse: retrieve: cap requested size to negotiated max_write
Date: Wed, 24 Apr 2019 14:17:27 +0200	[thread overview]
Message-ID: <CAJfpegsiWuykUsfg=sO8sKo5h86U65q10=e=wYKXTQEHW8DFkw@mail.gmail.com> (raw)
In-Reply-To: <20190424115620.GA2723@deco.navytux.spb.ru>

On Wed, Apr 24, 2019 at 1:56 PM Kirill Smelkov <kirr@nexedi.com> wrote:

> I assume you are meaning this:
>
>         --- a/fs/fuse/dev.c
>         +++ b/fs/fuse/dev.c
>         @@ -1745,15 +1745,15 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
>                 unsigned int offset;
>                 size_t total_len = 0;
>                 unsigned int num_pages;
>
>                 offset = outarg->offset & ~PAGE_MASK;
>                 file_size = i_size_read(inode);
>
>         -       num = outarg->size;
>         +       num = min(outarg->size, fc->max_write);
>                 if (outarg->offset > file_size)
>                         num = 0;
>                 else if (outarg->offset + num > file_size)
>                         num = file_size - outarg->offset;               <-- THIS
>
>                 num_pages = (num + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
>                 num_pages = min(num_pages, fc->max_pages);
>
> and then in this case (offset + num > file_size) num overwrite
>
>         num = file_size - offset
>
> can make num only smaller, right? And then the patch is not wrong because there
> is no other num overwriting in this function except when num is being further
> decremented in loop that prepares pages to retrieve.

You're right, of course.


> > Also the patch is whitespace damaged.
>
> I've tried to do the following in my mutt on "RESEND4, PATCH 1/2"
> message:
>
>         |(cd ~/src/linux/linux && git am -)
>
> and the patch applied successfully. So could you please clarify what
> "whitespace damaged" means?

Hmm, apparently this (and only this) message is "quoted-printable"
encoded.  git-am seems to handle it fine, but my script doesn't.
Anyway, I'll do it manually.

Thanks,
Miklos

  reply	other threads:[~2019-04-24 12:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 10:15 [RESEND4, PATCH 0/2] fuse: don't stuck clients on retrieve_notify with size > max_write Kirill Smelkov
2019-03-27 10:15 ` [RESEND4, PATCH 2/2] fuse: require /dev/fuse reads to have enough buffer capacity as negotiated Kirill Smelkov
2019-04-24 10:48   ` Miklos Szeredi
2019-04-24 11:58     ` Kirill Smelkov
2019-03-27 10:15 ` [RESEND4, PATCH 1/2] fuse: retrieve: cap requested size to negotiated max_write Kirill Smelkov
2019-04-24 10:44   ` Miklos Szeredi
2019-04-24 11:56     ` Kirill Smelkov
2019-04-24 12:17       ` Miklos Szeredi [this message]
2019-04-24 12:31         ` Kirill Smelkov
2019-04-24 13:19           ` Miklos Szeredi
2019-04-24 14:22             ` Kirill Smelkov
2019-04-24 15:02               ` Miklos Szeredi
2019-04-24 18:10                 ` Kirill Smelkov
2019-04-24 18:59                   ` Kirill Smelkov

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='CAJfpegsiWuykUsfg=sO8sKo5h86U65q10=e=wYKXTQEHW8DFkw@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=akpm@linux-foundation.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=hanwen@google.com \
    --cc=jakobunt@gmail.com \
    --cc=kirr@nexedi.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).