]> git.baikalelectronics.ru Git - kernel.git/commit
libnvdimm: fix badblock range handling of ARS range
authorToshi Kani <toshi.kani@hpe.com>
Fri, 7 Jul 2017 23:44:26 +0000 (17:44 -0600)
committerDan Williams <dan.j.williams@intel.com>
Mon, 17 Jul 2017 18:43:58 +0000 (11:43 -0700)
commitc34e44bad1a4cbaf5a426bce3fdf6394fd5989b9
tree4ca26b53cd5798187dcd89b6ed0a32d5f2b20a64
parentc1e7f93cfc9ccbe5772b8d0eb3da04ab3bcc7881
libnvdimm: fix badblock range handling of ARS range

__add_badblock_range() does not account sector alignment when
it sets 'num_sectors'.  Therefore, an ARS error record range
spanning across two sectors is set to a single sector length,
which leaves the 2nd sector unprotected.

Change __add_badblock_range() to set 'num_sectors' properly.

Cc: <stable@vger.kernel.org>
Fixes: 5be4aa740e84 ("libnvdimm: Add a poison list and export badblocks")
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/core.c