Skip to content

Commit f3da625

Browse files
fdmananakdave
authored andcommitted
btrfs: remove duplicate system chunk array max size overflow check
We check it twice, once in validate_sys_chunk_array() and then again in its caller, btrfs_validate_super(), right after it calls validate_sys_chunk_array(). So remove the duplicated check from btrfs_validate_super(). Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c4d3008 commit f3da625

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,12 +2545,6 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info,
25452545
* Obvious sys_chunk_array corruptions, it must hold at least one key
25462546
* and one chunk
25472547
*/
2548-
if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
2549-
btrfs_err(fs_info, "system chunk array too big %u > %u",
2550-
btrfs_super_sys_array_size(sb),
2551-
BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
2552-
ret = -EINVAL;
2553-
}
25542548
if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key)
25552549
+ sizeof(struct btrfs_chunk)) {
25562550
btrfs_err(fs_info, "system chunk array too small %u < %zu",

0 commit comments

Comments
 (0)