24 Commits

Author SHA1 Message Date
Manuel Mendez
7873eb976e c_src: Align and standardize help outputs
While adding scrub to data in last commit I noticed that the help output
where all over the place, both "physically" on the console and also
things like inconsistent case and newlines before "Report bugs to ...",
so I decided to fix all that up.
2025-10-07 16:22:50 -04:00
Kent Overstreet
145ffa823b Update bcachefs sources to b31b8a82b13e bcachefs: fix ctime update on unlink
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-10-06 17:18:03 -04:00
Kent Overstreet
13c8026c10 cmd_list_journal: Transaction filtering now works correctly
Some checks failed
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Previously, we'd skip all transactions after the first non-transaction
entry - oops.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-09-09 18:13:24 -04:00
Kent Overstreet
c12d7b3315 Commands called with no arguments now print usage
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-08-27 18:47:54 -04:00
Kent Overstreet
78b1ccf5f1 cmd_list_journal: By default, print all contiguous entries
Some checks failed
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Previously, we defaulted to only printing dirty journal entries (which
means nothing would be printed after a clean shutdown) - this is usually
not what we want.

Now, we default to printing the biggest range that has no gaps or
missing entries.

-a, --all
  now means print all entries, not just contiguous entries

And we now have

-d, --dirty-only
  for the the previous default behaviour.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-07-02 15:33:07 -04:00
Kent Overstreet
4145de1746 cmd_list_journal: new options
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
-D, --datetime
  Print out one line per journal entry, with datetime it was written

-L, --log-only
  Only print entries containing log messages

-F, --flush-only
  Only print flush commits

Additionally, we now print a line for missing journal entry ranges.

These make it easier to get an overall picture of what happened in the
journal - in particular, seeing how far back we can rewind before we
have gaps.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-30 22:39:52 -04:00
Kent Overstreet
792222046d cmd_list_journal: More filtering tweaks
New options:

-B: show blacklisted entries: previously show by default, but
    highlighted
-l: Show log-only entries, i.e. recovery, snapshot deletion messages
-o: Print entry offset for each subentry

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-13 19:58:02 -04:00
Kent Overstreet
529d14db49 cmd_list_journal: Fix assertion pop
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-07 19:17:53 -04:00
Kent Overstreet
315508358d cmd_list_journal: Improved matching
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-02 17:24:50 -04:00
Kent Overstreet
f6ed4c26d7 cmd_list_journal: Improved matching
Some checks failed
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-06-01 19:37:00 -04:00
Kent Overstreet
6cb4160e0c cmd_list_journal: handle jset_entries with bad lengths
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-05-25 17:59:45 -04:00
Kent Overstreet
241bcd0183 Fix infinite loop in cmd_list_journal
list_journal can print the entire contents of the journal, and non-dirty
entries don't get validated, so we have to account for that.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-05-25 17:05:55 -04:00
Kent Overstreet
6d7b47685b Update bcachefs sources to f0ebca18293c bcachefs: bch2_fs_open() now takes a darray
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-28 15:31:43 -04:00
Kent Overstreet
844721635c Update bcachefs sources to 2f9361370129 bcachefs: Improve opts.degraded
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13 21:10:24 -04:00
Kent Overstreet
76b3ec9d66 list_journal: fix transaction filter extent matching
Giving a single pos for the transaction filter now correctly matches
against extents.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-30 18:27:52 -04:00
Kent Overstreet
3fcc955d00 Scrub
Implement 'bcachefs data scrub', frontend for
BCH_IOCTL_DATA.BCH_DATA_OP_scrub.

Takes a path to a device, mountpoint, or filesystem uuid. Can be run on
a specific device by passing a device, or if run on a filesystem scrubs
all devices in parallel.

Metadata only scrubbing is supported via -m.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-02-03 14:08:49 -05: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
587f7f5a47 cmd_list_journal: open with noexcl, so we can work on mounted filesystems
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-02 21:06:47 -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
Kent Overstreet
abfdc593a5 Update bcachefs sources to 83338f5b2cb8 bcachefs: fix for building in userspace 2024-03-16 19:40:33 -04: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
Kent Overstreet
da4bbf51d0 cmd_list_journal: --transaction-filter now takes range
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-27 10:58:14 -05:00
Thomas Bertschinger
f5baaf48e3 move Rust sources to top level, C sources into c_src
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:

$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command

instead of "./bcachefs command".

Building and installing is still:

$ make && make install

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16 01:47:05 -05:00