Skip to content

block: fix concurrent elevator change failure#950

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

block: fix concurrent elevator change failure#950
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1109814=>linus-master

Conversation

@blktests-ci

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

Copy link
Copy Markdown

Pull request for series with
subject: block: fix concurrent elevator change failure
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1109814

@blktests-ci

blktests-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Author

Upstream branch: 9716c08
series: https://patchwork.kernel.org/project/linux-block/list/?series=1109814
version: 1

@blktests-ci

blktests-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Author

Upstream branch: 2a2974b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1109814
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from 7319d84 to e311169 Compare June 12, 2026 22:38
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5f78e5d to e48f9db Compare June 13, 2026 01:19
@blktests-ci

blktests-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown
Author

Upstream branch: 062871f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1109814
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from e311169 to 3c67290 Compare June 13, 2026 01:35
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 199644a to e6d9eb8 Compare June 17, 2026 12:02
@blktests-ci

blktests-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

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

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from 3c67290 to 7be7953 Compare June 17, 2026 12:20
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from e6d9eb8 to 7d8604f Compare June 24, 2026 01:11
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

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

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from 7be7953 to 937b8ef Compare June 24, 2026 01:37
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 7d8604f to 4cc45a3 Compare June 26, 2026 08:14
@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=1109814
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from 937b8ef to 3deda6a Compare June 26, 2026 08:57
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
When elevator_change() is called concurrently for the same queue, the
elevator_change_done() function runs concurrently as well. This function
adds or deletes kobjects for the debugfs entry of the queue. Then the
concurrent calls cause memory corruption of the kobjects and result in a
process hang. The core part of the elevator switch is protected by queue
freeze and q->elevator_lock. However, since the commit 559dc11
("block: move elv_register[unregister]_queue out of elevator_lock"), the
elevator_change_done() is not serialized. Hence the memory corruption
and the hang.

The failures are observed when udev-worker writes to a sysfs
queue/scheduler attribute file while the blktests test case block/005
writes to the same attribute file. The failure also can be recreated by
running two processes that write to the same queue/scheduler file
concurrently. The failure is observed since another commit 370ac28
("block: avoid cpu_hotplug_lock depedency on freeze_lock"). This commit
changed the behavior of queue freeze and it unveiled the failure.

Fix the failure by adding a new per-queue lock 'elevator_queue_lock',
which serializes the whole elevator switch steps for the same queue
including the elevator_change_done() call.

Fixes: 559dc11 ("block: move elv_register[unregister]_queue out of elevator_lock")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
@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=1109814
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1109814=>linus-master branch from 3deda6a to 4a6efa0 Compare June 29, 2026 18:00
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