[dm-devel] Possible bug in mirror target

Drew Hastings dhastings at crucialwebhost.com
Tue Feb 5 00:47:20 UTC 2019


Hi,

I'm assuming all user space code is expected to use the handle_errors
feature, so this isn't that big of a deal. I'm also using 4.19.13, which I
think is more recent than the latest update to dm-raid1.c

That said, there may be a bug that causes the entire mirror to crash if
there is an error on the first leg of the mirror, but not on the 2nd leg.

Works fine if you do cause IO errors on the 2nd leg:

root at kernel-dev:~# dmsetup create zerodev --table "0 1073741824 zero"
root at kernel-dev:~# dmsetup create errordev --table "0 1073741824 error"


root at kernel-dev:~# dmsetup create mirror-table --table "0 1073741824 mirror
core 2 524288 nosync 2 /dev/mapper/zerodev 0 /dev/mapper/errordev 0 0"
root at kernel-dev:~# dd if=/dev/zero of=/dev/mapper/mirror-table bs=512
count=1
1+0 records in
1+0 records out
512 bytes copied, 0.000417845 s, 1.2 MB/s
root at kernel-dev:~# dd if=/dev/zero of=/dev/mapper/mirror-table bs=512
count=1
1+0 records in
1+0 records out
512 bytes copied, 0.00036228 s, 1.4 MB/s
root at kernel-dev:~# dmsetup status mirror-table
0 1073741824 mirror 2 253:1 253:2 2047/2048 1 AD 1 core
root at kernel-dev:~# dmsetup remove mirror-table


The whole mirror fails if you do the error device on the first leg:

root at kernel-dev:~# dmsetup create mirror-table --table "0 1073741824 mirror
core 2 524288 nosync 2 /dev/mapper/errordev 0 /dev/mapper/zerodev 0 0"
root at kernel-dev:~# dd if=/dev/zero of=/dev/mapper/mirror-table bs=512
count=1
1+0 records in
1+0 records out
512 bytes copied, 0.000274188 s, 1.9 MB/s
root at kernel-dev:~# dd if=/dev/zero of=/dev/mapper/mirror-table bs=512
count=1
dd: error writing '/dev/mapper/mirror-table': Input/output error
1+0 records in
0+0 records out
0 bytes copied, 0.000857634 s, 0.0 kB/s

root at kernel-dev:~# dmsetup status mirror-table
0 1073741824 mirror 2 253:2 253:1 2047/2048 1 DA 1 core

dmesg would be:

[ 1935.876401] device-mapper: raid1: Mirror read failed from 253:2. Trying
alternative device.
[ 1939.091919] device-mapper: raid1: Mirror read failed.

Thanks for your time!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20190204/5ca3a05e/attachment.htm>


More information about the dm-devel mailing list