Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unprivileged btrfs subvol list #893

Open
wants to merge 29 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0e11b21
btrfs-progs: subvolume delete: add new option for recursive deletion
osandov Jun 27, 2024
082ce75
btrfs-progs: mkfs: add new option --subvol
maharmstone Aug 7, 2024
3ca473e
btrfs-progs: ci: update cleanup scripts
kdave Aug 16, 2024
2b204e1
btrfs-progs: fi show: remove stray newline in filesystem show
mattlangford Aug 8, 2024
2688073
btrfs-progs: docs: clarify number represention in on-disk-format tables
hanyuwei70 Aug 29, 2024
91a4311
btrfs-progs: mkfs: add default flag to --subvol
maharmstone Aug 15, 2024
2c8dc94
btrfs-progs: mkfs: add ro flag to --subvol
maharmstone Aug 27, 2024
bcee005
btrfs-progs: subvolume create: use libbtrfsutil for creation
maharmstone Jun 28, 2024
52467db
btrfs-progs: subvolume snapshot: use libbtrfsutil for snapshot
maharmstone Jun 28, 2024
6feabcb
btrfs-progs: remove unused qgroup functions
maharmstone Jun 28, 2024
4e16787
btrfs-progs: check: add rudimentary log checking
maharmstone Jul 3, 2024
260ead2
btrfs-progs: mkfs: add hard link support for --rootdir
adam900710 Aug 15, 2024
e42ce38
btrfs-progs: tests: add hardlink related tests for mkfs --subvol
adam900710 Aug 15, 2024
07785e5
btrfs-progs: convert: fix inline extent size for symlink
adam900710 Sep 3, 2024
3fb45ed
btrfs-progs: check/original: detect invalid file extent items for
adam900710 Sep 3, 2024
6cc1c0e
btrfs-progs: check/lowmem: detect invalid file extents for symbolic l…
adam900710 Sep 3, 2024
c5461ae
btrfs-progs: tests: add case to verify large symbolic link handling i…
adam900710 Sep 3, 2024
6e1b3e3
btrfs-progs: install btrfs-ioctl manual page
maharmstone Sep 12, 2024
1aac2d7
btrfs-progs: open the devices exclusively for writes
adam900710 Sep 11, 2024
2c87982
btrfs-progs: fix a false failure for inode cache cleanup
adam900710 Sep 11, 2024
30a1398
btrfs-progs: check: detect deprecated inode cache
adam900710 Sep 12, 2024
9f2b67a
btrfs-progs: tests: add case to handle deprecated inode cache in check
adam900710 Sep 12, 2024
d4e7d6d
libbtrfsutil: don't check for UID 0 in subvolume_info()
osandov Jun 21, 2024
ef6f0a1
libbtrfsutil: don't check for UID 0 in subvolume iterator
osandov Jun 21, 2024
21e084d
btrfs-progs: subvol list: remove unused raw layout code
osandov Jun 21, 2024
a079982
btrfs-progs: subvol list: remove unused filters
osandov Jun 21, 2024
31c7d5b
btrfs-progs: subvol list: document and test actual behavior of paths
osandov Jun 21, 2024
a374292
btrfs-progs: subvol list: use libbtrfsutil
osandov Jun 21, 2024
73abcba
btrfs-progs: subvol list: add sane -O and -A options
osandov Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Documentation/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif
endif

mandir ?= $(prefix)/share/man
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
Expand All @@ -44,8 +45,10 @@ help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

install: man
$(INSTALL) -d -m 755 $(DESTDIR)$(man2dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
$(INSTALL) -m 644 $(BUILDDIR)/man/*.2 $(DESTDIR)$(man2dir)
$(INSTALL) -m 644 $(BUILDDIR)/man/*.5 $(DESTDIR)$(man5dir)
$(INSTALL) -m 644 $(BUILDDIR)/man/*.8 $(DESTDIR)$(man8dir)
$(INSTALL) -m 644 btrfsck.8 $(DESTDIR)$(man8dir)
Expand Down
1 change: 1 addition & 0 deletions Documentation/btrfs-man5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ SEE ALSO
:manref:`chattr(1)`,
:manref:`fstrim(8)`,
:manref:`ioctl(2)`,
:doc:`btrfs-ioctl`,
:doc:`mkfs.btrfs`,
:manref:`mount(8)`,
:manref:`swapon(8)`
46 changes: 41 additions & 5 deletions Documentation/btrfs-subvolume.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid>
-i|--subvolid <subvolid>
subvolume id to be removed instead of the <path> that should point to the
filesystem with the subvolume

-R|--recursive
delete subvolumes beneath each subvolume recursively

This requires either `CAP_SYS_ADMIN` or the filesystem must be
mounted with `user_subvol_rm_allowed` mount option.
In the unprivileged case, subvolumes which cannot be accessed
are skipped. The deletion is not atomic.

-v|--verbose
(deprecated) alias for global *-v* option

Expand All @@ -134,20 +143,47 @@ list [options] [-G [\+|-]<value>] [-C [+|-]<value>] [--sort=rootid,gen,ogen,path

where *ID* is subvolume's (root)id, *generation* is an internal counter which is
updated every transaction, *parent_ID* is the same as the parent subvolume's id,
and *path* is the relative path of the subvolume to the top level subvolume.
and *path* is the path of the subvolume. The exact meaning of *path*
depends on the **Path filtering** option used.

If -O or -A is given, "top level" is replaced by "parent".

The subvolume's ID may be used by the subvolume set-default command,
or at mount time via the *subvolid=* option.

``Options``

Path filtering:

-O
Print <path> and all subvolumes below it, recursively. <path>
must be a subvolume. Paths are printed relative to <path>.

This may be used by unprivileged users, in which case this only
lists subvolumes that the user has access to.
-A
Print all subvolumes in the filesystem. Paths are printed
relative to the root of the filesystem.

You likely always want either -O or -A. The -o and -a options and the
default if no path filtering options are given have very confusing,
accidental behavior that is only kept for backwards compatibility.

-o
Print only subvolumes below specified <path>. Note that this is not a
recursive command, and won't show nested subvolumes under <path>.
Print only the immediate children subvolumes of the subvolume
containing <path>. Paths are printed relative to the root of
the filesystem.
-a
print all the subvolumes in the filesystem and distinguish between
absolute and relative path with respect to the given *path*.
Print all subvolumes in the filesystem other than the root
subvolume. Paths are printed relative to the root of the
filesystem, except that subvolumes that are not an immediate
child of the subvolume containing <path> are prefixed with
"<FS_TREE>/".

If none of these are given, print all subvolumes in the filesystem
other than the root subvolume. Paths below the subvolume containing
<path> are printed relative to that subvolume, and other paths are
printed relative to the root of the filesystem.

Field selection:

Expand Down
1 change: 1 addition & 0 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
('btrfs-qgroup', 'btrfs-qgroup', 'control the quota group of a btrfs filesystem', '', 8),
('btrfs-property', 'btrfs-property', 'get/set/list properties for given filesystem object', '', 8),
('btrfs-inspect-internal', 'btrfs-inspect-internal', 'query various internal information', '', 8),
('btrfs-ioctl', 'btrfs-ioctl', 'documentation about btrfs ioctls', '', 2),
('btrfs-image', 'btrfs-image', 'create/restore an image of the filesystem', '', 8),
('btrfs-find-root', 'btrfs-find-root', 'filter to find btrfs root', '', 8),
('btrfs-filesystem', 'btrfs-filesystem', 'command group that primarily does work on the whole filesystems', '', 8),
Expand Down
Loading
Loading