Skip to content

Commit 50be0c0

Browse files
liupingfanpaulmckrcu
authored andcommitted
srcu: Fix the comparision in srcu_invl_snp_seq()
A grace-period sequence number contains two fields: counter and state. SRCU_SNP_INIT_SEQ provides a guaranteed invalid value for grace-period sequence numbers in newly allocated srcu_node structures' ->srcu_have_cbs[] and ->srcu_gp_seq_needed_exp fields. The point of the comparison in srcu_invl_snp_seq() is not to detect invalid grace-period sequence numbers in general, but rather to detect a newly allocated srcu_node structure whose ->srcu_have_cbs[] and ->srcu_gp_seq_needed_exp fields need to be brought into line with the srcu_struct structure's ->srcu_gp_seq field. This commit therefore causes srcu_invl_snp_seq() to compare both fields of the specified grace-period sequence number. Signed-off-by: Pingfan Liu <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent aa5210f commit 50be0c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/srcutree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void init_srcu_struct_data(struct srcu_struct *ssp)
154154
*/
155155
static inline bool srcu_invl_snp_seq(unsigned long s)
156156
{
157-
return rcu_seq_state(s) == SRCU_SNP_INIT_SEQ;
157+
return s == SRCU_SNP_INIT_SEQ;
158158
}
159159

160160
/*

0 commit comments

Comments
 (0)