Commit Graph

776 Commits

Author SHA1 Message Date
David Sterba 479103c705 btrfs-progs: docs: add 6.12 kernel development statistics
Update graphs.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-11-15 17:19:21 +01:00
(@silopolis) b5d8449287 btrfs-progs: docs: checksumming editing 2024-11-15 16:58:13 +01:00
(@silopolis) 499a0493b3 btrfs-progs: docs: auto-repair editing 2024-11-15 16:58:13 +01:00
Jérémie Tarot 881f1e350f btrfs-progs: docs: subvolume intro editing
* fix BTRFS capitalization
* fix repetition
* wording and punctuation in 'Nested subvolumes'
* wording and punctuation in 'system root layouts'
* wording and punctuation in 'Mount options'
* wording in 'Inode numbers'
* wording and punctuation in 'Performance'
2024-11-15 16:58:13 +01:00
Jérémie Tarot 324bea54e5 btrfs-progs: docs: fix BTRFS capitalization 2024-11-15 16:58:13 +01:00
Jérémie Tarot f4b2a33b8c btrfs-progs: docs: fix double word in intro 2024-11-15 16:58:13 +01:00
Colin Snover 66f08f9528 btrfs-progs: docs: enhance the scrub chapter
- Explain that scrub is device based

- Add extra warning on NOCOW files
  Which implies NODATASUM, and can cause unexpected stale data to be
  returned.

- Explain the limitation of scrub
  As it can only do very basic checksum verification and very basic
  mirror based repair.

