md: Whenassemble the array, consult the superblock of the freshest device
authorAlex Lyakas <alex.lyakas@zadara.com>
Wed, 13 Dec 2023 12:24:31 +0000 (14:24 +0200)
committerSong Liu <song@kernel.org>
Fri, 15 Dec 2023 23:21:24 +0000 (15:21 -0800)
commitdc1cc22ed58f11d58d8553c5ec5f11cbfc3e3039
tree21c279b456a7b2e717391bf178f160930f7f620e
parentaf140f806ae2679f9dba48ea0f5811da83854eb6
md: Whenassemble the array, consult the superblock of the freshest device

Upon assembling the array, both kernel and mdadm allow the devices to have event
counter difference of 1, and still consider them as up-to-date.
However, a device whose event count is behind by 1, may in fact not be up-to-date,
and array resync with such a device may cause data corruption.
To avoid this, consult the superblock of the freshest device about the status
of a device, whose event counter is behind by 1.

Signed-off-by: Alex Lyakas <alex.lyakas@zadara.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/1702470271-16073-1-git-send-email-alex.lyakas@zadara.com
drivers/md/md.c