diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2016-12-08 14:53:04 +0530 | 
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-12-14 04:38:26 -0800 | 
| commit | e8b4e119e00f3599acb0ea95f8237cf9b07546a3 (patch) | |
| tree | 8d68dd07e6da7a7b3e88899acf0b025ea54300a6 /libglusterfs | |
| parent | 82694e7d8a8b63483b43afa4fa283f66fab90672 (diff) | |
cluster/ec: Fix lk-owner set race in ec_unlock
Problem:
Rename does two locks. There is a case where when it tries to unlock it sends
xattrop of the directory with new version, callback of these two xattrops can
be picked up by two separate epoll threads. Both of them will try to set the
lk-owner for unlock in parallel on the same frame so one of these unlocks will
fail because the lk-owner doesn't match.
Fix:
Specify the lk-owner which will be set on inodelk frame which will not be over
written by any other thread/operation.
 >BUG: 1402710
 >Change-Id: I666ffc931440dc5253d72df666efe0ef1d73f99a
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
 >Reviewed-on: http://review.gluster.org/16074
 >Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
 >Smoke: Gluster Build System <jenkins@build.gluster.org>
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
BUG: 1404572
Change-Id: Iff4f0c1364e6533f3c07f192138bcd321789b4cd
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/16130
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/lkowner.h | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/lkowner.h b/libglusterfs/src/lkowner.h index b6a950f5e12..9712f176f30 100644 --- a/libglusterfs/src/lkowner.h +++ b/libglusterfs/src/lkowner.h @@ -84,4 +84,10 @@ out:          return is_null;  } +static inline void +lk_owner_copy (gf_lkowner_t *dst, gf_lkowner_t *src) +{ +        dst->len = src->len; +        memcpy(dst->data, src->data, src->len); +}  #endif /* _LK_OWNER_H */  | 
