diff options
| -rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a9f1fc23278b..45c592a7335e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -849,10 +849,7 @@ int find_free_dev_extent(struct btrfs_trans_handle *trans, | |||
| 849 | /* we don't want to overwrite the superblock on the drive, | 849 | /* we don't want to overwrite the superblock on the drive, |
| 850 | * so we make sure to start at an offset of at least 1MB | 850 | * so we make sure to start at an offset of at least 1MB |
| 851 | */ | 851 | */ |
| 852 | search_start = 1024 * 1024; | 852 | search_start = max(root->fs_info->alloc_start, 1024ull * 1024); |
| 853 | |||
| 854 | if (root->fs_info->alloc_start + num_bytes <= search_end) | ||
| 855 | search_start = max(root->fs_info->alloc_start, search_start); | ||
| 856 | 853 | ||
| 857 | max_hole_start = search_start; | 854 | max_hole_start = search_start; |
| 858 | max_hole_size = 0; | 855 | max_hole_size = 0; |
