From 2478d21c8d7c0e4d66990f7da7323f2c750a9d82 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 11 Oct 2010 15:17:18 +0000 Subject: unwind if layout is NULL in getxattr for dht Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 1917 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1917 --- xlators/cluster/dht/src/dht-common.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 3d6b0422fdb..9caa3dc5b93 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1841,6 +1841,13 @@ dht_getxattr (call_frame_t *frame, xlator_t *this, conf = this->private; layout = dht_layout_get (this, loc->inode); + if (!layout) { + gf_log (this->name, GF_LOG_ERROR, + "layout is NULL"); + op_errno = ENOENT; + goto err; + } + if (key && (strcmp (key, GF_XATTR_PATHINFO_KEY) == 0)) { hashed_subvol = dht_subvol_get_hashed (this, loc); cached_subvol = dht_subvol_get_cached (this, loc->inode); -- cgit