summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2015-05-12 16:36:55 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2015-07-07 08:06:43 -0700
commitafa793ff16b349989ca7c958466eae15d2d003f9 (patch)
treefcd88a57791a0fb238ea216be9c065efc229ec80 /libglusterfs
parentb1abcf61d927009dfd794316b02d683d0e6d32cc (diff)
libgfapi: Gracefully exit when glfd is invalid
When glfs_* methods operating on glfd are invoked after calling glfs_close(), the program segfaults inside __GLFS_ENTRY_VALIDATE_FD trying to deference glfd->fd->inode which is invalid. Also, returning EBADF seemed more specific than EINVAL. BUG: 1221008 Change-Id: I13a92dca52da9a300252b69e026581b3a9e931fd Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/10759 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index af0d66da1ec..0b1229aac7e 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -533,7 +533,7 @@ fd_destroy (fd_t *fd)
}
UNLOCK (&fd->inode->lock);
inode_unref (fd->inode);
- fd->inode = (inode_t *)0xaaaaaaaa;
+ fd->inode = NULL;
fd_lk_ctx_unref (fd->lk_ctx);
mem_put (fd);
out: