mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-28 07:50:32 +00:00
Attempting to dump a bad btrfs superblock returns successful exit status zero. According to the manual page non-zero should be returned on failure. Fix this. $ btrfs inspect-internal dump-super /dev/zero superblock: bytenr=65536, device=/dev/zero --------------------------------------------------------- ERROR: bad magic on superblock on /dev/zero at 65536 $ echo $? 0 Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com> Signed-off-by: David Sterba <dsterba@suse.com>
23 lines
913 B
Bash
Executable File
23 lines
913 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# let dump-super dump random data, must not crash
|
|
|
|
source "$TEST_TOP/common"
|
|
|
|
check_prereq btrfs
|
|
|
|
run_mustfail "attempt to print bad superblock without force" \
|
|
"$TOP/btrfs" inspect-internal dump-super /dev/urandom
|
|
run_mustfail "attempt to print bad superblock without force" \
|
|
"$TOP/btrfs" inspect-internal dump-super -a /dev/urandom
|
|
run_mustfail "attempt to print bad superblock without force" \
|
|
"$TOP/btrfs" inspect-internal dump-super -fa /dev/urandom
|
|
|
|
# All forced, no failure
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|
|
run_check "$TOP/btrfs" inspect-internal dump-super -Ffa /dev/urandom
|