summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-19 04:33:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-19 03:46:42 -0700
commitecd0a913dc7359c3dad6cb9188ac999a6613d8b3 (patch)
tree612960ce4a8aeaee24429334b87396ee1443d3a4 /xlators/protocol/client
parent12e997d86358f44ab3729e1619591d1c8d0a8dc5 (diff)
protocol/client: fix ESTALE in statfs on root inode
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1397 (Cached dir fd_ts are a leakin') URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1397
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index cddfbcfc466..75034ddfff9 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;