From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: remove duplicate permission checks in do_sendfile()
Date: Fri, 28 Jan 2022 16:48:07 +0800 [thread overview]
Message-ID: <16ac38b7-6a3a-9f18-b8fa-ca3bfe053504@linux.alibaba.com> (raw)
In-Reply-To: <20211130080218.22517-1-tianjia.zhang@linux.alibaba.com>
ping.
Thanks.
On 11/30/21 4:02 PM, Tianjia Zhang wrote:
> The permission check for out.file is mainly performed in the function
> rw_verify_area(), and this check is called twice in the function
> do_splice_direct() and before calling do_splice_direct(). This is a
> redundant check and it is necessary to remove.
>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
> fs/read_write.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 0074afa7ecb3..bc7c3fcc3400 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1238,9 +1238,6 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
> #endif
> opipe = get_pipe_info(out.file, true);
> if (!opipe) {
> - retval = rw_verify_area(WRITE, out.file, &out_pos, count);
> - if (retval < 0)
> - goto fput_out;
> file_start_write(out.file);
> retval = do_splice_direct(in.file, &pos, out.file, &out_pos,
> count, fl);
prev parent reply other threads:[~2022-01-28 8:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 8:02 Tianjia Zhang
2022-01-28 8:48 ` Tianjia Zhang [this message]
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=16ac38b7-6a3a-9f18-b8fa-ca3bfe053504@linux.alibaba.com \
--to=tianjia.zhang@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®