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

Re: Zero Divide in Kernel 3.12-rc4



On 2013-10-22 22:38, Michael Schmitz wrote:

Ingo - could you add
if (scmd->device->sector_size > 2048)
sdev_printk(KERN_ERR, scmd->device, "Whoa - large secor size %d\n",
scmd->device->sector_size);
before the do_div calls, and see what that reports?

Ok, so, drivers/scsi/sd.c looks now as this:


        if (scmd->device->sector_size < 512) {
                /* only legitimate sector_size here is 256 */
                start_lba <<= 1;
                end_lba <<= 1;
        } else {
                /* be careful ... don't want any overflows */
                u64 factor = scmd->device->sector_size / 512;
                if (scmd->device->sector_size > 2048)
sdev_printk(KERN_ERR, scmd->device, "Whoa - large sector size %d\n", scmd->device->sector_size);
                do_div(start_lba, factor);
                do_div(end_lba, factor);
        }

... will rebuilt and install it then...

--
Ciao...          //    Fon: 0381-2744150
.     Ingo     \X/     http://blog.windfluechter.net

gpg pubkey: http://www.juergensmann.de/ij_public_key.


Reply to: