Commit Graph

18 Commits

Author SHA1 Message Date
Omar Sandoval a4d2d1b498 btrfs-progs: subvolume delete: add new option for recursive deletion
Add new option --recursive 'btrfs subvol delete', causing it to pass the
BTRFS_UTIL_DELETE_SUBVOLUME_RECURSIVE flag through to libbtrfsutil.

This can work in two modes, depending on the user:

- regular user - this will skip subvolumes that are not accessible
- root (CAP_SYS_ADMIN) - no limitations

Pull-request: #861
Signed-off-by: Mark Harmstone <maharmstone@meta.com>
Co-authored-by: Omar Sandoval <osandov@osandov.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
[ Add details to man page, fix indent in the doc. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 17:00:03 +02:00
Qu Wenruo 99447fb708 Revert "btrfs-progs: subvol delete: add options to delete the qgroup"
This reverts commit 9da773aa46.

There are several problems related to the --delete-qgroup option:

- Currently kernel doesn't allow to delete non-empty qgroups

- A qgroup can only be empty after fully dropped and a transaction is
  committed
  The tool doesn't take either factor into consideration

- Things like drop_subtree_threshold or other operations can mark qgroup
  inconsistent and skip accounting
  This can mean the target qgroup will never be empty until next rescan

On the other hand, even we do it the proper way, it would hugely delay
the command (wait until the subvolume to be cleaned).

Furthermore, even if the waiting is handled properly,
drop_subtree_threshold can still prevent us deleting the qgroup (qgroup
numbers are inconsistent, and accounting is skipped completely).

So the qgroup cleanup needs kernel to make it work properly.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:49:15 +02:00
David Sterba f463c0dcc1 btrfs-progs: docs: use manref role for all manual page references
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-16 09:38:16 +01:00
Max-Julian Pogner 0f165240b5 btrfs-progs: docs: typo in btrfs subvolume create
"desinations" => "destinations"

[ci skip]

Pull-request: #743
Signed-off-by: Max-Julian Pogner <max-julian@pogner.at>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-12 11:59:42 +01:00
David Sterba 71ad6f2f53 btrfs-progs: subvol sync: check if the filesystem is writable
The subvolume cleaning is done by polling but it's possible that the
filesystem turns to read-only (as reported), either due to an error
intentionally. In that case the waiting would be indefinite without an
obvious reason.

To fix that check if the filesystem is still writable in each iteration.

Issue: #535
Link: https://github.com/btrfs/fstests/issues/40
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-08 17:08:55 +01:00
David Sterba 9da773aa46 btrfs-progs: subvol delete: add options to delete the qgroup
The 0/subvolid qgroups are not automatically deleted when the subvolume
is deleted, for historical reasons. There's a command to clean up all
such stale qgroups (btrfs qgroup clean-stale) but this should be also
possible with the subvolume deletion.

With the options we can switch the default to delete the qgroup by
default eventually, if somebody depends on the not deleting behaviour
the negation option can be used.

Issue: #366
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 12:36:44 +01:00
Qu Wenruo 5aa959fb34 btrfs-progs: subvolume create: accept multiple arguments
This patch would make "btrfs subvolume create" to accept multiple
arguments, just like "mkdir".

The existing options like "-i <qgroupid>" and "-p" would all be applied
to all subvolume(s).

If one destination failed, the command would return 1, while still retry
the remaining destinations.

Issue: #695
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-23 20:15:47 +01:00
Matteo Croce f5ad6b0444 btrfs-progs: docs: subvolume list -o is not recursive, align documentation with tools behaviour
The `btrfs subvolume list -o` command intentionally doesn't
recurse subvolumes, so make it clear in the documentation.

Pull-reques: #709
Signed-off-by: Matteo Croce <teknoraver@meta.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-14 13:17:35 +01:00
Sidong Yang ac4bb90e7b btrfs-progs: subvolume create: add option -p option to create parent directories
Add new option -p to 'subvolume create' so it behaves like 'mkdir -p'
and create all missing path components before the subvolume.

Issue: #429
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-10-21 15:51:07 +02:00
David Sterba a0137082de btrfs-progs: docs: formatting updates
- use :file: and :command:
- simplify manual page references
- add more web links
- typo fixes
- more cross-references

Signed-off-by: David Sterba <dsterba@suse.com>
2023-07-26 14:59:10 +02:00
David Sterba 1afe51d22d btrfs-progs: docs: use command role for programs or command lines
Replace **bold** or ``quoted`` with :command:`line ...` that is supposed
to be used verbatim.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-27 01:48:47 +02:00
David Sterba 02ffc977be btrfs-progs: docs: don't use wiki links in manual pages and package
The wiki has been archived so remove the links from manual page
footers. Also replace the wiki link by RTD site in configure and
libbtrfsutil.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-16 22:38:21 +01:00
David Sterba 447f976472 btrfs-progs: subvol delete: update EPERM error message
The message could be confusing in case there's no send in progress and
the real reason is lack of permissions when deleting a subvolume.
Mention the permissions as first reason. Also update documentation.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-24 15:14:47 +02:00
David Sterba 7322fc4de2 btrfs-progs: docs: update documentation site references in manual pages
Mention the read-the-docs page in manual pages and update INSTALL and
README.md with a reference.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:12 +02:00
Sidong Yang 2d039cc815 btrfs-progs: docs: add cross reference for manualpages
RST format provides cross reference function that users can navigate
manual pages click. This patch is written by macro that replaces old
references to doc role in RST format.

Issue: #495
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:08 +02:00
frukto 31750cb120 btrfs-progs: docs: make description of list output more clear
Author: frukto <fruktopus@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-06-06 15:48:03 +02:00
David Sterba 208aed2ed4 btrfs-progs: docs: add more chapters (part 3)
All main pages have some content and many typos have been fixed.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-12-17 15:35:10 +01:00
David Sterba f03df4f256 btrfs-progs: docs: convert btrfs-subvolume to rst
Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-29 17:30:04 +02:00