Commit Graph

1576 Commits

Author SHA1 Message Date
Kent Overstreet
4f9293b045 cmd_fsck: Create loopback device for kernel fsck when necessary
fstests generic/648 now passes

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
282331defa Fix some warnings about elided lifetimes
these popped up on the latest rustc

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
b1e6d1ced2 cmd_mount: Change error message on -EBUSY to match util-linux
This causes xfstests generic/741 to pass

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Alyssa Ross
3666da87f2 Pass -C default-linker-libraries to rustc
By default, rustc passes -nodefaultlibs to the linker.  In some cases,
this can cause compiler builtins (e.g. __cpu_model, used by
__builtin_cpu_supports) not to be linked in:

= note: /nix/store/s2cjhni3s6shh0n35ay1hpj8d85k44qk-x86_64-unknown-linux-musl-binutils-2.43.1/bin/x86_64-unknown-linux-musl-ld: ./libbcachefs.a(tools-util.o): in function `resolve_crc32c':
        /build/source/c_src/tools-util.c:457:(.text+0x1023): undefined reference to `__cpu_model'
        collect2: error: ld returned 1 exit status

I saw this with static musl GCC builds, and others have reported it with
Clang.

Link: https://github.com/koverstreet/bcachefs-tools/issues/300
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Alyssa Ross
6153c37e38 Avoid static linking conflicts with libblkid
When static linking, it's not possible to have two functions with the
same name in different libraries:

	= note: /nix/store/s2cjhni3s6shh0n35ay1hpj8d85k44qk-x86_64-unknown-linux-musl-binutils-2.43.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/zwid05lzfy46k32xljb2alh0gq7ys58a-util-linux-minimal-static-x86_64-unknown-linux-musl-2.39.4-lib/lib/libblkid.a(libcommon_la-crc32c.o): in function `crc32c':
	        (.text+0x0): multiple definition of `crc32c'; ./libbcachefs.a(tools-util.o):/build/source/c_src/tools-util.c:484: first defined here
	        collect2: error: ld returned 1 exit status

Work around this by avoiding a known name collision with a function in
libblkid.

Closes: https://github.com/koverstreet/bcachefs-tools/issues/311
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
4e25d26a81 Update bcachefs sources to 9ab6c94002b9 bcachefs: bch2_journal_meta() takes ref on c->writes 2024-10-12 17:20:56 -04:00
Kent Overstreet
1dba682527 cmd_kill_btree_node: Can now kill multiple nodes simultaneously
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-12 17:20:56 -04:00
Kent Overstreet
571ca8b8ce cmd_list_journal: Add filtering on log msg
This allows us to filter out e.g. all btree_node_write_work transacitons

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 21:58:15 -04:00
Kent Overstreet
01413354a5 Update bcachefs sources to 8aa83b2beeb3 bcachefs: Improve check_snapshot_exists() 2024-10-09 21:58:03 -04:00
Kent Overstreet
1d68a6da59 Update bcachefs sources to 3b80552e7057 bcachefs: __wait_for_freeing_inode: Switch to wait_bit_queue_entry
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 19:49:17 -04:00
Kent Overstreet
c4456b4714 Update cargo dependencies
This fixes an odd bindgen issue

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09 19:48:37 -04:00
Kent Overstreet
d27d4cf7f0 Fix 'fuse' feature conditional compilation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-05 22:49:27 -04:00
Thomas Bertschinger
3829e49167 fuse: graceful shutdown when startup fails
When FUSE startup encounters an error after opening the filesystem--for
example because of a bad mountpoint--it exited uncleanly, which is a
bit unfriendly.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-04 22:48:21 -04:00
Kent Overstreet
9f20109509 Update bcachefs sources to 438696e03da7 bcachefs: rename version -> bversion for big endian builds 2024-09-29 22:18:18 -04:00
Kent Overstreet
7a98f526b5 cmd_list: open with noxcl
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-29 22:18:18 -04:00
Kent Overstreet
bc5d903fda Update bcachefs sources to 82792a451950 bcachefs: Switch some bch2_dev_rcu() calls to _noerror
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-07 22:25:45 -04:00
Kent Overstreet
cd35891eb9 Update bcachefs sources to ec2ddb95112b bcachefs: bch2_opts_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-07 21:14:35 -04:00
Alyssa Ross
f9ec00d5ca Remove udev from PKGCONFIG_LIBS in Makefile
libudev.pc is the pkg-config file for the udev libraries.  udev.pc is
just there to define the directory that rules etc. should be installed
into.  It therefore doesn't need to be included in the list of libraries
passed to pkg-config --cflags or pkg-config --libs.

