io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, Jann Horn <jannh@google.com>
Cc: io-uring <io-uring@vger.kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Clay Harris <bugs@claycon.org>
Subject: Re: [PATCH 1/2] splice: export do_tee()
Date: Mon, 4 May 2020 19:36:25 +0300	[thread overview]
Message-ID: <9d43b5b5-577b-bc44-1667-fdd2055e63d7@gmail.com> (raw)
In-Reply-To: <1007c4ff-2af0-1473-a268-a0ae245d8188@gmail.com>

On 04/05/2020 17:03, Pavel Begunkov wrote:
> On 04/05/2020 16:43, Jens Axboe wrote:
>> On 5/4/20 6:31 AM, Pavel Begunkov wrote:
>>> On 04/05/2020 14:09, Jann Horn wrote:
>>>> On Sat, May 2, 2020 at 2:10 PM Pavel Begunkov <asml.silence@gmail.com> wrote:
>>>>> export do_tee() for use in io_uring
>>>> [...]
>>>>> diff --git a/fs/splice.c b/fs/splice.c
>>>> [...]
>>>>>   * The 'flags' used are the SPLICE_F_* variants, currently the only
>>>>>   * applicable one is SPLICE_F_NONBLOCK.
>>>>>   */
>>>>> -static long do_tee(struct file *in, struct file *out, size_t len,
>>>>> -                  unsigned int flags)
>>>>> +long do_tee(struct file *in, struct file *out, size_t len, unsigned int flags)
>>>>>  {
>>>>>         struct pipe_inode_info *ipipe = get_pipe_info(in);
>>>>>         struct pipe_inode_info *opipe = get_pipe_info(out);
>>>>
>>>> AFAICS do_tee() in its current form is not something you should be
>>>> making available to anything else, because the file mode checks are
>>>> performed in sys_tee() instead of in do_tee(). (And I don't see any
>>>> check for file modes in your uring patch, but maybe I missed it?) If
>>>> you want to make do_tee() available elsewhere, please refactor the
>>>> file mode checks over into do_tee().
>>>
>>> Overlooked it indeed. Glad you found it
>>
>> Yeah indeed, that's a glaring oversight on my part too. Will you send
>> a patch for 5.7-rc as well for splice?
> 
> Absolutely

The right way would be to do as Jann proposed, but would you prefer an
io_uring.c local fix for-5.7 and then a proper one? I assume it could be easier
to manage.

-- 
Pavel Begunkov

  reply	other threads:[~2020-05-04 16:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 12:09 [PATCH 0/2] add tee(2) support Pavel Begunkov
2020-05-02 12:09 ` [PATCH 1/2] splice: export do_tee() Pavel Begunkov
2020-05-04 11:09   ` Jann Horn
2020-05-04 12:31     ` Pavel Begunkov
2020-05-04 13:43       ` Jens Axboe
2020-05-04 14:03         ` Pavel Begunkov
2020-05-04 16:36           ` Pavel Begunkov [this message]
2020-05-04 16:39             ` Jens Axboe
2020-05-02 12:09 ` [PATCH 2/2] io_uring: add tee(2) support Pavel Begunkov

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=9d43b5b5-577b-bc44-1667-fdd2055e63d7@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bugs@claycon.org \
    --cc=io-uring@vger.kernel.org \
    --cc=jannh@google.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;
as well as URLs for NNTP newsgroup(s).