All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>,
	Christian Brauner <brauner@kernel.org>
Cc: 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, Xiubo Li <xiubli@redhat.com>
Subject: Re: [PATCH v2 0/3] Avert possible deadlock with splice() and fanotify
Date: Thu, 30 Nov 2023 11:32:12 -0500	[thread overview]
Message-ID: <982db1db61fcdc02bc176622889c4c0d8fe6f5b9.camel@kernel.org> (raw)
In-Reply-To: <20231130141624.3338942-1-amir73il@gmail.com>

On Thu, 2023-11-30 at 16:16 +0200, Amir Goldstein wrote:
> Christian,
> 
> Josef has helped me see the light and figure out how to avoid the
> possible deadlock, which involves:
> - splice() from source file in a loop mounted fs to dest file in
>   a host fs, where the loop image file is
> - fsfreeze on host fs
> - write to host fs in context of fanotify permission event handler
>   (FAN_ACCESS_PERM) on the splice source file
> 
> The first patch should not be changing any logic.
> I only build tested the ceph patch, so hoping to get an
> Acked-by/Tested-by from Jeff.
> 

Xiubo (cc'ed) is probably in a better position these days to review and
get you test results with this patch. 

> The following patches rids us of the deadlock by not holding
> file_start_write() while reading from splice source file in the
> cases where source and destination can be on different arbitrary
> filesystems.
> 
> The patches apply and tested on top of vfs.rw branch.
> 
> Thanks,
> Amir.
> 
> Changes since v1:
> - Add patch to deal with nfsd/ksmbd server-side-copy
> - Shorten helper name to splice_file_range()
> - Added assertion for flags value in generic_copy_file_range()
> - Added RVB from Jan
> 
> Amir Goldstein (3):
>   fs: fork splice_file_range() from do_splice_direct()
>   fs: move file_start_write() into direct_splice_actor()
>   fs: use do_splice_direct() for nfsd/ksmbd server-side-copy
> 
>  fs/ceph/file.c         |  9 +++--
>  fs/overlayfs/copy_up.c |  2 -
>  fs/read_write.c        | 42 +++++++++++---------
>  fs/splice.c            | 88 +++++++++++++++++++++++++++++++-----------
>  include/linux/fs.h     |  2 -
>  include/linux/splice.h | 13 ++++---
>  6 files changed, 103 insertions(+), 53 deletions(-)
> 

-- 
Jeff Layton <jlayton@kernel.org>

  parent reply	other threads:[~2023-11-30 16:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 14:16 [PATCH v2 0/3] Avert possible deadlock with splice() and fanotify Amir Goldstein
2023-11-30 14:16 ` [PATCH v2 1/3] fs: fork splice_file_range() from do_splice_direct() Amir Goldstein
2023-11-30 16:27   ` Jeff Layton
2023-12-04  8:37   ` Christoph Hellwig
2023-12-04  8:38     ` Christoph Hellwig
2023-12-04 13:29       ` Amir Goldstein
2023-12-04 14:07         ` Christoph Hellwig
2023-12-04 14:29           ` Amir Goldstein
2023-12-04 17:16             ` Jan Kara
2023-12-04 18:53               ` Amir Goldstein
2023-11-30 14:16 ` [PATCH v2 2/3] fs: move file_start_write() into direct_splice_actor() Amir Goldstein
2023-12-04  8:38   ` Christoph Hellwig
2023-11-30 14:16 ` [PATCH v2 3/3] fs: use do_splice_direct() for nfsd/ksmbd server-side-copy Amir Goldstein
2023-11-30 16:49   ` Jan Kara
2023-12-04  8:39   ` Christoph Hellwig
2023-12-04 13:19     ` Amir Goldstein
2023-12-04 14:02       ` Christoph Hellwig
2023-12-05  0:16   ` [PATCH] fs: read_write: make default in vfs_copy_file_range() reachable Bert Karwatzki
2023-12-05  3:45     ` Amir Goldstein
2023-12-05  5:01       ` Amir Goldstein
2023-12-05  9:50         ` Bert Karwatzki
2023-11-30 16:32 ` Jeff Layton [this message]
2023-12-01 10:40 ` [PATCH v2 0/3] Avert possible deadlock with splice() and fanotify Christian Brauner

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=982db1db61fcdc02bc176622889c4c0d8fe6f5b9.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiubli@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.