Commit Graph

702 Commits

Author SHA1 Message Date
David Sterba 76c49eb686 btrfs-progs: use unsigned types for bit shifts in configure.ac and docs
Bit shifts should be done on unsigned type as a matter of good practice
to avoid any problems with bit overflowing to the sign bit.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-12 22:05:49 +01:00
David Sterba 60cc6f3fd8 btrfs-progs: docs: add kernel 6.8 changelog
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-11 21:45:31 +01:00
David Sterba 709aeedbc3 btrfs-progs: docs: add 6.8 kernel development statistics
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-11 21:30:54 +01:00
Termuellinator 4a1133cb60 btrfs-progs: docs: correct systemd-run argument for limiting bandwith
There's an error in resource control command name, the argument is
IOReadBandwidthMax instead of IOBandwidthReadMax.  See
https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

[ci skip]

Pull-request: #744
Author: Termuellinator <saldorin@web.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-06 20:57:09 +01:00
Martin aba8adabcc btrfs-progs: docs/conf.py: enable navigation_with_keys on RTD
Feature from https://github.com/sphinx-doc/sphinx/pull/2064 enable
navigation to be able to navigate documentation using the arrow keys.

Pull-request: #754
Author: Martin <spleefer90@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-29 12:46:55 +01:00
David Sterba f5db48e053 btrfs-progs: docs: clarify potential problems with convert
Add a note summarizing the problems.

[ci skip]

Issue: #257
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 10:52:08 +01:00
David Sterba 93cdc1c2fc btrfs-progs: docs: clarify inode numbers
Update wording and add an example.

[ci skip]

Issue: #729
Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-20 10:26:09 +01:00
David Sterba 06d0ed483d btrfs-progs: docs: update fstests requirements
Add more packages providing some utilities and add new DM targests.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-19 13:03:53 +01:00
David Sterba fc9753e743 btrfs-progs: docs: add plots of develoment stats
Add visuals of the tabulated stats.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-16 12:29:34 +01: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
David Sterba 831a23616a btrfs-progs: docs: add role for manual page references
Add a new role to render manual page references and also link to the web
pages on man7.org.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-16 09:37:09 +01:00
David Sterba 570d1c3cae btrfs-progs: docs: fix warnings and links to duplicated labels
Use the new docref and duplabel syntax to fix build warnings and fix the
link targets in the pages.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-13 18:24:19 +01:00
David Sterba 2700ab22d4 btrfs-progs: docs: add document and label reference extensions
Sphinx/RST does not(?) have native support for cross references to
labels in specific documents (doc, ref but not both at the same time),
also allowing duplicate labels. We have web and manual pages and to
share the same text there are common files included from each, defining
labels. This leads to warnings and clicking the links ends up in the
included document (like ch-volume-management-intro.rst) instead of the
parent.

