From: Filipe Manana Date: Wed, 21 Jan 2015 04:57:03 +0000 (+1100) Subject: common: fix function _require_batched_discard() X-Git-Tag: v2022.05.01~2974 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=90a5c23039acf9bb14c5bdf710a4a94f04241ef0;p=users%2Fhch%2Fxfstests-dev.git common: fix function _require_batched_discard() Commit 01d42b7efe3fcb9169befda3072c41d25a87c920 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 Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/common/rc b/common/rc index 5ce33229f..5770b0a3b 100644 --- a/common/rc +++ b/common/rc @@ -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()