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

Commit 631c07c8 authored by Julia Lawall's avatar Julia Lawall Committed by Chris Mason
Browse files

Btrfs: Correct redundant test in add_inode_ref

dir has already been tested.  It seems that this test should be on the
recently returned value inode.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/

)

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 9779b72f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -797,7 +797,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
		return -ENOENT;
		return -ENOENT;


	inode = read_one_inode(root, key->objectid);
	inode = read_one_inode(root, key->objectid);
	BUG_ON(!dir);
	BUG_ON(!inode);


	ref_ptr = btrfs_item_ptr_offset(eb, slot);
	ref_ptr = btrfs_item_ptr_offset(eb, slot);
	ref_end = ref_ptr + btrfs_item_size_nr(eb, slot);
	ref_end = ref_ptr + btrfs_item_size_nr(eb, slot);