Commit 60f99f6a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ratelimit I/O error printk's

Ratelimit a couple of potentially-stormy printk's in the writeback code.
parent df7e395b
...@@ -189,9 +189,12 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate) ...@@ -189,9 +189,12 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate)
if (uptodate) { if (uptodate) {
set_buffer_uptodate(bh); set_buffer_uptodate(bh);
} else { } else {
buffer_io_error(bh); if (printk_ratelimit()) {
printk(KERN_WARNING "lost page write due to I/O error on %s\n", buffer_io_error(bh);
bdevname(bh->b_bdev, b)); printk(KERN_WARNING "lost page write due to "
"I/O error on %s\n",
bdevname(bh->b_bdev, b));
}
set_buffer_write_io_error(bh); set_buffer_write_io_error(bh);
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
} }
...@@ -572,9 +575,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) ...@@ -572,9 +575,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
if (uptodate) { if (uptodate) {
set_buffer_uptodate(bh); set_buffer_uptodate(bh);
} else { } else {
buffer_io_error(bh); if (printk_ratelimit()) {
printk(KERN_WARNING "lost page write due to I/O error on %s\n", buffer_io_error(bh);
bdevname(bh->b_bdev, b)); printk(KERN_WARNING "lost page write due to "
"I/O error on %s\n",
bdevname(bh->b_bdev, b));
}
set_bit(AS_EIO, &page->mapping->flags); set_bit(AS_EIO, &page->mapping->flags);
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
SetPageError(page); SetPageError(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment