Filipe Manana 1c167b87f4 btrfs: remove unnecessary NULL check for the new inode during rename exchange
At the very end of btrfs_rename_exchange(), in case an error happened, we
are checking if 'new_inode' is NULL, but that is not needed since during a
rename exchange, unlike regular renames, 'new_inode' can never be NULL,
and if it were, we would have a crashed much earlier when we dereference it
multiple times.

So remove the check because it is not necessary and because it is causing
static checkers to emit a warning. I probably introduced the check by
copy-pasting similar code from btrfs_rename(), where 'new_inode' can be
NULL, in commit 86e8aa0e772cab ("Btrfs: unpin logs if rename exchange
operation fails").

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-08-23 13:19:10 +02:00
..
2021-01-24 14:27:20 +01:00
2021-08-23 13:19:09 +02:00
2021-06-22 14:11:57 +02:00
2021-06-22 14:11:57 +02:00
2021-06-22 14:11:57 +02:00
2021-02-09 02:46:07 +01:00
2021-08-23 13:19:09 +02:00
2019-11-18 23:43:44 +01:00
2021-08-23 13:19:09 +02:00
2021-06-22 14:11:57 +02:00
2021-08-23 13:19:09 +02:00
2021-06-22 14:11:57 +02:00
2020-10-07 12:13:17 +02:00
2021-08-23 13:19:09 +02:00
2021-08-23 13:19:09 +02:00
2021-03-05 12:21:14 -08:00