On Tue, Apr 10, 2001 at 09:13:05PM +0200, Sancho Dauskardt wrote:
>
> > > What happens when swapping different size CompactFlash cards ?
> >
> >It appears that, if a TEST_UNIT_READY fails with the right sense data to
> >indicate a media-change, the disk is re-validated. But don't quote me on
> >that...
>
> Sounds good, but in a mount,umount,mount sequence only one TEST_UNIT_READY
> is issued.
>
> I'm doing following:
> * plug reader in
> scsi does:
> INQUIRY
> TEST_UNIT_READY
> --> autosense
> READ_CAPACITY a few times
> * insert 8MB CF card
> * mount -r -n /dev/sda1 /mnt/cf
> scsi does:
> START_STOP - start
> TEST_UNIT_READY
> READ_CAPACITY
> MODE_SENSE
> READ_10 block 0
> ALLOW_MEDIUM_REMOVAL
> few READ_10's fat+dir ?
> ALLOW_MEDIUM_REMOVAL - unlock
> START_STOP - start
> ALLOW_MEDIUM_REMOVAL - lock
> START_STOP - start
> again READ_10's
> * ld or whatever
> * umount -n /mnt/cf
> scsi does:
> ALLOW_MEDIUM_REMOVAL - unlock
> * insert 128MB CF card
> * mount -r -n /dev/sda1 /mnt/cf
> START_STOP - start
Here is where we need to change the behavior. Right here we need to fail
the command with the right sense data -- at least, that seems to work
correctly for other devices. The START_STOP should fail with sense data
that indicates medium change.
> ALLOW_MEDIUM_REMOVAL - lock
> few READ_10's fat+dir ?
> ALLOW_MEDIUM_REMOVAL - unlock
> START_STOP - start
> ALLOW_MEDIUM_REMOVAL - lock
> START_STOP - start
> again READ_10's
>
> After the second mount no TEST_UNIT_READY.
Matt
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
I'm a pink gumdrop! How can anything be worse?!!
-- Erwin
User Friendly, 10/4/1998
PGP signature