diff options
author | Sanju Rakonde <srakonde@redhat.com> | 2018-11-28 16:13:58 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-12-03 17:03:57 +0000 |
commit | 2bb0e89e4bb113a93c6e786446a140cd99261af8 (patch) | |
tree | 4e3ad012d934fb471b60bbd3b18fd61f4fc4c8cf /xlators/mgmt/glusterd/src/glusterd-snapshot.c | |
parent | 220722b426f4014abdca0c719b2ca4e3aefeecc4 (diff) |
glusterd: perform rcu_read_lock/unlock() under cleanup_lock mutex
Problem: glusterd should not try to acquire locks on any resources,
when it already received a SIGTERM and cleanup is started. Otherwise
we might hit segfault, since the thread which is going through
cleanup path will be freeing up the resouces and some other thread
might be trying to acquire locks on freed resources.
Solution: perform rcu_read_lock/unlock() under cleanup_lock mutex.
fixes: bz#1654270
Change-Id: I87a97cfe4f272f74f246d688660934638911ce54
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 543d677f420..48af5e8355a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -186,7 +186,7 @@ glusterd_find_missed_snap(dict_t *rsp_dict, glusterd_volinfo_t *vol, continue; } - rcu_read_lock(); + RCU_READ_LOCK; cds_list_for_each_entry_rcu(peerinfo, peers, uuid_list) { if (gf_uuid_compare(peerinfo->uuid, brickinfo->uuid)) { @@ -208,12 +208,12 @@ glusterd_find_missed_snap(dict_t *rsp_dict, glusterd_volinfo_t *vol, "info for %s:%s in the " "rsp_dict", brickinfo->hostname, brickinfo->path); - rcu_read_unlock(); + RCU_READ_UNLOCK; goto out; } } } - rcu_read_unlock(); + RCU_READ_UNLOCK; brick_count++; } |