diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-07-02 01:58:19 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-07-02 01:58:19 +0200 |
commit | 089866061428ec9bf67221247c936792078c41a4 (patch) | |
tree | b43cd87fbf80a81d3580cf795c8f816be9e0f041 | |
parent | Merge tag 'thermal-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff) | |
parent | nvdimm: Fix badblocks clear off-by-one error (diff) | |
download | linux-089866061428ec9bf67221247c936792078c41a4.tar.xz linux-089866061428ec9bf67221247c936792078c41a4.zip |
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
-rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a4fc17db707c..b38d0355b0ac 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -176,8 +176,8 @@ static int nvdimm_clear_badblocks_region(struct device *dev, void *data) ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; /* make sure we are in the region */ - if (ctx->phys < nd_region->ndr_start - || (ctx->phys + ctx->cleared) > ndr_end) + if (ctx->phys < nd_region->ndr_start || + (ctx->phys + ctx->cleared - 1) > ndr_end) return 0; sector = (ctx->phys - nd_region->ndr_start) / 512; |