]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/nvme/host/core.c
nvme: fix ns removal hang when failing to revalidate due to a transient error
[linux.git] / drivers / nvme / host / core.c
index f15a77dd311583c3fb18cca5eacf7d2cca2a9067..fad04282148d0c22ecfc3bb1d018cc157b8fab5e 100644 (file)
@@ -1765,7 +1765,13 @@ static int nvme_revalidate_disk(struct gendisk *disk)
 free_id:
        kfree(id);
 out:
-       if (ret > 0)
+       /*
+        * Only fail the function if we got a fatal error back from the
+        * device, otherwise ignore the error and just move on.
+        */
+       if (ret == -ENOMEM || (ret > 0 && !(ret & NVME_SC_DNR)))
+               ret = 0;
+       else if (ret > 0)
                ret = blk_status_to_errno(nvme_error_status(ret));
        return ret;
 }