diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-12-31 16:41:43 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-02-11 02:15:30 -0800 |
commit | bb8845d3bd94f94a1302bb50811be209a7253dcb (patch) | |
tree | 122533ed5b6c7132129e298afcfc23ab89390209 /xlators/cluster/afr/src/afr-open.c | |
parent | 069bc07126d32bc6319d587ff91aa0006ba5fac8 (diff) |
cluster/afr: serialize inode locks
Backport of http://review.gluster.com/9372
Problem:
Afr winds inodelk calls without any order, so blocking inodelks
from two different mounts can lead to dead lock when mount1 gets
the lock on brick-1 and blocked on brick-2 where as mount2 gets
lock on brick-2 and blocked on brick-1
Fix:
Serialize the inodelks whether they are blocking inodelks or
non-blocking inodelks.
Non-blocking locks also need to be serialized.
Otherwise there is a chance that both the mounts which issued same
non-blocking inodelk may endup not acquiring the lock on any-brick.
Ex:
Mount1 and Mount2 request for full length lock on file f1. Mount1 afr may
acquire the partial lock on brick-1 and may not acquire the lock on brick-2
because Mount2 already got the lock on brick-2, vice versa. Since both the
mounts only got partial locks, afr treats them as failure in gaining the locks
and unwinds with EAGAIN errno.
Change-Id: I939a1d101e313a9f0abf212b94cdce1392611a5e
BUG: 1177928
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9374
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-open.c')
0 files changed, 0 insertions, 0 deletions