diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2012-04-03 15:22:45 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-03 04:20:48 -0700 |
commit | 3c5aed7d8226e50296c6a7106e0d59682732e9b5 (patch) | |
tree | 63537ed75772fad83cec6a8c092abcbfb22b2d3a /xlators | |
parent | 0e4c74861f762d4af7b7d8ffce5384920a6aa335 (diff) |
locks, stripe: check if dict is NULL before refing it
Change-Id: Ifab58504280ed92e4435f7805052745e56bef5ef
BUG: 808003
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3073
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 9 | ||||
-rw-r--r-- | xlators/features/locks/src/posix.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 73700ff92..44a00ee12 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -225,7 +225,8 @@ stripe_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->stbuf = *buf; local->postparent = *postparent; local->inode = inode_ref (inode); - local->xdata = dict_ref (xdata); + if (xdata) + local->xdata = dict_ref (xdata); if (local->xattr) { stripe_aggregate_xattr (local->xdata, local->xattr); @@ -1848,7 +1849,8 @@ stripe_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, } local->op_ret = -1; local->call_count = priv->child_count; - local->xdata = dict_ref (xdata); + if (xdata) + local->xdata = dict_ref (xdata); local->mode = mode; local->umask = umask; loc_copy (&local->loc, loc); @@ -2297,7 +2299,8 @@ stripe_create (call_frame_t *frame, xlator_t *this, loc_t *loc, local->flags = flags; local->mode = mode; local->umask = umask; - local->xattr = dict_ref (xdata); + if (xdata) + local->xattr = dict_ref (xdata); local->call_count = priv->child_count; /* Send a setxattr request to nodes where the diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 15b68fac7..3e04c18f0 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -272,7 +272,8 @@ pl_ftruncate (call_frame_t *frame, xlator_t *this, local->op = FTRUNCATE; local->offset = offset; local->fd = fd_ref (fd); - local->xdata = dict_ref (xdata); + if (xdata) + local->xdata = dict_ref (xdata); frame->local = local; |