From: Andrew Morton <akpm@osdl.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: alon.barlev@gmail.com, torvalds@osdl.org,
linux-pm@lists.osdl.org, psusi@cfl.rr.com,
linux-kernel@vger.kernel.org, mrmacman_g4@mac.com
Subject: Re: Flames over -- Re: Which is simpler?
Date: Sun, 19 Feb 2006 12:02:21 -0800 [thread overview]
Message-ID: <20060219120221.1d11cee0.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0602191142290.9165-100000@netrider.rowland.org>
[-- Attachment #1: Type: text/plain, Size: 2661 bytes --]
Alan Stern <stern@rowland.harvard.edu> wrote:
>
> On Sun, 19 Feb 2006, Phillip Susi wrote:
>
> > Andrew Morton wrote:
> > >>
> > >> Hrm... interesting but sounds like that could be sticky. For instance,
> > >> what if the user script that does the verifying happens to be ON the
> > >> volume to be verified?
> > >
> > > Well that would be a bug. Solutions would be a) don't put the scripts on a
> > > removable/power-downable device or b) use tmpfs.
> > >
> >
> > I don't see how it could be a bug, just think of the root on usb case.
> > Keeping the program locked in ram would sidestep that issue, but tmpfs
> > is pagable right? Swap on usb?
> >
> > Also, this user space program isn't going to be able to keep fully up to
> > date on what the disk looks like. Imagine a filesystem that keeps a
> > generation counter in the super block and increments it every time it
> > writes to the disk. The user space daemon might read that, then the fs
> > changes it, you suspend, and when you wake up, the daemon thinks the
> > media changed because it wasn't fully up to date.
>
> There are other, harder problems associated with doing this is userspace.
>
> Really, the device needs to be considered separately at each level of
> driver processing. At the USB level it may still appear to be the same,
> but at the SCSI level it may appear different. Or at the SCSI level it
> may be the same, but at the gendisk level it may be different (different
> media, partition table changed). Or at the gendisk level it may be the
> same, but at the filesystem level one or more of the partitions may be
> different (superblock changed).
>
> Each level would need its own way of checking for changes and recreating
> the appropriate data structures. And while making the determinations, we
> would need to temporarily set the device to read-only. Yes, userspace
> could do _some_ of the work, but it would need a lot of help from the
> kernel.
>
There are two things here: a) identifying the device and b) putting it into
the correct place in the various data structures. I suspect these can (and
should) be separated out.
For a), the current kernel behaviour is what we want - make the thing
appear at a new place in the namespace and in the hierarchy. Then
userspace can do whatever needs to be done to identify the device, and
apply some sort of policy decision to the result.
It's what comes next that we're missing: the ability for userspace to tell
the krnrel what the decice's naming and positioning _should_ be. The
kernel will then atomically tear down what it currently has and will then
set everything up as desired.
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2006-02-19 20:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060217210445.GR3490@openzaurus.ucw.cz>
2006-02-18 21:04 ` Flames over -- Re: Which is simpler? 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 [this message]
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
[not found] <200602132327.10475.rjw@sisk.pl>
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
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=20060219120221.1d11cee0.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=alon.barlev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=mrmacman_g4@mac.com \
--cc=psusi@cfl.rr.com \
--cc=stern@rowland.harvard.edu \
--cc=torvalds@osdl.org \
/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