Skip to content

Commit

Permalink
FS-Cache: Limit the number of I/O error reports for a cache
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dhowells committed Dec 20, 2012
1 parent c2d35bf commit 75bc411
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/fscache/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 75bc411

Please sign in to comment.