linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>,
	David Howells <dhowells@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] fs: fork do_splice_copy_file_range() from do_splice_direct()
Date: Thu, 30 Nov 2023 14:30:09 +0100	[thread overview]
Message-ID: <20231130133009.pufons7adm7mjndl@quack3> (raw)
In-Reply-To: <CAOQ4uxixp3YRE0xRDe5EkTmTvnRU_qeJ=R=MqxRWkqHRtLf+4A@mail.gmail.com>

On Thu 30-11-23 12:09:09, Amir Goldstein wrote:
> On Wed, Nov 29, 2023 at 10:07 PM Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > The new helper is meant to be called from context of ->copy_file_range()
> > methods instead of do_splice_direct().
> >
> > Currently, the only difference is that do_splice_copy_file_range() does
> > not take a splice flags argument and it asserts that file_start_write()
> > was called.
> >
> > Soon, do_splice_direct() will be called without file_start_write() held.
> >
> > Use the new helper from __ceph_copy_file_range(), that was incorrectly
> > passing the copy_file_range() flags argument as splice flags argument
> > to do_splice_direct(). the value of flags was 0, so no actual bug fix.
> >
> > Move the definition of both helpers to linux/splice.h.
> >
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
...
> > +/**
> > + * do_splice_copy_file_range - splices data for copy_file_range()
> > + * @in:                file to splice from
> > + * @ppos:      input file offset
> > + * @out:       file to splice to
> > + * @opos:      output file offset
> > + * @len:       number of bytes to splice
> > + *
> > + * Description:
> > + *    For use by generic_copy_file_range() and ->copy_file_range() methods.
> > + *
> > + * Callers already called rw_verify_area() on the entire range.
> > + */
> > +long do_splice_copy_file_range(struct file *in, loff_t *ppos, struct file *out,
> > +                              loff_t *opos, size_t len)
> 
> FYI, I renamed do_splice_vfs_copy_file_range => splice_file_range in v2
> for brevity.

Yeah, after the rename things look better :). Otherwise I didn't find any
problem so feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-11-30 13:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 20:07 [PATCH 0/2] Avert possible deadlock with splice() and fanotify Amir Goldstein
2023-11-29 20:07 ` [PATCH 1/2] fs: fork do_splice_copy_file_range() from do_splice_direct() Amir Goldstein
2023-11-30 10:09   ` Amir Goldstein
2023-11-30 13:30     ` Jan Kara [this message]
2023-11-30 13:18   ` Christian Brauner
2023-11-30 13:37     ` Amir Goldstein
2023-11-29 20:07 ` [PATCH 2/2] fs: move file_start_write() into direct_splice_actor() Amir Goldstein
2023-11-30 13:32   ` Jan Kara
2023-11-30  8:32 ` [PATCH 0/2] Avert possible deadlock with splice() and fanotify Amir Goldstein
2023-11-30 10:07   ` Amir Goldstein
2023-11-30 13:37     ` Jan Kara
2023-11-30 13:46       ` Amir Goldstein

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=20231130133009.pufons7adm7mjndl@quack3 \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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).