Re: [PATCH] Fix nasty 32-bit overflow bug in buffer i/o code.

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

 



On Mon, Sep 22, 2014 at 8:29 AM, Anton Altaparmakov <aia21@xxxxxxxxx> wrote:
>
> You could do "block & ~(sector_t)(size - 1)" instead of "(sector_t)index << sizebits" if you prefer but not sure that is an improvement!

No, it would be even worse. Something like

  block & ~(sector_t)((size >> 9) - 1)

because block is the sector number (ie 512-byte) and size is in bytes.

           Linus
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]