Skip to contentSkip to conversation

generic/805: mask unmount failures on cleanup

PATCH In review Darrick J. Wong 2 participants 4 messages Oct 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/805: mask unmount failures on cleanup

From: Darrick J. Wong <[email protected]>

On (what's left of) my NFS-booted QA fleet I get test "failures" like this:

--- a/generic/805.out 2026-09-22 13:33:18.326820071 -0700
+++ b/generic/805.out.bad 2026-10-14 18:58:34.438866321 -0700
@@ -1,2 +1,4 @@
QA output created by 805
Silence is golden
+umount.nfs: remote share not in 'host:dir' format +umount.nfs: /mnt/s: not mounted

This is caused by the _unmount call in _cleanup getting cranky about the scratch mount not being mounted despite the -q flag. I think this is because umount(8) detects the underlying fs as NFS and delegates entirely to umount.nfs, and that program whines.

So fix the test by redirecting the output. We've already decided if the test passes or not before we get to cleanup.

---
 tests/generic/805 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/805 +1 -1
index 401829c4c6fcdf..fa454310137a29 100755
@@ -25,7 +25,7 @@ _cleanup()
 {
 	xfs_freeze -u $SCRATCH_MNT 2>/dev/null
 	$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
-	_unmount -q $SCRATCH_MNT
+	_unmount -q $SCRATCH_MNT &>> $seqres.full
 	_dmsetup_remove $node
 	cd /
 	rm -f $tmp.*
#1 lore raw
Quoted 13 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

On (what's left of) my NFS-booted QA fleet I get test "failures" like this:

--- a/generic/805.out 2026-09-22 13:33:18.326820071 -0700
+++ b/generic/805.out.bad 2026-10-14 18:58:34.438866321 -0700
@@ -1,2 +1,4 @@
QA output created by 805
Silence is golden
+umount.nfs: remote share not in 'host:dir' format +umount.nfs: /mnt/s: not mounted

Quoted 7 lines

This is caused by the _unmount call in _cleanup getting cranky about the scratch mount not being mounted despite the -q flag. I think this is because umount(8) detects the underlying fs as NFS and delegates entirely to umount.nfs, and that program whines.

So fix the test by redirecting the output. We've already decided if the test passes or not before we get to cleanup.

We really should not end up here with NFS.

Oh, this test is missing a

_require_block_device $SCRATCH_DEV

so that all the dm magic is skipped when on a non-bdev fs.

#2 lore raw
Quoted 22 lines · Christoph Hellwig
Quoted 13 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

On (what's left of) my NFS-booted QA fleet I get test "failures" like this:

--- a/generic/805.out 2026-09-22 13:33:18.326820071 -0700
+++ b/generic/805.out.bad 2026-10-14 18:58:34.438866321 -0700
@@ -1,2 +1,4 @@
QA output created by 805
Silence is golden
+umount.nfs: remote share not in 'host:dir' format +umount.nfs: /mnt/s: not mounted

Quoted 7 lines

This is caused by the _unmount call in _cleanup getting cranky about the scratch mount not being mounted despite the -q flag. I think this is because umount(8) detects the underlying fs as NFS and delegates entirely to umount.nfs, and that program whines.

So fix the test by redirecting the output. We've already decided if the test passes or not before we get to cleanup.

Quoted 7 lines

We really should not end up here with NFS.

Oh, this test is missing a

_require_block_device $SCRATCH_DEV

so that all the dm magic is skipped when on a non-bdev fs.

_require_dm_target already checks that scratch-dev is a bdev, but I think you've misunderstood me.

The test vm boots off NFS to test XFS, so / and /mnt are NFS. SCRATCH_DEV is XFS, so when SCRATCH_MNT is mounted, /mnt/s will be XFS. After unmounting SCRATCH_MNT, /mnt/s will look like it's NFS, so that's why umount does what it does:

# mkfs.xfs -f /dev/sda
# mount /dev/sda /mnt/s
# umount /mnt/s
# umount /mnt/s
umount.nfs: remote share not in 'host:dir' format
umount.nfs: /mnt/s: not mounted

(I'm not fstesting NFS, I left that to Chuck and Anna.)

--D

Reviewed-by
#3 lore raw
Quoted 5 lines · Darrick J. Wong

The test vm boots off NFS to test XFS, so / and /mnt are NFS. SCRATCH_DEV is XFS, so when SCRATCH_MNT is mounted, /mnt/s will be XFS. After unmounting SCRATCH_MNT, /mnt/s will look like it's NFS, so that's why umount does what it does:

Quoted 8 lines
# mkfs.xfs -f /dev/sda
# mount /dev/sda /mnt/s
# umount /mnt/s
# umount /mnt/s
umount.nfs: remote share not in 'host:dir' format
umount.nfs: /mnt/s: not mounted

(I'm not fstesting NFS, I left that to Chuck and Anna.)

Ah. The patch looks good then: