Thread (62 messages) 62 messages, 8 authors, 2021-11-06

Re: [PATCH 5/6] dax,pmem: Add data recovery feature to pmem_copy_to/from_iter()

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-10-21 11:29:06
Also in: dm-devel, linux-fsdevel, lkml, nvdimm

+	if (flags & DAXDEV_F_RECOVERY) {
+		lead_off = (unsigned long)addr & ~PAGE_MASK;
+		len = PFN_PHYS(PFN_UP(lead_off + bytes));
+		if (is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, len)) {
+			if (lead_off || !(PAGE_ALIGNED(bytes))) {
+				dev_warn(dev, "Found poison, but addr(%p) and/or bytes(%#lx) not page aligned\n",
+					addr, bytes);
+				return (size_t) -EIO;
+			}
+			pmem_off = PFN_PHYS(pgoff) + pmem->data_offset;
+			if (pmem_clear_poison(pmem, pmem_off, bytes) !=
+					BLK_STS_OK)
+				return (size_t) -EIO;
+		}
Shouldn't this just go down in a separe ->clear_poison operation
to make the whole thing a little easier to follow?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help