At least one implementation of the libudev API, libudev-zero, does not
provide a udev.pc file, because it does not implement the udev rules
language, just the library API.  With this change, it's possible to
build bcachefs-tools against libudev-zero by pointing PKGCONFIG_UDEVDIR
somewhere on the make command line.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-09-04 15:38:46 -04:00
koverstreet
68704c30dc
Merge pull request #335 from workingjubilee/remove-trivial-deps
Remove trivial deps
2024-09-04 11:39:40 -04:00
Jubilee Young
a1122aced2 Remove byteorder dep
This requires something other than literally zero code to replace, but
is another opportunity to deny packagers the fun of experimenting with
replacing crate versions with incompatible patched crate versions.
2024-09-03 00:31:33 -07:00
Jubilee Young
1a5b11db3f bch_bindgen: Remove memoffset dep
A trivial replacement allowed by std stabilizing it in rust 1.77.
Less crate dependencies means less odd decisions by packagers.
2024-09-03 00:14:30 -07:00
Kent Overstreet
1e058db4b6 cmd_dump: Open in noexcl mode
no need to make it harder to dump than it needs to be

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-31 21:34:15 -04:00
Kent Overstreet
b422b19f63 Update bcachefs sources to 22fa8fc32e6a bcachefs: rcu_pending now works in userspace 2024-08-23 19:34:30 -04:00
koverstreet
6f938e0399
Merge pull request #333 from reedriley/master
fix setattr in usage/docs; bump version in various places from v1.9.5 (wrong) to v1.11.1
2024-08-23 17:47:05 -04:00
Reed Riley
481a50f0a9 version bump to v1.11.1 2024-08-22 16:26:18 -05:00
Reed Riley
6c32c8d9c9 change setattr to set-file-option in docs/usage 2024-08-22 16:23:51 -05:00
koverstreet
d30bc11101
Merge pull request #331 from Managor/master
Change lingering set-option texts to set-fs-option
2024-08-21 17:34:06 -04:00
Antti Savolainen
ef47274485 Change lingering set-option texts to set-fs-option 2024-08-21 15:24:00 +03:00
Kent Overstreet
31039815a7 posix_to_bcachefs: fix missing copy_xattrs() error checking
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-20 19:47:56 -04:00
Kent Overstreet
8e0023ed4a Update bcachefs sources to 62439c6f1a6d bcachefs: Simplify bch2_xattr_emit() implementation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-18 20:44:19 -04:00
Kent Overstreet
e2e1493111 Update bcachefs sources to e7015d0df31c bcachefs: Simplify bch2_xattr_emit() implementation
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-17 16:09:41 -04:00
Kent Overstreet
8b93af8747 kill_btree_node fixup
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10 17:30:27 -04:00
koverstreet
74a48d6da8
Merge pull request #326 from PowerUser64/spelling-fix
doc: correct some spelling errors
2024-08-10 12:16:55 -04:00
Kent Overstreet
6687752a1d Update bcachefs sources to 070f7d6a382a bcachefs: bch2_sb_nr_devices()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-10 11:52:25 -04:00
PowerUser64
5b4ee5cf7b doc: correct some spelling errors 2024-08-09 21:36:42 -07:00
Kent Overstreet
495a54c03b Revert "build: rm package.version from Cargo.toml"
This reverts commit 48c51020e5.

