cb8e9e
From d5ec5956a627bdff35e9a92b55226be79b10fc6a Mon Sep 17 00:00:00 2001
cb8e9e
From: Niels de Vos <ndevos@redhat.com>
cb8e9e
Date: Thu, 11 Jun 2015 01:10:08 +0200
cb8e9e
Subject: [PATCH 43/57] logging: log "Stale filehandle" on the client as Debug
cb8e9e
cb8e9e
There are valid use-cases where a "Stale filehandle" is expected. One of
cb8e9e
these is deleting a file through NFS-Ganesha. When the "filename" is
cb8e9e
deleted, Ganesha will stat the file-handle to update its attributes. The
cb8e9e
file-handle would still be valid in the case where there are hardlinks.
cb8e9e
cb8e9e
There is no need to log "Stale filehandle" as Warning. It is perfectly
cb8e9e
fine to have this logged as Debug.
cb8e9e
cb8e9e
Backported from http://review.gluster.org/11169:
cb8e9e
> Cherry picked from commit ec7d0c3de11cbee1470308dcc10ec9f02e7fdfff:
cb8e9e
> > Change-Id: Ib9006d95a5d1f7dd394bf5d5994ad70740ad4ab2
cb8e9e
> > BUG: 1228731
cb8e9e
> > Signed-off-by: Niels de Vos <ndevos@redhat.com>
cb8e9e
> > Reviewed-on: http://review.gluster.org/11107
cb8e9e
> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
cb8e9e
> > Tested-by: Gluster Build System <jenkins@build.gluster.com>
cb8e9e
> > Reviewed-by: soumya k <skoduri@redhat.com>
cb8e9e
> > Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
cb8e9e
>
cb8e9e
> Change-Id: Ib9006d95a5d1f7dd394bf5d5994ad70740ad4ab2
cb8e9e
> BUG: 1228729
cb8e9e
> Signed-off-by: Niels de Vos <ndevos@redhat.com>
cb8e9e
cb8e9e
Change-Id: Ib9006d95a5d1f7dd394bf5d5994ad70740ad4ab2
cb8e9e
BUG: 1224215
cb8e9e
Signed-off-by: Niels de Vos <ndevos@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/50478
cb8e9e
Reviewed-by: Jiffin Thottan <jthottan@redhat.com>
cb8e9e
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
cb8e9e
---
cb8e9e
 xlators/protocol/client/src/client-rpc-fops.c |    7 +++++--
cb8e9e
 1 files changed, 5 insertions(+), 2 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
cb8e9e
index d4021f5..e5912bd 100644
cb8e9e
--- a/xlators/protocol/client/src/client-rpc-fops.c
cb8e9e
+++ b/xlators/protocol/client/src/client-rpc-fops.c
cb8e9e
@@ -476,7 +476,6 @@ client3_3_stat_cbk (struct rpc_req *req, struct iovec *iov, int count,
cb8e9e
         xlator_t *this       = NULL;
cb8e9e
         dict_t  *xdata       = NULL;
cb8e9e
 
cb8e9e
-
cb8e9e
         this = THIS;
cb8e9e
 
cb8e9e
         frame = myframe;
cb8e9e
@@ -504,7 +503,11 @@ client3_3_stat_cbk (struct rpc_req *req, struct iovec *iov, int count,
cb8e9e
 
cb8e9e
 out:
cb8e9e
         if (rsp.op_ret == -1) {
cb8e9e
-                gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
cb8e9e
+                /* stale filehandles are possible during normal operations, no
cb8e9e
+                 * need to spam the logs with these */
cb8e9e
+                gf_log (this->name,
cb8e9e
+                        rsp.op_errno == ESTALE ? GF_LOG_DEBUG : GF_LOG_WARNING,
cb8e9e
+                        "remote operation failed: %s",
cb8e9e
                         strerror (gf_error_to_errno (rsp.op_errno)));
cb8e9e
         }
cb8e9e
 
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e