Blob Blame History Raw
From 7a81e3712678d9f3d7e276931260c89a012d9b59 Mon Sep 17 00:00:00 2001
From: N Balachandran <nbalacha@redhat.com>
Date: Wed, 16 Nov 2016 11:25:02 +0530
Subject: [PATCH 173/206] 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 <nbalacha@redhat.com>
> Reviewed-on: http://review.gluster.org/15847
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>

Change-Id: Iffc180c02e593401a88dd5fcf1b233d091f85af8
BUG: 1394752
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/90283
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Atin Mukherjee <amukherj@redhat.com>
---
 xlators/cluster/dht/src/dht-common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index a160d3f..a2bd8b7 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -711,8 +711,10 @@ 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);
-- 
2.9.3