linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Christian Brauner <brauner@kernel.org>,
	NeilBrown <neil@brown.name>
Subject: [PATCHES][RFC][CFT] simple_recursive_removal() work
Date: Sat, 14 Jun 2025 07:00:50 +0100	[thread overview]
Message-ID: <20250614060050.GB1880847@ZenIV> (raw)

[another part of tree-in-dcache pile pulled into a separate branch]

	Removing subtrees of kernel filesystems is done in quite a few
places; unfortunately, it's easy to get wrong.	A number of open-coded
attempts are out there, with varying amount of bogosities.

	simple_recursive_removal() had been introduced for doing that with
all precautions needed; it does an equivalent of rm -rf, with sufficient
locking, eviction of anything mounted on top of the subtree, etc.

	The series below converts a bunch of open-coded instances
to using that.  It's v6.16-rc1-based, lives in
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #work.simple_recursive_removal
Individual patches in followups.

The first commit is shared with work.rpc_pipe (and several other branches);
the rest has not been posted yet.  If there's no objections, into -next
it goes...

Shortlog:
Al Viro(8)
      simple_recursive_removal(): saner interaction with fsnotify
      add locked_recursive_removal()
      spufs: switch to locked_recursive_removal()
      binfmt_misc: switch to locked_recursive_removal()
      pstore: switch to locked_recursive_removal()
      fuse_ctl: use simple_recursive_removal()
      kill binderfs_remove_file()
      functionfs, gadgetfs: use simple_recursive_removal()

Diffstat:
 arch/powerpc/platforms/cell/spufs/inode.c | 49 ++++++-------------------------
 drivers/android/binder.c                  |  2 +-
 drivers/android/binder_internal.h         |  2 --
 drivers/android/binderfs.c                | 15 ----------
 drivers/usb/gadget/function/f_fs.c        |  3 +-
 drivers/usb/gadget/legacy/inode.c         |  7 +----
 fs/binfmt_misc.c                          | 40 +------------------------
 fs/fuse/control.c                         | 30 ++++++++-----------
 fs/fuse/fuse_i.h                          |  6 ----
 fs/libfs.c                                | 29 +++++++++++++-----
 fs/pstore/inode.c                         |  3 +-
 include/linux/fs.h                        |  2 ++
 12 files changed, 50 insertions(+), 138 deletions(-)

             reply	other threads:[~2025-06-14  6:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-14  6:00 Al Viro [this message]
2025-06-14  6:02 ` [PATCH 1/8] simple_recursive_removal(): saner interaction with fsnotify Al Viro
2025-06-14  6:02   ` [PATCH 2/8] add locked_recursive_removal() Al Viro
2025-06-16 14:38     ` Christian Brauner
2025-06-14  6:02   ` [PATCH 3/8] spufs: switch to locked_recursive_removal() Al Viro
2025-06-16 14:40     ` Christian Brauner
2025-06-16 19:14       ` Al Viro
2025-06-17 11:25         ` Christian Brauner
2025-06-14  6:02   ` [PATCH 4/8] binfmt_misc: " Al Viro
2025-06-16 14:43     ` Christian Brauner
2025-06-16 19:17       ` Al Viro
2025-06-14  6:02   ` [PATCH 5/8] pstore: " Al Viro
2025-06-16 14:43     ` Christian Brauner
2025-06-14  6:02   ` [PATCH 6/8] fuse_ctl: use simple_recursive_removal() Al Viro
2025-06-16 14:44     ` Christian Brauner
2025-06-14  6:02   ` [PATCH 7/8] kill binderfs_remove_file() Al Viro
2025-06-16 14:45     ` Christian Brauner
2025-06-14  6:02   ` [PATCH 8/8] functionfs, gadgetfs: use simple_recursive_removal() Al Viro
2025-06-16 14:46     ` Christian Brauner
2025-06-16 14:34   ` [PATCH 1/8] simple_recursive_removal(): saner interaction with fsnotify 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=20250614060050.GB1880847@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=torvalds@linux-foundation.org \
    /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).