summaryrefslogtreecommitdiffstats
path: root/events
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@users.noreply.github.com>2021-02-24 16:44:55 +0100
committerXavi Hernandez <xhernandez@gmail.com>2021-04-12 15:03:54 +0200
commit79e9b447bf82ec1ce09ed5c0c45dcc5751fa9cf2 (patch)
tree21de2c8137ed3854805af660d61abfbca2477390 /events
parent909a9a1aa10594a7f53d2bc7fa75ca7f5d2297af (diff)
downloadglusterfs-release-8.tar.gz
glusterfs-release-8.tar.xz
glusterfs-release-8.zip
cluster/afr: Fix race in lockinfo (f)getxattrrelease-8
* cluster/afr: Fix race in lockinfo (f)getxattr A shared dictionary was updated outside the lock after having updated the number of remaining answers. This means that one thread may be processing the last answer and unwinding the request before another thread completes updating the dict. Thread 1 Thread 2 LOCK() call_cnt-- (=1) UNLOCK() LOCK() call_cnt-- (=0) UNLOCK() update_dict(dict) if (call_cnt == 0) { STACK_UNWIND(dict); } update_dict(dict) if (call_cnt == 0) { STACK_UNWIND(dict); } The updates from thread 1 are lost. This patch also reduces the work done inside the locked region and reduces code duplication. Fixes: #2161 Change-Id: Idc0d34ab19ea6031de0641f7b05c624d90fac8fa Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'events')
0 files changed, 0 insertions, 0 deletions