diff options
author | Soumya Koduri <skoduri@redhat.com> | 2016-07-21 12:14:27 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-07-22 08:13:29 -0700 |
commit | 89dee8b46e126bc1d7541da90fa60844aa83451e (patch) | |
tree | 4d4807d07c246b34f2310c0a90e386b31dc0c382 /api/src/glfs-handleops.c | |
parent | 637ce9e2e27e9f598a4a6c5a04cd339efaa62076 (diff) |
glfs/upcall: entries should be removed under mutex lock
During poll, upcall entries should be removed from the
upcall_list only under upcall_list_mutex lock. Otherwise
it could result in the list corruption if there are entries
being added during poll resulting in memory leak.
Also addressed a probable leak during any failures with upcall
entry addition.
Change-Id: I468183f961eb6faed9a0a1bcb783705f711641fc
BUG: 1358608
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/14972
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r-- | api/src/glfs-handleops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 373560a00d8..c68a54512d3 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -2031,6 +2031,7 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct glfs_callback_arg *up_arg) &fs->upcall_list, upcall_list) { found = 1; + list_del_init (&u_list->upcall_list); break; } } @@ -2067,7 +2068,6 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct glfs_callback_arg *up_arg) up_arg->reason = reason; - list_del_init (&u_list->upcall_list); GF_FREE (u_list->upcall_data.data); GF_FREE (u_list); } |