aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-12 13:39:03 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit1259ab75c62462b8ffad90067b5e1f6312786a18 (patch)
treeccc6b795e524a74b3fb9666409ca2f7f33bf98dd /fs/btrfs/volumes.c
parentca7a79ad8dbe24669a8ced01f9fc0126b872745d (diff)
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,
1807 if (atomic_dec_and_test(&multi->stripes_pending)) { 1807 if (atomic_dec_and_test(&multi->stripes_pending)) {
1808 bio->bi_private = multi->private; 1808 bio->bi_private = multi->private;
1809 bio->bi_end_io = multi->end_io; 1809 bio->bi_end_io = multi->end_io;
1810
1811 /* only send an error to the higher layers if it is 1810 /* only send an error to the higher layers if it is
1812 * beyond the tolerance of the multi-bio 1811 * beyond the tolerance of the multi-bio
1813 */ 1812 */
1814 if (atomic_read(&multi->error) > multi->max_errors) 1813 if (atomic_read(&multi->error) > multi->max_errors) {
1815 err = -EIO; 1814 err = -EIO;
1816 else 1815 } else if (err) {
1816 /*
1817 * this bio is actually up to date, we didn't
1818 * go over the max number of errors
1819 */
1820 set_bit(BIO_UPTODATE, &bio->bi_flags);
1817 err = 0; 1821 err = 0;
1822 }
1818 kfree(multi); 1823 kfree(multi);
1819 1824
1820#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23) 1825#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)