summaryrefslogtreecommitdiffstats
path: root/xlators/features/index/src/index.h
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-06-15 16:02:44 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-06-23 21:14:08 -0700
commit59523a782d7ed00b31c8cdf8da74310384272355 (patch)
treea445e8888acc42bd7836233a5307e9975ee323c0 /xlators/features/index/src/index.h
parentec3ea75513347deb95960f49d58fc19478a7ad17 (diff)
features/index: Do deletion of name-index in unwind path
Previously the deletion of name index was being done before winding the xattrop to posix. This order needs to be changed to ensure we don't lose the index in the event the xattrop fails in posix xl. Change-Id: I4aa892b102cbf5269cede041b871064563cb7348 BUG: 1331323 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/14742 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/features/index/src/index.h')
-rw-r--r--xlators/features/index/src/index.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/xlators/features/index/src/index.h b/xlators/features/index/src/index.h
index 24fd293db70..5fb5a65cd8e 100644
--- a/xlators/features/index/src/index.h
+++ b/xlators/features/index/src/index.h
@@ -62,14 +62,25 @@ typedef struct index_priv {
int64_t pending_count;
} index_priv_t;
+typedef struct index_local {
+ inode_t *inode;
+ dict_t *xdata;
+} index_local_t;
+
#define INDEX_STACK_UNWIND(fop, frame, params ...) \
do { \
+ index_local_t *__local = NULL; \
if (frame) { \
- inode_t *_inode = frame->local; \
+ __local = frame->local; \
frame->local = NULL; \
- inode_unref (_inode); \
} \
STACK_UNWIND_STRICT (fop, frame, params); \
+ if (__local) { \
+ inode_unref (__local->inode); \
+ if (__local->xdata) \
+ dict_unref (__local->xdata); \
+ mem_put (__local); \
+ } \
} while (0)
#endif