ext4: Fix an IS_ERR() vs NULL check
Subsystems (2)
PATCH 1/1 ext4: Fix an IS_ERR() vs NULL check
The ext4_find_extent() function never returns NULL, it returns error pointers.
Fixes 44059e503b03 ("ext4: fast commit recovery path")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/ext4/extents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/extents.c +2 -2
@@ -5820,8 +5820,8 @@ int ext4_ext_replay_update_ex(struct inode *inode, ext4_lblk_t start,int ret; path =ext4_find_extent (inode, start,NULL ,0 ); -if (!path) -return -EINVAL ; +if (IS_ERR (path)) +return PTR_ERR (path); ex = path[path->p_depth].p_ext;if (!ex) { ret = -EFSCORRUPTED ;
Signature · 1 line
2.28.0
Quoted 5 lines · Dan Carpenter
The
ext4_find_extent()function never returns NULL, it returns error pointers.Fixes 44059e503b03 ("ext4: fast commit recovery path")Signed-off-by Dan Carpenter <[email protected]>
I think this fix has fallen through the cracks? It looks good to me so feel free to add:
Reviewed-by Jan Kara <[email protected]>
Honza
Quoted 22 lines
--- fs/ext4/extents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ext4/extents.c +2
-2@@ -5820,8 +5820,8 @@ int ext4_ext_replay_update_ex(struct inode *inode, ext4_lblk_t start,int ret; path =ext4_find_extent (inode, start,NULL ,0 ); -if (!path) -return -EINVAL ; +if (IS_ERR (path)) +return PTR_ERR (path); ex = path[path->p_depth].p_ext;if (!ex) { ret = -EFSCORRUPTED ;Signature · 1 line
2.28.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Theodore Y. Ts'o
maintainerQuoted 11 lines · Jan Kara
Quoted 5 lines · Dan Carpenter
The
ext4_find_extent()function never returns NULL, it returns error pointers.Fixes 44059e503b03 ("ext4: fast commit recovery path")Signed-off-by Dan Carpenter <[email protected]>I think this fix has fallen through the cracks? It looks good to me so feel free to add:
Reviewed-by Jan Kara <[email protected]>
This had indeed slipped through the cracks. Thanks for pointing it out; I've applied it.
- Ted