From 6278aa86f819bbb08e3b9ea829779fd6b60bbfff Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 12 Mar 2021 23:39:21 +0800 Subject: [PATCH] lockdep: fix follows/follows_bt resize() size Without this the size of follows/follows_bt won't ever change, and if the total lock number larger than 4094 it will cause crash in lockdep_will_lock(). Signed-off-by: Xiubo Li --- src/common/lockdep.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 241e2ea3c140c..18d0cde09c889 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -172,8 +172,8 @@ static int _lockdep_register(const char *name) if (current_maxid <= (unsigned)id) { current_maxid = (unsigned)id + 1; if (current_maxid == follows.size()) { - follows.resize(current_maxid); - follows_bt.resize(current_maxid); + follows.resize(current_maxid + 1); + follows_bt.resize(current_maxid + 1); } } lock_ids[name] = id; -- 2.47.3