linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ted Ts'o <tytso@mit.edu>
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: Mon, 30 Apr 2012 01:10:33 -0400	[thread overview]
Message-ID: <20120430051033.GA562@kroah.com> (raw)
In-Reply-To: <20120429220512.GC7342@thunk.org>

On Sun, Apr 29, 2012 at 06:05:12PM -0400, Ted Ts'o wrote:
> I've been looking more closely at this, and I think we can make things
> better by having the file system create a symlink from partition's
> holders directory to the file system's kobject (assuming the file
> system has a kobject, which most do not have).  i.e., I'd add to
> ext4_fill_super() something like this:
> 
> 	ret = add_symlink(bdev->bd_part->holder_dir, &ext4_kset->kobj);

But, as you point out, not all filesystems have /sys/fs/ entries.  In
fact, the large majority do not.

And why would you be doing this at a fs-specific level?  If you want to
know what type of filesystem is mounted on each block device, yes, that
would matter, but you don't.  You want to know what is "busy", right?

And "busy" means different things, including the fact that the whole
block device underneath can disappear at any moment no matter how much
it isn't nice that this happens.

So a combination of 'lsof' and other things might just be the best that
we can do, like GNOME and KDE are doing today.  As you point out the
mount namespace issue, it gets really tricky to try to figure it all
out, so maybe we really don't want to?

thanks,

greg k-h

  reply	other threads:[~2012-04-30  5:10 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
2012-04-29 22:05     ` Ted Ts'o
2012-04-30  5:10       ` Greg KH [this message]
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=20120430051033.GA562@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --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).