* [PATCH] umount: read mountinfo if --detach-loop given
@ 2014-09-18 6:09 Robert Schiele
2014-09-22 11:19 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Robert Schiele @ 2014-09-18 6:09 UTC (permalink / raw)
To: util-linux
Don't use the optimization not to read mountinfo from commit
6a52473ecd877227f6f7da2b95da0b51593ffec1 if --detach-loop was given
since we need the name of the loop device in that case and with the
optimization this is not present and thus the detach operation
obviously fails.
Signed-off-by: Robert Schiele <rschiele@gmail.com>
---
libmount/src/context_umount.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 73e8214..6c1d9a2 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -254,7 +254,8 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
* options for the target (e.g. helper=udisks to call /sbin/umount.udisks).
*
* So, let's use statfs() if possible (it's bad idea for --lazy/--force
- * umounts as target is probably unreachable NFS).
+ * umounts as target is probably unreachable NFS, also for --detach-loop
+ * as this additionally needs to know the name of the loop device).
*/
if (!mnt_context_is_restricted(cxt)
&& *tgt == '/'
@@ -262,6 +263,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
&& !mnt_context_mtab_writable(cxt)
&& !mnt_context_is_force(cxt)
&& !mnt_context_is_lazy(cxt)
+ && !mnt_context_is_loopdel(cxt)
&& stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)
&& !has_utab_entry(cxt, tgt)) {
--
1.8.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] umount: read mountinfo if --detach-loop given
2014-09-18 6:09 [PATCH] umount: read mountinfo if --detach-loop given Robert Schiele
@ 2014-09-22 11:19 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-09-22 11:19 UTC (permalink / raw)
To: Robert Schiele; +Cc: util-linux
On Thu, Sep 18, 2014 at 08:09:59AM +0200, Robert Schiele wrote:
> libmount/src/context_umount.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied, thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-22 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 6:09 [PATCH] umount: read mountinfo if --detach-loop given Robert Schiele
2014-09-22 11:19 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).