[Devel] [vzlin-dev] [PATCH rh7] cbt: remove useless rcu_dereference() -v2
Dmitry Monakhov
dmonakhov at openvz.org
Fri Apr 8 00:49:33 PDT 2016
Maxim Patlasov <mpatlasov at virtuozzo.com> writes:
> The implementation of CBT (blk-cbt.c) RCU-protects q->cbt, not cbt->map[ixd].
>
> In v2:
> - fixed one more place with redundant rcu_dereference
>
> Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
ACK.
> ---
> block/blk-cbt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/blk-cbt.c b/block/blk-cbt.c
> index 7a4303f..b66f513 100644
> --- a/block/blk-cbt.c
> +++ b/block/blk-cbt.c
> @@ -96,7 +96,7 @@ static int __blk_cbt_set(struct cbt_info *cbt, blkcnt_t block,
> unsigned long len = min_t(unsigned long, BITS_PER_PAGE - off,
> count);
>
> - page = rcu_dereference(cbt->map[idx]);
> + page = cbt->map[idx];
> if (page) {
> spin_lock_page(page);
> set_bits(page_address(page), off, len, set);
> @@ -394,7 +394,7 @@ static void cbt_find_next_extent(struct cbt_info *cbt, blkcnt_t block, struct cb
> idx = block >> (PAGE_SHIFT + 3);
> while (block < cbt->block_max) {
> off = block & (BITS_PER_PAGE -1);
> - page = rcu_dereference(cbt->map[idx]);
> + page = cbt->map[idx];
> if (!page) {
> if (found)
> break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20160408/1b222b64/attachment.sig>
More information about the Devel
mailing list