Commit Graph

1361 Commits

Author SHA1 Message Date
Evan Richter
b832e3b2f7 remove --tier from device add getopt parser 2024-04-29 09:59:16 -06:00
Kent Overstreet
efbe47e2b4 Update bcachefs sources to c19cbaf6e7b0 bcachefs: Run upgrade/downgrade even in -o nochanges mode 2024-04-28 21:29:50 -04:00
Kent Overstreet
b9e48edba7 Update bcachefs sources to 035773e55b52 bcachefs: fix integer conversion bug 2024-04-25 16:25:29 -04:00
Kent Overstreet
ec2d118738 fix splice_fd_to_stdinout() when stdin is closed
We need to check when stdin has been closed - otherwise we'll spin
because select() will return immediately.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-25 00:43:47 -04:00
Kent Overstreet
b3677f3040 Merge branch 'man-bcachefs-subvolume-snapshot' of https://github.com/FedericoSchonborn/bcachefs-tools 2024-04-19 21:42:12 -04:00
Federico Damián Schonborn
b8b36900f8
bcachefs.8: subvolume delete -> subvolume snapshot
Signed-off-by: Federico Damián Schonborn <federicoschonborn@disroot.org>
2024-04-19 22:36:17 -03:00
Kent Overstreet
0e0aa31912 Update bcachefs sources to 0389c09b2fb7 bcachefs: Fix bio alloc in check_extent_checksum()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 17:34:56 -04:00
Kent Overstreet
59e04ddf40 1.7.0 - mi_btree_bitmap
New on disk forat feature - per member 64 bit bitmap of regions with
btree nodes, to accelerate recovering by scanning for btree nodes.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 03:25:28 -04:00
Kent Overstreet
c824bbe69d Update bcachefs sources to 10ca1f99f8c9 bcachefs: Fix bch2_dev_btree_bitmap_marked_sectors() shift
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-17 01:44:20 -04:00
koverstreet
cf44deafe6
Merge pull request #251 from tasleson/handle_dev_symlink
mount: canonicalize device path for single device node
2024-04-15 18:25:41 -04:00
Kent Overstreet
5aaa6422b6 Update bcachefs sources to ad29cf999a91 bcachefs: set_btree_iter_dontneed also clears should_be_locked
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-15 14:24:48 -04:00
Tony Asleson
825062222c mount: canonicalize device path for single device node
If we pass a symlink for a single device node we fail to locate the
device node.  Canonicalize the device node before we try to read up
the superblock.

This allows the following to work.
 # bcachefs mount /dev/mapper/vg-thinvolume /mnt/lv_thin

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-04-09 15:03:26 -05:00
Kent Overstreet
5639fb38ca Update bcachefs sources to 09d4c2acbf4c bcachefs: reconstruct_inode()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-03 17:34:02 -04:00
Kent Overstreet
9f4ed5ce05 cmd_show_super: Also print device model
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-04-01 21:38:19 -04:00
Kent Overstreet
6e50a9b4fc cmd_list, cmd_list_journal: pass -o very_degraded 2024-03-30 22:09:06 -04:00
Kent Overstreet
8e02744a90 Update bcachefs sources to 794723fc10c4 bcachefs: Topology repair now uses nodes found by scanning to fill holes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-30 22:05:40 -04:00
Tony Asleson
89b322abb3 mount: Handle multi-device with 1 device node
Instead of requiring the user to supply all the device nodes for a
multi-device FS, allow them to specifiy 1 of them.  We then fetch
the UUID for the FS and then find all the disks on the system that
match this UUID.

This allows me to bring up a bcachefs FS in /etc/fstab by using a
UUID.  This works because it appears the mount command looks up
the UUID, finds an entry in /dev/disk/by-uuid and then passes that
found device node to mount.bcachefs which fails with
`insufficient_devices_to_start` as bcachefs is expecting a list of
devices with a ":" between them.  This behavior is preserved if a
user specifies a list of all the needed device nodes to bring up
the FS.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-20 17:02:35 -04:00
Thomas Glanzmann
c28af3c0cc Typo: Tell sh to read the script from stdin
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-18 16:10:30 -04:00
Thomas Glanzmann
8ce35b5424 Add example to install rust toolchain and add two missing debian build dependencies.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-18 14:21:52 -04:00
Kent Overstreet
abfdc593a5 Update bcachefs sources to 83338f5b2cb8 bcachefs: fix for building in userspace 2024-03-16 19:40:33 -04:00
koverstreet
f1e87c66af
Merge pull request #249 from wezm/const-cast
Avoid casting away const when processing C command args
2024-03-13 17:50:25 -04:00
Wesley Moore
888321446d
Avoid casting away const when processing C command args 2024-03-13 20:07:07 +10:00
Kent Overstreet
6a41851118 path_to_cstr()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-08 16:40:38 -05:00
Kent Overstreet
f4f87d9f76 cmd_dump: Set very_degraded
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-08 16:40:38 -05:00
Kent Overstreet
62ab2e5216 Update bcachefs sources to 26494335d114 bcachefs: improve move_gap()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-25 21:34:11 -05:00
koverstreet
55a2b65bd0
Merge pull request #243 from CyanChanges/patch-1
Typo: `filysestem` -> `filesystem`
2024-02-25 15:03:14 -05:00
Kent Overstreet
9ed434861f bkey.rs: use a single unsafe {} for BkeyValC conversion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-24 18:44:45 -05:00
Kent Overstreet
03272a1e55 Update bcachefs sources to a623b3063d5d bcachefs: Fix check_snapshot() memcpy 2024-02-24 01:26:40 -05:00
Cyan
0c00d3a372
Typo 2024-02-24 14:21:54 +08:00
Kent Overstreet
010182e790 v1.6.4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-23 19:25:27 -05:00
Thomas Bertschinger
3388cf009a powerpc: use "long long" for 64-bit types in userspace
This resolves build warnings and failures for architectures where the
Linux userspace `asm/types.h` header defines 64-bit types (u64, s64) as
`long` instead of `long long`.

By defining `__SANE_USERSPACE_TYPES__`, these types are defined as
`long long` instead.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-23 17:26:28 -05:00
Roland Vet
16661be294 bch2_sb_is_encrypted{,_and_locked}
Specifically also mention locked

Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23 08:37:23 +01:00
Roland Vet
817e957697 Apply naming convention: passphrase->unlock->key->decrypt->fs
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23 08:37:23 +01:00
Roland Vet
387e2a01ce Test 'fix'?
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23 08:37:23 +01:00
Roland Vet
8a800c671e Replace 7 spaces and a tab with a tab.
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
b582c9b4b8 Improve error message
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
eaf5575080 Rename sb to block_device
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
ceb9eaa020 Rename password{,_policy}
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
37c0ae2e79 Rename KeyLocation to more appropriate KeyPolicy
Also key_location to key_policy

Improve help description key policy

Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
ceb259b2a3 Typo
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
46ed72461f Rename sbs to block_devices_to_mount
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
b7c43996a1 Rephrase help message
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
911c53266a Remove unnecessary brackets
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
d67643f24c Add decryption by key_file
- Add key_file option to Cli
- Rework decryption flow logic to first attempt key_file
- Read password from file and pass to decrypt_master_key

Explicity specify '-k' for key_location

Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:49 +01:00
Roland Vet
0ff96b2a0f Add fmt::Display for KeyLocation
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:36 +01:00
Roland Vet
86049a1641 Refactor ask_for_key to call new decrypt_master_key
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 21:12:02 +01:00
Roland Vet
0728677cdc Fix dirent test: lines have changed
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 08:12:28 +01:00
Roland Vet
466802d8c7 Fix line check
Output has become much more verbose:

mounting version 1.6: btree_subvolume_children opts=ro,errors=continue,degraded,nochanges,norecovery,read_only
recovering from clean shutdown, journal seq 9
alloc_read... done
stripes_read... done
snapshots_read... done
u64s 16 type inode_v3 0:4096:U32_MAX len 0 ver 0:   mode=40755
  flags= (16300000)
  journal_seq=1
  bi_size=0
  bi_sectors=0

  bi_version=0bi_atime=90363614
  bi_ctime=91363625
  bi_mtime=91363625
  bi_otime=90363614
  bi_uid=0
  bi_gid=0
  bi_nlink=1
  bi_generation=0
  bi_dev=0
  bi_data_checksum=0
  bi_compression=0
  bi_project=0
  bi_background_compression=0
  bi_data_replicas=0
  bi_promote_target=0
  bi_foreground_target=0
  bi_background_target=0
  bi_erasure_code=0
  bi_fields_set=0
  bi_dir=0
  bi_dir_offset=0
  bi_subvol=1
  bi_parent_subvol=0
  bi_nocow=0

u64s 17 type inode_v3 0:4097:U32_MAX len 0 ver 0:   mode=40700
  flags= (15300000)
  journal_seq=1
  bi_size=0
  bi_sectors=0

  bi_version=0bi_atime=91363625
  bi_ctime=91363625
  bi_mtime=91363625
  bi_otime=91363625
  bi_uid=0
  bi_gid=0
  bi_nlink=0
  bi_generation=0
  bi_dev=0
  bi_data_checksum=0
  bi_compression=0
  bi_project=0
  bi_background_compression=0
  bi_data_replicas=0
  bi_promote_target=0
  bi_foreground_target=0
  bi_background_target=0
  bi_erasure_code=0
  bi_fields_set=0
  bi_dir=4096
  bi_dir_offset=453699834857023875
  bi_subvol=0
  bi_parent_subvol=0
  bi_nocow=0

Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22 08:12:28 +01:00
Thomas Bertschinger
25e84a9917 rust: use libc::Ioctl type for ioctl() request argument
The second argument to ioctl() can be defined as a different type by
different libc implementations, and can be a different size on different
architectures depending on what type it is defined as. For example,
glibc defines it as `unsigned long` which may have a different size on
32-bit vs. 64-bit architectures, and musl libc defines it as `int`.

The Rust libc crate exposes a type `libc::Ioctl` which is defined as the
appropriate integer type for the given libc implementation. Using this
type for the request argument to `libc::ioctl()` ensures code will
compile correctly regardless of architecture and libc implementation.

Also, because ioctl request numbers are defined to be 32 bits
(regardless of the fact that `unsigned long` might sometimes take 64
bits on some architectures), this patch changes the Rust representation
of the bcachefs ioctl numbers to u32 instead of u64.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-20 22:27:19 -05:00
Kent Overstreet
de9c798382 v1.6.3
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-20 18:42:07 -05:00