linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: Revoking filesystems [was Re: Sysfs attributes racing with unregistration]
Date: Thu, 5 Jan 2012 12:52:11 -0800	[thread overview]
Message-ID: <20120105205211.GA2934@google.com> (raw)
In-Reply-To: <20120105192822.GD26382@thunk.org>

Hello,

On Thu, Jan 05, 2012 at 02:28:22PM -0500, Ted Ts'o wrote:
> > I think these are two separate mechanisms.  Filesystems need to be
> > able to handle IO errors no matter what and underlying device going
> > away is the same situation.  There's no reason to mix that with force
> > unmount.  That's a separate feature and whether to force unmount
> > filesystem on device removal or permanent failure is a policy decision
> > which belongs to userland - ie. if such behavior is desired, it should
> > be implemented via udev/udisk instead of hard coded logic in kernel.
> 
> I think it's needless complexity to loop this into userspace.  If the
> block device is gone, it's *gone*.  What else could userspace do with
> this information that block device has disappeared?  Right now, once
> gone, it's never coming back.  Even if the luser plugs the USB device
> back in, it's going to be coming back as a new block device node.
> 
> So we might as well automatically forcibly unmount the file system at
> this point.  I can imagine sending an optional notification that such
> a thing has happened, perhaps via a netlink socket, but why not have
> the kernel do the right thing automatically?

* If this was the one method to deal with hotunplug, sure, but it's
  not.  We already have (supposedly) working failure mode for hot
  device removal.

* Any modern linux distro already has all the infrastructure to handle
  this.  You can't handle hotplug without userland provided poicies
  and the same mechanism is used for hotunplugging too, *today*.  If
  force umount is decided to be the action to take on block device
  removal, that would be several line changes in userland.  Userland
  is already responsible for taking actions for those events.

* Such automation might look like a good idea now but we really don't
  know how it would end up in the longer run or for different use case
  scenarios.  I think a good example of this is the cdrom driver.  It
  implents tons of automatic behaviors, and then had to be augmented
  with ioctls to turn on and off them as they no longer fit new
  hardware, new userland behavior and changing user expectations.

So, regardless of whether adding revoking is a good idea or not, I
believe that force umount should be a separate thing from internal
block error handling.

> The other use case would be a system administrator who doesn't want to
> figure out which random shell is still cd'ed into a directory of a
> file system he/she wants to unmount, he can still force the umount.
> (Other Unix systems have had this feature in the past, and the result
> is the same as what happens if you are cd'ed into a directory which is
> later rmdir'ed.)  It's an ungraceful way of running things, but
> sometimes it's the easist way to go.

More importantly, I can't really see valid use cases other than
scenarios like the above for using revocation for usual hot unplug.
For most users, it wouldn't matter one way or the other.  It's not
like sync + lazy umount can't achieve (note that all the desktop stuff
knows about "filesystem is going away" and will gracefully step aside)
most of forced umount anyway.  It could be nice to cli aficionados or
grumpy admins but for the vast majority of userbase, it just wouldn't
matter.  Given that, I'm not convinced this is a worthwhile thing to
have.

Thanks.

-- 
tejun

  reply	other threads:[~2012-01-05 20:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 16:52 Sysfs attributes racing with unregistration Alan Stern
2012-01-04 17:18 ` Tejun Heo
2012-01-04 18:13   ` Eric W. Biederman
2012-01-04 19:41     ` Alan Stern
2012-01-05  3:07       ` Eric W. Biederman
2012-01-05 15:13         ` Revoking filesystems [was Re: Sysfs attributes racing with unregistration] Alan Stern
2012-01-05 15:32           ` Tejun Heo
2012-01-05 16:03             ` Eric W. Biederman
2012-01-05 16:44               ` Tejun Heo
2012-01-05 16:47               ` Alan Stern
2012-01-05 17:11                 ` Tejun Heo
2012-01-05 18:27                 ` Ted Ts'o
2012-01-05 18:36                   ` Tejun Heo
2012-01-05 19:28                     ` Ted Ts'o
2012-01-05 20:52                       ` Tejun Heo [this message]
2012-01-06  6:25                       ` Alexander E. Patrakov
2012-01-07 21:01                       ` Revoking filesystems [was Re: Sysfs attributes racing withunregistration] Milton Miller
2012-01-05 20:43                     ` Revoking filesystems [was Re: Sysfs attributes racing with unregistration] Eric W. Biederman
2012-01-05 20:55                       ` Tejun Heo
2012-01-05 18:38                   ` Christoph Hellwig
2012-01-05 15:52           ` Eric W. Biederman
2013-01-14 15:11             ` watchdog code anish kumar
2012-01-05 18:18           ` Revoking filesystems [was Re: Sysfs attributes racing with unregistration] Greg KH
2012-01-04 18:13   ` Sysfs attributes racing with unregistration Alan Stern
2012-01-04 18:20     ` Tejun Heo

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=20120105205211.GA2934@google.com \
    --to=tj@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tytso@mit.edu \
    /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).