From 7a32aa912ea4e49d3ef922ec6e0cb3d394109962 Mon Sep 17 00:00:00 2001 From: Junaid Date: Mon, 4 Apr 2011 12:03:04 +0000 Subject: features/marker: Check for NULL before dereferencing pointers stored in local. Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2607 (Fileop fails when quota is enabled) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2607 --- xlators/features/marker/src/marker-quota.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 16139fc24..afb93c6ee 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -489,14 +489,14 @@ quota_dirty_inode_readdir (call_frame_t *frame, { quota_local_t *local = NULL; + local = frame->local; + if (op_ret == -1) { local->err = -1; release_lock_on_dirty_inode (frame, NULL, this, 0, 0); return 0; } - local = frame->local; - if (local->fd == NULL) local->fd = fd_ref (fd); @@ -1224,6 +1224,9 @@ quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie, goto err; } + VALIDATE_OR_GOTO (local->ctx, err); + VALIDATE_OR_GOTO (local->contri, err); + gf_log (this->name, GF_LOG_DEBUG, "%s marked dirty", local->parent_loc.path); priv = this->private; -- cgit