rcu: create new rcu_access_index() and use in mce
The MCE subsystem needs to sample an RCU-protected index outside of any protection for that index. If this was a pointer, we would use rcu_access_pointer(), but there is no corresponding rcu_access_index(). This commit therefore creates an rcu_access_index() and applies it to MCE. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Tested-by: Zdenek Kabelac <zkabelac@redhat.com>
This commit is contained in:
@@ -1626,7 +1626,7 @@ out:
|
||||
static unsigned int mce_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
poll_wait(file, &mce_wait, wait);
|
||||
if (rcu_dereference_check_mce(mcelog.next))
|
||||
if (rcu_access_index(mcelog.next))
|
||||
return POLLIN | POLLRDNORM;
|
||||
if (!mce_apei_read_done && apei_check_mce())
|
||||
return POLLIN | POLLRDNORM;
|
||||
|
Reference in New Issue
Block a user