All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Allow rmdir(2) to delete a subvolume
@ 2018-04-11  5:18 Misono Tomohiro
  2018-04-11  5:19 ` [PATCH v4 1/4] btrfs: move may_destroy_subvol() from ioctl.c to inode.c Misono Tomohiro
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Misono Tomohiro @ 2018-04-11  5:18 UTC (permalink / raw)
  To: linux-btrfs

changelog:
  v3 -> v4 ... Reorganize patches and updates commit log.
               No code change in total
  v2 -> v3 ... Use if-else block instead of two if blocks and 
               add Tested-by tag in 2nd patch
  v1 -> v2 ... Split the patch to hopefully make review easier

Note: I will send a xfstest if this series is merged.

This series changes the behavior of rmdir(2) and allow it to delete an
empty subvolume.

1st to 3rd patches refactor btrfs_ioctl_snap_destroy() and no functional
change happens.

btrfs_ioctl_snap_destroy() is roughly comprised of two parts.
The first part is permission check of the (parent) subvolume. The second
part is additional check (1. send is not in progress. 2. the subvolume
is not a default subvolume. 3. the subvolume does not contain other
subvoume) and actual deletion process.

The aim of 1st to 3rd patches is to  extract the second part as
btrfs_delete_subvolume().

4th patch is just one line but this changes the behavior of rmdir(2)
by calling btrfs_delete_subvolume(). For rmdir(2), permission check is
already done in vfs layer.

Tomohiro Misono (4):
  btrfs: move may_destroy_subvol() from ioctl.c to inode.c
  btrfs: Add definition of btrfs_delete_subvolume()
  btrfs: Refactor btrfs_ioctl_snap_destroy() by using
    btrfs_delete_subvolume()
  btrfs: Allow rmdir(2) to delete an empty subvolume

 fs/btrfs/ctree.h |   5 +-
 fs/btrfs/inode.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/ioctl.c | 185 +--------------------------------------------------
 3 files changed, 198 insertions(+), 189 deletions(-)

-- 
2.14.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-17 17:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11  5:18 [PATCH v4 0/4] Allow rmdir(2) to delete a subvolume Misono Tomohiro
2018-04-11  5:19 ` [PATCH v4 1/4] btrfs: move may_destroy_subvol() from ioctl.c to inode.c Misono Tomohiro
2018-04-11  5:20 ` [PATCH v4 2/4] btrfs: Add definition of btrfs_delete_subvolume() Misono Tomohiro
2018-04-11  5:20 ` [PATCH v4 3/4] btrfs: Refactor btrfs_ioctl_snap_destroy() by using btrfs_delete_subvolume() Misono Tomohiro
2018-04-16 17:53   ` David Sterba
2018-04-17  0:21     ` Misono Tomohiro
2018-04-17 17:03       ` David Sterba
2018-04-11  5:22 ` [PATCH v4 4/4] btrfs: Allow rmdir(2) to delete an empty subvolume Misono Tomohiro

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.