mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/xfs: Fix _require_scratch_xfs_shrink bug
Since local declaration can't pass function return value, this helper never detects whether kernel or xfsprogs supports xfs shrink feature successfully. Fit it by separating declaration and assignment of local variables. Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+2
-1
@@ -820,7 +820,8 @@ _require_scratch_xfs_shrink()
|
||||
. $tmp.mkfs
|
||||
_scratch_mount
|
||||
# here just to check if kernel supports, no need do more extra work
|
||||
local errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
|
||||
local errmsg
|
||||
errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$errmsg" | grep 'XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument' > /dev/null && \
|
||||
_notrun "kernel does not support shrinking"
|
||||
|
||||
Reference in New Issue
Block a user