summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-06-30sketchamiculas-build-fsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-29Merge pull request #309 from tmuehlbacher/improve-logging-exitingkoverstreet
Improve logging and exiting
2024-06-29Be explicit about which fsck implementation we're runningKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-28Update bcachefs sources to 9404a01d3dc5 bcachefs: Make read_only a mount ↵v1.9.2Kent Overstreet
option again, but hidden Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-29feat: use `ExitCode` over `std::process:exit()`Thomas Mühlbacher
Should provide us with better outputs on process failure, also makes unwinding better and is generally recommended over `exit()`. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-28feat: add `--quiet` cli argumentThomas Mühlbacher
To silence log outputs on the CLI. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-28feat: use env_loggerThomas Mühlbacher
Instead of the custom logger impl, which limits the features we can easily provide for users. This introduces the `BCACHEFS_LOG` environment variable for setting the log verbosity. Setting `BCACHEFS_LOG=trace`, e.g. in a test environment, will yield all log messages. Also I think it's reasonable to print INFO level logs by default. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-28Merge pull request #305 from Artturin/use-ar-varkoverstreet
Use the AR variable in Makefile
2024-06-26feat(key): make `UnlockPolicy::Fail` more usefulThomas Mühlbacher
We already can check if an fs is encrypted with `bcachefs unlock -c`. With this option we can now instead check if we have a key but not actually mount by not specifying a mount point. e.g. ```sh if bcachefs mount -k fail "$blkdev"`; then echo "device is unlocked!" fi ``` Not sure what the original intent for this was. For scenarios where encryption is simply not supported on principle? Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26refactor(key): split up unlocking functionsThomas Mühlbacher
This is more similar to the existing C code, which is already in nice small chunks. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26refactor: simplify branches for parsing devThomas Mühlbacher
Less repetition and no nested if/else. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26feat(mount): make unlock policy optional/explictThomas Mühlbacher
This changes the semantics of some arguments related to unlocking and slightly changes the unlocking logic. Also update help formatting/text. Instead of defaulting to `UnlockPolicy::Ask`, the argument becomes optional. That means if it is specified, the user really wants that specific policy. Similar to how `passphrase_file` also works. This also extends `UnlockPolicy` to override `isatty` detection. Fixes: #292 Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26refactor(mount): rename `opt` => `cli`Thomas Mühlbacher
The term option is already used for mount options and the `Option` type. In other modules it's just called `cli`, so let's do that here as well. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-26refactor: rm function param only used for log msgThomas Mühlbacher
We lose that bit of info but it's weird to require a parameter simply because we want to use it for a log message. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-24Use the AR variable in MakefileArtturin
For cross-compiling
2024-06-20key: use c_long type for keyctl_search() helper fnDavid Disseldorp
The keyctl_search() C function returns a long, which is already reflected in the KeyHandle._id type. The search_keyring() helper function currently returns a Result<i64>, which breaks 32-bit builds for e.g. armv7l: error[E0308]: mismatched types --> src/key.rs:121:16 | 121 | Ok(key_id) | -- ^^^^^^ expected `i64`, found `i32` | | | arguments to this enum variant are incorrect ... error[E0308]: mismatched types --> src/key.rs:135:24 | 135 | _id: id, | ^^ expected `i32`, found `i64` Fix this by changing search_keyring() to return a Result<c_long>. Fixes: f72ded6a ("fix(key): search for key in all relevant keyrings") Signed-off-by: David Disseldorp <ddiss@suse.de> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-19v1.9.1v1.9.1Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-19Merge commit '41df701a089fbf19fe16d65fbb6df46854b1f3df' of ↵Kent Overstreet
https://github.com/tmuehlbacher/bcachefs-tools
2024-06-19update Cargo.lock versionKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-19Update version to 1.9.0v1.9.0Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-18fix(logger): log to stderrThomas Mühlbacher
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-18fix(key): search for key in all relevant keyringsThomas Mühlbacher
Previously, using `bcachefs unlock -k session` would still cause mount to ask for a passphrase. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-18fix(key): remove any newlines from passphraseThomas Mühlbacher
To match the behavior of the C code and because there may be newlines under some conditions. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-18chore(editorconfig): extend for sh scriptsThomas Mühlbacher
To match with what's already in the repo. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-17Merge pull request #302 from koverstreet/update_flake_lock_actionkoverstreet
flake.lock: Update
2024-06-17flake.lock: Updategithub-actions[bot]
Flake lock file updates: • Updated input 'crane': 'github:ipetkov/crane/17d9e9dedd58dde2c562a4296934c6d6a0844534?narHash=sha256-hGLeRxSEeFz9WvmQ4s4AuMJ5InLSZvoczDdXkWSFi1A%3D' (2024-06-09) → 'github:ipetkov/crane/0095fd8ea00ae0a9e6014f39c375e40c2fbd3386?narHash=sha256-UKrfy/46YF2TRnxTtKCYzqf2f5ZPRRWwKCCJb7O5X8U%3D' (2024-06-15) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07) → 'github:nixos/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/4fc1c45a5f50169f9f29f6a98a438fb910b834ed?narHash=sha256-npYqVg%2BWk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE%3D' (2024-06-08) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81?narHash=sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls%3D' (2024-06-16)
2024-06-17Merge pull request #301 from tmuehlbacher/fix-nix-installkoverstreet
fix(nix): install paths from pkg-config properly
2024-06-17Update bcachefs sources to 792ca5ba3c9a bcachefs: kill key cache arg to ↵Kent Overstreet
bch2_assert_pos_locked()
2024-06-17Update bcachefs sources to c56e1ec97dfd bcachefs: Fix bch2_sb_downgrade_update()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-17fix(nix): install paths from pkg-config properlyThomas Mühlbacher
Because we were using `DESTDIR` instead of `PREFIX` for some reason, no one noticed that this didn't work. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-16Preserve directory {a,m,c} times by calling copy_times() after the recursionAriel Miculas
Otherwise the directory {a,m,c} times will be modified by the recursive copy of the directory tree. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16Fix incomplete file copy due to copy_data misuseAriel Miculas
The copy_data function takes a start and an end parameter as the range of bytes to copy, but it was called with a start and a length parameter. This resulted in incomplete file copies. Fix it by passing the end of the range instead of the length. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16Fix performance regression of update_inodeAriel Miculas
This kernel commit: 65bd442397274347e721a89c2c4882a392bae982 removes BTREE_ITER_cached from bch2_btree_insert_trans, which causes the update_inode function to take a long time (~20s). Add this flag back in the update_inode function. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16bcachefs: allow initializing a bcachefs filesystem from a source directoryAriel Miculas
Add a new source command line argument which specifies the directory tree that will be copied onto the newly formatted bcachefs filesystem. This commit also fixes an issue in copy_link where uninitialized data is copied into the symlink because of a round_up of the buffer size. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16fix missing includeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-10Merge pull request #297 from koverstreet/update_flake_lock_actionkoverstreet
flake.lock: Update
2024-06-10flake.lock: Updategithub-actions[bot]
Flake lock file updates: • Updated input 'crane': 'github:ipetkov/crane/480dff0be03dac0e51a8dfc26e882b0d123a450e?narHash=sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8%3D' (2024-05-29) → 'github:ipetkov/crane/17d9e9dedd58dde2c562a4296934c6d6a0844534?narHash=sha256-hGLeRxSEeFz9WvmQ4s4AuMJ5InLSZvoczDdXkWSFi1A%3D' (2024-06-09) • Updated input 'fenix': 'github:nix-community/fenix/14c3b99d4b7cb91343807eac77f005ed9218f742?narHash=sha256-BKFOT/eg0mCf99oTKa63yW%2Bd5Y3K6c5Gb%2BNetxacaHg%3D' (2024-05-31) → 'github:nix-community/fenix/ab655c627777ab5f9964652fe23bbb1dfbd687a8?narHash=sha256-ixopuTeTouxqTxfMuzs6IaRttbT8JqRW5C9Q/57WxQw%3D' (2024-06-08) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/b32f181f477576bb203879f7539608f3327b6178?narHash=sha256-mUZtVS2S%2BleFcMpBgbqkMnZm4II1qBM21pW8UnivVSo%3D' (2024-05-27) → 'github:rust-lang/rust-analyzer/48bbdd6a74f3176987d5c809894ac33957000d19?narHash=sha256-%2BlRAmz92CNUxorqWusgJbL9VE1eKCnQQojglRemzwkw%3D' (2024-06-05) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9?narHash=sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78%3D' (2024-05-16) → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8?narHash=sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw%3D' (2024-06-01) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz?narHash=sha256-QBx10%2Bk6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94%3D' (2024-05-02) → 'https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29) → 'github:nixos/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/52b66cade760e93276146eb057122b8011ab9057?narHash=sha256-V68CsekhPCF6Oz84t2FHY5jin4smKrmsS208Xw057zs%3D' (2024-05-30) → 'github:numtide/treefmt-nix/4fc1c45a5f50169f9f29f6a98a438fb910b834ed?narHash=sha256-npYqVg%2BWk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE%3D' (2024-06-08)
2024-06-10Merge pull request #295 from tmuehlbacher/flake-stuffkoverstreet
Make nix package builds have a unique version; dev shell addition
2024-06-10Merge pull request #294 from tmuehlbacher/subvol-fixkoverstreet
fix(subvol): canonicalize requires path to exist
2024-06-10fix(subvol): canonicalize requires path to existThomas Mühlbacher
Which is probably not the case when you want to create a subvolume in that path. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-10build(nix): use actual commit rev in versionThomas Mühlbacher
This way we get an actually unique version for every version that can be traced back to the source. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-10build(nix): add bear to dev shellThomas Mühlbacher
A useful addition to make sure is available, since we also make clangd available through clang-tools. bear can generate the `compile_commands.json` for clangd. For example with `make clean && bear -- make -j$(nproc)`. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-09Merge pull request #293 from ↵koverstreet
tmuehlbacher/fix-subvolume-commands-with-relative-paths fix(subvol): make cmds work with relative paths
2024-06-09fix(subvol): make cmds work with relative pathsThomas Mühlbacher
`Path::parent()` returns `Some("")` for relative paths with a single component. The simplest fix is to just canonicalize the paths first. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-07Fix target option parsing for format, migrateKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-05Update bcachefs sources to 4f69e2d39ad3 bcachefs: bch2_btree_insert() - add ↵Kent Overstreet
btree iter flags
2024-06-03cmd_fs_usage: Use now BCH_IOCTL_QUERY_ACCOUNTINGKent Overstreet
We can now report on compression type/ratio, btree usage, and pending rebalance work. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03cmd_fs_usage: split out devs_usage_to_text()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03Update bcachefs sources to f81dc88f0c80 bcachefs: bch2_btree_insert() - add ↵Kent Overstreet
btree iter flags Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03Merge pull request #291 from tmuehlbacher/fix-subvolume-commandskoverstreet
Fix subvolume commands