]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pmem: fail io-requests to known bad blocks
authorDan Williams <dan.j.williams@intel.com>
Wed, 6 Jan 2016 20:03:41 +0000 (12:03 -0800)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:25:50 +0000 (12:25 -0500)
commitf0efbedf6736c3ed6681de850b2a585e6ae20f0c
treed55647fc6645170e7c2f8d0564a4b0f46b567a6d
parentdde5a03d3942d0348eb9d876a04f44f77ab669a1
pmem: fail io-requests to known bad blocks

Orabug: 22913653

Check the sectors specified in a read bio to see if they hit a known bad
block, and return an error code pmem_do_bvec().

Note that the ->rw_page() is not in a position to return errors.  For
now, copy the same layering violation present in zram_rw_page() to avoid
crashes of the form:

 kernel BUG at mm/filemap.c:822!
 [..]
 Call Trace:
  [<ffffffff811c540e>] page_endio+0x1e/0x60
  [<ffffffff81290d29>] mpage_end_io+0x39/0x60
  [<ffffffff8141c4ef>] bio_endio+0x3f/0x60
  [<ffffffffa005c491>] pmem_make_request+0x111/0x230 [nd_pmem]

...i.e. unlock a page that was already unlocked via pmem_rw_page() =>
page_endio().

Reported-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit e10624f8c09710b3b0740ea3847627ea02f55c39)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/nvdimm/pmem.c