]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dax: fix O_DIRECT I/O to the last block of a blockdev
authorJeff Moyer <jmoyer@redhat.com>
Fri, 14 Aug 2015 20:15:31 +0000 (16:15 -0400)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:53 +0000 (12:19 -0500)
commitcc264e774f0797723aa58196c7600052488e3813
tree3fd71cd4fbe18604f85dc486012f4ebc0e0f75bf
parent9c119a9f04d174af32ca1038eb60f2df8fa828fa
dax: fix O_DIRECT I/O to the last block of a blockdev

Orabug: 22913653

commit bbab37ddc20b (block: Add support for DAX reads/writes to
block devices) caused a regression in mkfs.xfs.  That utility
sets the block size of the device to the logical block size
using the BLKBSZSET ioctl, and then issues a single sector read
from the last sector of the device.  This results in the dax_io
code trying to do a page-sized read from 512 bytes from the end
of the device.  The result is -ERANGE being returned to userspace.

The fix is to align the block to the page size before calling
get_block.

Thanks to willy for simplifying my original patch.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Tested-by: Linda Knippers <linda.knippers@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit e94f5a2285fc94202a9efb2c687481f29b64132c)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/dax.c