aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <mason@suse.com>2004-08-22 22:38:24 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:38:24 -0700
commitd16b94fe079f79cb9a268a2fb9576a84c562d4e3 (patch)
treefd87566198a4295ad9d9562bce07a101f4906d8b /fs
parenta88cff7fcf8532decbbec25aaf0ba57e97d98227 (diff)
downloadhistory-d16b94fe079f79cb9a268a2fb9576a84c562d4e3.tar.gz
[PATCH] add BH_Eopnotsupp for testing async barrier failures
In order for filesystems to detect asynchronous ordered write failures for buffers sent via submit_bh, they need a bit they can test for in the buffer head. This adds BH_Eopnotsupp and the related buffer operations end_buffer_write_sync is changed to avoid a printk for BH_Eoptnotsupp related failures, since the FS is responsible for a retry. sync_dirty_buffer is changed to test for BH_Eopnotsupp and return -EOPNOTSUPP to the caller Some of this came from Jens Axboe Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index e2fdba6182a673..9234e587eaaa58 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -213,7 +213,7 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate)
if (uptodate) {
set_buffer_uptodate(bh);
} else {
- if (printk_ratelimit()) {
+ if (!buffer_eopnotsupp(bh) && printk_ratelimit()) {
buffer_io_error(bh);
printk(KERN_WARNING "lost page write due to "
"I/O error on %s\n",
@@ -2756,8 +2756,10 @@ static int end_bio_bh_io_sync(struct bio *bio, unsigned int bytes_done, int err)
if (bio->bi_size)
return 1;
- if (err == -EOPNOTSUPP)
+ if (err == -EOPNOTSUPP) {
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
+ set_bit(BH_Eopnotsupp, &bh->b_state);
+ }
bh->b_end_io(bh, test_bit(BIO_UPTODATE, &bio->bi_flags));
bio_put(bio);
@@ -2882,6 +2884,10 @@ int sync_dirty_buffer(struct buffer_head *bh)
bh->b_end_io = end_buffer_write_sync;
ret = submit_bh(WRITE, bh);
wait_on_buffer(bh);
+ if (buffer_eopnotsupp(bh)) {
+ clear_buffer_eopnotsupp(bh);
+ ret = -EOPNOTSUPP;
+ }
if (!ret && !buffer_uptodate(bh))
ret = -EIO;
} else {