From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jan Kara <jack@suse.cz>, linux-usb@vger.kernel.org
Cc: "Toralf Förster" <toralf.foerster@gmx.de>, linux-kernel@vger.kernel.org
Subject: Re: ./fs/partitions/check.c: off-by-one error ?
Date: Tue, 22 Apr 2008 08:32:14 -0700 [thread overview]
Message-ID: <20080422083214.cbfa3786.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20080422103829.GC21922@atrey.karlin.mff.cuni.cz>
On Tue, 22 Apr 2008 12:38:29 +0200 Jan Kara wrote:
> > Inserting an 2 GB SD Card into my digikam and mounting it as an USB drive I've
> > in my system log :
> >
> > Apr 20 12:27:54 n22 usb 2-2: new full speed USB device using uhci_hcd and address 4
> > Apr 20 12:27:54 n22 usb 2-2: configuration #1 chosen from 1 choice
> > Apr 20 12:27:54 n22 SCSI subsystem initialized
> > Apr 20 12:27:54 n22 Initializing USB Mass Storage driver...
> > Apr 20 12:27:54 n22 scsi0 : SCSI emulation for USB Mass Storage devices
> > Apr 20 12:27:54 n22 usbcore: registered new interface driver usb-storage
> > Apr 20 12:27:54 n22 USB Mass Storage support registered.
> > Apr 20 12:27:54 n22 usb-storage: device found at 4
> > Apr 20 12:27:54 n22 usb-storage: waiting for device to settle before scanning
> > Apr 20 12:27:59 n22 scsi 0:0:0:0: Direct-Access MATSHITA DMC-TZ3 0100 PQ: 0 ANSI: 2
> > Apr 20 12:27:59 n22 usb-storage: device scan complete
> > Apr 20 12:27:59 n22 Driver 'sd' needs updating - please use bus_type methods
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] 3902463 512-byte hardware sectors (1998 MB)
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Write Protect is off
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Mode Sense: 04 00 00 00
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Assuming drive cache: write through
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] 3902463 512-byte hardware sectors (1998 MB)
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Write Protect is off
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Mode Sense: 04 00 00 00
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Assuming drive cache: write through
> > Apr 20 12:27:59 n22 sda: sda1
> > Apr 20 12:27:59 n22 sda: p1 exceeds device capacity
> > Apr 20 12:27:59 n22 sd 0:0:0:0: [sda] Attached SCSI removable disk
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> > Apr 20 12:27:59 n22 attempt to access beyond end of device
> > Apr 20 12:27:59 n22 sda: rw=0, want=3902464, limit=3902463
> > Apr 20 12:27:59 n22 Buffer I/O error on device sda1, logical block 3902334
> >
> > My system is a :
> >
> > tfoerste@n22 ~/devel/linux-2.6/fs/partitions $ uname -a
> > Linux n22 2.6.24-gentoo-r4 #4 Sun Apr 20 12:16:18 CEST 2008 i686 Intel(R)
> > Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux
> >
> > I already re-formatted the card under Linux as well as under Windows XP and got
> > always the same behaviour.
> This looks more like a strange interaction of your device size (it
> claims to have 3902463 sectors) and your partitioning programs which
> create partition ending at sector 3902464. Can you send the partition
> table you have on the device? E.g:
> fdisk /dev/sda
> x
> p
>
> will print detailed information about the partition table.
Is this something that using US_FL_FIX_CAPACITY will fix?
US_FL_FIX_CAPACITY -> sets ->fix_capacity, then:
/* Some devices return the total number of sectors, not the
* highest sector number. Make the necessary adjustment. */
if (sdp->fix_capacity) {
--sdkp->capacity;
---
~Randy
next prev parent reply other threads:[~2008-04-22 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-20 10:35 Toralf Förster
2008-04-22 10:38 ` Jan Kara
2008-04-22 15:32 ` Randy Dunlap [this message]
2008-04-22 15:48 ` Alan Stern
2008-04-23 16:42 ` Toralf Förster
2008-04-28 12:56 ` Jan Kara
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=20080422083214.cbfa3786.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=toralf.foerster@gmx.de \
/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
Powered by JetHome