linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-fsdevel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: Some way of telling which block devices are in use (and how)
Date: Sun, 29 Apr 2012 17:23:05 -0400	[thread overview]
Message-ID: <20120429212305.GB7342@thunk.org> (raw)
In-Reply-To: <20120429201830.GA10188@kroah.com>

On Sun, Apr 29, 2012 at 01:18:30PM -0700, Greg KH wrote:
> Don't we already have a way to do all of this through sysfs today?  How
> does gnome/kde handle this when you try to eject a device with an active
> mount that is busy?  It pops up a dialog telling you why this can't be
> ejected, and which device it is.  I think everything you want is already
> there, if not, perhaps dm just needs to add a few more sysfs links to
> tie it all together.

I'm pretty sure GNOME/KDE is just checking /proc/mounts.  Which won't
help if someone is playing games with mount namespaces; the file
system might not be mounted in the namespace where the sysadmin is
trying to do the umount, so the sysadmin will be clueless as to why
they can't unmount the block device.  (And even if they know that it
has been mounted, there's no way to enumerate or name the mount
namespaces, so all the sysadmin can do is to check /proc/$pid/mounts
for every single pid currently running on the system, which is both
painful and something you can't do in a race-free manner.  Fun, fun,
fun....)

And then there are also all of the other ways which the block device
might be busy.  What GNOME/KDE do may often good enough such that it
works most of the time, but there are cases such as

	https://bugs.launchpad.net/bugs/711799

where it's not so obvious why the block device is busy, and it would
be nice if there's an easy way to definitively tell *why* the block
device is busy.

					- Ted

  reply	other threads:[~2012-04-29 21:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-29 18:57 Some way of telling which block devices are in use (and how) Theodore Ts'o
2012-04-29 20:18 ` Greg KH
2012-04-29 21:23   ` Ted Ts'o [this message]
2012-04-29 22:05     ` Ted Ts'o
2012-04-30  5:10       ` Greg KH
2012-04-30  9:11         ` Ted Ts'o
2012-04-30 16:21           ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120429212305.GB7342@thunk.org \
    --to=tytso@mit.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).