Skip to content

Commit e84b83b

Browse files
committed
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 <[email protected]> Cc: Christoph Hellwig <[email protected]> Reported-by: Ross Zwisler <[email protected]> Tested-by: Ross Zwisler <[email protected]> Fixes: cccbce6 ("filesystem-dax: convert to dax_direct_access()") Signed-off-by: Dan Williams <[email protected]>
1 parent b177fe8 commit e84b83b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/dax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,12 +971,12 @@ int __dax_zero_page_range(struct block_device *bdev,
971971
void *kaddr;
972972
pfn_t pfn;
973973

974-
rc = bdev_dax_pgoff(bdev, sector, size, &pgoff);
974+
rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff);
975975
if (rc)
976976
return rc;
977977

978978
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,
980980
&pfn);
981981
if (rc < 0) {
982982
dax_read_unlock(id);

0 commit comments

Comments
 (0)