From: Bart Van Assche Date: Wed, 28 Feb 2018 18:15:28 +0000 (-0800) Subject: block/loop: Delete gendisk before cleaning up the request queue X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0fa8ebdd4244b8e652cc5341c3d5b4b06f84a637;p=openwrt%2Fstaging%2Fblogic.git block/loop: Delete gendisk before cleaning up the request queue Remove the disk, partition and bdi sysfs attributes before cleaning up the request queue associated with the disk. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Joseph Qi Reviewed-by: Ming Lei Cc: Josef Bacik Cc: Shaohua Li Cc: Omar Sandoval Cc: Hannes Reinecke Signed-off-by: Jens Axboe --- diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 87855b5123a6..9d29aa6413e5 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1864,8 +1864,8 @@ out: static void loop_remove(struct loop_device *lo) { - blk_cleanup_queue(lo->lo_queue); del_gendisk(lo->lo_disk); + blk_cleanup_queue(lo->lo_queue); blk_mq_free_tag_set(&lo->tag_set); put_disk(lo->lo_disk); kfree(lo);