diff options
| author | shishir gowda <shishirng@gluster.com> | 2010-09-23 02:09:25 +0000 | 
|---|---|---|
| committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-24 03:53:31 -0700 | 
| commit | 406bcbb443aaca1655be9dcb9101a717eafdc061 (patch) | |
| tree | 5b640872d1df928af869c84786f76af75087bc19 /xlators/cluster/afr/src/afr-open.c | |
| parent | c5a5fea9e6a1f1709e6826c1eea89dfd25cc496b (diff) | |
Check for possible fd/ctx NULL in afr
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1636 (Replicate crashed in afr_nonblocking_inodelk on deref of NULL fd_ctx)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1636
Diffstat (limited to 'xlators/cluster/afr/src/afr-open.c')
| -rw-r--r-- | xlators/cluster/afr/src/afr-open.c | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index dc830f7d5..69bbb56b8 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -100,21 +100,23 @@ afr_open_cbk (call_frame_t *frame, void *cookie,                          ret = afr_fd_ctx_set (this, fd);                          if (ret < 0) { -                                gf_log (this->name, GF_LOG_DEBUG, +                                gf_log (this->name, GF_LOG_ERROR,                                          "could not set fd ctx for fd=%p",                                          fd);                                  local->op_ret   = -1;                                  local->op_errno = -ret; +                                goto unlock;                          }                          ret = fd_ctx_get (fd, this, &ctx);                          if (ret < 0) { -                                gf_log (this->name, GF_LOG_DEBUG, +                                gf_log (this->name, GF_LOG_ERROR,                                          "could not get fd ctx for fd=%p", fd);                                  local->op_ret   = -1;                                  local->op_errno = -ret; +                                goto unlock;                          }                          fd_ctx = (afr_fd_ctx_t *)(long) ctx; @@ -124,6 +126,7 @@ afr_open_cbk (call_frame_t *frame, void *cookie,                          fd_ctx->wbflags                = local->cont.open.wbflags;  		}  	} +unlock:  	UNLOCK (&frame->lock);  	call_count = afr_frame_return (frame);  | 
