summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason2008-05-12 19:39:03 +0200
committerChris Mason2008-09-25 17:04:03 +0200
commit1259ab75c62462b8ffad90067b5e1f6312786a18 (patch)
treeccc6b795e524a74b3fb9666409ca2f7f33bf98dd /fs/btrfs/volumes.c
parentBtrfs: Pass down the expected generation number when reading tree blocks (diff)
downloadkernel-qcow2-linux-1259ab75c62462b8ffad90067b5e1f6312786a18.tar.gz
kernel-qcow2-linux-1259ab75c62462b8ffad90067b5e1f6312786a18.tar.xz
kernel-qcow2-linux-1259ab75c62462b8ffad90067b5e1f6312786a18.zip
Btrfs: Handle write errors on raid1 and raid10
When duplicate copies exist, writes are allowed to fail to one of those copies. This changeset includes a few changes that allow the FS to continue even when some IOs fail. It also adds verification of the parent generation number for btree blocks. This generation is stored in the pointer to a block, and it ensures that missed writes to are detected. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b5d7bd1915b4..5fc7fb481474 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1807,14 +1807,19 @@ static int end_bio_multi_stripe(struct bio *bio,
if (atomic_dec_and_test(&multi->stripes_pending)) {
bio->bi_private = multi->private;
bio->bi_end_io = multi->end_io;
-
/* only send an error to the higher layers if it is
* beyond the tolerance of the multi-bio
*/
- if (atomic_read(&multi->error) > multi->max_errors)
+ if (atomic_read(&multi->error) > multi->max_errors) {
err = -EIO;
- else
+ } else if (err) {
+ /*
+ * this bio is actually up to date, we didn't
+ * go over the max number of errors
+ */
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
err = 0;
+ }
kfree(multi);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)