Skip to content

md/raid1: fix data lost for writemostly rdev#241

Closed
kpd-daemon[bot] wants to merge 1 commit into
md-6.16_basefrom
series/998210=>md-6.16
Closed

md/raid1: fix data lost for writemostly rdev#241
kpd-daemon[bot] wants to merge 1 commit into
md-6.16_basefrom
series/998210=>md-6.16

Conversation

@kpd-daemon
Copy link
Copy Markdown

@kpd-daemon kpd-daemon Bot commented Sep 3, 2025

Pull request for series with
subject: md/raid1: fix data lost for writemostly rdev
version: 1
url: https://patchwork.kernel.org/project/linux-raid/list/?series=998210

If writemostly is enabled, alloc_behind_master_bio() will allocate a new
bio for rdev, with bi_opf set to 0. Later, raid1_write_request() will
clone from this bio, hence bi_opf is still 0 for the cloned bio. Submit
this cloned bio will end up to be read, causing write data lost.

Fix this problem by inheriting bi_opf from original bio for
behind_mast_bio.

Fixes: e879a0d ("md/raid1,raid10: don't ignore IO flags")
Reported-and-tested-by: Ian Dall <ian@beware.dropbear.id.au>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220507
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
@kpd-daemon
Copy link
Copy Markdown
Author

kpd-daemon Bot commented Sep 3, 2025

Upstream branch: c17fb54
series: https://patchwork.kernel.org/project/linux-raid/list/?series=998210
version: 1

@kpd-daemon
Copy link
Copy Markdown
Author

kpd-daemon Bot commented Sep 4, 2025

At least one diff in series https://patchwork.kernel.org/project/linux-raid/list/?series=998210 irrelevant now. Closing PR.

@kpd-daemon kpd-daemon Bot added accepted and removed new labels Sep 4, 2025
@kpd-daemon kpd-daemon Bot closed this Sep 4, 2025
@kpd-daemon kpd-daemon Bot deleted the series/998210=>md-6.16 branch September 11, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant