From aa604c9ade233fc40e221fb0ad8ee2ab70133447 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 17 Sep 2021 12:56:38 -0500 Subject: [PATCH] test-index-check-device: unmount "lazily" to avoid potential crash Apparently the umount was failing on some systems, and since we're already using loop, mke2fs, etc. which aren't really portable, and we use "umount -l" in cleanup-mounts-under, just use it here too for now. Thanks to Abdel Said for reporting the problem: ! t/test-index-check-device.sh:38 mke2fs -F -j -m 0 testfs.img ok ! t/test-index-check-device.sh:39 mount -o loop testfs.img /opt/bup/t/mnt/test-index-check-device.sh-YuNQZtU ok ! t/test-index-check-device.sh:41 chown root:root /opt/bup/t/mnt/test-index-check-device.sh-YuNQZtU ok ! t/test-index-check-device.sh:42 chmod 0700 /opt/bup/t/mnt/test-index-check-device.sh-YuNQZtU ok ! t/test-index-check-device.sh:45 date ok umount: /opt/bup/t/mnt/test-index-check-device.sh-YuNQZtU: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) ! t/test-index-check-device.sh:46 umount /opt/bup/t/mnt/test-index-check-device.sh-YuNQZtU FAILED Additional discussion: https://groups.google.com/d/msg/bup-list/GhVonW0XGVE/8kIkJEOwCQAJ Signed-off-by: Rob Browning --- test/ext/test-index-check-device | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ext/test-index-check-device b/test/ext/test-index-check-device index 1326df1..a0861c7 100755 --- a/test/ext/test-index-check-device +++ b/test/ext/test-index-check-device @@ -50,7 +50,8 @@ WVPASS chmod 0700 "$tmpmnt1" # Create trivial content. WVPASS date > "$tmpmnt1/foo" -WVPASS umount "$tmpmnt1" +# A non-lazy umount was reported to fail on some systems +WVPASS umount -l "$tmpmnt1" # Mount twice, so we'll have the same content with different devices. WVPASS cp -pP testfs.img testfs2.img -- 2.39.2