summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-08-25 17:30:34 +0200
committerDavid Sterba <dsterba@suse.com>2017-09-08 16:15:05 +0200
commitd1b968dcbad59a304fafbf62b859e0692287a2f8 (patch)
treea871134238196f6c33999784cecd9672abee0fbe
parent819a496dede9d4dd5c76fddbfb591aa9590e519e (diff)
btrfs-progs: drop redundant check of blocksize in read_tree_block
The tree blocks are supposed to be always of nodesize. Before the parameter has been dropped, it was unlikely but possible to pass a misaligned value. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--disk-io.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/disk-io.c b/disk-io.c
index 1ea2ac90..6bb1b935 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -307,7 +307,6 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
u64 best_transid = 0;
u32 sectorsize = fs_info->sectorsize;
u32 nodesize = fs_info->nodesize;
- u32 blocksize = fs_info->nodesize;
int mirror_num = 0;
int good_mirror = 0;
int num_copies;
@@ -324,13 +323,8 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
bytenr, sectorsize);
return ERR_PTR(-EIO);
}
- if (blocksize < nodesize || !IS_ALIGNED(blocksize, nodesize)) {
- error("tree block size %u is not aligned to nodesize %u",
- blocksize, nodesize);
- return ERR_PTR(-EIO);
- }
- eb = btrfs_find_create_tree_block(fs_info, bytenr, blocksize);
+ eb = btrfs_find_create_tree_block(fs_info, bytenr, nodesize);
if (!eb)
return ERR_PTR(-ENOMEM);