public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.9: strange stale buffers when reading partition table (USB/SCSI)
@ 2001-09-27  2:37 Jeremy Fitzhardinge
  2001-09-27  3:18 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2001-09-27  2:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: jeremy

I have a Sony DSC F505V digital camera, which allows you to download images by
presenting itself as a USB storage device containing a single partition with a
FAT filesystem on it.

The camera is detected by USB, and SCSI will talk to it, but it fails to find
the partition table.  I added some code after the bread() in
fs/partitions/msdos.c:443 to dump the read data, which shows that it is getting
garbage.  It has relation to anything on the actual device, and it changes from
time to time.

The strange thing is that reading the device via /dev/sda works fine.  fdisk
shows a valid partition table, and the partition itself looks fine. 

If I add:

        bh = getblk(dev, 0, get_ptable_blocksize(dev));
        if (bh)
                bforget(bh);

just before the bread(), the bread gets the correct stuff and can read the
partition table.  Everything works fine from there on:

hub.c: USB new device connect on bus1/1, assigned device number 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: Sony      Model: Sony DSC          Rev: 2.10
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 253696 512-byte hdwr sectors (130 MB)
usb-uhci.c: interrupt, status 3, frame# 207
usb-uhci.c: interrupt, status 3, frame# 213
sda: Write Protect is off
 /dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
scsi singledevice 0 0 0 0
usb-uhci.c: interrupt, status 3, frame# 48
...

So it looks like someone is leaking buffers or something.  The bforget() looks
like its simply papering over the symptoms of some other problem, but I don't
know where to start looking.  Perhaps there's a SCSI problem which is leaving
stale blocks around, perhaps related to it being a removeable device?

This is 2.4.9-linus with ext3 (though plain 2.4.9 without ext3 behaves in
exactly the same way).

I haven't tried 2.4.10 yet, but it sounds like everything has changed in this
area anyway...

        J

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-27  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-27  2:37 2.4.9: strange stale buffers when reading partition table (USB/SCSI) Jeremy Fitzhardinge
2001-09-27  3:18 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox