summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-04-17 00:32:17 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-17 10:29:17 +0530
commit41011cdb4c9f76a1805f0b908d1d7f77cef545b2 (patch)
tree7394ec3b71225f2979aba7cffa8f4811c3ade495 /xlators/protocol
parent4c4021bea2d9f484321066518e10d2b139af2a3a (diff)
protocol/client - NULL check for loc->inode added in statfs(), before trying to retrieve remote inode number from loc->inode's context.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-protocol.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index d7ab797b6de..d89da3fbc85 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -1990,14 +1990,16 @@ client_statfs (call_frame_t *frame,
}
pathlen = STRLEN_0(loc->path);
-
- ret = inode_ctx_get (loc->inode, this, &ino);
- if (loc->inode->ino && ret < 0) {
- gf_log (this->name, GF_LOG_ERROR,
- "STATFS %"PRId64" (%s): "
- "failed to get remote inode number",
- loc->inode->ino, loc->path);
- }
+
+ if (loc->inode) {
+ ret = inode_ctx_get (loc->inode, this, &ino);
+ if (loc->inode->ino && ret < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "STATFS %"PRId64" (%s): "
+ "failed to get remote inode number",
+ loc->inode->ino, loc->path);
+ }
+ }
hdrlen = gf_hdr_len (req, pathlen);
hdr = gf_hdr_new (req, pathlen);