]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1: fix potential data inconsistency issue with write behind device
authorGuoqing Jiang <gqjiang@suse.com>
Wed, 19 Jun 2019 09:30:46 +0000 (17:30 +0800)
committerSong Liu <songliubraving@fb.com>
Thu, 20 Jun 2019 23:35:59 +0000 (16:35 -0700)
commit211b27abae18e28668218904078538198e1c05cd
tree2661881c5231d9ccf5ae1f92d078572dbdaf6850
parent6c0d133e461cf7328806e167c2bab576a5aca943
md/raid1: fix potential data inconsistency issue with write behind device

For write-behind mode, we think write IO is complete once it has
reached all the non-writemostly devices. It works fine for single
queue devices.

But for multiqueue device, if there are lots of IOs come from upper
layer, then the write-behind device could issue those IOs to different
queues, depends on the each queue's delay, so there is no guarantee
that those IOs can arrive in order.

To address the issue, we need to check the collision among write
behind IOs, we can only continue without collision, otherwise wait
for the completion of previous collisioned IO.

And WBCollision is introduced for multiqueue device which is worked
under write-behind mode.

But this patch doesn't handle below cases which could have the data
inconsistency issue as well, these cases will be handled in later
patches.

1. modify max_write_behind by write backlog node.
2. add or remove array's bitmap dynamically.
3. the change of member disk.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c
drivers/md/md.h
drivers/md/raid1.c