Commit 23d4f616 authored by jinbaohong's avatar jinbaohong Committed by David Sterba
Browse files

btrfs: use READA_FORWARD_ALWAYS for device extent verification



btrfs_verify_dev_extents() iterates through the entire device tree
during mount to verify dev extents against chunks. Since this function
scans the whole tree, READA_FORWARD_ALWAYS is more appropriate than
READA_FORWARD.

While the device tree is typically small (a few hundred KB even for
multi-TB filesystems), using the correct readahead mode for full-tree
iteration is more consistent with the intended usage.

Signed-off-by: default avatarrobbieko <robbieko@synology.com>
Signed-off-by: default avatarjinbaohong <jinbaohong@synology.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4681dbcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8026,7 +8026,7 @@ int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info)
	if (!path)
		return -ENOMEM;

	path->reada = READA_FORWARD;
	path->reada = READA_FORWARD_ALWAYS;
	ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
	if (ret < 0)
		return ret;