public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Alon Bar-Lev <alon.barlev@gmail.com>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Flames over -- Re: Which is simpler?
Date: Tue, 14 Feb 2006 22:08:10 -0500	[thread overview]
Message-ID: <43F29B1A.30309@cfl.rr.com> (raw)
In-Reply-To: <79A58445-4313-4645-8382-8C82C8831B5F@mac.com>

Kyle Moffett wrote:
> On Feb 14, 2006, at 16:13, Phillip Susi wrote:
>> Because you can not go yanking devices out from under the kernel 
>> without it's knowledge or consent.  This is no more acceptable than 
>> ejecting a floppy without first unmounting it; the only difference is 
>> that the floppy drive doesn't erroneously inform the kernel that you 
>> have done this simply because you suspend.
> 
> Yes, but causing it to overwrite data over random blockdevs when the 
> unexpected happens is _not_ OK.
> 

Why not?  That is exactly what happens if you suspend and swap floppies. 
  Just don't do that and you're fine.  It is nice if you can handle the 
swapped case more gracefully, but not at the cost of data loss in the 
_normal_ case.

> You've obviously never administrated any kind of large scale linux lab.  
> We had so many people just saving files on their USB sticks and pulling 
> them that we would daily get people reporting that they couldn't _mount_ 
> their USB stick because the last user hadn't unmounted it first.  At one 
> point we had to write a Perl script run from cron that ran every 10 
> minutes and verified if USB-stick mounts were still good, and if not it 

This is a very good argument for _correctly_ detecting device removal. 
I am not arguing against that.  The problem is with _incorrectly_ 
detecting device removal.

