From df83bc05ff2c09fe5bd12ae32398bc58471d1f1a Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 30 Apr 2013 19:41:34 +0530 Subject: performance/io-cache: check the inode context to be NULL before accessing Change-Id: I475af7f8ffd5e5d8adbd2a74af20e56ad7751f69 BUG: 958108 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/4916 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur Reviewed-on: http://review.gluster.org/5077 Reviewed-by: Anand Avati --- xlators/performance/io-cache/src/io-cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index a7459a9a378..30dc14a9cdb 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -551,6 +551,13 @@ ioc_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, inode_ctx_get (fd->inode, this, &tmp_ioc_inode); ioc_inode = (ioc_inode_t *)(long)tmp_ioc_inode; + //TODO: see why inode context is NULL and handle it. + if (!ioc_inode) { + gf_log (this->name, GF_LOG_ERROR, "inode context is " + "NULL (%s)", uuid_utoa (fd->inode->gfid)); + goto out; + } + ioc_table_lock (ioc_inode->table); { list_move_tail (&ioc_inode->inode_lru, -- cgit