From 8313d53accaa22feb14d284fb91245be0a32e16e Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 15 Nov 2016 20:40:08 +0530 Subject: cluster/dht: Check for null inode Check for NULL inode before attempting to set dht inode ctx. Change-Id: I7693c18445f138221d8417df5e95b118cedb818a BUG: 1395261 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/15847 Smoke: Gluster Build System Reviewed-by: Shyamsundar Ranganathan NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/cluster/dht/src/dht-common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht/src') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 01d83bb3074..ab3b893d151 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -899,8 +899,11 @@ unlock: dht_layout_set (this, local->inode, layout); } - dht_inode_ctx_time_update (local->inode, this, - &local->stbuf, 1); + if (local->inode) { + dht_inode_ctx_time_update (local->inode, this, + &local->stbuf, 1); + } + if (local->loc.parent) { dht_inode_ctx_time_update (local->loc.parent, this, &local->postparent, 1); -- cgit