]> git.karo-electronics.de Git - karo-tx-linux.git/commit
loop: cleanup partitions when detaching loop device
authorPhillip Susi <psusi@ubuntu.com>
Wed, 20 Mar 2013 04:07:00 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:28:20 +0000 (16:28 +1100)
commitd3eb2ad16e41dc27229628afd9f42b88606a5834
treea874786d34da44fdea0ac938618d65c5d7286c87
parent4df5333c8fcd487b589c663ae01bd1c8e3cdc22e
loop: cleanup partitions when detaching loop device

Any partitions added by user space to the loop device were being left in
place after detaching the loop device.  This was because the detach path
issued a BLKRRPART to clean up partitions if LO_FLAGS_PARTSCAN was set,
meaning that the partitions were auto scanned on attach.  Replace this
BLKRRPART with code that unconditionally cleans up partitions on detach
instead.

The user-visible effect of this bug is that the partition devnodes still
show up after detaching the backing file, and I think the partitions
remained in place after attaching a new file even though it had different
or no partitions at all.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/loop.c