From: Christoph Hellwig Date: Fri, 12 Jan 2024 05:08:30 +0000 (+0100) Subject: xfs: check that the mountpoint is actually mounted in _supports_xfs_scrub X-Git-Tag: v2024.01.14~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d04485207fe6701f587e862336627f50a7add44;p=xfstests-dev.git xfs: check that the mountpoint is actually mounted in _supports_xfs_scrub Add a sanity check that the passed in mount point is actually mounted to guard against actually calling _supports_xfs_scrub before $SCRATCH_MNT is mounted. Signed-off-by: Christoph Hellwig Reviewed-by: Zorro Lang Reviewed-by: Darrick J. Wong Signed-off-by: Zorro Lang --- diff --git a/common/xfs b/common/xfs index f53b33fc..4e54d75c 100644 --- a/common/xfs +++ b/common/xfs @@ -649,6 +649,9 @@ _supports_xfs_scrub() test "$FSTYP" = "xfs" || return 1 test -x "$XFS_SCRUB_PROG" || return 1 + mountpoint $mountpoint >/dev/null || \ + _fail "$mountpoint is not mounted" + # Probe for kernel support... $XFS_IO_PROG -c 'help scrub' 2>&1 | grep -q 'types are:.*probe' || return 1 $XFS_IO_PROG -c "scrub probe" "$mountpoint" 2>&1 | grep -q "Inappropriate ioctl" && return 1