From 4cc4e47f6cad1127ad425cc0ab10bc42ab1411c8 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 16 Feb 2012 17:48:44 +0530 Subject: storage/posix: reset op_ret to -1 after call to MAKE_INODE_HANDLE MAKE_INODE_HANDLE uses op_ret. We do not reset it to -1, and in few instances we jump to label out, where we unwind with op_ret. Change-Id: Iac4d9f250f5253b3ce0cd91cc385168247efd4a8 BUG: 788998 Signed-off-by: shishir gowda Reviewed-on: http://review.gluster.com/2759 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/storage/posix/src/posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7a66cd8c8..24dd536e4 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -565,6 +565,7 @@ posix_opendir (call_frame_t *frame, xlator_t *this, SET_FS_ID (frame->root->uid, frame->root->gid); MAKE_INODE_HANDLE (real_path, this, loc, NULL); + op_ret = -1; dir = opendir (real_path); if (dir == NULL) { @@ -1762,6 +1763,7 @@ posix_open (call_frame_t *frame, xlator_t *this, MAKE_INODE_HANDLE (real_path, this, loc, &stbuf); + op_ret = -1; SET_FS_ID (frame->root->uid, frame->root->gid); if (priv->o_direct) @@ -2323,6 +2325,7 @@ posix_setxattr (call_frame_t *frame, xlator_t *this, MAKE_INODE_HANDLE (real_path, this, loc, NULL); + op_ret = -1; dict_del (dict, GFID_XATTR_KEY); trav = dict->members_list; @@ -2379,6 +2382,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, SET_FS_ID (frame->root->uid, frame->root->gid); MAKE_INODE_HANDLE (real_path, this, loc, NULL); + op_ret = -1; priv = this->private; if (loc->inode && IA_ISDIR(loc->inode->ia_type) && name && @@ -2761,6 +2765,7 @@ posix_removexattr (call_frame_t *frame, xlator_t *this, if (!strcmp (GFID_XATTR_KEY, name)) { gf_log (this->name, GF_LOG_WARNING, "Remove xattr called" " on gfid for file %s", real_path); + op_ret = -1; goto out; } -- cgit