summaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells2012-12-05 14:34:48 +0100
committerDavid Howells2012-12-20 23:10:44 +0100
commit75bc411388f4aeb9fb0381bd56eb5d67193ed9a1 (patch)
tree78248c99fe37dd24ee22b421e7716e85e65e2ab3 /fs/fscache
parentFS-Cache: Don't mask off the object event mask when printing it (diff)
downloadkernel-qcow2-linux-75bc411388f4aeb9fb0381bd56eb5d67193ed9a1.tar.gz
kernel-qcow2-linux-75bc411388f4aeb9fb0381bd56eb5d67193ed9a1.tar.xz
kernel-qcow2-linux-75bc411388f4aeb9fb0381bd56eb5d67193ed9a1.zip
FS-Cache: Limit the number of I/O error reports for a cache
Limit the number of I/O error reports for a cache to 1 to prevent massive amounts of noise. After the first I/O error the cache is taken off line automatically, so must be restarted to resume caching. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c
index 6a3c48abd677..b52aed1dca97 100644
--- a/fs/fscache/cache.c
+++ b/fs/fscache/cache.c
@@ -314,10 +314,10 @@ EXPORT_SYMBOL(fscache_add_cache);
*/
void fscache_io_error(struct fscache_cache *cache)
{
- set_bit(FSCACHE_IOERROR, &cache->flags);
-
- printk(KERN_ERR "FS-Cache: Cache %s stopped due to I/O error\n",
- cache->ops->name);
+ if (!test_and_set_bit(FSCACHE_IOERROR, &cache->flags))
+ printk(KERN_ERR "FS-Cache:"
+ " Cache '%s' stopped due to I/O error\n",
+ cache->ops->name);
}
EXPORT_SYMBOL(fscache_io_error);