Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123283
b: refs/heads/master
c: 08bafc0
h: refs/heads/master
i:
  123281: 26975c0
  123279: f9d43cd
v: v3
  • Loading branch information
Keith Mannthey authored and Jens Axboe committed Dec 29, 2008
1 parent 6f6840e commit 483ca70
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c239517d9f18427fc2e7ed259fb3b866595f5af
refs/heads/master: 08bafc0341f2f7920e9045bc32c40299cac8c21b
3 changes: 3 additions & 0 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
nbytes = bio->bi_size;
}

if (unlikely(rq->cmd_flags & REQ_QUIET))
set_bit(BIO_QUIET, &bio->bi_flags);

bio->bi_size -= nbytes;
bio->bi_sector += (nbytes >> 9);

Expand Down
19 changes: 15 additions & 4 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,18 @@ __clear_page_buffers(struct page *page)
page_cache_release(page);
}


static int quiet_error(struct buffer_head *bh)
{
if (!test_bit(BH_Quiet, &bh->b_state) && printk_ratelimit())
return 0;
return 1;
}


static void buffer_io_error(struct buffer_head *bh)
{
char b[BDEVNAME_SIZE];

printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
bdevname(bh->b_bdev, b),
(unsigned long long)bh->b_blocknr);
Expand Down Expand Up @@ -144,7 +152,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate)
if (uptodate) {
set_buffer_uptodate(bh);
} else {
if (!buffer_eopnotsupp(bh) && printk_ratelimit()) {
if (!buffer_eopnotsupp(bh) && !quiet_error(bh)) {
buffer_io_error(bh);
printk(KERN_WARNING "lost page write due to "
"I/O error on %s\n",
Expand Down Expand Up @@ -394,7 +402,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
set_buffer_uptodate(bh);
} else {
clear_buffer_uptodate(bh);
if (printk_ratelimit())
if (!quiet_error(bh))
buffer_io_error(bh);
SetPageError(page);
}
Expand Down Expand Up @@ -455,7 +463,7 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
if (uptodate) {
set_buffer_uptodate(bh);
} else {
if (printk_ratelimit()) {
if (!quiet_error(bh)) {
buffer_io_error(bh);
printk(KERN_WARNING "lost page write due to "
"I/O error on %s\n",
Expand Down Expand Up @@ -2913,6 +2921,9 @@ static void end_bio_bh_io_sync(struct bio *bio, int err)
set_bit(BH_Eopnotsupp, &bh->b_state);
}

if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags)))
set_bit(BH_Quiet, &bh->b_state);

bh->b_end_io(bh, test_bit(BIO_UPTODATE, &bio->bi_flags));
bio_put(bio);
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ struct bio {
#define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */
#define BIO_NULL_MAPPED 9 /* contains invalid user pages */
#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */
#define BIO_QUIET 11 /* Make BIO Quiet */
#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))

/*
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/buffer_head.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum bh_state_bits {
BH_Ordered, /* ordered write */
BH_Eopnotsupp, /* operation not supported (barrier) */
BH_Unwritten, /* Buffer is allocated on disk but not written */
BH_Quiet, /* Buffer Error Prinks to be quiet */

BH_PrivateStart,/* not a state bit, but the first bit available
* for private allocation by other entities
Expand Down

0 comments on commit 483ca70

Please sign in to comment.