aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index eeb6733eb9f5..6500f9e23330 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5888,10 +5888,11 @@ int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int op,
5888 mirror_num, need_raid_map); 5888 mirror_num, need_raid_map);
5889} 5889}
5890 5890
5891int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, 5891int btrfs_rmap_block(struct btrfs_fs_info *fs_info,
5892 u64 chunk_start, u64 physical, u64 devid, 5892 u64 chunk_start, u64 physical, u64 devid,
5893 u64 **logical, int *naddrs, int *stripe_len) 5893 u64 **logical, int *naddrs, int *stripe_len)
5894{ 5894{
5895 struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
5895 struct extent_map_tree *em_tree = &map_tree->map_tree; 5896 struct extent_map_tree *em_tree = &map_tree->map_tree;
5896 struct extent_map *em; 5897 struct extent_map *em;
5897 struct map_lookup *map; 5898 struct map_lookup *map;
@@ -5907,13 +5908,13 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
5907 read_unlock(&em_tree->lock); 5908 read_unlock(&em_tree->lock);
5908 5909
5909 if (!em) { 5910 if (!em) {
5910 pr_err("BTRFS: couldn't find em for chunk %Lu\n", 5911 btrfs_err(fs_info, "couldn't find em for chunk %Lu",
5911 chunk_start); 5912 chunk_start);
5912 return -EIO; 5913 return -EIO;
5913 } 5914 }
5914 5915
5915 if (em->start != chunk_start) { 5916 if (em->start != chunk_start) {
5916 pr_err("BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n", 5917 btrfs_err(fs_info, "bad chunk start, em=%Lu, wanted=%Lu",
5917 em->start, chunk_start); 5918 em->start, chunk_start);
5918 free_extent_map(em); 5919 free_extent_map(em);
5919 return -EIO; 5920 return -EIO;
@@ -6118,10 +6119,12 @@ static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio,
6118 6119
6119 rcu_read_lock(); 6120 rcu_read_lock();
6120 name = rcu_dereference(dev->name); 6121 name = rcu_dereference(dev->name);
6121 pr_debug("btrfs_map_bio: rw %d 0x%x, sector=%llu, dev=%lu (%s id %llu), size=%u\n", 6122 btrfs_debug(fs_info,
6122 bio_op(bio), bio->bi_opf, (u64)bio->bi_iter.bi_sector, 6123 "btrfs_map_bio: rw %d 0x%x, sector=%llu, dev=%lu (%s id %llu), size=%u",
6123 (u_long)dev->bdev->bd_dev, name->str, dev->devid, 6124 bio_op(bio), bio->bi_opf,
6124 bio->bi_iter.bi_size); 6125 (u64)bio->bi_iter.bi_sector,
6126 (u_long)dev->bdev->bd_dev, name->str, dev->devid,
6127 bio->bi_iter.bi_size);
6125 rcu_read_unlock(); 6128 rcu_read_unlock();
6126 } 6129 }
6127#endif 6130#endif
@@ -6644,7 +6647,8 @@ static int read_one_dev(struct btrfs_root *root,
6644 6647
6645int btrfs_read_sys_array(struct btrfs_root *root) 6648int btrfs_read_sys_array(struct btrfs_root *root)
6646{ 6649{
6647 struct btrfs_super_block *super_copy = root->fs_info->super_copy; 6650 struct btrfs_fs_info *fs_info = root->fs_info;
6651 struct btrfs_super_block *super_copy = fs_info->super_copy;
6648 struct extent_buffer *sb; 6652 struct extent_buffer *sb;
6649 struct btrfs_disk_key *disk_key; 6653 struct btrfs_disk_key *disk_key;
6650 struct btrfs_chunk *chunk; 6654 struct btrfs_chunk *chunk;
@@ -6715,7 +6719,8 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6715 6719
6716 num_stripes = btrfs_chunk_num_stripes(sb, chunk); 6720 num_stripes = btrfs_chunk_num_stripes(sb, chunk);
6717 if (!num_stripes) { 6721 if (!num_stripes) {
6718 pr_err("BTRFS: invalid number of stripes %u in sys_array at offset %u\n", 6722 btrfs_err(fs_info,
6723 "invalid number of stripes %u in sys_array at offset %u",
6719 num_stripes, cur_offset); 6724 num_stripes, cur_offset);
6720 ret = -EIO; 6725 ret = -EIO;
6721 break; 6726 break;
@@ -6723,7 +6728,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6723 6728
6724 type = btrfs_chunk_type(sb, chunk); 6729 type = btrfs_chunk_type(sb, chunk);
6725 if ((type & BTRFS_BLOCK_GROUP_SYSTEM) == 0) { 6730 if ((type & BTRFS_BLOCK_GROUP_SYSTEM) == 0) {
6726 btrfs_err(root->fs_info, 6731 btrfs_err(fs_info,
6727 "invalid chunk type %llu in sys_array at offset %u", 6732 "invalid chunk type %llu in sys_array at offset %u",
6728 type, cur_offset); 6733 type, cur_offset);
6729 ret = -EIO; 6734 ret = -EIO;
@@ -6738,8 +6743,9 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6738 if (ret) 6743 if (ret)
6739 break; 6744 break;
6740 } else { 6745 } else {
6741 pr_err("BTRFS: unexpected item type %u in sys_array at offset %u\n", 6746 btrfs_err(fs_info,
6742 (u32)key.type, cur_offset); 6747 "unexpected item type %u in sys_array at offset %u",
6748 (u32)key.type, cur_offset);
6743 ret = -EIO; 6749 ret = -EIO;
6744 break; 6750 break;
6745 } 6751 }
@@ -6752,7 +6758,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6752 return ret; 6758 return ret;
6753 6759
6754out_short_read: 6760out_short_read:
6755 pr_err("BTRFS: sys_array too short to read %u bytes at offset %u\n", 6761 btrfs_err(fs_info, "sys_array too short to read %u bytes at offset %u",
6756 len, cur_offset); 6762 len, cur_offset);
6757 clear_extent_buffer_uptodate(sb); 6763 clear_extent_buffer_uptodate(sb);
6758 free_extent_buffer_stale(sb); 6764 free_extent_buffer_stale(sb);