From: Karel Zak Date: Wed, 1 Dec 2021 11:35:42 +0000 (+0100) Subject: libmount: disable mtab only on statfs() success only X-Git-Tag: v2.38-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a1b1f82b75fe0cbc9d9b356fe1f7c62be45e635;p=thirdparty%2Futil-linux.git libmount: disable mtab only on statfs() success only Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 173637a15a..25a409e227 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -283,10 +283,6 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg return 1; /* not found */ type = mnt_fs_get_fstype(cxt->fs); - - DBG(CXT, ul_debugobj(cxt, " umount: disabling mtab")); - mnt_context_disable_mtab(cxt, TRUE); - if (!type) { struct statfs vfs; int fd; @@ -307,6 +303,9 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg } } if (type) { + DBG(CXT, ul_debugobj(cxt, " umount: disabling mtab")); + mnt_context_disable_mtab(cxt, TRUE); + DBG(CXT, ul_debugobj(cxt, " mountinfo unnecessary [type=%s]", type)); return 0;