Commit ce289a4d authored by Alex Lyakas's avatar Alex Lyakas Committed by Yongqiang Liu
Browse files

md: Whenassemble the array, consult the superblock of the freshest device

stable inclusion
from stable-v4.19.307
commit 81ca80caa3c5c2e4e5d1da2dca42cc11964c1e9f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I970CO


CVE: NA

--------------------------------

[ Upstream commit dc1cc22ed58f11d58d8553c5ec5f11cbfc3e3039 ]

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: default avatarAlex Lyakas <alex.lyakas@zadara.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/1702470271-16073-1-git-send-email-alex.lyakas@zadara.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent f58697dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment