device-mapper-test-suite icon indicating copy to clipboard operation
device-mapper-test-suite copied to clipboard

wrong assumption on meta dev size

Open simonxuhao opened this issue 5 years ago • 0 comments

Document says "A metadata dev of 1G, and data dev of 4G is sufficient.", but it doesn't work with a 1G meta dev (/dev/loop0) and a 4G data dev (/dev/loop1):

BasicTests_dd_benchmark.log:

D, [2019-10-09T16:28:13.757995 #9853] DEBUG -- : executing: 'blockdev --getsz /dev/loop0'
D, [2019-10-09T16:28:13.764555 #9853] DEBUG -- : stdout:
    2097152
D, [2019-10-09T16:28:13.764749 #9853] DEBUG -- : executing: 'dd if=/dev/zero of=/dev/loop0 bs=512 count=8 seek=0'
D, [2019-10-09T16:28:13.771620 #9853] DEBUG -- : stderr:
    8+0 records in
    8+0 records out
    4096 bytes (4.1 kB, 4.0 KiB) copied, 0.00396838 s, 1.0 MB/s
D, [2019-10-09T16:28:13.771764 #9853] DEBUG -- : executing: 'blockdev --getsz /dev/loop1'
D, [2019-10-09T16:28:13.782728 #9853] DEBUG -- : stdout:
    8388608
D, [2019-10-09T16:28:13.783069 #9853] DEBUG -- : executing: 'dmsetup create test-dev-389767 --notable'
D, [2019-10-09T16:28:13.793071 #9853] DEBUG -- : writing table: <<table:0 20971520 thin-pool /dev/loop0 /dev/loop1 128 0 0>>
D, [2019-10-09T16:28:13.793230 #9853] DEBUG -- : executing: 'dmsetup load test-dev-389767 /tmp/dm-table20191009-9853-55ionb'
D, [2019-10-09T16:28:13.818950 #9853] DEBUG -- : stderr:
    device-mapper: reload ioctl on test-dev-389767  failed: Invalid argument
    Command failed.
D, [2019-10-09T16:28:13.819051 #9853] DEBUG -- : command failed with 'pid 9881 exit 1': dmsetup load test-dev-389767 /tmp/dm-table20191009-9853-55ionb

It seems that the code ignores the size of data dev returned by blockdev and just assumes that it is at least 10 times the size of meta dev? If so, the document and/or the code should be updated.

simonxuhao avatar Oct 09 '19 03:10 simonxuhao