mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
rhashtable: silence RCU warning in rhashtable_test.
print_ht in rhashtable_test calls rht_dereference() with neither RCU protection or the mutex. This triggers an RCU warning. So take the mutex to silence the warning. Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
e5ab564c9e
commit
cbab901296
@@ -501,6 +501,8 @@ static unsigned int __init print_ht(struct rhltable *rhlt)
|
|||||||
unsigned int i, cnt = 0;
|
unsigned int i, cnt = 0;
|
||||||
|
|
||||||
ht = &rhlt->ht;
|
ht = &rhlt->ht;
|
||||||
|
/* Take the mutex to avoid RCU warning */
|
||||||
|
mutex_lock(&ht->mutex);
|
||||||
tbl = rht_dereference(ht->tbl, ht);
|
tbl = rht_dereference(ht->tbl, ht);
|
||||||
for (i = 0; i < tbl->size; i++) {
|
for (i = 0; i < tbl->size; i++) {
|
||||||
struct rhash_head *pos, *next;
|
struct rhash_head *pos, *next;
|
||||||
@@ -534,6 +536,7 @@ static unsigned int __init print_ht(struct rhltable *rhlt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk(KERN_ERR "\n---- ht: ----%s\n-------------\n", buff);
|
printk(KERN_ERR "\n---- ht: ----%s\n-------------\n", buff);
|
||||||
|
mutex_unlock(&ht->mutex);
|
||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user