generic/563: use a loop device to avoid partition incompatibility
authorBrian Foster <bfoster@redhat.com>
Mon, 14 Dec 2020 17:18:54 +0000 (12:18 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Dec 2020 16:18:43 +0000 (00:18 +0800)
commit62cf7ce77f4fff388d33b68502d2e591e724dda7
tree8fb63e12640892748b502ca191a8a993cd6a5bb7
parenta225507009a3bbb7bdf1a701efc0d2e11e334594
generic/563: use a loop device to avoid partition incompatibility

cgroup writeback accounting does not track partition level
statistics. Instead, I/O is accounted against the parent device. As
a result, the test fails if the scratch device happens to be a
device partition. Since parent level stats are potentially polluted
by factors external to the test, wrap the scratch device in a
loopback device to guarantee the test always runs on a top-level
block device.

Reported-by: Boyang Xue <bxue@redhat.com>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/563