Re: USB disk disconnect problems

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

 



(Re-sending, as the first one got blocked by the list for having an HTML part).

On Sun, Aug 21, 2022 at 7:47 AM Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Aug 21, 2022 at 12:17:30PM +0100, James Dutton wrote:
> > I know my suggested behaviour might be detrimental for some users, in
> > case one modifies the usb disk in another computer and then comes
> > back, but I would like an option that assumes it has not been plugged
> > into anything else.

In the “old days” (that is, my original design for use-storage) it
used to do exactly what you are looking for - based on VID, DID, and
SerialNumber it would “remember” devices. The SCSI host would never be
destroyed, and when a device re-appeared it would be re-connected to
the existing host.

That caused all sorts of problems. The SCSI and block layers just
couldn’t handle it well. A clean umount / mount cycle worked fine, but
if you unexpectedly disconnected the device all hell broke loose and
there was no way to recover.

I did it this way because, way back when, there were issues
dynamically destroying SCSI hosts. The people who worked on those
other layers found it much, much easier to fix that problem than try
to make it possible to recover from an unexpected disconnect.

Honestly, I’m not even sure where you would need to begin to make this
work. It would require pretty radical changes is the block I/O layers
to differentiate different failure modes, keep a lot more data around
after certain types of failures, allow for specifying which devices
this new policy (which is assuming reconnected devices really haven’t
been altered) applies to, etc — it’s a big lift.

Matt
aka “the guy who originally designed how this works”

-- 
Matthew Dharm
Former Maintainer, USB Mass Storage driver for Linux




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux