From 5542415e196d1bc7819f43e0d23f13cdbff5117f Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Tue, 9 Sep 2014 22:21:28 +0400 Subject: [PATCH] tar2fs: wait a bit Looks like there's a race condition somewhere: this script will fail to clean up after itself when considerable background load is inflicted upon the host it's running on (e.g. LA ~16 on a 8-core, single-disk system). Note that this commit is NOT enough to win that race but just a step in the right direction... --- bin/tar2fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tar2fs b/bin/tar2fs index 9c099f92..d9bce07d 100755 --- a/bin/tar2fs +++ b/bin/tar2fs @@ -129,7 +129,7 @@ exit_handler() { umount ${BOOTFS:+"$BOOTFS"} "$ROOTFS"{/dev,/proc,/sys,} if [ -n "$LOOPDEV" ]; then - kpartx -d "$LOOPDEV" + kpartx -d -s "$LOOPDEV" losetup --detach "$LOOPDEV" fi rm -r -- "$ROOTFS"