From 61b669c8366bc43e62324bbd0ce381cdbe633b93 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Mon, 28 Mar 2011 04:04:55 +0000 Subject: features/marker: check for op_ret before doing any operations in lookup callback Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2497 (client crashes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2497 --- xlators/features/marker/src/marker.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 3a43ffdf453..43bb58cd83e 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1580,7 +1580,6 @@ marker_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *dict, struct iatt *postparent) { - struct iatt stat_buf; marker_conf_t *priv = NULL; marker_local_t *local = NULL; @@ -1589,12 +1588,6 @@ marker_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - priv = this->private; - - dict_ref (dict); - - memmove (&stat_buf, buf, sizeof (struct iatt)); - local = (marker_local_t *) frame->local; frame->local = NULL; @@ -1605,15 +1598,15 @@ marker_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret == -1 || local == NULL) goto out; + priv = this->private; + if (priv->feature_enabled & GF_QUOTA) { - quota_xattr_state (this, &local->loc, dict, stat_buf); + quota_xattr_state (this, &local->loc, dict, *buf); } out: marker_local_unref (local); - dict_unref (dict); - return 0; } -- cgit