diff options
author | Li Nan <[email protected]> | 2023-06-02 17:18:39 +0800 |
---|---|---|
committer | Song Liu <[email protected]> | 2023-06-13 15:25:43 -0700 |
commit | 2ae6aaf76912bae53c74b191569d2ab484f24bf3 (patch) | |
tree | 6438f8328b668cc4695e9db3f3eda512c5baa758 /drivers/platform/surface/aggregator/ssh_parser.c | |
parent | 8d355a46c1e0cea59be3ea8395409a5e6eeed946 (diff) |
md/raid10: fix io loss while replacement replace rdev
When removing a disk with replacement, the replacement will be used to
replace rdev. During this process, there is a brief window in which both
rdev and replacement are read as NULL in raid10_write_request(). This
will result in io not being submitted but it should be.
//remove //write
raid10_remove_disk raid10_write_request
mirror->rdev = NULL
read rdev -> NULL
mirror->rdev = mirror->replacement
mirror->replacement = NULL
read replacement -> NULL
Fix it by reading replacement first and rdev later, meanwhile, use smp_mb()
to prevent memory reordering.
Fixes: 475b0321a4df ("md/raid10: writes should get directed to replacement as well as original.")
Signed-off-by: Li Nan <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/platform/surface/aggregator/ssh_parser.c')
0 files changed, 0 insertions, 0 deletions