diff options
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 86ecca48c604..3b9fb478b0d1 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1895,13 +1895,11 @@ static int free_io_failure(struct inode *inode, struct io_failure_record *rec, | |||
1895 | if (ret) | 1895 | if (ret) |
1896 | err = ret; | 1896 | err = ret; |
1897 | 1897 | ||
1898 | if (did_repair) { | 1898 | ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start, |
1899 | ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start, | 1899 | rec->start + rec->len - 1, |
1900 | rec->start + rec->len - 1, | 1900 | EXTENT_DAMAGED, GFP_NOFS); |
1901 | EXTENT_DAMAGED, GFP_NOFS); | 1901 | if (ret && !err) |
1902 | if (ret && !err) | 1902 | err = ret; |
1903 | err = ret; | ||
1904 | } | ||
1905 | 1903 | ||
1906 | kfree(rec); | 1904 | kfree(rec); |
1907 | return err; | 1905 | return err; |
@@ -1932,10 +1930,15 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
1932 | u64 map_length = 0; | 1930 | u64 map_length = 0; |
1933 | u64 sector; | 1931 | u64 sector; |
1934 | struct btrfs_bio *bbio = NULL; | 1932 | struct btrfs_bio *bbio = NULL; |
1933 | struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree; | ||
1935 | int ret; | 1934 | int ret; |
1936 | 1935 | ||
1937 | BUG_ON(!mirror_num); | 1936 | BUG_ON(!mirror_num); |
1938 | 1937 | ||
1938 | /* we can't repair anything in raid56 yet */ | ||
1939 | if (btrfs_is_parity_mirror(map_tree, logical, length, mirror_num)) | ||
1940 | return 0; | ||
1941 | |||
1939 | bio = bio_alloc(GFP_NOFS, 1); | 1942 | bio = bio_alloc(GFP_NOFS, 1); |
1940 | if (!bio) | 1943 | if (!bio) |
1941 | return -EIO; | 1944 | return -EIO; |
@@ -2052,6 +2055,7 @@ static int clean_io_failure(u64 start, struct page *page) | |||
2052 | failrec->failed_mirror); | 2055 | failrec->failed_mirror); |
2053 | did_repair = !ret; | 2056 | did_repair = !ret; |
2054 | } | 2057 | } |
2058 | ret = 0; | ||
2055 | } | 2059 | } |
2056 | 2060 | ||
2057 | out: | 2061 | out: |