From c1e3d3b963a46fb92d309ac3d0a11adfad8ce745 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Fri, 24 Feb 2012 14:59:43 +0530 Subject: locks/glusterd: Fixed clearing of posix locks from failing always. Change-Id: Ieaf636c6f0d2aa1d001143a2d1433fce85dc8c7a BUG: 797042 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/2812 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/features/locks/src/clear.c | 1 + xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/locks/src/clear.c b/xlators/features/locks/src/clear.c index a7b2455e33c..ad6d0893cef 100644 --- a/xlators/features/locks/src/clear.c +++ b/xlators/features/locks/src/clear.c @@ -204,6 +204,7 @@ clrlk_clear_posixlk (xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args, } pthread_mutex_unlock (&pl_inode->mutex); grant_blocked_locks (this, pl_inode); + ret = 0; out: *blkd = bcount; *granted = gcount; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index caafa9fd094..da7631d1677 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1556,10 +1556,12 @@ glusterd_clearlocks_send_cmd (glusterd_volinfo_t *volinfo, char *cmd, { int ret = -1; glusterd_conf_t *priv = NULL; + char abspath[PATH_MAX] = {0, }; priv = THIS->private; - ret = sys_lgetxattr (mntpt, cmd, result, PATH_MAX); + snprintf (abspath, sizeof (abspath), "%s/%s", mntpt, path); + ret = sys_lgetxattr (abspath, cmd, result, PATH_MAX); if (ret < 0) { snprintf (errstr, err_len, "clear-locks getxattr command " "failed. Reason: %s", strerror (errno)); -- cgit