> forcefully unmounted them.  Now obviously this is the kind of behavior 
> that we want to avoid, but end-users are bound to do stupid stuff until 
> it comes back and bites them at least twice (except on Linux with -o 
> sync mounts it usually doesn't).  Think about how most linux distros 
> automatically turn on -o sync on USB keys and the like; they do it for 
> precisely this reason.
> 

Some distros do.  Some do not.  I side with those who do not because 
doing so promotes stupid users ( they won't learn until it bites them 
twice ) and because it burns out the flash memory 10 times faster and 
slows down access.

> 
> I described a workable method to handle root-on-USB (and I'm not sure, 
> but I doubt it works now).  You would have early userspace find your USB 
> filesystems again and pass device information to the resuming kernel, 
> which would then restore RAM and then use the passed information to 
> attach its filesystems again.
> 

There is currently no such method of reconnecting a filesystem to a 
device once the device has been broken by an eject, is there?  Also that 
amounts to much the same thing as I have been saying all along: the 
system should check to see if the device that is there now is the same 
as the one that was there before, and if so, resume using it.

> One other alternative that just occurs to me now is to have a special 
> stackable filesystem that can suspend all IO and unmount the filesystem 
> underneath it then have the filesystem be easily reattachable later on 
> (the stackable layer would look up paths again on remount.  You would 
> have an mlocked program start during suspend that would create a new 
> namespace with a basic tmpfs, procfs, and sysfs.  It would be able to 
> rescan all removable devices on resume and reattach them to the 
> stackable mounts in the primary namespace through /proc/<pid>/root.  
> This seems to me to be the most race-free and most flexible solution.  
> It will even handle network suspend and resume without too much extra 
> effort.
> 

That seems rather complex with little benefit.  The only advantage that 
would have over not breaking the mount in the first place is in the 
pedantic case where the user screws with the media during suspend. 
Seems like a high price to pay to cleanly deal with a pedantic error 
condition.



  reply	other threads:[~2006-02-15  3:08 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-12 16:57 Flames over -- Re: Which is simpler? Alan Stern
2006-02-13  0:51 ` Phillip Susi
2006-02-13  2:19   ` Alan Stern
2006-02-13  3:52     ` Phillip Susi
2006-02-13  5:43       ` Kyle Moffett
2006-02-13 16:40         ` Phillip Susi
2006-02-13 16:31       ` Alan Stern
2006-02-13 17:14         ` Phillip Susi
2006-02-13 20:04           ` Alan Stern
2006-02-13 20:38             ` Phillip Susi
2006-02-13 21:24               ` Alan Stern
2006-02-13 22:27                 ` Rafael J. Wysocki
2006-02-14 19:26                   ` Alan Stern
2006-02-14 20:41                     ` Rafael J. Wysocki
2006-02-14 21:08                       ` Lee Revell
2006-02-15 15:56                       ` Alan Stern
2006-02-13 22:51                 ` J. Bruce Fields
2006-02-13 23:47                 ` Phillip Susi
2006-02-14  0:50                   ` Kyle Moffett
2006-02-14  2:09                     ` Phillip Susi
2006-02-14  4:09                       ` Kyle Moffett
2006-02-14  4:28                         ` Alan Stern
2006-02-14  5:11                           ` Kyle Moffett
2006-02-14 15:33                             ` Alan Stern
2006-02-14  6:27                         ` Phillip Susi
2006-02-14 16:23                           ` Kyle Moffett
2006-02-14 18:39                             ` Phillip Susi
2006-02-14 19:55                               ` Kyle Moffett
2006-02-14 21:13                                 ` Phillip Susi
2006-02-14 23:32                                   ` Kyle Moffett
2006-02-15  3:08                                     ` Phillip Susi [this message]
2006-02-14 19:14                             ` Olivier Galibert
2006-02-14 19:37                               ` Phillip Susi
2006-02-17 21:04                   ` Pavel Machek
2006-02-18 16:34                     ` Phillip Susi
2006-02-18 17:29                       ` Pavel Machek
2006-02-19  5:52                         ` Phillip Susi
2006-02-19  9:02                           ` Pavel Machek
2006-02-19 16:35                             ` Phillip Susi
2006-02-19 16:41                               ` Alan Stern
2006-02-19 19:17                                 ` Phillip Susi
2006-02-19 19:43                                   ` Pavel Machek
2006-02-20  0:56                                     ` Olivier Galibert
2006-02-20  1:01                                       ` Pavel Machek
2006-02-20  1:26                                         ` Olivier Galibert
2006-02-20  4:04                                           ` Alan Stern
2006-02-19 20:16                                   ` Bernd Eckenfels
2006-02-18 21:04                     ` Alan Stern
2006-02-19  0:02                       ` Andrew Morton
2006-02-19  6:02                         ` Phillip Susi
2006-02-19  6:32                           ` Andrew Morton
2006-02-19 16:39                             ` Phillip Susi
2006-02-19 16:54                               ` Alan Stern
2006-02-19 20:02                                 ` Andrew Morton
2006-02-19 20:44                                   ` Oliver Neukum
2006-02-19 21:02                                     ` Andrew Morton
2006-02-20  6:55                                       ` Oliver Neukum
2006-02-20  7:29                                         ` Andrew Morton
2006-02-20  7:57                                           ` Andrew Morton
2006-02-14 14:15     ` hackmiester / Hunter Fuller
2006-02-15 23:51     ` Pavel Machek
2006-02-13  2:25   ` Kyle Moffett
  -- strict thread matches above, loose matches on Subject: below --
2006-02-13 19:16 David Brownell
2006-02-13 20:08 ` Phillip Susi
2006-02-14  3:10   ` David Brownell
2006-02-14  6:05     ` Phillip Susi
2006-02-14 17:04       ` David Brownell
2006-02-15 23:43   ` Pavel Machek
2006-02-18 20:51     ` David Brownell
2006-02-19  6:06       ` Phillip Susi
2006-02-20  5:50         ` David Brownell
2006-02-20 16:07           ` Phillip Susi
2006-02-20 16:51             ` Olivier Galibert
2006-02-20 18:20               ` Phillip Susi
2006-02-20 18:44                 ` Olivier Galibert
2006-02-20 21:45                   ` Phillip Susi
2006-02-21 16:19             ` David Brownell
2006-02-21 18:30               ` Phillip Susi

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=43F29B1A.30309@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=alon.barlev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    --cc=stern@rowland.harvard.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