common: fix function _require_batched_discard()

Commit 01d42b7efe broke the check
for the success status of running fstrim. The [ ] bracets should
have been killed. This made several tests being skipped even when
the test/scratch devices support trim/discard.

For reference:

$ [ fstrim /mnt/ ] || echo foobar
bash: [: fstrim: unary operator expected
foobar

$ fstrim /mnt/ || echo foobar
$ echo $?
0

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Filipe Manana
2015-01-21 15:57:03 +11:00
committed by Dave Chinner
parent 521cc6fd39
commit 90a5c23039
+1 -1
View File
@@ -2388,7 +2388,7 @@ _require_batched_discard()
exit 1
fi
_require_fstrim
[$FSTRIM_PROG $1 > /dev/null 2>&1] || _notrun "FITRIM not supported on $1"
$FSTRIM_PROG $1 > /dev/null 2>&1 || _notrun "FITRIM not supported on $1"
}
_require_dumpe2fs()