]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Reword "cache is full" messages
authorAndrew Deason <adeason@sinenomine.net>
Thu, 13 Dec 2018 18:25:32 +0000 (12:25 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 25 Jan 2019 14:30:26 +0000 (09:30 -0500)
Currently, there are multiple different areas in the code that log a
message that look like this, when we encounter an ENOSPC error when
writing to the cache:

    *** Cache partition is FULL - Decrease cachesize!!! ***

The message is a bit unclear, and doesn't even mention AFS at all.
Reword the message to try to explain a little more what's happening.

Also, since we log the same message in several different places, move
them all to a common function, called afs_WarnENOSPC, so we only need
to change the message in one place.

Reviewed-on: https://gerrit.openafs.org/13410
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d9d9571785dabc5c311111b1263fe0881b0ccda5)

Change-Id: I8e958f2896f5d4503d3a153b52720e8ba3025261
Reviewed-on: https://gerrit.openafs.org/13417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/AIX/osi_file.c
src/afs/HPUX/osi_file.c
src/afs/IRIX/osi_file.c
src/afs/LINUX/osi_file.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_prototypes.h
src/afs/afs_warn.c

index 4bd33711e1a2c1059fe218968671cd0641b9ed8d..d3b66f56962cc831abfb73fbc4d7c2d2ac918583 100644 (file)
@@ -240,8 +240,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        afs_Trace3(afs_iclSetp, CM_TRACE_WRITEFAILED, ICL_TYPE_INT32, asize,
                   ICL_TYPE_INT32, resid, ICL_TYPE_INT32, code);
        if (code == ENOSPC)
-           afs_warnuser
-               ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
+            afs_WarnENOSPC();
        setuerror(code);
        if (code > 0) {
            code = -code;
index a562fd46d01d02491a6a596741f660b579cf74c9..529f0fa1114530fdc14a0fb96e2cbadb9079e4f2 100644 (file)
@@ -207,8 +207,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        afile->offset += code;
     } else {
        if (code == ENOSPC)
-           afs_warnuser
-               ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
+            afs_WarnENOSPC();
        setuerror(code);
        if (code > 0) {
            code = -code;
index 92a366cc880c4f529d1bcd8cf46e763f06577870..92bbf4c5fc1b7a670f76b4d1c28980ab1321aa16 100644 (file)
@@ -191,8 +191,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        afile->offset += code;
     } else {
        if (code == ENOSPC)
-           afs_warnuser
-               ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
+            afs_WarnENOSPC();
        if (code > 0) {
            code = -code;
        }
index fd68b16b382e52b3eaa0881d99bd5365a4dbdbdf..a9693cb6bc7e2843e5eafc8fe3eed760da8e6b5a 100644 (file)
@@ -299,8 +299,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        afile->offset += code;
     } else {
        if (code == ENOSPC)
-           afs_warnuser
-               ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
+            afs_WarnENOSPC();
        if (code > 0) {
            code = -code;
        }
index c7c56dc15cdb3b8353f30b73f9c0acde589547ef..5372af664d2ecfc208277838bf4334560eaaaf11 100644 (file)
@@ -130,8 +130,7 @@ afs_UFSWriteUIO(struct vcache *avc, afs_dcache_id_t *inode, struct uio *tuiop)
 # endif
     AFS_GLOCK();
     if (code == ENOSPC)
-       afs_warnuser
-           ("\n\n\n*** Cache partition is full - decrease cachesize!!! ***\n\n\n");
+        afs_WarnENOSPC();
 #elif defined(AFS_SGI_ENV)
     AFS_GUNLOCK();
     avc->f.states |= CWritingUFS;
index c911e84b367ad99aeac3375b024933158c0df59f..3e2b0b11e70a4ca906cd88fef81873584c181404 100644 (file)
@@ -1045,6 +1045,7 @@ extern void afs_warnuser(char *fmt, ...)
 extern void afs_warnall(char *fmt, ...)
        AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
 #endif
+extern void afs_WarnENOSPC(void);
 
 /* afs_vcache.c */
 extern int VCHash(struct VenusFid *fid);
index 17d3c89be57944ffbd5db49be38647a2d8d67f31..ba0b757ac2ff5879eb8b9f57ed3c3e030a9a1b73 100644 (file)
@@ -254,3 +254,18 @@ afs_warnall(char *fmt, ...)
 # endif /* AFS_LINUX20_ENV */
 }
 #endif /* AFS_AIX_ENV */
+
+/*
+ * Log a warning when we encounter an ENOSPC error when writing to the cache
+ * partition. We should not normally encounter ENOSPC errors, since we limit
+ * our space usage according to the client config, which should be configured
+ * such that we never run out of space.
+ */
+void
+afs_WarnENOSPC(void)
+{
+    afs_warnuser("afs: Cache partition is FULL! This should not happen, and "
+                 "can result in errors in userspace applications. To avoid "
+                 "this, reduce the configured cache size so we do not run out "
+                 "of space.\n");
+}