xfstests generic/260: get correct trimmed bytes
[xfstests-dev.git] / tests / generic / 260
index dc8b822c3f31b8de3249a9a057be1a3cdd147d43..a003a7f9141b9832fc11971b4f8b4ba0e17f547a 100755 (executable)
@@ -104,9 +104,7 @@ _scratch_mount
 # This is a bit fuzzy, but since the file system is fresh
 # there should be at least (fssize/2) free space to trim.
 # This is supposed to catch wrong FITRIM argument handling
-out=$($FSTRIM_PROG -v -o10M $SCRATCH_MNT)
-nopref=${out##*: }
-bytes=${nopref%% *}
+bytes=$($FSTRIM_PROG -v -o10M $SCRATCH_MNT | _filter_fstrim)
 
 if [ $bytes -gt $(_math "$fssize*1024") ]; then
        status=1
@@ -177,9 +175,7 @@ _scratch_mount
 # It is because btrfs does not have not-yet-used parts of the device
 # mapped and since we got here right after the mkfs, there is not
 # enough free extents in the root tree.
-out=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT)
-nopref=${out##*: }
-bytes=${nopref%% *}
+bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim)
 if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then
        status=1
        echo "It seems that fs logic handling len argument overflows"