summaryrefslogtreecommitdiffstats
path: root/fs/dax.c
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2023-06-23 15:20:00 -0600
committerVishal Verma <vishal.l.verma@intel.com>2023-06-23 15:20:00 -0600
commit95bf6df03d412f678a7b558da186c2ef797ac40c (patch)
treeae7c6b57d11bf3e5a2c898c7b33e21687118f2d2 /fs/dax.c
parent0e796e3eafc5ba450a1f479f22aef4c8a4c7d686 (diff)
parent46e66dab8565f742374e9cc4ff7d35f344d774e2 (diff)
downloadlinux-95bf6df03d412f678a7b558da186c2ef797ac40c.tar.gz
linux-95bf6df03d412f678a7b558da186c2ef797ac40c.tar.bz2
linux-95bf6df03d412f678a7b558da186c2ef797ac40c.zip
Merge branch 'for-6.5/dax-cleanups' into nvdimm-for-next
The reference counting of dax_region objects is needlessly complicated, has lead to confusion [1], and has hidden a bug [2]. While testing the cleanup for those issues, a CONFIG_DEBUG_KOBJECT_RELEASE test run uncovered a use-after-free in dax_mapping_release(). Clean all of that up. Thanks to Yongqiang, Paul, and Ira for their analysis. Additionally, clean up a redundant variable in fsdax, and fix memory hotplug registration in the kmem driver. [1]: http://lore.kernel.org/r/20221203095858.612027-1-liuyongqiang13@huawei.com [2]: http://lore.kernel.org/r/3cf0890b-4eb0-e70e-cd9c-2ecc3d496263@hpe.com
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 2ababb89918d..cb36c6746fc4 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1830,7 +1830,6 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
vm_fault_t ret = VM_FAULT_FALLBACK;
pgoff_t max_pgoff;
void *entry;
- int error;
if (vmf->flags & FAULT_FLAG_WRITE)
iter.flags |= IOMAP_WRITE;
@@ -1877,7 +1876,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
}
iter.pos = (loff_t)xas.xa_index << PAGE_SHIFT;
- while ((error = iomap_iter(&iter, ops)) > 0) {
+ while (iomap_iter(&iter, ops) > 0) {
if (iomap_length(&iter) < PMD_SIZE)
continue; /* actually breaks out of the loop */