diff options
| author | Jianyun Gao <jianyungao89@gmail.com> | 2026-10-11 14:48:39 +0800 |
|---|---|---|
| committer | Alison Schofield <alison.schofield@intel.com> | 2026-10-15 16:58:07 -0700 |
| commit | a4bfbfb4e98a62b589ac7ca9e73e9612bfe8cab7 (patch) | |
| tree | 39509aa19c87b9b89f3886ad72809982f29f0549 /tools/lib/python/kdoc/python_version.py | |
| parent | 4da700e2cadf84a6e858391d5be51d64dcba080f (diff) | |
dax: fix dax_range_compare_iter() to use correct size and address offset
dax_range_compare_iter() has two bugs in how it calls
dax_iomap_direct_access() and uses the returned addresses:
1. The size argument passed to dax_iomap_direct_access() is
ALIGN(pos + len, PAGE_SIZE), which is an absolute file offset
rather than a length. This causes the underlying dax_direct_access()
to request a massively inflated nr_pages via PHYS_PFN(size).
2. The addresses returned by dax_iomap_direct_access() are page-aligned
starting addresses, but memcmp() compares from saddr/daddr directly
without adding the page-in-page offset of pos1/pos2. When pos1/pos2
are not page-aligned, this compares the wrong data.
Fix the size by computing ALIGN(len + offset_in_page(pos), PAGE_SIZE),
matching the pattern used in dax_iomap_copy_around(). Fix the address
by adding offset_in_page(pos1)/offset_in_page(pos2) to saddr/daddr in
the memcmp() call.
Fixes: 6f7db3894ae2 ("fsdax: dedup file range to use a compare function")
Cc: stable@vger.kernel.org
Signed-off-by: Jianyun Gao <jianyungao89@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261011064840.1296-1-jianyungao89@gmail.com
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
