• Vishal Verma's avatar
    libnvdimm: fix potential deadlock while clearing errors · 0930a750
    Vishal Verma authored
    With the ACPI NFIT 'DSM' methods, acpi can be called from IO paths.
    Specifically, the DSM to clear media errors is called during writes, so
    that we can provide a writes-fix-errors model.
    
    However it is easy to imagine a scenario like:
     -> write through the nvdimm driver
       -> acpi allocation
         -> writeback, causes more IO through the nvdimm driver
           -> deadlock
    
    Fix this by using memalloc_noio_{save,restore}, which sets the GFP_NOIO
    flag for the current scope when issuing commands/IOs that are expected
    to clear errors.
    
    Cc: <linux-acpi@vger.kernel.org>
    Cc: <linux-nvdimm@lists.01.org>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Robert Moore <robert.moore@intel.com>
    Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    0930a750
bus.c 28.3 KB