From: David Howells Date: Wed, 5 Dec 2012 13:34:48 +0000 (+0000) Subject: FS-Cache: Limit the number of I/O error reports for a cache X-Git-Tag: v3.8-rc1~13^2~28^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75bc411388f4aeb9fb0381bd56eb5d67193ed9a1;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 --- diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c index 6a3c48a..b52aed1 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);