• Dan Williams's avatar
    pmem: fail io-requests to known bad blocks · e10624f8
    Dan Williams authored
    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: default avatarVishal Verma <vishal.l.verma@intel.com>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    e10624f8
pmem.c 12.2 KB