path: root/xlators/features/locks/src/locks.h
diff options
authorAshish Pandey <>2016-02-17 15:57:02 +0530
committerPranith Kumar Karampuri <>2016-03-30 01:51:11 -0700
commit7bbcd6fb692dffc628b723eace8cfcfa466e606f (patch)
treebc94cffe889a20851d813de0abb7f54bb1db1b6b /xlators/features/locks/src/locks.h
parent207289621f6c5b75bdb80aa14ddaf72efd5eb9b1 (diff)
cluster/ec: Rebalance hangs during rename
Problem: During the rename of a particular file (ec is holding blocking inodelk on the parent directory), if the rename of another file under the same directory comes. EC does not release the lock and goes ahead and renames the "new" file with the "already held lock". That causes rebalance process to be blocked on a lock which has been acquired by rename. Solution: While rename fop comes, ec takes blocking inodelk on old and new parent of the file. Before releasing, every lock held by ec, it waits for some "time" to see if that lock can be reused by the next fop. If within this "time" some other request comes, it releases this lock based on condition "lock count > 1" To get this "lock count" for rename fop, we have implemented "pl_rename" in feature/lock. Also, on ec side, changed the condition to release the lock based on the type of fop and old and new parent directories. Change-Id: I979dbab1185df962e8f305a6074ae1186ffe7db0 Bug: 1304988 Signed-off-by: Ashish Pandey <> Reviewed-on: Smoke: Gluster Build System <> NetBSD-regression: NetBSD Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Pranith Kumar Karampuri <> Reviewed-by: Krutika Dhananjay <>
Diffstat (limited to 'xlators/features/locks/src/locks.h')
1 files changed, 1 insertions, 2 deletions
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h
index 8c24eb8..df42cf5 100644
--- a/xlators/features/locks/src/locks.h
+++ b/xlators/features/locks/src/locks.h
@@ -164,8 +164,7 @@ typedef struct {
data_t *inodelk_dom_count_req;
dict_t *xdata;
- /* used by {f,}truncate */
- loc_t loc;
+ loc_t loc[2];
fd_t *fd;
off_t offset;