]> www.infradead.org Git - users/sagi/blktests.git/commit
loop/001: verify all partitions are removed loop-partition-scan
authorDongli Zhang <dongli.zhang@oracle.com>
Thu, 14 Mar 2019 11:45:17 +0000 (19:45 +0800)
committerOmar Sandoval <osandov@fb.com>
Thu, 21 Mar 2019 23:21:38 +0000 (16:21 -0700)
commit6c1237cd358008024ece90bd915a67c23add8a2a
tree2c0fa3a823cb0c3d4d91e28cdb9d1364006ab239
parenteb4bd6a30728e60732948165e86bd8a6355ba9cb
loop/001: verify all partitions are removed

loop/001 does not test whether all partitions are removed successfully
during loop device partition scanning. As a result, the regression
introduced by 0da03cab87e6 ("loop: Fix deadlock when calling
blkdev_reread_part()") can not be detected.

The regression will generate below message in dmesg:

[  464.414043] __loop_clr_fd: partition scan of loop0 failed (rc=-22)

and leave orphan partitions like below:

- /dev/loop0p1
- /sys/block/loop0/loop0p1

This patch verifies all partitions are removed by checking if there is
/sys/block/loopX/loopXpY left. The expected number of partitions left is 0.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
[Omar: check devices and sysfs for both before and after]
Signed-off-by: Omar Sandoval <osandov@fb.com>
tests/loop/001
tests/loop/001.out