diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c index e24428db..0199bc26 100644 --- a/kernel-shared/volumes.c +++ b/kernel-shared/volumes.c @@ -774,14 +774,13 @@ next: * search_end may be smaller than search_start. */ if (search_end > search_start) { + hole_size = search_end - search_start; if (dev_extent_hole_check(device, &search_start, &hole_size, num_bytes)) { btrfs_release_path(path); goto again; } - hole_size = search_end - search_start; - if (hole_size > max_hole_size) { max_hole_start = search_start; max_hole_size = hole_size;