From ecd0a913dc7359c3dad6cb9188ac999a6613d8b3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 19 Aug 2010 04:33:07 +0000 Subject: protocol/client: fix ESTALE in statfs on root inode Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 1397 (Cached dir fd_ts are a leakin') URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1397 --- xlators/protocol/client/src/client3_1-fops.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index cddfbcfc4..75034ddff 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -3705,15 +3705,20 @@ client3_1_statfs (call_frame_t *frame, xlator_t *this, args = data; - if (args->loc->inode) { - ret = inode_ctx_get2 (args->loc->inode, this, - &req.ino, &req.gen); - if (args->loc->inode->ino && ret < 0) { - gf_log (this->name, GF_LOG_TRACE, - "STATFS %"PRId64" (%s): " - "failed to get remote inode number", - args->loc->inode->ino, args->loc->path); - goto unwind; + if (args->loc && args->loc->inode) { + if (args->loc->inode->ino == 1) { + req.ino = 1; + req.gen = 0; + } else { + ret = inode_ctx_get2 (args->loc->inode, this, + &req.ino, &req.gen); + if (args->loc->inode->ino && ret < 0) { + gf_log (this->name, GF_LOG_TRACE, + "STATFS %"PRId64" (%s): " + "failed to get remote inode number", + args->loc->inode->ino, args->loc->path); + goto unwind; + } } } req.path = (char *)args->loc->path; -- cgit