loop: do not print warn message if partition scan is successful

Do not print warn message when the partition scan returns 0.

Fixes: d57f3374ba ("loop: Move special partition reread handling in loop_clr_fd()")
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Dongli Zhang 2019-02-22 22:10:19 +08:00 committed by Jens Axboe
parent 8f4e80da76
commit 40853d6fc6

View File

@ -1115,8 +1115,9 @@ out_unlock:
err = __blkdev_reread_part(bdev);
else
err = blkdev_reread_part(bdev);
pr_warn("%s: partition scan of loop%d failed (rc=%d)\n",
__func__, lo_number, err);
if (err)
pr_warn("%s: partition scan of loop%d failed (rc=%d)\n",
__func__, lo_number, err);
/* Device is gone, no point in returning error */
err = 0;
}