From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>, linux-ide@vger.kernel.org
Subject: Re: ST340823A disk size issue
Date: Thu, 2 Aug 2007 14:27:44 +0200 [thread overview]
Message-ID: <200708021427.44368.bzolnier@gmail.com> (raw)
In-Reply-To: <20070802123359.1e731c35@the-village.bc.nu>
On Thursday 02 August 2007, Alan Cox wrote:
> > Additionally fs/partitions/check.c:rescan_partitions() should warn if the
> > partition exceeds device size and we are not seeing any such warning.
>
> Why would it if there isn't anything wrong ?
Look at the __generic_make_requests() snippet (which was in my original mail).
...
/* Test device or partition size, when known. */
maxsector = bio->bi_bdev->bd_inode->i_size >> 9;
if (maxsector) {
sector_t sector = bio->bi_sector;
if (maxsector < nr_sectors || maxsector - nr_sectors < sector) {
/*
* This may well happen - the kernel calls bread()
* without checking the size of the device, e.g., when
* mounting a device.
*/
handle_bad_sector(bio);
goto end_io;
...
This check prevents requests exceeding device/partition size to ever hit LLD.
Device size is set by LLD itself so we can be sure that it is OK and for
the partition size the code in rescan_partitions() would warn if the size
of partition exceeds size of the device.
> The same disks just work in libata even with the hpa being disabled. It
> closed a pile of long standing bugzillas about such problems with odd
Logs / bug numbers please.
> sized disks. This therefore (and instrumenting the requests being issued
> when I first looked at it) made me fairly sure its not the drive. I was
> seeing 1K requests for the last 512 byte sector.
We should never ever see 1K requests for the last 512 bytes sector coming
from the block layer. If we make driver handle such cases we may be just
papering over some other issue.
Bart
next prev parent reply other threads:[~2007-08-02 12:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 9:29 ST340823A disk size issue Mikko Rapeli
2007-08-01 13:05 ` Alan Cox
2007-08-02 12:35 ` Mikko Rapeli
2007-08-01 20:34 ` Bartlomiej Zolnierkiewicz
2007-08-01 21:50 ` Mikko Rapeli
2007-08-01 22:19 ` Bartlomiej Zolnierkiewicz
2007-08-01 22:32 ` Alan Cox
2007-08-01 23:17 ` Bartlomiej Zolnierkiewicz
2007-08-02 11:33 ` Alan Cox
2007-08-02 12:27 ` Bartlomiej Zolnierkiewicz [this message]
2007-08-02 13:09 ` Alan Cox
2007-08-02 20:03 ` Mikko Rapeli
2007-08-02 20:42 ` Alan Cox
2007-08-02 22:34 ` Bartlomiej Zolnierkiewicz
2007-08-02 23:11 ` Mikko Rapeli
2007-08-02 23:35 ` Bartlomiej Zolnierkiewicz
2007-08-05 19:06 ` [PATCH] ST340823A, HPA and libata Mikko Rapeli
2007-08-05 19:32 ` Alan Cox
2007-08-08 13:25 ` Alan Cox
2007-08-15 13:56 ` Mikko Rapeli
2007-09-20 21:37 ` Jeff Garzik
2007-08-02 0:33 ` ST340823A disk size issue Bartlomiej Zolnierkiewicz
2007-08-02 12:17 ` Sergei Shtylyov
2007-08-02 12:38 ` Sergei Shtylyov
2007-08-01 22:25 ` Alan Cox
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=200708021427.44368.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-ide@vger.kernel.org \
--cc=mikko.rapeli@iki.fi \
/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;
as well as URLs for NNTP newsgroup(s).