Skip to content

Commit 0898660

Browse files
committed
Merge tag 'libnvdimm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fix from Vishal Verma: - Fix a bug in the libnvdimm 'BTT' (Block Translation Table) driver where accounting for poison blocks to be cleared was off by one, causing a failure to clear the the last badblock in an nvdimm region. * tag 'libnvdimm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm: Fix badblocks clear off-by-one error
2 parents 1ce8c44 + ef91020 commit 0898660

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvdimm/bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ static int nvdimm_clear_badblocks_region(struct device *dev, void *data)
176176
ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1;
177177

178178
/* make sure we are in the region */
179-
if (ctx->phys < nd_region->ndr_start
180-
|| (ctx->phys + ctx->cleared) > ndr_end)
179+
if (ctx->phys < nd_region->ndr_start ||
180+
(ctx->phys + ctx->cleared - 1) > ndr_end)
181181
return 0;
182182

183183
sector = (ctx->phys - nd_region->ndr_start) / 512;

0 commit comments

Comments
 (0)