Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c76edb7 authored by Wang Shilong's avatar Wang Shilong Committed by Chris Mason
Browse files

Btrfs: fix missing skinny metadata check in scrub_stripe()



Check if we support skinny metadata firstly and fix to use
right type to search.

Signed-off-by: default avatarWang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 28e5dd8f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2373,8 +2373,11 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
			scrub_blocked_if_needed(fs_info);
		}

		key.objectid = logical;
		if (btrfs_fs_incompat(fs_info, SKINNY_METADATA))
			key.type = BTRFS_METADATA_ITEM_KEY;
		else
			key.type = BTRFS_EXTENT_ITEM_KEY;
		key.objectid = logical;
		key.offset = (u64)-1;

		ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);