[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegsiWuykUsfg=sO8sKo5h86U65q10=e=wYKXTQEHW8DFkw@mail.gmail.com>
Date: Wed, 24 Apr 2019 14:17:27 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Kirill Smelkov <kirr@...edi.com>
Cc: Miklos Szeredi <mszeredi@...hat.com>,
Han-Wen Nienhuys <hanwen@...gle.com>,
Jakob Unterwurzacher <jakobunt@...il.com>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
fuse-devel <fuse-devel@...ts.sourceforge.net>,
stable <stable@...r.kernel.org>
Subject: Re: [RESEND4, PATCH 1/2] fuse: retrieve: cap requested size to
negotiated max_write
On Wed, Apr 24, 2019 at 1:56 PM Kirill Smelkov <kirr@...edi.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
Powered by blists - more mailing lists