Skip to content

Enable lock context analysis#619

Open
blktests-ci[bot] wants to merge 14 commits intolinus-master_basefrom
series/1061541=>linus-master
Open

Enable lock context analysis#619
blktests-ci[bot] wants to merge 14 commits intolinus-master_basefrom
series/1061541=>linus-master

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Mar 4, 2026

Pull request for series with
subject: Enable lock context analysis
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1061541

@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

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

@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from e52183e to afbdff3 Compare March 5, 2026 01:28
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from afbdff3 to dce2c9a Compare March 5, 2026 01:38
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 78036b2 to bbb3394 Compare March 5, 2026 12:20
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from dce2c9a to e2cb4e7 Compare March 5, 2026 12:24
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from bbb3394 to 901a429 Compare March 5, 2026 21:37
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

Upstream branch: 5ee8dbf
series: https://patchwork.kernel.org/project/linux-block/list/?series=1061541
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from e2cb4e7 to 0e2f11f Compare March 5, 2026 21:41
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 901a429 to 1f19ba6 Compare March 10, 2026 06:29
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 10, 2026

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

@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from 0e2f11f to 427f9ac Compare March 10, 2026 06:32
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 1f19ba6 to e79276a Compare March 11, 2026 08:02
Make drbd_adm_dump_devices() call rcu_read_lock() before
rcu_read_unlock() is called. This has been detected by the Clang
thread-safety analyzer. Compile-tested only.

Tested-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Cc: Andreas Gruenbacher <agruen@linbit.com>
Fixes: a55bbd3 ("drbd: Backport the "status" command")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
The Clang thread-safety analyzer does not support testing return values
with "< 0". Hence change the "< 0" test into "!= 0". This is fine since
the radix_tree_maybe_preload() return value is <= 0.

Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Clang is more strict than sparse with regard to lock context annotation
checking. Hence this patch that makes the lock context annotations
compatible with Clang. __release() annotations have been added below
invocations of indirect calls that unlock a mutex because Clang does not
support annotating function pointers with __releases().

Enable context analysis in the block layer Makefile.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
ktio() unlocks and locks iocq[id].lock. Add a __must_hold() annotation
that reflects this. This annotation prevents that Clang will complain
about this function once lock context analysis is enabled.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Clang performs more strict checking of lock context annotations than
sparse. This patch makes the DRBD lock context annotations compatible
with Clang and prepares for enabling lock context analysis.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding lock context
annotations that are compatible with Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding those lock context
annotations that are required by Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding the lock context
annotations that are required by Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding the lock context
annotations that are required by Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding the lock context
annotations required by Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Add the lock context annotations that are required by Clang. Remove the
__must_hold(&ub->mutex) annotation from ublk_mark_io_ready() because not
all callers hold ub->mutex.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 11, 2026

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

Prepare for enabling lock context analysis by adding a lock context
annotation that is required for Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Prepare for enabling lock context analysis by adding the lock context
annotations that are required by Clang.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Now that all locking functions in block drivers have been annotated,
enable lock context analysis for all block drivers.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> # zram
@blktests-ci blktests-ci bot force-pushed the series/1061541=>linus-master branch from 427f9ac to a4132f8 Compare March 11, 2026 08:05
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