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.
Change-Id: If1c259bd22a382ff56ed29326aa20c86389d06bc
Reviewed-on: https://gerrit.openafs.org/13410
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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;
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;
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;
}
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;
}
# 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;
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);
# 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");
+}