md/raid5: Annotate rdev/replacement accesses when nr_pending is elevated
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 7 Apr 2022 16:57:10 +0000 (10:57 -0600)
committerSong Liu <song@kernel.org>
Mon, 25 Apr 2022 21:00:36 +0000 (14:00 -0700)
commite38b0432550507a78d63c8da094e5f50820bdf92
treecea047480fc45df5002b43964e3418727ae5dcd8
parentb0920ede081b3f1659872f80ce552305610675a6
md/raid5: Annotate rdev/replacement accesses when nr_pending is elevated

There are a number of accesses to __rcu variables that should be safe
because nr_pending in the disk is known to be elevated.

Create a wrapper around rcu_dereference_protected() to annotate these
accesses and verify that nr_pending is non-zero.

This fixes a number of sparse warnings.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/raid5.c