util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* History of Lazy and Force unmouting
@ 2017-10-30 21:41 Joshua Watt
  2017-11-03 11:00 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2017-10-30 21:41 UTC (permalink / raw)
  To: util-linux

All,

I was hoping to get some background on why the util-linux umount
command doesn't allow lazy unmounting (the -l flag) to be combined with
force unmounting (the -f flag). If both flags are specified, umount
only passes MNT_DETACH to the kernel instead of MNT_DETACH | MNT_FORCE.
 I looked through the kernel code, and it appears that the two flags
are orthogonal, so you *should* be able to specify both? I tried
looking back in the git history of util-linux, but it appears to have
been that way since support for lazy unmounting was added in 2006.

Thanks,
Joshua Watt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: History of Lazy and Force unmouting
  2017-10-30 21:41 History of Lazy and Force unmouting Joshua Watt
@ 2017-11-03 11:00 ` Karel Zak
  2017-11-03 14:17   ` Joshua Watt
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2017-11-03 11:00 UTC (permalink / raw)
  To: Joshua Watt; +Cc: util-linux

On Mon, Oct 30, 2017 at 04:41:12PM -0500, Joshua Watt wrote:
> I was hoping to get some background on why the util-linux umount
> command doesn't allow lazy unmounting (the -l flag) to be combined with
> force unmounting (the -f flag). If both flags are specified, umount
> only passes MNT_DETACH to the kernel instead of MNT_DETACH | MNT_FORCE.

The current libmount code follows the original mount(*) behavior. The
flag MNT_DETACH is supported since util-linux 2.11m (year 2001).

>  I looked through the kernel code, and it appears that the two flags
> are orthogonal, so you *should* be able to specify both? I tried
> looking back in the git history of util-linux, but it appears to have
> been that way since support for lazy unmounting was added in 2006.

2006 is time when the code was imported to the git. The important
tarball are older.

Anyway, does it make sense to use the both flags in the same time?

>From kernel code it seems that MNT_FORCE forces FS driver to kill all
resources (by op->umount_begin()) before the umount, so what do you 
expect from later MNT_DETACH?

The problem is that libmount prefers MNT_DETACH, so if you specify
both flags that MNT_FORCE is silently ignored. It would be better
prefer MNT_FORCE or accept both flags and don't try to be more smart
than kernel.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: History of Lazy and Force unmouting
  2017-11-03 11:00 ` Karel Zak
@ 2017-11-03 14:17   ` Joshua Watt
  0 siblings, 0 replies; 3+ messages in thread
From: Joshua Watt @ 2017-11-03 14:17 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

On Nov 3, 2017 06:00, "Karel Zak" <kzak@redhat.com> wrote:

On Mon, Oct 30, 2017 at 04:41:12PM -0500, Joshua Watt wrote:
> I was hoping to get some background on why the util-linux umount
> command doesn't allow lazy unmounting (the -l flag) to be combined with
> force unmounting (the -f flag). If both flags are specified, umount
> only passes MNT_DETACH to the kernel instead of MNT_DETACH | MNT_FORCE.

The current libmount code follows the original mount(*) behavior. The
flag MNT_DETACH is supported since util-linux 2.11m (year 2001).

>  I looked through the kernel code, and it appears that the two flags
> are orthogonal, so you *should* be able to specify both? I tried
> looking back in the git history of util-linux, but it appears to have
> been that way since support for lazy unmounting was added in 2006.

2006 is time when the code was imported to the git. The important
tarball are older.

Anyway, does it make sense to use the both flags in the same time?

>From kernel code it seems that MNT_FORCE forces FS driver to kill all
resources (by op->umount_begin()) before the umount, so what do you
expect from later MNT_DETACH?


I'm currently in discussion with the kernel nfs team about the MNT_FORCE
behavior, specifically that it doesn't shut everything down. I came across
this oddity in my testing and was curious if it was on purpose.

http://www.spinics.net/lists/linux-nfs/msg66073.html


The problem is that libmount prefers MNT_DETACH, so if you specify
both flags that MNT_FORCE is silently ignored. It would be better
prefer MNT_FORCE or accept both flags and don't try to be more smart
than kernel.


Ok. I'll submit a patch after I get home from vacation.


    Karel

--
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

[-- Attachment #2: Type: text/html, Size: 3321 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-03 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 21:41 History of Lazy and Force unmouting Joshua Watt
2017-11-03 11:00 ` Karel Zak
2017-11-03 14:17   ` Joshua Watt

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).