Commit e92c2941 authored by Dan Carpenter's avatar Dan Carpenter Committed by David Sterba
Browse files

btrfs: tree-checker: fix bounds check in check_inode_extref()



The parentheses for the unlikely() annotation were put in the wrong
place so it means that the condition is basically never true and the
bounds checking is skipped.

Fixes: aab9458b ("btrfs: tree-checker: add inode extref checks")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent fec9b9d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1797,7 +1797,7 @@ static int check_inode_extref(struct extent_buffer *leaf,
		struct btrfs_inode_extref *extref = (struct btrfs_inode_extref *)ptr;
		u16 namelen;

		if (unlikely(ptr + sizeof(*extref)) > end) {
		if (unlikely(ptr + sizeof(*extref) > end)) {
			inode_ref_err(leaf, slot,
			"inode extref overflow, ptr %lu end %lu inode_extref size %zu",
				      ptr, end, sizeof(*extref));