Re: [PATCH 7/8] SCSI: add a field to scsi_device to count open file references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 4 Mar 2008, Stefan Richter wrote:

> >> On Mon, 2008-03-03 at 15:16 -0500, Alan Stern wrote:
> >>> This count
> >>> will be used by usb-storage to determine whether USB-PERSIST should be
> >>> forced on during a suspend.
> 
> Why should devices without openers be treated differently from devices 
> with openers?

It's not the openers themselves that matter; it's whether or not the 
device contains a mounted filesystem.  I'm using the openers as a proxy 
for that.  If you can suggest a better approach, I'd like to hear it.

Devices containing a mounted filesystem need special treatment to avoid
being disconnected when power is lost during a system suspend or
hibernation.  In principle this special treatment could be extended to
all USB devices, whether mounted or not.  However the USB spec says not
to do it.

Really it's a tradeoff.  If power goes out during a suspend and a
device with a mounted filesystem is disconnected as a result, there's a
very high risk of data loss.  Conversely, if the user replaces the
medium while the system is asleep and the kernel doesn't realize it,
then upon waking the data on the new medium will be corrupted.

After suffering from exactly this sort of data loss, Linus decreed that
the kernel should automatically avoid disconnecting devices with
mounted filesystems, even though it contradicts the spec.  So I need a
way to know whether anything is mounted on a device below a SCSI host.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux