loop: Refuse to tear down loop device if partitions are open
loop_clr_fd defers teardown if the loop device itself is
referenced but proceeds when a partition of the loop device is
open. When this happens partition scanning will fail, leaving
behind the block devices for the loop device's partitions.
Prevent this by returning -EBUSY when attempting to tear down
the loop device while any partition block device is open.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Showing
Please register or sign in to comment