diff options
| -rw-r--r-- | fs/buffer.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 9d1da1d314a2..20805db2c987 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -128,19 +128,13 @@ __clear_page_buffers(struct page *page) | |||
| 128 | page_cache_release(page); | 128 | page_cache_release(page); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | |||
| 132 | static int quiet_error(struct buffer_head *bh) | ||
| 133 | { | ||
| 134 | if (!test_bit(BH_Quiet, &bh->b_state) && printk_ratelimit()) | ||
| 135 | return 0; | ||
| 136 | return 1; | ||
| 137 | } | ||
| 138 | |||
| 139 | |||
| 140 | static void buffer_io_error(struct buffer_head *bh, char *msg) | 131 | static void buffer_io_error(struct buffer_head *bh, char *msg) |
| 141 | { | 132 | { |
| 142 | char b[BDEVNAME_SIZE]; | 133 | char b[BDEVNAME_SIZE]; |
| 143 | printk(KERN_ERR "Buffer I/O error on dev %s, logical block %llu%s\n", | 134 | |
| 135 | if (!test_bit(BH_Quiet, &bh->b_state)) | ||
| 136 | printk_ratelimited(KERN_ERR | ||
| 137 | "Buffer I/O error on dev %s, logical block %llu%s\n", | ||
| 144 | bdevname(bh->b_bdev, b), | 138 | bdevname(bh->b_bdev, b), |
| 145 | (unsigned long long)bh->b_blocknr, msg); | 139 | (unsigned long long)bh->b_blocknr, msg); |
| 146 | } | 140 | } |
| @@ -180,8 +174,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate) | |||
| 180 | if (uptodate) { | 174 | if (uptodate) { |
| 181 | set_buffer_uptodate(bh); | 175 | set_buffer_uptodate(bh); |
| 182 | } else { | 176 | } else { |
| 183 | if (!quiet_error(bh)) | 177 | buffer_io_error(bh, ", lost sync page write"); |
| 184 | buffer_io_error(bh, ", lost sync page write"); | ||
| 185 | set_buffer_write_io_error(bh); | 178 | set_buffer_write_io_error(bh); |
| 186 | clear_buffer_uptodate(bh); | 179 | clear_buffer_uptodate(bh); |
| 187 | } | 180 | } |
| @@ -298,8 +291,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
| 298 | set_buffer_uptodate(bh); | 291 | set_buffer_uptodate(bh); |
| 299 | } else { | 292 | } else { |
| 300 | clear_buffer_uptodate(bh); | 293 | clear_buffer_uptodate(bh); |
| 301 | if (!quiet_error(bh)) | 294 | buffer_io_error(bh, ", async page read"); |
| 302 | buffer_io_error(bh, ", async page read"); | ||
| 303 | SetPageError(page); | 295 | SetPageError(page); |
| 304 | } | 296 | } |
| 305 | 297 | ||
| @@ -358,8 +350,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) | |||
| 358 | if (uptodate) { | 350 | if (uptodate) { |
| 359 | set_buffer_uptodate(bh); | 351 | set_buffer_uptodate(bh); |
| 360 | } else { | 352 | } else { |
| 361 | if (!quiet_error(bh)) | 353 | buffer_io_error(bh, ", lost async page write"); |
| 362 | buffer_io_error(bh, ", lost async page write"); | ||
| 363 | set_bit(AS_EIO, &page->mapping->flags); | 354 | set_bit(AS_EIO, &page->mapping->flags); |
| 364 | set_buffer_write_io_error(bh); | 355 | set_buffer_write_io_error(bh); |
| 365 | clear_buffer_uptodate(bh); | 356 | clear_buffer_uptodate(bh); |
