From 3429e8755756191d010896083ca9a7141682ead9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 25 Nov 2009 15:13:37 +0000 Subject: add an extra check for loc->parent when loc->ino is not 1 This extra check is needed only in case where setup is "server -> chain -> client", where for the root inode, inode->ino is not updated in the first lookup call, hence used to crash. Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 377 (segfault in protocol/client with chaining) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=377 --- xlators/protocol/client/src/client-protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 2723126ca95..d0f33e730f8 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -3268,7 +3268,7 @@ client_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, GF_VALIDATE_OR_GOTO (this->name, loc, unwind); GF_VALIDATE_OR_GOTO (this->name, loc->path, unwind); - if (loc->ino != 1) { + if (loc->ino != 1 && loc->parent) { ret = inode_ctx_get2 (loc->parent, this, &par, &gen); if (loc->parent->ino && ret < 0) { gf_log (this->name, GF_LOG_TRACE, -- cgit