ext4: use IS_ERR instead of IS_ERR_OR_NULL and set inode null when IS_ERR
authorYi Li <yili@winhong.com>
Wed, 30 Dec 2020 03:38:27 +0000 (11:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:19 +0000 (18:27 +0100)
commit6c557cb1f9d786e129c5af9dd42f527846206348
tree38d328b42d22a15819acb94355e901261db1b587
parentfcae2beac981fecf4cab89da37abe328a8e6e16f
ext4: use IS_ERR instead of IS_ERR_OR_NULL and set inode null when IS_ERR

commit 23dd561ad9eae02b4d51bb502fe4e1a0666e9567 upstream.

1: ext4_iget/ext4_find_extent never returns NULL, use IS_ERR
instead of IS_ERR_OR_NULL to fix this.

2: ext4_fc_replay_inode should set the inode to NULL when IS_ERR.
and go to call iput properly.

Fixes: 8016e29f4362 ("ext4: fast commit recovery path")
Signed-off-by: Yi Li <yili@winhong.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20201230033827.3996064-1-yili@winhong.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/fast_commit.c