aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/disk-io.c18
-rw-r--r--fs/btrfs/extent_io.c13
-rw-r--r--fs/btrfs/volumes.c2
3 files changed, 10 insertions, 23 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index a9ce491d279b..1c7d84aff864 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -214,25 +214,18 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
214 while (1) { 214 while (1) {
215 ret = read_extent_buffer_pages(io_tree, eb, start, 1, 215 ret = read_extent_buffer_pages(io_tree, eb, start, 1,
216 btree_get_extent, mirror_num); 216 btree_get_extent, mirror_num);
217 if (!ret) { 217 if (!ret)
218 if (mirror_num)
219printk("good read %Lu mirror %d total %d\n", eb->start, mirror_num, num_copies);
220 return ret; 218 return ret;
221 } 219
222 num_copies = btrfs_num_copies(&root->fs_info->mapping_tree, 220 num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
223 eb->start, eb->len); 221 eb->start, eb->len);
224printk("failed to read %Lu mirror %d total %d\n", eb->start, mirror_num, num_copies); 222 if (num_copies == 1)
225 if (num_copies == 1) {
226printk("reading %Lu failed only one copy\n", eb->start);
227 return ret; 223 return ret;
228 } 224
229 mirror_num++; 225 mirror_num++;
230 if (mirror_num > num_copies) { 226 if (mirror_num > num_copies)
231printk("bailing at mirror %d of %d\n", mirror_num, num_copies);
232 return ret; 227 return ret;
233 }
234 } 228 }
235printk("read extent buffer page last\n");
236 return -EIO; 229 return -EIO;
237} 230}
238 231
@@ -322,7 +315,6 @@ int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end,
322 btrfs_clear_buffer_defrag(eb); 315 btrfs_clear_buffer_defrag(eb);
323 found_start = btrfs_header_bytenr(eb); 316 found_start = btrfs_header_bytenr(eb);
324 if (found_start != start) { 317 if (found_start != start) {
325printk("bad start on %Lu found %Lu\n", eb->start, found_start);
326 ret = -EIO; 318 ret = -EIO;
327 goto err; 319 goto err;
328 } 320 }
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 2368536629e7..dd403b426ff5 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3003,17 +3003,18 @@ int extent_buffer_uptodate(struct extent_io_tree *tree,
3003 struct extent_buffer *eb) 3003 struct extent_buffer *eb)
3004{ 3004{
3005 int ret = 0; 3005 int ret = 0;
3006 int ret2;
3007 unsigned long num_pages; 3006 unsigned long num_pages;
3008 unsigned long i; 3007 unsigned long i;
3009 struct page *page; 3008 struct page *page;
3010 int pg_uptodate = 1; 3009 int pg_uptodate = 1;
3011 3010
3012 if (eb->flags & EXTENT_UPTODATE) 3011 if (eb->flags & EXTENT_UPTODATE)
3013 ret = 1; 3012 return 1;
3014 3013
3015 ret2 = test_range_bit(tree, eb->start, eb->start + eb->len - 1, 3014 ret = test_range_bit(tree, eb->start, eb->start + eb->len - 1,
3016 EXTENT_UPTODATE, 1); 3015 EXTENT_UPTODATE, 1);
3016 if (ret)
3017 return ret;
3017 3018
3018 num_pages = num_extent_pages(eb->start, eb->len); 3019 num_pages = num_extent_pages(eb->start, eb->len);
3019 for (i = 0; i < num_pages; i++) { 3020 for (i = 0; i < num_pages; i++) {
@@ -3023,11 +3024,7 @@ int extent_buffer_uptodate(struct extent_io_tree *tree,
3023 break; 3024 break;
3024 } 3025 }
3025 } 3026 }
3026 if ((ret || ret2) && !pg_uptodate) { 3027 return pg_uptodate;
3027printk("uptodate error2 eb %Lu ret %d ret2 %d pg_uptodate %d\n", eb->start, ret, ret2, pg_uptodate);
3028 WARN_ON(1);
3029 }
3030 return (ret || ret2);
3031} 3028}
3032EXPORT_SYMBOL(extent_buffer_uptodate); 3029EXPORT_SYMBOL(extent_buffer_uptodate);
3033 3030
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6476ecbf132e..9a7241134560 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1282,7 +1282,6 @@ again:
1282 num_stripes, sub_stripes); 1282 num_stripes, sub_stripes);
1283 1283
1284 index = 0; 1284 index = 0;
1285printk("new chunk type %Lu start %Lu size %Lu\n", type, key.offset, *num_bytes);
1286 while(index < num_stripes) { 1285 while(index < num_stripes) {
1287 struct btrfs_stripe *stripe; 1286 struct btrfs_stripe *stripe;
1288 BUG_ON(list_empty(&private_devs)); 1287 BUG_ON(list_empty(&private_devs));
@@ -1299,7 +1298,6 @@ printk("new chunk type %Lu start %Lu size %Lu\n", type, key.offset, *num_bytes);
1299 BTRFS_FIRST_CHUNK_TREE_OBJECTID, key.offset, 1298 BTRFS_FIRST_CHUNK_TREE_OBJECTID, key.offset,
1300 calc_size, &dev_offset); 1299 calc_size, &dev_offset);
1301 BUG_ON(ret); 1300 BUG_ON(ret);
1302printk("alloc chunk start %Lu size %Lu from dev %Lu type %Lu\n", key.offset, calc_size, device->devid, type);
1303 device->bytes_used += calc_size; 1301 device->bytes_used += calc_size;
1304 ret = btrfs_update_device(trans, device); 1302 ret = btrfs_update_device(trans, device);
1305 BUG_ON(ret); 1303 BUG_ON(ret);