[PATCH 1/1] test-index-check-device: unmount "lazily" to avoid potential crash

0 views
Skip to first unread message

Rob Browning

unread,
Sep 17, 2021, 2:10:03 PM9/17/21
to bup-...@googlegroups.com, Abdel Said
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 <r...@defaultvalue.org>
---

Pushed - thanks.

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 1326df1c..a0861c71 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.30.2

Reply all
Reply to author
Forward
0 new messages