diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-05-10 22:38:13 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-05-11 00:46:55 -0400 |
commit | e84b83b9ee2187817cf895471675f1ccdf64cd53 (patch) | |
tree | 5cfe0788dff1536475ce68c9c2241327e545d8b3 /fs/dax.c | |
parent | b177fe85dd27de1ee4c29f59c4e82b3ea3b78784 (diff) |
filesystem-dax: fix broken __dax_zero_page_range() conversion
The conversion of __dax_zero_page_range() to 'struct dax_operations'
caused it to frequently fail. The mistake was treating the @size
parameter as a dax mapping length rather than just a length of the
clear_pmem() operation. The dax mapping length is assumed to be hard
coded as PAGE_SIZE.
Without this fix any page unaligned zeroing request will trigger a
-EINVAL return from bdev_dax_pgoff().
Cc: Jan Kara <jack@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Tested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -971,12 +971,12 @@ int __dax_zero_page_range(struct block_device *bdev, | |||
971 | void *kaddr; | 971 | void *kaddr; |
972 | pfn_t pfn; | 972 | pfn_t pfn; |
973 | 973 | ||
974 | rc = bdev_dax_pgoff(bdev, sector, size, &pgoff); | 974 | rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff); |
975 | if (rc) | 975 | if (rc) |
976 | return rc; | 976 | return rc; |
977 | 977 | ||
978 | id = dax_read_lock(); | 978 | id = dax_read_lock(); |
979 | rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, | 979 | rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, |
980 | &pfn); | 980 | &pfn); |
981 | if (rc < 0) { | 981 | if (rc < 0) { |
982 | dax_read_unlock(id); | 982 | dax_read_unlock(id); |