summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2015-03-25 15:04:19 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-04 23:21:06 -0700
commitc85b7c2c0c7b8b9e576ebd20e7446b9051c733e4 (patch)
tree16d2075b2ff5ab8ed524197fc0eaeeddf8e81030 /xlators/storage/posix/src/posix.c
parent3933109fa34d2e405364b57103f8b6a427acc8ec (diff)
features/trash : Notify CTR translator if an unlink happens to a file
Backport of http://review.gluster.org/#/c/9989/ This implementation is same as the posix_unlink_cbk() where CTR sends a request during a unlink to send the number of links to the inode and posix obliges sending it using the unwind xdata dict. For Trash xlator a unlink is stat + mkdir(if parent is not present) + rename. And hence this is handled in trash_unlink_rename_cbk(). Change-Id: I402e83567b88e3c9fe171379693c82937af567f9 BUG: 1218032 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Signed-off-by: Anoop C S <achiraya@redhat.com> Reviewed-on: http://review.gluster.org/10513 Reviewed-by: Joseph Fernandes Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 6b6f7675a89..afc11fa813c 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1652,11 +1652,12 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
if (!unwind_dict) {
op_ret = 0;
gf_log (this->name, GF_LOG_WARNING,
- "Failed to creating unwind_dict");
+ "Memory allocation failure while "
+ "creating unwind_dict");
goto out;
}
- /* Even if unwind_dict fails to set CTR_RESPONSE_LINK_COUNT_XDATA we will
- * not mark the FOP unsuccessful
+ /* Even if unwind_dict fails to set CTR_RESPONSE_LINK_COUNT_XDATA we
+ * will not mark the FOP unsuccessful
* because this dict is only used by CTR Xlator to clear
* all records if link count == 0*/
op_ret = dict_set_uint32 (unwind_dict, CTR_RESPONSE_LINK_COUNT_XDATA,
@@ -1678,6 +1679,11 @@ out:
close (fd);
}
+ /* unref unwind_dict*/
+ if (unwind_dict) {
+ dict_unref (unwind_dict);
+ }
+
return 0;
}