Deleting the version from Cargo.toml broke the MSRV build with cargo
1.7.0.
2024-08-09 04:08:08 -04:00
Kent Overstreet
3f885423df fsck: modprobe before doing version check
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09 04:01:23 -04:00
Kent Overstreet
8d75a97e1a cmd_fs_usage: fix null ptr deref
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09 03:44:27 -04:00
Kent Overstreet
b00ac20e76 mount: When mounting a single device, make sure we mount the device specified
When mounting a multi device filesystem we have to scan for component
devices from the UUID, but we don't want to scan if it's a single device
filesystem; if the same filesystem is exposed via multiple device nodes
(e.g. dm faulty testing), the scan can pick up the wrong node.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-09 03:44:27 -04:00
Kent Overstreet
c616061a93 bch_sb::number_of_devices() now calls proper c helper
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-08 11:51:17 -04:00
Kent Overstreet
95e8cddd3b Update bcachefs sources to dfc7b2c9433e bcachefs: bch2_sb_nr_devices()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-08 11:51:07 -04:00
Kent Overstreet
da1d5571f5 fixup! cmd_set_option: Can now set device options
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-06 20:34:20 -04:00
koverstreet
6958dd8df2
Merge pull request #320 from WhatAmISupposedToPutHere/master
Ask for password via systemd-ask-password
2024-08-02 09:33:46 -04:00
koverstreet
e42312b602
Merge pull request #324 from JohnRTitor/nix-fix
nix: add meta.mainProgram to allow directly running from this repo
2024-07-31 18:22:23 -04:00
John Titor
73a271e130
nix: add meta.mainProgram to allow directly running from this repo 2024-07-31 22:37:13 +05:30
koverstreet
c60ce81890
Merge pull request #323 from koverstreet/update_flake_lock_action
flake.lock: Update
2024-07-30 20:46:21 -04:00
github-actions[bot]
1eaac529af flake.lock: Update
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/8a68b987c476a33e90f203f0927614a75c3f47ea?narHash=sha256-a0G1NvyXGzdwgu6e1HQpmK5R5yLsfxeBe07nNDyYd%2Bg%3D' (2024-07-18)
  → 'github:ipetkov/crane/529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf?narHash=sha256-k3oiD2z2AAwBFLa4%2BxfU%2B7G5fisRXfkvrMTCJrjZzXo%3D' (2024-07-24)
• Updated input 'fenix':
    'github:nix-community/fenix/d3121c162a1fa4fabcb9af9642d50e8b05ddfe83?narHash=sha256-AJjRiL2diAitpARbE9bUTlgtqHC8QS1ImXNaXMRhKoU%3D' (2024-07-20)
  → 'github:nix-community/fenix/483df76def3e5010d709aa3a0418ba2088503994?narHash=sha256-DfGaJtgrzcwPQYLTvjL1KaVIjpvi85b2MpM6yEGvJzM%3D' (2024-07-30)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/b333f85a9dc06a45d9eb126c6371414c49b46784?narHash=sha256-23zmEelXzAvnfMlLsJ6a6P7yNiI9WOUrS9xh9dXVc/U%3D' (2024-07-19)
  → 'github:rust-lang/rust-analyzer/a021b85be57d34b1eed687fcafd5d5ec64b2d853?narHash=sha256-KxjkPVn9rQqYam6DhiN/V2NcMXtYW25maxkJoiVMpmE%3D' (2024-07-29)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19)
  → 'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/888bfb10a9b091d9ed2f5f8064de8d488f7b7c97?narHash=sha256-wNXLQ/ATs1S4Opg1PmuNoJ%2BWamqj93rgZYV3Di7kxkg%3D' (2024-07-20)
  → 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7?narHash=sha256-uru7JzOa33YlSRwf9sfXpJG%2BUAV%2BbnBEYMjrzKrQZFw%3D' (2024-07-30)
2024-07-30 21:57:23 +00:00
koverstreet
1e5452a027
Merge pull request #322 from tmuehlbacher/fix-c-exit-code
Fix C exit code
2024-07-30 17:56:43 -04:00
Thomas Mühlbacher
fb6a56bb81 fix(nix): silence trace from treefmt-nix
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-30 23:35:39 +02:00
Thomas Mühlbacher
b4db95b16e fix: don't try to convert C command returns to u8
Fixes Rust panics if some C command (like fsck) returns a value bigger
than 255. The process exit code will be mangled but what can we do, it's
less confusing than a panic (that unfortunately doesn't print the return
value).

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-07-30 23:33:09 +02:00