Skip to content

Commit 8638aab

Browse files
naotakdave
authored andcommitted
btrfs-progs: tests: check nullb index for the error case
"_find_free_index" can return "" when an error occur. Check the return value for the case and fail the test. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 050fe80 commit 8638aab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/nullb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ fi
146146
if [ "$CMD" = 'create' ]; then
147147
_check_setup
148148
index=$(_find_free_index)
149+
if [ -z "$index" ]; then
150+
exit 1
151+
fi
149152
name="nullb$index"
150153
# size in MB
151154
size=$(_parse_device_size "$@")

0 commit comments

Comments
 (0)