As a last resort, implement own role that does the doc and ref in one
go. A special directive is used to define a label that is expected
to be duplicate (but otherwise it's an ordinary label) and this gets rid
of the warning too.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-13 18:18:29 +01:00
David Sterba d80dc96460 btrfs-progs: docs: status page updates
Subpage promoted to 'OK', no serious problems since 6.0. Otherwise
references, adjustments, wording updates.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-13 07:15:41 +01:00
David Sterba 42f98fcc88 btrfs-progs: docs: recalculate checksumming performance
There are new backends and builtin accelerated implementations.
Recalculate the table results, a different host than before, with SHANI
extension.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-13 07:15:31 +01:00
David Sterba 152cd4de97 btrfs-progs: docs: add kernel changelogs
Add 6.6 and 6.7 changes, mention the subpage vs zoned limitation found
recently.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-02-12 15:52:49 +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 d7be6ed156 btrfs-progs: docs: mkfs and sectorsize updates
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-18 02:44:58 +01:00
Neal Gompa e3232c2abb btrfs-progs: mkfs: make 4k sectorsize default
We have had working subpage support in Btrfs for many cycles now.
Generally, we do not want people creating filesystems by default
with non-4k sectorsizes since it creates portability problems.

As the subpage has stabilized it seems to be safe to do the switch.
This may still affect users that relying on the previous behaviour.

Issue: #604
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Signed-off-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-18 02:37:45 +01:00
Anand Jain 8049446bb0 btrfs-progs: docs: placeholder for contents.rst file on older sphinx version
Older versions of sphinx require the contents.rst file otherwise the
build fails, while new versions don't need it and use index.rst.

Sphinx error:

master file btrfs-progs/Documentation/contents.rst not found
make[1]: *** [Makefile:37: man] Error 2
make: *** [Makefile:502: build-Documentation] Error 2

This build error is seen on version 1.7.6-3.

To make it work on old and new versions create a placeholder empty file
but make it a phony build target so new sphinx does not see it and
report as not in any TOC.

[ci skip]

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-11 17:04:48 +01:00
Anand Jain 2b3d95519e btrfs-progs: docs: fix sphinx code-block warnings
There are several warnings regarding the absence of an argument for the
code-block directive on some build servers using python3-sphinx 0.2.2-17.

For example:

Making all in Documentation
    [SPHINX] man
ch-subvolume-intro.rst:141: WARNING: Error in "code-block" directive:
1 argument(s) required, 0 supplied.

.. code-block::

   27 21 0:19 /subv1 /mnt rw,relatime - btrfs /dev/sda rw,space_cache

 Etc...

Add the none argument.

[ci skip]

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-10 22:49:06 +01:00
David Sterba faa75347f6 btrfs-progs: docs: update status
Bump version, all the new features in 6.7 have been already added.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-09 17:00:39 +01:00
David Sterba 228848aabe btrfs-progs: docs: add 6.7 kernel development statistics
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-01-09 16:53:17 +01:00
David Sterba eaa54973b6 btrfs-progs: scrub limit: add option to apply the limit to all devices
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-09 01:57:29 +01:00
David Sterba 30d1a2d390 btrfs-progs: scrub limit: allow to set the limit
Add new options to set the per-device limit (requires root privileges as
it writes to the sysfs files).

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-09 01:57:27 +01:00
David Sterba 7f869161b7 btrfs-progs: docs: update scrub io limiting
[ci skip]

Issue: #402
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-09 01:17:22 +01:00
David Sterba fbf211459a btrfs-progs: srcub: new subcommand limit
Add new command to read the scrub limits set via the sysfs file (no root
access needed).

Example output:

  $ btrfs scrub limit /mnt
  UUID: 57a05502-9e81-4b21-ad9d-0fc31863ed11
  Id  Limit            Path
  --  -----  --------------
   1      -  /dev/nvme0n1p1
   2      -  /dev/nvme0n1p2
   3      -  /dev/nvme0n1p3
   4      -  /dev/nvme2n1p4
   5      -  /dev/nvme0n1p5
   6      -  /dev/nvme0n1p6

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-09 01:17:22 +01:00
David Sterba b5909e62b2 btrfs-progs: use statvfs() in print_filesystem_usage_overall
The statfs(2) syscall is deprecated by LSB in favor of statvfs(2),
however we can't replace all uses because we still need the
statfs::f_type to determine the filesystem by magic numer.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-08 17:08:55 +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 7e4a235df1 btrfs-progs: scrub status: print device speed limit in status if set
When there's a speed limit set for a device via
/sysfs/fs/btrfs/FSID/devinfo/scrub_speed_max, show it in the scrub status
output like below:

  $ btrfs scrub status -d /mnt
  ...
  Rate:              47.98MiB/s (limit 60MiB/s)
  ...

If the limit is 0 this means unlimited and is not printed.

For a single device filesystem the limit is printed even without '-d' as
it's clear which device limit applies. For multi-device filesysetms,
without any limits nothing is printed, if there at least one device
limit set then the following is printed:

  Rate:             36.37MiB/s (some device limits set)

More details with the -d option.

Issue: #531
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-08 17:08:33 +01:00
David Sterba 9aafb384cb btrfs-progs: docs: cross references, ioctl updates
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-06 17:44:28 +01:00
David Sterba 478a295b00 btrfs-progs: docs: document label ioctls
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-06 17:44:28 +01:00
David Sterba c1ce48ed3f btrfs-progs: docs: document device add and remove ioctls
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 20:17:31 +01:00
David Sterba 216c9f0ffb btrfs-progs: docs: move doc conventions to developer docs
The DocConventions are now fairly complete and can be moved to the
proper section.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 19:33:28 +01:00
Qu Wenruo eae4109054 btrfs-progs: check: remove inode cache clearing functionality
Since we're already directing the end user to use "btrfs rescue
clear-ino-cache" command, there is not much need to support it in
btrfs-check.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 17:57:04 +01:00
Qu Wenruo 171dd56995 btrfs-progs: docs: update the man page for btrfs check lowmem mode
Lowmem mode has improved quite a lot since its introduction, for
read-only check it's definitely fine.

For repair mode, both lowmem and original mode are considered dangerous
especially for complex corruptions with unknown cause.

For now lowmem mode is only bad at fixing fundamentally corrupted cases,
like bad shift offsets or transid, which in real world it's not an easy
repair for the original mode either.

This patch would move the --mode option out of the dangerous section and
update the notes for the lowmem mode on its limitation.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 17:37:25 +01:00
David Sterba 8b9684f965 btrfs-progs: docs: add config file for readthedocs.io
There's another config required for building the RTD documentation,
https://docs.readthedocs.io/en/stable/config-file/ .

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 16:36:24 +01:00
David Sterba cc2e3ab03d btrfs-progs: docs: update and restyle links of source repositories
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-05 16:19:09 +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
David Sterba 9e55abfd77 btrfs-progs: device delete: add timeout when removing multiple devices
Reported on IRC, that it's unexpected that passing several devices on
command line for 'btrfs device delete' still uses some of the devices
during deletion. The expectation was that they'd be removed at once (and
thus not used for the intermediate chunk relocation).

