"Device busy for revalidation" with usb-storage

From: Derrik Pates (dpates@dsdk12.net)
Date: Mon Oct 22 2001 - 00:05:56 EST


I've recently acquired a SanDisk CompactFlash card reader, and was trying
it with Linux (2.4.12, on an Apple iBook). The unit works well, but I
discovered that when different-sized cards are used, the SCSI disk driver
reports "Device busy for revalidation (usage=1)" when I try to access it
(causing out-of-bounds errors, since the SCSI disk driver still thinks
it's dealing with the old geometry). After a look in drivers/scsi/sd.c, I
found the fop_revalidate_scsidisk() routine, which calls
revalidate_scsidisk() with 0 as the second parameter (maxusage, apparently
the usage-count limit beyond which it should not try to revalidate).
Shouldn't this be a 1, instead of a 0, since when the mount takes place,
something will have the device open (the kernel, of course), so it will
never have a 0 usage count when fop_revalidate_scsidisk() gets called?

Changing the 0 to a 1, rebuilding the sd_mod driver and loading the
modified version, then swapping the CF cards and mounting them, I found
that my change did cause them to be revalidated properly, correcting the
geometry that the SCSI disk driver had.

(Please CC: me with replies, I am not subscribed to the list.)

Derrik Pates | Sysadmin, Douglas School | #linuxOS on EFnet
dpates@dsdk12.net | District (dsdk12.net) | #linuxOS on OPN

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 23 2001 - 21:00:29 EST