diff options
author | krishna <ksriniva@redhat.com> | 2012-03-08 16:38:36 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-11 22:59:35 -0700 |
commit | b596986ca43b2acd83debe3c77607cc4e8ff1dc6 (patch) | |
tree | c6f072240da021005bef915f0a80a0a2e54e1d82 /xlators/nfs/server/src/nfs3.c | |
parent | ef108d4fa77fd9aba48a7b9475c9b72352c16e6a (diff) |
nfs/nlm: logging NFS client IP address when FH->volume mapping fails or when resolve_and_resume fails.
Change-Id: Ia89113f46c1d7c9ed629e9dc0ff0779c41ed947f
BUG: 765259
Signed-off-by: krishna <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/2900
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 1cb8d07e656..69cd3f786e2 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -216,14 +216,23 @@ out: } -#define nfs3_map_fh_to_volume(nfs3state, handle, rqst, volume, status, label) \ +#define nfs3_map_fh_to_volume(nfs3state, handle, req, volume, status, label) \ do { \ - char buf[256]; \ + char exportid[256], gfid[256]; \ + rpc_transport_t *trans = NULL; \ volume = nfs3_fh_to_xlator ((nfs3state), handle); \ if (!volume) { \ - uuid_unparse (handle->exportid, buf); \ + uuid_unparse (handle->exportid, exportid); \ + uuid_unparse (handle->gfid, gfid); \ + trans = rpcsvc_request_transport (req); \ gf_log (GF_NFS3, GF_LOG_ERROR, "Failed to map " \ - "FH to vol, exportid=%s", buf); \ + "FH to vol: client=%s, exportid=%s, gfid=%s",\ + trans->peerinfo.identifier, exportid, \ + gfid); \ + gf_log (GF_NFS3, GF_LOG_ERROR, \ + "Stale nfs client %s must be trying to "\ + "connect to a deleted volume, please " \ + "unmount it.", trans->peerinfo.identifier);\ status = NFS3ERR_STALE; \ goto label; \ } else { \ @@ -248,13 +257,15 @@ out: #define nfs3_check_fh_resolve_status(cst, nfstat, erlabl) \ do { \ xlator_t *xlatorp = NULL; \ - char buf[256], gfid[256]; \ + char buf[256], gfid[256]; \ + rpc_transport_t *trans = NULL; \ if ((cst)->resolve_ret < 0) { \ + trans = rpcsvc_request_transport (cst->req); \ xlatorp = nfs3_fh_to_xlator (cst->nfs3state, \ &cst->resolvefh); \ - uuid_unparse (cst->fh.gfid, gfid); \ - sprintf (buf, "%s : %s", xlatorp ? \ - xlatorp->name : "ERR", gfid); \ + uuid_unparse (cst->resolvefh.gfid, gfid); \ + sprintf (buf, "(%s) %s : %s", trans->peerinfo.identifier,\ + xlatorp ? xlatorp->name : "ERR", gfid); \ gf_log (GF_NFS3, GF_LOG_ERROR, "Unable to resolve FH"\ ": %s", buf); \ nfstat = nfs3_errno_to_nfsstat3 (cst->resolve_errno);\ @@ -265,14 +276,16 @@ out: #define nfs3_check_new_fh_resolve_status(cst, nfstat, erlabl) \ do { \ xlator_t *xlatorp = NULL; \ - char buf[256], gfid[256]; \ + char buf[256], gfid[256]; \ + rpc_transport_t *trans = NULL; \ if (((cst)->resolve_ret < 0) && \ ((cst)->resolve_errno != ENOENT)) { \ + trans = rpcsvc_request_transport (cst->req); \ xlatorp = nfs3_fh_to_xlator (cst->nfs3state, \ - &cst->resolvefh); \ - uuid_unparse (cst->fh.gfid, gfid); \ - sprintf (buf, "%s : %s", xlatorp ? \ - xlatorp->name : "ERR", gfid); \ + &cst->resolvefh); \ + uuid_unparse (cst->resolvefh.gfid, gfid); \ + sprintf (buf, "(%s) %s : %s", trans->peerinfo.identifier,\ + xlatorp ? xlatorp->name : "ERR", gfid); \ gf_log (GF_NFS3, GF_LOG_ERROR, "Unable to resolve FH"\ ": %s", buf); \ nfstat = nfs3_errno_to_nfsstat3 (cs->resolve_errno);\ |