As it works now, the ioctl removes only one device. As a workaround, add
a timeout (like we have for the full balance and others) when there are
more devices passed on the command line. This can be skipped by the
--force parameter.

Issue: #708
Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-01 02:54:09 +01:00
David Sterba ac8edc1513 btrfs-progs: docs: restyle the landing page
Add an introductory paragraph with most important links, put TOC
listings to columns.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-12-01 00:54:27 +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
Martin Ligabue 8397fee2a3 btrfs-progs: docs: fix typo in btrfs-rescue
"that are do not match -> that do not match"

[ci skip]

Pull-request: #700
Author: Martin Ligabue <martinligabue@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
David Sterba fcd9142b67 btrfs-progs: docs: formatting, fixups, updates
- update Status page
- new features in 6.7
- more ioctls
- CSS fix to wrap long lines in tables

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
David Sterba ffebbf6f2a btrfs-progs: docs: add 6.6 kernel development statistics
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
David Sterba 93f263650c btrfs-progs: fi defrag: add new option to process the range in steps
Add a convenience option to processing the range in smaller steps than
the whole file, where a flush is done after each steps. This could be
potentially used to measure progress with 'btrfs -vv fi defrag'.

Issue: #616
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
Qu Wenruo 87b3197d81 btrfs-progs: move space cache removal to rescue group
The option "--clear-space-cache" is not really that suitable for "btrfs
check" group, as there are some concerns:

- Allowing transid mismatch
- No leaf item checks

  Thoe behaviour are inherited from the default open ctree flags for
  "btrfs check", which can be unsafe if the end user just wants to clear
  the cache.

- Unclear if the cache clearing would happen along with repair

  Thankfully the clearing of space cache is done without any repair

Thus there is a proposal to move space cache removal to rescue group,
and this patch would do that exactly.

However this would lead to some behavior changes:

- Transid mismatch would be treated as error
- Leaf items size/offset would still be checked

  If we hit any above error, we should just abort without doing any
  write.

These change would increase the safety of the space cache removal, thus
I believe it's worthy to introduce such behavior change.

Since we're here, also add a small explanation on why we need this
dedicated tool to clear space cache (especially for v1 cache).

Issue: #698
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
Johannes Thumshirn 04d9e13461 btrfs-progs: docs: add document for RAID stripe tree design
Add a document describing the layout and functionality of the newly
introduced RAID Stripe Tree.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +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