Signed-off-by: Colin Snover <csnover@users.noreply.github.com>
[ Add an SoB line and commit message, remove the mention of btrfs-check errors,
  as there is no evidence/example where btrfs-check failed to choose a good mirror. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-11-04 18:31:38 +10:30
Colin Snover 18dcd2d6d0 btrfs-procs: docs: add warning about balance to replace failing device
Since balance is copying the old good data/metadata into a new chunk
(which can be on the same failed device), it's not a safe way to handle
failed devices.

Signed-off-by: Colin Snover <csnover@users.noreply.github.com>
[ Add an SoB and simple commit message, remove the unnecessary
  explanation, and guide the user to use `btrfs dev replace` ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-11-04 18:31:38 +10:30
Colin Snover d832a32d8d btrfs-progs: docs: clarify how btrfs check works with replicas
- Btrfs-check does device assembly automatically
  Thus no difference when specifying different devices of the same
  filesystem

- Btrfs-check automatically choose good metadata
  Thus as long as there is any good mirror for metadata, it will not
  report error for that repariable metadata.

Signed-off-by: Colin Snover <csnover@users.noreply.github.com>
[ Add an SoB line, remove the scrub recommendation as btrfs-check is
  supposed to choose the good mirror ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-11-04 18:31:38 +10:30
Colin Snover b3f6300176 btrfs-progs: docs: clarify transid verify error recoverability
- Fix the format of the transid mismatch reason and type

- Fix a typo in the reason

- Explain more on the recoverable case
  That both a regular metadata read and read-write scrub can do the
  same trick.

- Add an extra data salvage method using "rescue=all,ro" mount option

Signed-off-by: Colin Snover <csnover@users.noreply.github.com>
[ Add an SoB line ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-11-04 18:31:37 +10:30
Colin Snover 5b0452da51 btrfs-progs: docs: say where to get help
- The IRC channel
- The mailling list
- The btrfs-progs repo for user space bugs

Signed-off-by: Colin Snover <csnover@users.noreply.github.com>
[ Add an SoB line ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-11-04 16:11:06 +10:30
HAN Yuwei 48655de5f0 btrfs-progs: docs: Added DEV_ITEM object id.
Added DEV_ITEM object id to the reserved object id list. It's historical reason
to let both of DEV_ITEM and ROOT_TREE have same object id. Developers should
be aware of it.

Signed-off-by: HAN Yuwei <hrx@bupt.moe>
[ Replace immediate number with key names ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-10-29 10:17:26 +10:30
Qu Wenruo 9d533a606b btrfs-progs: fix the typo inside kernel-by-version.rst
This "stil" -> "still" typo is causing the latest CI spellchecks to fail.

Fix that so we can get a good CI run.

Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-10-29 09:39:09 +10:30
Mark Harmstone 2595fbfa21 btrfs-progs: docs: fix typo and dead link
The slides for the talk "Kernel maintainership: an oral tradition",
linked to in the documentation, seem to have gone from the Linux
Foundation website. Change to the version on bootlin.com.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
2024-10-21 07:44:00 +10:30
David Sterba e671013853 btrfs-progs: docs: add kernel changelogs for 6.9, 6.10 and 6.11
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-10-16 02:07:22 +02:00
David Sterba 1cc034e60f btrfs-progs: docs: update 6.11 contribution graphs
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-10-15 23:39:08 +02:00
Mark Harmstone 59f74c25af btrfs-progs: mkfs: rework --subvol CLI option
Change mkfs.btrfs --subvol so that instead of being of the form --subvol
DIR:FLAGS, it's instead --subvol MODIFIER:DIR, with MODIFIER being ro,
rw, default, or ro-default.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
2024-10-10 14:14:32 +10:30
David Sterba 79ce9b6512 libbtrfsutil: bump btrfsutil version, add release steps
[ ci skip ]

Issue: #310
Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-19 01:51:18 +02:00
Qu Wenruo ef11574733 btrfs-progs: mkfs: add hard link support for --rootdir
The new hard link detection and creation support is done by maintaining
an rb tree with the following members:

- st_ino, st_dev
  This is to record the stat() report from the host fs.
  With this two, we can detect if it's really a hard link (st_dev
  determines one filesystem/subvolume, and st_ino determines the inode
  number inside the fs).

- root
  This is btrfs root pointer. This a special requirement for the recent
  introduced "--subvol" option.

  As we can have the following corner case:

  rootdir/
  |- foobar_hardlink1
  |- foobar_hardlink2
  |- subv/		<- To be a subvolume inside btrfs
     |- foobar_hardlink3

  In above case, on the host fs, `subv/` directory is just a regular
  directory, but in the new btrfs it will be a subvolume.

  In that case, `foobar_hardlink3` cannot be created as a hard link,
  but a new inode.

- st_nlink and found_nlink
  Records the original reported number of links, and the nlinks we
  created inside btrfs.
  This is recorded in case we created all hard links and can remove
  the entry early.

- btrfs_ino
  This is the inode number inside btrfs.

And since we can handle hard links safely, remove all the related
warnings, and add a new note for `--subvol` option, warning about the
case where we need to split hard links due to subvolume boundary.

Pull-request: #873
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-09-17 17:00:03 +02:00
Mark Harmstone ec8a6b1536 btrfs-progs: mkfs: add ro flag to --subvol
Adds a flag to mkfs.btrfs --subvol to allow subvolumes to be created
readonly.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
2024-09-17 17:00:03 +02:00
Mark Harmstone fa70df7e78 btrfs-progs: mkfs: add default flag to --subvol
Change --subvol that it can accept flags, and add a "default" flag that
allows you to mark a subvolume as the default.

Signed-off-by: Mark Harmstone <maharmstone@fb.com>
2024-09-17 17:00:03 +02:00
Mark Harmstone e844ffcaad btrfs-progs: mkfs: add new option --subvol
Add a new option --subvol, which tells mkfs.btrfs to create the
specified directories as subvolumes when used with --rootdir.

Given a populated directory dir, the command

  $ mkfs.btrfs --rootdir dir --subvol usr --subvol home --subvol home/username img

will create subvolumes 'usr' and 'home' within the toplevel subvolume,
and subvolume 'username' within the 'home' subvolume. It will fail if
any of the directories do not yet exist.

Pull-request: #868
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 17:00:03 +02:00
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
David Sterba 5b7f6a4a5b btrfs-progs: docs: add path-utils.h API docs
[ ci skip ]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:47:42 +02:00
David Sterba 4ca6444fba btrfs-progs: docs: inline files vs tail packing
Explain the difference, in case somebody want's to use it as a source to
correct that on Wikipedia.

[ ci skip ]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:47:42 +02:00
David Sterba 158a25af0d btrfs-progs: fi resize: warn if new size is < 256M
The lower kernel limit is 256M otherwise it's considered an invalid
parameter.

Issue: #875
Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:19:03 +02:00
David Sterba aca8a3a05b btrfs-progs: docs: add heading for 6.11
Still TBD.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:19:03 +02:00
David Sterba ec236d38b9 btrfs-progs: docs: update feature status
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:19:03 +02:00
David Sterba e1e070642c btrfs-progs: docs: add 6.11 kernel development statistics
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 16:19:03 +02:00
Mark Harmstone 08c1e627a8 btrfs-progs: install btrfs-ioctl manual page
btrfs-ioctl.rst was laid out like it should be a man page, including
having a section number, but it wasn't getting installed because there
was not enough content.

Pull-request: #892
Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-09-17 14:33:22 +02:00
Han Yuwei 17b9e3f2af btrfs-progs: docs: clarify number represention in on-disk-format tables
Added 0x prefix to HEX numbers and transform some tables to new format.

Pull-request: #881
Signed-off-by: Yuwei Han <hrx@bupt.moe>
[ Fix RST grammar errors ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-09-17 14:33:22 +02:00
rhn 07b8c74bc8 btrfs-progs: docs: clarify btrfs-send checksum
The way the CRC32C checksum used for btrfs-send differs from the way
it's used elsewhere in btrfs. Without making the distinction, it's easy
to make the flawed assumption that CRC32C always refers to the same, and
end up with code that produces the wrong checksums.

This small note should guide the reader to the right function.

The best notes on the protocol I found are here:
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/Design_notes_on_Send/Receive.html

The crc32c might be used in two meanings and this could be confusing
when implementing the send stream protocol.

Rust code describing the algorithm for the crc crate that worked for me:

pub const CRC_32_BTRFS_SEND: crc::Algorithm<u32> = crc::Algorithm {
	width: 32, poly: 0x1edc6f41, init: 0, refin: true, refout: true,
	xorout: 0, check: 0xe3069283, residue: 0xb798b438
};

(it's a slight variation on the one used in ISCSI)

Note: Documentation/dev/dev-send-stream.rst briefly mentions that

Pull-request: #794
Author: rhn <gihu.rhn@porcupinefactory.org>
[ rephrase changelog and copy text from pull request and add link to
  developer documentation of the send stream ]
Signed-off-by: David Sterba <dsterba@suse.com>
2024-08-14 23:59:47 +02:00
David Sterba 720b1f3ab4 btrfs-progs: docs: fix new typos
Last minute documentation changes before release that did not go through
CI.

Signed-off-by: David Sterba <dsterba@suse.com>
2024-08-14 23:58:14 +02:00
David Sterba cbc15a9161 btrfs-progs: docs: update sysfs descriptions
[ci skip]

Issue: #374
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba e6966e6770 btrfs-progs: docs: move Interoperability to the first section
The page is not complete but mentions at least NFS, cgroups and
fsverity.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba ef1f99fde6 btrfs-progs: docs: include sysfs to Administration
The sysfs file description is hard to find. Also link to btrfs(5) from
administration.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba bf2eb30e0c btrfs-progs: docs: list supported fs-verity ioctls
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba 6b99f901df btrfs-progs: docs: add new encoded rw ioctls to the list
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba 4cab3f8c97 btrfs-progs: docs: add example for nested subvolumes
Make it more visible what the result of snapshotted subvolume is. This
partially duplicates the other section.

[ci skip]

Issue: #644
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba fca2fe3316 btrfs-progs: docs: add zone reclaim
[ci skip]

Issue: #768
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba 42dad5ea65 btrfs-progs: docs: update source repositories, workflows
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
David Sterba 39470a52b5 btrfs-progs: docs: clarify swapfile an multi-device filesystem
It is possible to create swapfile on a multi-device filesystem but it's
not reliable. The check that verifies that in kernel:

10698                 } else if (device != map->stripes[0].dev) {
10699                         btrfs_warn(fs_info, "swapfile must be on one device");
10700                         ret = -EINVAL;
10701                         goto out;
10702                 }

This does not count devices but rather the actual placement of the
swapfile extents, so multi-device filesystem with single profile can
create it as long as there's enough space and the allocator decides to
place it properly.

[ci skip]

Pull-request: #839
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 20:05:11 +02:00
Qu Wenruo c58266504e btrfs-progs: docs: add warning for -s option of btrfs-image
The filename sanitization is not recommended as it introduces mismatches
between DIR_ITEM and INODE_REF.

Even hash collision mode (double "-s" option) is not ensured to always
find a hash collision, and when fails to find one, a mismatch happens.

And when a mismatch happens, the kernel will not resolve the path
correctly since kernel uses the hash from DIR_ITEM to lookup the child
inode.

So add a warning into the "-s" option of btrfs-image.

Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-07-30 19:56:41 +02:00
Yaroslav Halchenko 16a7cbca91 btrfs-progs: run codespell throughout fixing typos automagically
Spell checking can now run in automated mode.

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

Author: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:56:08 +02:00
Yaroslav Halchenko 5b3bb3973a btrfs-progs: do interactive fixing of some ambigous typos
Typos fixed manually using the following:

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

Author: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:56:08 +02:00
David Sterba 4a1acc205a btrfs-progs: list-chunks: update help and documentation
Sync help text with current implementation (sorting, no usage nor empty
options).

Issue: #559
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:53:33 +02:00
David Sterba 0eb8a65844 btrfs-progs: tree-stats: add options for size output units
Add the usual long options for all byte size related values in the
output.

Issue: #268
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:53:33 +02:00
David Sterba ef73193623 btrfs-progs: dump-tree: escape special characters in paths or xattrs
Filenames can contain a newline (or other funny characters), this makes
the dump-tree output confusing, same for xattr names or values that can
binary data.  Encode the special characters in the C-style ('\e' ->
"\e", or \NNN if there's no single letter representation). This is based
on the isprint() as it's espected either on a terminal or in a dump
file.

Issue: #350
Issue: #407
Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:53:33 +02:00
David Sterba 5308564ca7 btrfs-progs: docs: document github PR workflow
[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:53:33 +02:00
David Sterba 023b20421c btrfs-progs: docs: add headings for 6.9 and 6.10 changes
Add headings for now, contents to be added later.

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
2024-07-30 19:53:33 +02:00