From: Omar Sandoval <osandov@osandov.com>
To: linux-btrfs@vger.kernel.org
Cc: kernel-team@fb.com
Subject: [PATCH 0/8] btrfs-progs: add subvol list options for sane path behavior
Date: Fri, 21 Jun 2024 11:53:29 -0700 [thread overview]
Message-ID: <cover.1718995160.git.osandov@fb.com> (raw)
From: Omar Sandoval <osandov@fb.com>
Hello,
btrfs subvol list's path handling has been a constant source of
confusion for users. None of -o, -a, or the default do what users
expect. This has been broken for a decade; see [1].
This series adds two new options, -O and -A, which do what users
actually want: list subvolumes below a path, or list all subvolumes,
with minimal path shenanigans. This approach is conservative and tries
to maintain backwards compatibility, but it's worth discussing whether
we should instead fix the existing options/default, or more noisily
deprecate the existing options.
One additional benefit of this is that -O can be used by unprivileged
users.
Patch 1 fixes a libbtrfsutil bug I encountered while testing this.
Patches 2 and 3 fix libbtrfsutil's privilege checks to work in user
namespaces. Patches 4 and 5 remove some unused subvol list code. Patch 6
documents and tests the current, insane behavior. Patch 7 converts
subvol list to use libbtrfsutil. This is a revival of one of my old
patches [2], but is much easier now that libbtrfs has been pared down.
Patch 8 adds the new options, including documentation and tests.
Thanks!
Omar
1: https://lore.kernel.org/all/bdd9af61-b408-c8d2-6697-84230b0bcf89@gmail.com/
2: https://lore.kernel.org/all/6492726d6e89bf792627e4431f7ba7691f09c3d2.1518720598.git.osandov@fb.com/
Omar Sandoval (8):
libbtrfsutil: fix accidentally closing fd passed to subvolume iterator
libbtrfsutil: don't check for UID 0 in subvolume_info()
libbtrfsutil: don't check for UID 0 in subvolume iterator
btrfs-progs: subvol list: remove unused raw layout code
btrfs-progs: subvol list: remove unused filters
btrfs-progs: subvol list: document and test actual behavior of paths
btrfs-progs: subvol list: use libbtrfsutil
btrfs-progs: subvol list: add sane -O and -A options
Documentation/btrfs-subvolume.rst | 37 +-
cmds/subvolume-list.c | 1081 +++++------------
libbtrfsutil/python/tests/test_subvolume.py | 18 +
libbtrfsutil/subvolume.c | 50 +-
.../026-subvolume-list-path-filtering/test.sh | 156 +++
5 files changed, 565 insertions(+), 777 deletions(-)
create mode 100755 tests/cli-tests/026-subvolume-list-path-filtering/test.sh
--
2.45.2
next reply other threads:[~2024-06-21 18:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 18:53 Omar Sandoval [this message]
2024-06-21 18:53 ` [PATCH 1/8] libbtrfsutil: fix accidentally closing fd passed to subvolume iterator Omar Sandoval
2024-06-21 18:53 ` [PATCH 2/8] libbtrfsutil: don't check for UID 0 in subvolume_info() Omar Sandoval
2024-06-21 18:53 ` [PATCH 3/8] libbtrfsutil: don't check for UID 0 in subvolume iterator Omar Sandoval
2024-06-21 18:53 ` [PATCH 4/8] btrfs-progs: subvol list: remove unused raw layout code Omar Sandoval
2024-06-21 18:53 ` [PATCH 5/8] btrfs-progs: subvol list: remove unused filters Omar Sandoval
2024-06-21 18:53 ` [PATCH 6/8] btrfs-progs: subvol list: document and test actual behavior of paths Omar Sandoval
2024-06-21 18:53 ` [PATCH 7/8] btrfs-progs: subvol list: use libbtrfsutil Omar Sandoval
2024-06-21 18:53 ` [PATCH 8/8] btrfs-progs: subvol list: add sane -O and -A options Omar Sandoval
2024-06-25 15:34 ` [PATCH 0/8] btrfs-progs: add subvol list options for sane path behavior David Sterba
2024-07-01 21:52 ` Omar Sandoval
2024-07-03 23:40 ` David Sterba
2024-07-11 23:59 ` Omar Sandoval
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=cover.1718995160.git.osandov@fb.com \
--to=osandov@osandov.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.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 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.