From b596986ca43b2acd83debe3c77607cc4e8ff1dc6 Mon Sep 17 00:00:00 2001 From: krishna Date: Thu, 8 Mar 2012 16:38:36 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2900 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/nfs/server/src/nfs3.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'xlators/nfs/server/src/nfs3.c') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 1cb8d07e6..69cd3f786 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);\ -- cgit