It then might be a problem with "/dev/loop-control" device node. Which dynamically find or allocate a free device, but also add and remove loop devices from the running system.
# drivers/block/loop.c
2090 static void loop_remove(struct loop_device *lo) 2091 { 2092 del_gendisk(lo->lo_disk); 2093 blk_cleanup_queue(lo->lo_queue); 2094 blk_mq_free_tag_set(&lo->tag_set); 2095 put_disk(lo->lo_disk); 2096 kfree(lo); 2097 }
2177 case LOOP_CTL_REMOVE: 2178 ret = loop_lookup(&lo, parm); 2179 if (ret < 0) 2180 break; 2181 if (lo->lo_state != Lo_unbound) { 2182 ret = -EBUSY; 2183 break; 2184 } 2185 if (atomic_read(&lo->lo_refcnt) > 0) { 2186 ret = -EBUSY; 2187 break; 2188 } 2189 lo->lo_disk->private_data = NULL; 2190 idr_remove(&loop_index_idr, lo->lo_number); 2191 loop_remove(lo); 2192 break;
It then might be a problem with "/dev/loop-control" device node. Which dynamically find or allocate a free device, but also add and remove loop devices from the running system.
# drivers/ block/loop. c
2090 static void loop_remove(struct loop_device *lo) lo->lo_ disk); queue(lo- >lo_queue) ; free_tag_ set(&lo- >tag_set) ; lo->lo_ disk);
2091 {
2092 del_gendisk(
2093 blk_cleanup_
2094 blk_mq_
2095 put_disk(
2096 kfree(lo);
2097 }
2177 case LOOP_CTL_REMOVE: read(&lo- >lo_refcnt) > 0) { disk->private_ data = NULL; &loop_index_ idr, lo->lo_number);
2178 ret = loop_lookup(&lo, parm);
2179 if (ret < 0)
2180 break;
2181 if (lo->lo_state != Lo_unbound) {
2182 ret = -EBUSY;
2183 break;
2184 }
2185 if (atomic_
2186 ret = -EBUSY;
2187 break;
2188 }
2189 lo->lo_
2190 idr_remove(
2191 loop_remove(lo);
2192 break;