]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Do not call afs_MarinerLog when afs_mariner is not set
authorHans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Fri, 21 Dec 2012 08:05:19 +0000 (09:04 +0059)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 9 Jan 2013 18:55:01 +0000 (10:55 -0800)
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.

(cherry picked from commit 41f8d6b9239d8ee1ca786c0485bea4251c96b9e5)

Change-Id: Id9584b07a0d3726fdd2176ac04945f976255e2d4
Reviewed-on: http://gerrit.openafs.org/8801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/afs_warn.c

index edd75a835b7cf1c729b046efe4f1c8ef96af0dd4..f8371e20ce5f8c3693293850da3063a65e962fee 100644 (file)
@@ -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);
index f4f28dac0c6c51c3c6888d4bdf17a3355d153e15..d076a0d35f764c10f5dc16ef5adcdc64da19e04f 100644 (file)
@@ -1384,7 +1384,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 */
index b50f06b27b6e8d98b32732204462b7d64e8d99aa..308f8f39e07dda6c941879e112c1175439154bc2 100644 (file)
@@ -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 */
index 8ec43343b07ec4be633a696bb1ae75152e802bbb..d8bdddc01ecec79577c3eb7635c70b7430ba7591 100644 (file)
@@ -150,7 +150,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);