mirror_zfs/lib
Ned Bass e06be58641 Fix for access beyond end of device error
This commit fixes a sign extension bug affecting l2arc devices.  Extremely
large offsets may be passed down to the low level block device driver on
reads, generating errors similar to

    attempt to access beyond end of device
    sdbi1: rw=14, want=36028797014862705, limit=125026959

The unwanted sign extension occurrs because the function arc_read_nolock()
stores the offset as a daddr_t, a 32-bit signed int type in the Linux kernel.
This offset is then passed to zio_read_phys() as a uint64_t argument, causing
sign extension for values of 0x80000000 or greater.  To avoid this, we store
the offset in a uint64_t.

This change also changes a few daddr_t struct members to uint64_t in the libspl
headers to avoid similar bugs cropping up in the future.  We also add an ASSERT
to __vdev_disk_physio() to check for invalid offsets.

Closes #66
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-11-10 21:29:07 -08:00
..
libavl Add FAILFAST support 2010-10-12 14:55:02 -07:00
libefi Add FAILFAST support 2010-10-12 14:55:02 -07:00
libnvpair Add FAILFAST support 2010-10-12 14:55:02 -07:00
libspl Fix for access beyond end of device error 2010-11-10 21:29:07 -08:00
libunicode Add FAILFAST support 2010-10-12 14:55:02 -07:00
libuutil Add FAILFAST support 2010-10-12 14:55:02 -07:00
libzfs Call modprobe with absolute path 2010-10-22 12:39:57 -07:00
libzpool Add FAILFAST support 2010-10-12 14:55:02 -07:00
Makefile.am Add linux libspl support 2010-08-31 13:41:59 -07:00
Makefile.in Add FAILFAST support 2010-10-12 14:55:02 -07:00