public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: linux-kernel@vger.kernel.org
Cc: jeremy@goop.org
Subject: 2.4.9: strange stale buffers when reading partition table (USB/SCSI)
Date: Wed, 26 Sep 2001 19:37:10 -0700 (PDT)	[thread overview]
Message-ID: <1001558230.3bb290d6a8b8e@www.goop.org> (raw)

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

             reply	other threads:[~2001-09-27  2:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-27  2:37 Jeremy Fitzhardinge [this message]
2001-09-27  3:18 ` 2.4.9: strange stale buffers when reading partition table (USB/SCSI) Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1001558230.3bb290d6a8b8e@www.goop.org \
    --to=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox