From f30af2735cab7475d86665856b433ca409e79ee7 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 31 Dec 2014 15:15:53 +0530 Subject: cluster/afr: serialize inode locks 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: Ie6cc3d564638ab3aad586f9a4064d81e42d52aef BUG: 1176008 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/9372 Reviewed-by: Krutika Dhananjay Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- xlators/cluster/afr/src/afr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 4044fd59d4e..4fdc5f774cc 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -623,7 +623,7 @@ typedef struct _afr_local { } zerofill; struct { - const char *volume; + char *volume; int32_t cmd; struct gf_flock flock; } inodelk; -- cgit