On Sat, May 29, 2010 at 2:45 AM, Dan Carpenter <[email protected]> wrote:
> "old_inode" cannot be null here, because we dereference it
> unconditionally throughout the function.
>
> Signed-off-by: Dan Carpenter <[email protected]>
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index fa6ccc1..0bc29be 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -6487,10 +6487,8 @@ static int btrfs_rename(struct inode *old_dir, struct 
> dentry *old_dentry,
>         * make sure the inode gets flushed if it is replacing
>         * something.
>         */
> -       if (new_inode && new_inode->i_size &&
> -           old_inode && S_ISREG(old_inode->i_mode)) {
> +       if (new_inode && new_inode->i_size && S_ISREG(old_inode->i_mode))
>                btrfs_add_ordered_operation(trans, root, old_inode);
> -       }

I think code like this is here because there are still a lot of
features that are being added to btrfs and it's easier to have the
additional checks than continually adding and removing them as the
code changes.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to