Avoid looping forever trying to unmount busy tmpfs

This split unmount is a bit crude, unfortunately.  A user may have set
up a bind or overlayfs mount on top of a tmpfs -- so unmounting tmpfs
first will then always result in EBUSY.

Avoid logging busy errors and fake OK.  We'll catch it later in the
second stage unmount.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-04-12 21:57:14 +02:00
parent 5adb92ca1b
commit a91e197553
+4 -2
View File
@@ -94,10 +94,12 @@ static int unmount(const char *target)
int rc; int rc;
rc = umount(target); rc = umount(target);
if (rc) if (rc && errno != EBUSY) {
print(2, "Failed unmounting %s, error %d: %s", target, errno, strerror(errno)); print(2, "Failed unmounting %s, error %d: %s", target, errno, strerror(errno));
return rc;
}
return rc; return 0;
} }
void unmount_tmpfs(void) void unmount_tmpfs(void)