From 63fd77221c5c420e00f6f95d1e226255db948967 Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Thu, 5 May 2022 20:42:01 +0200
Subject: [PATCH] tmpdir-setup: use lazy umount

The umount of the job tmpdir often takes a lot of time (minutes!) when
the user write a log of data to it, because there are many dirty pages
which are written to the disk before the umount completes.

This writing is obviously a waste of resources, because as soon as the
unmount is finished, the backup image for the filesystem is destroyed
anyway.

Unfortunatly, we currenty don't have a solid way to avoid the
unnecessary writeback.

Use lazy umount so that at least mxqd doesn't block while the writeback
is happening.
---
 helper/tmpdir-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helper/tmpdir-setup b/helper/tmpdir-setup
index 088acdf3..8cf77322 100755
--- a/helper/tmpdir-setup
+++ b/helper/tmpdir-setup
@@ -54,7 +54,7 @@ cmd_cleanup() {
 
     mountpoint=$mntdir/$MXQ_JOBID
 
-    umount $mountpoint
+    umount -l $mountpoint
     rmdir $mountpoint
 }