summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2010-12-28 01:14:19 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-29 10:20:46 -0800
commit165efc45ab5518033612a58c1ac51243eb6bcef8 (patch)
treece63a87e5e11f7663211818006fd3088ae0ac2f4
parent010394ee5e237606023f455955e005e111b9fa5b (diff)
nfs/server: unrefing inodes on error in nfs_loc_copy ().
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2252 (unreffing of inodes not done when memory allocation fails) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2252
-rw-r--r--xlators/nfs/server/src/nfs-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index ef2d1d3fdf5..f109cdde590 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -187,6 +187,14 @@ nfs_loc_copy (loc_t *dst, loc_t *src)
ret = 0;
out:
+ if (ret == -1) {
+ if (dst->inode)
+ inode_unref (dst->inode);
+
+ if (dst->parent)
+ inode_unref (dst->parent);
+ }
+
return ret;
}
d increment the GLFS_NUM_MESSAGES
- * - Append to the list of messages defined, towards the end
- * - Retain macro naming as glfs_msg_X (for redability across developers)
- * NOTE: Rules for message format modifications
- * 3) Check acorss the code if the message ID macro in question is reused
- * anywhere. If reused then then the modifications should ensure correctness
- * everywhere, or needs a new message ID as (1) above was not adhered to. If
- * not used anywhere, proceed with the required modification.
- * NOTE: Rules for message deletion
- * 4) Check (3) and if used anywhere else, then cannot be deleted. If not used
- * anywhere, then can be deleted, but will leave a hole by design, as
- * addition rules specify modification to the end of the list and not filling
- * holes.
- */
-
-#define GLFS_WRITE_BEHIND_BASE GLFS_MSGID_COMP_WRITE_BEHIND
-#define GLFS_WRITE_BEHIND_NUM_MESSAGES 7
-#define GLFS_MSGID_END (GLFS_WRITE_BEHIND_BASE +\
- GLFS_WRITE_BEHIND_NUM_MESSAGES + 1)
-
-/* Messages with message IDs */
-#define glfs_msg_start_x GLFS_WRITE_BEHIND_BASE, "Invalid: Start of messages"
-
-
-
-
-/*!
- * @messageid
- * @diagnosis
- * @recommendedaction None
- *
- */
-
-#define WRITE_BEHIND_MSG_EXCEEDED_MAX_SIZE (GLFS_WRITE_BEHIND_BASE + 1)
-
-/*!
- * @messageid
- * @diagnosis
- * @recommendedaction None
- *
- */
-
-#define WRITE_BEHIND_MSG_INIT_FAILED (GLFS_WRITE_BEHIND_BASE + 2)
-
-/*!
- * @messageid
- * @diagnosis
- * @recommendedaction None
- *
- */
-
-#define WRITE_BEHIND_MSG_INVALID_ARGUMENT (GLFS_WRITE_BEHIND_BASE + 3)
-
-/*!
- * @messageid
- * @diagnosis
- * @recommendedaction None
- *
- */
-
-#define WRITE_BEHIND_MSG_NO_MEMORY (GLFS_WRITE_BEHIND_BASE + 4)
-
-/*!
- * @messageid
- * @diagnosis
- * @recommendedaction None
- *
- */
-