From 3d7356c0c205898bd4d515300c563be9ce113ec3 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 17 Sep 2010 04:12:51 +0000 Subject: Fix crash in dht_pathinfo_getxattr_cbk The crash happened due to NULL dereferencing. Signed-off-by: shishir gowda Signed-off-by: Vijay Bellur BUG: 1626 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1626 --- xlators/cluster/dht/src/dht-common.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 29d35b05528..92ea5854e20 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1596,12 +1596,19 @@ dht_pathinfo_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->pathinfo) strcat (local->pathinfo, " Link: "); + if (local->hashed_subvol) { + /* This will happen if there pending */ + STACK_WIND (frame, dht_pathinfo_getxattr_cbk, local->hashed_subvol, + local->hashed_subvol->fops->getxattr, + &local->loc, local->key); - /* This will happen if there pending */ - STACK_WIND (frame, dht_pathinfo_getxattr_cbk, local->hashed_subvol, - local->hashed_subvol->fops->getxattr, - &local->loc, local->key); + return 0; + } + gf_log ("this->name", GF_LOG_ERROR, "Unable to find hashed_subvol for path" + " %s", local->pathinfo); + + DHT_STACK_UNWIND (getxattr, frame, -1, op_errno, dict); return 0; } -- cgit