Commit Graph

719 Commits

Author SHA1 Message Date
David Sterba 5644dc5d18 btrfs-progs: docs: update 6.9 contribution graphs
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-06-03 23:01:11 +02:00
David Sterba 5dad958662 btrfs-progs: docs: document more fstests requirements
Newly added parted, for btrfs/318. Keep the list sorted.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-06-03 22:25:08 +02:00
David Sterba c147aaa59b btrfs-progs: clarify unlinked and deleted terminology for subvolumes
Recent patches updated stale qgroup handling, using 'unlinked' and
'dropped' where we otherwise use 'deleted' and 'cleaned'.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-05-17 18:13:18 +02:00
Qu Wenruo 7f3ab46400 btrfs-progs: qgroup: add more special statuses for qgroups
Currently `btrfs qgroup show` command shows any 0 level qgroup without a
root backref as `<stale>`, which is not correct.

There are several more cases:

- Under deletion
  The subvolume is not yet full dropped, but unlinked.
  In that case we would not have a root backref item, but the qgroup is
  not stale.

- Squota space holder
  This is for squota mode, that a fully dropped subvolume still have
  extents accounting on the already-gone subvolume.
  In this case it's not stale either, and future accounting relies on
  it.

This patch would add above special cases, and add an extra `SPECIAL
PATHS` section to explain all the cases, including `<stale>`.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-05-17 18:01:49 +02:00
David Sterba 24d8119b98 btrfs-progs: docs: update feature status
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-05-13 18:29:04 +02:00
David Sterba c7d02a77cc btrfs-progs: docs: add 6.9 kernel development statistics
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-05-13 18:22:24 +02:00
David Sterba 3b899063bd btrfs-progs: check: remove --clear-ino-cache option
The inode_cache functionality is long gone and the 'rescue' group
provides the clearning functionality, no point keeping it in check.
Move the --clear-space-cache option to the deprecaeted section so it can
be removed soon.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-05-02 14:02:50 +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
Qu Wenruo 40588d4aa9 btrfs-progs: docs: fix build due to phony contents.rst
[BUG]
Since commit 8049446bb0 ("btrfs-progs: docs: placeholder for
contents.rst file on older sphinx version"), on systems with much newer
sphinx-build, "make" would not work for Documentation directory:

  $ make clean-all && ./autogen.sh && ./configure --prefix=/usr/ && make -j12
  $ ls -alh Documentation/_build
  ls: cannot access 'Documentation/_build': No such file or directory

The sphinx-build has a much newer version:

  $ sphinx-build --version
  sphinx-build 7.2.6

[CAUSE]
On systems which don't need the workaround, the phony target of
contents.rst seems to cause a dependency loop:

  GNU Make 4.4.1
  Built for x86_64-pc-linux-gnu
  Copyright (C) 1988-2023 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Reading makefiles...
  Reading makefile 'Makefile'...
  Updating makefiles....
   Considering target file 'Makefile'.
    Looking for an implicit rule for 'Makefile'.
     Trying pattern rule '%:' with stem 'Makefile'.
    Found implicit rule '%:' for 'Makefile'.
   Finished prerequisites of target file 'Makefile'.
   No need to remake target 'Makefile'.
  Updating goal targets....
  Considering target file 'contents.rst'.
   File 'contents.rst' does not exist.
  Finished prerequisites of target file 'contents.rst'.
  Must remake target 'contents.rst'.
  Makefile:35: update target 'contents.rst' due to: target is .PHONY
  if [ "$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
  	touch contents.rst; \
  fi
  Putting child 0x64ee81960130 (contents.rst) PID 66833 on the chain.
  Live child 0x64ee81960130 (contents.rst) PID 66833
  Reaping winning child 0x64ee81960130 PID 66833
  Removing child 0x64ee81960130 PID 66833 from chain.
  Successfully remade target file 'contents.rst'.

All the default make doing is just try to generate contents.rst, but
since we have much newer version, we won't generate the file at all.

[FIX]
Instead of a phony target, just move the contents.rst generation into
man page target so that we won't cause loop target on contents.rst.

Fixes: 8049446bb0 ("btrfs-progs: docs: placeholder for contents.rst file on older sphinx version")
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 152c708944 btrfs-progs: docs: update feature status
Add some missing entries. Changes to supported levels:

- increase to 6.8 from 6.7 where applicable, there were fixes to squota
  and temp-fsid

- raid-stripe-tree declares support from 6.7, however this is still
  behind CONFIG_BTRFS_DEBUG option in kernel, there are some bugs
  and the known lack of RAID56 support

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:49:15 +02:00
Christoph Anton Mitterer 5a956bb3b1 btrfs-progs: docs: how to get the length of the portion used by btrfs on a device
A user who wants to shrink a btrfs filesystem within some other logical
device (like a partition) will likely want to adapt the size of the
underlying device, too.

This commit adds documentation that describes how the length of the
portion that btrfs uses of some device can be found out.

Thanks go out to Roman Mamedov <rm@romanrm.net> for hinting `btrfs
filesystem show` as alternative command.

Note: the granularity is one sectorsize and the input values are
silently rounded down to avoid bugs from converted filesystems that
would not adhere to the native btrfs constraints.

[ci skip]

Pull-request: #775
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:34:46 +02:00
Christoph Anton Mitterer 8af90d4902 btrfs-progs: docs: minor improvement in resize
Being able to expand (“can”) the partition beforehand is not enough – it must
actually be done.

Pull-request: #775
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:34:46 +02:00
Chris Mayo ad1de33b2d btrfs-progs: docs: fix broken link from Status to Changes (feature/version)
[ci skip]

Pull-request: #773
Author: Chris Mayo <aklhfex@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:34:46 +02:00
Austin Chang 4081b8ba36 btrfs-progs: docs: fix image directives in design page
Copy the images from wiki so that we don't need to jump around the web
search results.

[ci skip]

Pull-request: #771
Signed-off-by: Austin Chang <austin880625@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-04-30 21:34:46 +02:00
David Sterba 5cfa61d6e8 btrfs-progs: docs: update memory related problems
Inspired by https://www.reddit.com/r/btrfs/comments/1bkdewb/btrfs_errors_in_dmesg/ .

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-25 23:33:25 +01:00
HAN Yuwei f240b9f6d0 btrfs-progs: docs: fix incorrect description about compression with O_DIRECT
It was reported in https://lore.kernel.org/linux-btrfs/e7ce9995-93cb-4904-875c-684d4494765f@web.de/
that compression does not happen on direct io files. This is incorrectly
documented that it works but this is not true. Compression works on
buffered writes and relies on page cache, while direct io avoids that
and takes a different path in code.

[ci skip]

Pull-request: #764
Author: HAN Yuwei <hrx@bupt.moe>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-25 22:57:50 +01:00
Thomas Bertels 41dce59a0f btrfs-progs: docs: fix typo in ch-hardware-considerations
verity -> verify

[ci skip]

Pull-request: #759
Author: Thomas Bertels <3265870+tbertels@users.noreply.github.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-03-25 22:50:41 +01:00
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