Alan Cox wrote:
> 
> > I haven't really checked, but are we handling the case where a storage
> > device is disconnected without the usual "sync"/"umount" cycle?  Is
> > there a way for us to do this?  I notice that folks are working an the
> 
> None. We don't force all I/O to be synchronous. Neither btw does windows.
> If you yank out a drive at the wrong moment scandisk will have fun with it

I am not referring to popping out the media during a write operation,
the 
ORB drive won't allow it.  I am talking about detaching the drive after
all writing to a drive have apparently completed.  In my case, I had
copied
a bunch of RPM files to the media.  Writing to the disk had stopped and
the cp command had exited.  Yet, when I moved the drive over to Windows
(this was a VFAT partition), I found that many files had a 4K file size.

I don't think I mean that all I/O to a removable storage medium 
needs to be synchronous.  Sync and update both cause buffers and caches 
to be flushed to media.  What I am suggesting is that we might tag a
drive
as containing removable media and then cause files written or removed
from
that drive to be flushed/synced on a periodic basis.  For example, we
might 
sync the drive once every minute or half a minute.  True, this does move 
us towards more synchronous behavior and would cause a performance hit 
for some applications.  

Are you saying that it is not feasible to implement such a system,
or/and it is stupid and bad to implement such a system?

> > automount portion, but I haven't seen discussion of unmounting.
> 
> Currently we assume drive locking works. CD for example we lock the drive
> when we mount and unlock on umount. Obviously it doesnt help when the user
> can pull the USB connector out

Yes.  Drive locking works for the media I am using.  Pulling out the
connector is a problem, but Matt Dharm's usb-storage driver is supposed
to handle this situation pretty gracefully by reporting the blocked
I/O and holding the I/O until the drive is reattached.  I have not 
tested this, so your milage may vary.

Bottom line:  I'll remember to run "sync" before I move my drive between
machines in the future.  I would really prefer that a usermode pop up a
warning when I've disconnected a drive before the writes to the drive
have 
completed.  This seems to be fairly easy to implement.  There is already
work underway on usermode driven loading and unloading of USB drivers.
If we notice that a drive has been removed and have some way of telling 
that there are unwritten buffers/cache for that media, we deliver the
popup.
Then, when the HUB sees the drive has been reattached, a sync can be 
fired off.

Am I totally off base here?  If so, please explain.

Thanks,
        Miles

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to