summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-12-19 12:45:34 +0530
committerVijay Bellur <vijay@gluster.com>2011-12-22 05:11:25 -0800
commit23495efe35515891cc56b49ef967d5b1ba195e3e (patch)
tree2b7002fed0940d2cd5e63e02b953181c1919122c
parent941edee5dc38328fb46dd8b284956357ca67dec9 (diff)
features/locks: Fix release of locks on disconnect
When a disconnect comes on a transport, all the locks on that transport should be cleared irrespective of entry presence. Change-Id: I1c432ec1ddc8fe3f7bf236992f47437d0dacd6ae BUG: 765430 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/808 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/features/locks/src/inodelk.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 94ecfc265ad..1db08e05858 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -381,6 +381,7 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
struct list_head released;
char *path = NULL;
+ char *file = NULL;
INIT_LIST_HEAD (&granted);
INIT_LIST_HEAD (&released);
@@ -396,18 +397,16 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
list_del_init (&l->blocked_locks);
- if (inode_path (inode, NULL, &path) < 0) {
- gf_log (this->name, GF_LOG_TRACE,
- "inode_path failed");
- goto unlock;
- }
+ inode_path (inode, NULL, &path);
+ if (path)
+ file = path;
+ else
+ file = uuid_utoa (inode->gfid);
- gf_log (this->name, GF_LOG_TRACE,
- "releasing lock on %s held by "
+ gf_log (this->name, GF_LOG_DEBUG,
+ "releasing blocking lock on %s held by "
"{transport=%p, pid=%"PRId64" lk-owner=%"PRIu64"}",
- path, trans,
- (uint64_t) l->client_pid,
- l->owner);
+ file, trans, (uint64_t) l->client_pid, l->owner);
list_add (&l->blocked_locks, &released);
if (path) {
@@ -423,26 +422,22 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
__delete_inode_lock (l);
__destroy_inode_lock (l);
+ inode_path (inode, NULL, &path);
+ if (path)
+ file = path;
+ else
+ file = uuid_utoa (inode->gfid);
- if (inode_path (inode, NULL, &path) < 0) {
- gf_log (this->name, GF_LOG_TRACE,
- "inode_path failed");
- goto unlock;
- }
-
- gf_log (this->name, GF_LOG_TRACE,
- "releasing lock on %s held by "
+ gf_log (this->name, GF_LOG_DEBUG,
+ "releasing granted lock on %s held by "
"{transport=%p, pid=%"PRId64" lk-owner=%"PRIu64"}",
- path, trans,
- (uint64_t) l->client_pid,
- l->owner);
+ file, trans, (uint64_t) l->client_pid, l->owner);
if (path) {
GF_FREE (path);
path = NULL;
}
}
}
-unlock:
if (path)
GF_FREE (path);