diff options
author | Christoph Hellwig <hch@lst.de> | 2024-01-12 06:08:30 +0100 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2024-01-14 20:39:09 +0800 |
commit | 4d04485207fe6701f587e862336627f50a7add44 (patch) | |
tree | 9da377849fcd0b1362c2967875ee9eb09f884c1a | |
parent | 66c7b4a494044bba04d68f437c5246dc4d5fe6f4 (diff) |
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 <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r-- | common/xfs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |