From: Julia Lawall Date: Mon, 27 Jul 2009 17:57:00 +0000 (-0400) Subject: Btrfs: Correct redundant test in add_inode_ref X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=631c07c8d12bcc6ce4a0fbfbd64ea843d78e2b10;p=openwrt%2Fstaging%2Fblogic.git 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: Julia Lawall Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 195606862618..11d0787c6188 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -797,7 +797,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, return -ENOENT; inode = read_one_inode(root, key->objectid); - BUG_ON(!dir); + BUG_ON(!inode); ref_ptr = btrfs_item_ptr_offset(eb, slot); ref_end = ref_ptr + btrfs_item_size_nr(eb, slot);