[PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap

From: Ildar Ismagilov
Date: Wed Jan 31 2018 - 14:40:54 EST


Signed-off-by: Ildar Ismagilov <devix84@xxxxxxxxx>
---
kernel/rcu/srcutree.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 1798d1aa60fa..c54617280245 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -552,6 +552,9 @@ static void srcu_gp_end(struct srcu_struct *sp)
if (ULONG_CMP_GE(gpseq,
sdp->srcu_gp_seq_needed + 100))
sdp->srcu_gp_seq_needed = gpseq;
+ if (ULONG_CMP_GE(gpseq,
+ sdp->srcu_gp_seq_needed_exp + 100))
+ sdp->srcu_gp_seq_needed_exp = gpseq;
raw_spin_unlock_irqrestore_rcu_node(sdp, flags);
}
}
--
2.11.0