All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Hastings <dhastings@crucialwebhost.com>
To: dm-devel@redhat.com
Subject: Possible bug in mirror target
Date: Mon, 4 Feb 2019 17:47:20 -0700	[thread overview]
Message-ID: <CAN-y+EKdQnRWck4B3Ms0ZGHqEL4+V+xPb-G3vhPy+Qe0DMO0oA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2032 bytes --]

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@kernel-dev:~# dmsetup create zerodev --table "0 1073741824 zero"
root@kernel-dev:~# dmsetup create errordev --table "0 1073741824 error"


root@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@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@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@kernel-dev:~# dmsetup status mirror-table
0 1073741824 mirror 2 253:1 253:2 2047/2048 1 AD 1 core
root@kernel-dev:~# dmsetup remove mirror-table


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

root@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@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@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@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!

[-- Attachment #1.2: Type: text/html, Size: 2812 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2019-02-05  0:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05  0:47 Drew Hastings [this message]
2019-02-05 10:03 ` Possible bug in mirror target Zdenek Kabelac
2019-02-10 21:58   ` John Stoffel
2019-02-12 15:02     ` Zdenek Kabelac
2019-02-12 22:36       ` John Stoffel
2019-02-13 14:21         ` Zdenek Kabelac
2019-02-13 15:01           ` Bryn M. Reeves
2019-02-13 18:08             ` Zdenek Kabelac
2019-02-14 10:23               ` Bryn M. Reeves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN-y+EKdQnRWck4B3Ms0ZGHqEL4+V+xPb-G3vhPy+Qe0DMO0oA@mail.gmail.com \
    --to=dhastings@crucialwebhost.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.