From 41f8d6b9239d8ee1ca786c0485bea4251c96b9e5 Mon Sep 17 00:00:00 2001 From: Hans-Werner Paulsen Date: Mon, 26 Nov 2012 15:45:26 +0059 Subject: [PATCH] Do not call afs_MarinerLog when afs_mariner is not set When mariner log is not set up (afs_mariner=0), do not call afs_MarinerLog, otherwise a osi_NetSend() to hostaddress=0 is tried, which will give you ICMP messages in the socket error queue. Do not call afs_AddMarinerName, when afs_mariner is not set. Change-Id: I1ed6369fb0eea130348f4f6fd37bb0d021c4c791 Reviewed-on: http://gerrit.openafs.org/8519 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/VNOPS/afs_vnop_create.c | 6 ++++-- src/afs/VNOPS/afs_vnop_lookup.c | 1 - src/afs/VNOPS/afs_vnop_remove.c | 3 ++- src/afs/afs_warn.c | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index 5fe491a99..a2aae52fb 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -486,10 +486,12 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, afs_PutVolume(volp, READ_LOCK); if (code == 0) { - afs_AddMarinerName(aname, *avcp); + if (afs_mariner) + afs_AddMarinerName(aname, *avcp); /* return the new status in vattr */ afs_CopyOutAttrs(*avcp, attrs); - afs_MarinerLog("store$Creating", *avcp); + if (afs_mariner) + afs_MarinerLog("store$Creating", *avcp); } afs_PutFakeStat(&fakestate); diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 1a3605682..7e16e3a22 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -1381,7 +1381,6 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr int pass = 0, hit = 0; int force_eval = afs_fakestat_enable ? 0 : 1; long dirCookie; - extern afs_int32 afs_mariner; /*Writing activity to log? */ afs_hyper_t versionNo; int no_read_access = 0; struct sysname_info sysState; /* used only for @sys checking */ diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index cda6f8e9c..3d6c4022a 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -124,7 +124,8 @@ afsremove(struct vcache *adp, struct dcache *tdc, * call FindVCache instead of GetVCache since if the file's really * gone, we won't be able to fetch the status info anyway. */ if (tvc) { - afs_MarinerLog("store$Removing", tvc); + if (afs_mariner) + afs_MarinerLog("store$Removing", tvc); #ifdef AFS_BOZONLOCK_ENV afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ diff --git a/src/afs/afs_warn.c b/src/afs/afs_warn.c index 58a5920f4..834a84839 100644 --- a/src/afs/afs_warn.c +++ b/src/afs/afs_warn.c @@ -148,7 +148,8 @@ afs_warnuser(char *fmt, ...) /* mariner log the warning */ snprintf(buf, sizeof(buf), "warn$"); vsnprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), fmt, ap); - afs_MarinerLog(buf, NULL); + if (afs_mariner) + afs_MarinerLog(buf, NULL); va_end(ap); va_start(ap, fmt); vprintf(fmt, ap); -- 2.39.5