Re: ST340823A disk size issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux