]> arthur.barton.de Git - bup.git/commitdiff
test-index-check-device: unmount "lazily" to avoid potential crash
authorRob Browning <rlb@defaultvalue.org>
Fri, 17 Sep 2021 17:56:38 +0000 (12:56 -0500)
committerRob Browning <rlb@defaultvalue.org>
Fri, 17 Sep 2021 18:05:59 +0000 (13:05 -0500)
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 <rlb@defaultvalue.org>
test/ext/test-index-check-device

index 1326df1c91b9d5a9cfea7382613039db7cb36fc1..a0861c711938bee4b779d4afca0c9be852c71080 100755 (executable)
@@ -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