fsck: fix stale "bad orphan inode" after fsck runs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | fsck: consume -l option instead of passing to e2fsckmisc/ | +3 | 0 replies | |
| 2/5 | fsck: fix -C fd option parsing when fd is a separate argumentmisc/ | +1 | 0 replies | |
| 3/5 | e2fsck: flush superblock immediately after orphan cleanupe2fsck/ | +11 | 0 replies | |
| 4/5 | tests: add fsck option-parsing regression testtests/ tests/ tests/ +1 more | +66 | 0 replies | |
| 5/5 | tests: add orphan-cleanup flush regression testtests/ tests/ tests/ | +69 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH e2fsprogs 0/5] fsck: fix stale "bad orphan inode" after fsck runs
systemd-fsck invokes the fsck wrapper with options (-l, -C <fd>) that the e2fsprogs wrapper mis-parses and leaks to e2fsck, where they get eaten as a bad_blocks_file. e2fsck then aborts after orphan cleanup but before flushing the superblock, leaving s_last_orphan stale on disk and the kernel reporting "bad orphan inode" on next mount.
This series fixes both wrapper parsing bugs (consume -l; parse a separate "-C <fd>"), and, as defense-in-depth, flushes the superblock right after orphan cleanup so an early abort can no longer corrupt the on-disk orphan state. Two regression tests are added. See the individual patches for details.
Comments and review are welcome.
Thanks,
Baokun
Baokun Li (5):
fsck: consume -l option instead of passing to e2fsck
fsck: fix -C fd option parsing when fd is a separate argument
e2fsck: flush superblock immediately after orphan cleanup
tests: add fsck option-parsing regression test
tests: add orphan-cleanup flush regression test
e2fsck/super.c | 11 ++++++ misc/fsck.c | 5 ++- tests/f_fsck_opt_parse/expect.1 | 2 + tests/f_fsck_opt_parse/name | 1 + tests/f_fsck_opt_parse/script | 61 +++++++++++++++++++++++++++++ tests/f_orphan_flush_abort/expect.1 | 7 ++++ tests/f_orphan_flush_abort/name | 1 + tests/f_orphan_flush_abort/script | 61 +++++++++++++++++++++++++++++ tests/test_config | 2 + 9 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 tests/f_fsck_opt_parse/expect.1 create mode 100644 tests/f_fsck_opt_parse/name create mode 100644 tests/f_fsck_opt_parse/script create mode 100644 tests/f_orphan_flush_abort/expect.1 create mode 100644 tests/f_orphan_flush_abort/name create mode 100644 tests/f_orphan_flush_abort/script
Signature · 1 line
2.43.7