lightnvm: pblk: improve error message if down_timeout fails
authorRakesh Pandit <rakesh@tuxera.com>
Fri, 13 Oct 2017 12:45:58 +0000 (14:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Oct 2017 14:34:57 +0000 (08:34 -0600)
The two pr_err messages are useless as they don't differentiate
error code.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c

index b53bb00a991886c72b8c4b6cfd0fad76d4291812..027c42bb1ab99afa2b7708f89331c59f2882f1a0 100644 (file)
@@ -1691,16 +1691,8 @@ static void __pblk_down_page(struct pblk *pblk, struct ppa_addr *ppa_list,
 #endif
 
        ret = down_timeout(&rlun->wr_sem, msecs_to_jiffies(30000));
-       if (ret) {
-               switch (ret) {
-               case -ETIME:
-                       pr_err("pblk: lun semaphore timed out\n");
-                       break;
-               case -EINTR:
-                       pr_err("pblk: lun semaphore timed out\n");
-                       break;
-               }
-       }
+       if (ret == -ETIME || ret == -EINTR)
+               pr_err("pblk: taking lun semaphore timed out: err %d\n", -ret);
 }
 
 void pblk_down_page(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas)