summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-09-09 00:39:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-09 06:38:42 -0700
commit226c228ff8effd6cc5edcb3326907b1faf69eaea (patch)
tree4d9150d532598b4b049bcbfded34f2eb23be9f53 /libglusterfsclient/src/libglusterfsclient.c
parentfd418ecf5d1eb4d3b65cff0890f8897592f2e9c8 (diff)
libglusterfsclient: Add inode_ctx NULL check during iattr cache validation
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 253 (Global bug for libglusterfsclient NULL checks and CALLOC handling fixes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=253
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 1dfe33327..8f7ae8809 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -587,6 +587,12 @@ libgf_is_iattr_cache_valid (libglusterfs_client_ctx_t *ctx, inode_t *inode,
return 0;
inode_ctx = libgf_get_inode_ctx (inode);
+ if (!inode_ctx) {
+ gf_log (LIBGF_XL_NAME, GF_LOG_ERROR, "No inode context"
+ " present\n");
+ return 0;
+ }
+
pthread_mutex_lock (&inode_ctx->lock);
{
current = time (NULL);