Skip to content

drbd: Fix double put_ldev in receive_SyncParam on fifo_alloc failure#1007

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

drbd: Fix double put_ldev in receive_SyncParam on fifo_alloc failure#1007
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1116613=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

Pull request for series with
subject: drbd: Fix double put_ldev in receive_SyncParam on fifo_alloc failure
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1116613

@blktests-ci

blktests-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1116613
version: 1

@blktests-ci

blktests-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 4edcdef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1116613
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1116613=>linus-master branch from 73dfac7 to 2f94827 Compare June 26, 2026 08:28
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
@blktests-ci

blktests-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Author

Upstream branch: dc59e4f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1116613
version: 1

In receive_SyncParam(), when the fifo_alloc() call for the resync
plan buffer fails, the error path executes put_ldev(device) at line
3790 and then jumps to the disconnect label. The disconnect label
also calls put_ldev(device) when new_disk_conf is non-NULL, which
is always the case by this point (get_ldev succeeded and
new_disk_conf was allocated).

This results in a double put_ldev, causing the ldev reference count
to underflow. All other goto disconnect sites in the same function
correctly rely solely on the disconnect label to perform the single
put_ldev — the fifo_alloc failure path was the only one to
prematurely release the reference.

Remove the spurious put_ldev(device) call before goto disconnect
to fix the double put.

Cc: stable@vger.kernel.org
Fixes: b30ab79 ("drbd: Rename "mdev" to "device"")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
@blktests-ci blktests-ci Bot force-pushed the series/1116613=>linus-master branch from 2f94827 to 26d5440 Compare June 29, 2026 17:32
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