diff options
| -rw-r--r-- | libglusterfs/src/fd.c | 4 | ||||
| -rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 7 | 
2 files changed, 9 insertions, 2 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index 5e25b59cf91..c656bda6cdc 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -484,8 +484,8 @@ fd_bind (fd_t *fd)  {          inode_t *inode = NULL; -        if (!fd) { -                gf_log ("fd.c", GF_LOG_ERROR, "fd is NULL"); +        if (!fd || !fd->inode) { +                gf_log_callingfn ("fd", GF_LOG_ERROR, "!fd || !fd->inode");                  return NULL;          }          inode = fd->inode; diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 1ced00a4bc2..a0276ad6bb4 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -1368,6 +1368,12 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  link_inode = inode_link (inode, state->loc.parent,                                           state->loc.name, stbuf); +                if (!link_inode) { +                        op_ret = -1; +                        op_errno = ENOENT; +                        goto out; +                } +                  if (link_inode != inode) {                          /*                             VERY racy code (if used anywhere else) @@ -1402,6 +1408,7 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                          op_ret, strerror (op_errno));          } +out:          req           = frame->local;          rsp.fd        = fd_no;  | 
