diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-09-09 00:46:28 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-09 06:39:08 -0700 |
commit | baa85e6b797dd3f3b70772a712599cc3ab8597b5 (patch) | |
tree | 23f207614015a09d74ac307baaacb2fb32f32ee4 | |
parent | 3c6cc99f3ab51b05d57bfe2b68f459a5c4b7cb20 (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
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 07be8bc4890..76cfec48dc7 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); |