Skip to content

drbd: serialize UUID snapshot in drbd_md_write()#793

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1089070=>linus-master
Open

drbd: serialize UUID snapshot in drbd_md_write()#793
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1089070=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented May 4, 2026

Pull request for series with
subject: drbd: serialize UUID snapshot in drbd_md_write()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1089070

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 4, 2026

Upstream branch: 66edb90
series: https://patchwork.kernel.org/project/linux-block/list/?series=1089070
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 4, 2026

Upstream branch: 6d35786
series: https://patchwork.kernel.org/project/linux-block/list/?series=1089070
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1089070=>linus-master branch from 5d46c76 to 1401f0b Compare May 4, 2026 11:04
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6f75bd1 to 1f0d33a Compare May 5, 2026 15:39
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 5, 2026

Upstream branch: 6d35786
series: https://patchwork.kernel.org/project/linux-block/list/?series=1089070
version: 1

drbd_md_write() copies device->ldev->md.uuid[] into the on-disk
metadata block without holding uuid_lock.

The write-side helpers drbd_uuid_new_current() and drbd_uuid_set_bm()
update md.uuid[] under uuid_lock, and some updates span multiple UUID
slots as one logical state transition. An unlocked drbd_md_write() can
therefore observe and persist a mixed UUID tuple assembled from two
different states.

This is problematic because the serialized UUID tuple is written to
stable storage and later consumed by reconnect and resync decision
logic, meaning an inconsistent on-disk snapshot can represent a state that
never existed atomically in memory.

Protect the UUID copy with uuid_lock so drbd_md_write() serializes one
coherent snapshot.

Fixes: b411b36 ("The DRBD driver")
Signed-off-by: Ziyu Zhang <ziyuzhang201@gmail.com>
@blktests-ci blktests-ci Bot force-pushed the series/1089070=>linus-master branch from 1401f0b to 1e0831b Compare May 5, 2026 15:48
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