Upstream btrfs-progs has a --force option in btrfs check which permits running the command on RO and RW mounted file systems for both --readonly and --repair.
--force
btrfs check
--readonly
--repair
This is somewhere between unreliable and dangerous on Fedora, where by far the most common Btrfs is the mounted root file system. Since it's mounted, and it's root, it's always busy doing something even if it's just writing out journald log bits. It's neither read-only nor quiescent.
In the case of a read-write mounted root file system,--readonly --force produces spurious results. And --repair --force will irreparably corrupt the file system. It's a big hurt me button.
--readonly --force
--repair --force
https://github.com/kdave/btrfs-progs/issues/503
Suggestions for Fedora:
a. Entirely disable --force, just rip it out.
b. Only permit --force on RO mounted file systems.
c. --repair + --force only works on RO mounted file systems. AND --readonly + --force works on RO and RW mounted file systems, but report the mounted state (RO or RW, and mountpoint) to STDOUT so we have some idea if the results might be questionable.
Log in to comment on this ticket.