The e2fsprogs fsck wrapper (misc/fsck.c, installed via make install) supports the -C option for progress reporting. The fd can be passed either attached (-C6) or separated (-C 6). Currently the wrapper handles "-C6" correctly, but fails to handle "-C 6" properly: # fsck -h | head -n1 fsck 1.47.4 (6-Mar-2025) # fsck -C6 -N /dev/sda [/sbin/fsck.ext4 (1) -- /dev/sda] fsck.ext4 -C6 /dev/sda # fsck -C 6 -N /dev/sda [/sbin/fsck.ext4 (1) -- /dev/sda] fsck.ext4 6 -C0 /dev/sda When "-C 6" is passed, it is parsed as "-C0" with "6" leaked as a stray argument. This is because in PRS(), the separate-argument branch uses argv[i] (which is "-C") instead of argv[i+1] (which is "6") to parse the fd value. string_to_int("-C") returns -1, so progress_fd stays at 0 and the "6" is never consumed. Later the wrapper generates "-C0" from progress_fd=0 and the stray "6" is passed before the device. Fix by using argv[i+1] to correctly parse the separate fd argument. Note: this is the e2fsprogs fsck wrapper (misc/fsck.c), not the util-linux fsck wrapper (disk-utils/fsck.c) which handles this correctly. Signed-off-by: Baokun Li --- misc/fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/fsck.c b/misc/fsck.c index cb935e1b4b71..318ecfcb4102 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -1188,7 +1188,7 @@ static void PRS(int argc, char *argv[]) goto next_arg; } else if (argc > i + 1 && argv[i + 1][0] != '-') { - progress_fd = string_to_int(argv[i]); + progress_fd = string_to_int(argv[i+1]); if (progress_fd < 0) progress_fd = 0; else { -- 2.43.7