linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix an IS_ERR() vs NULL check
@ 2020-10-23 11:22 Dan Carpenter
  2020-12-10 16:04 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-10-23 11:22 UTC (permalink / raw)
  To: Theodore Ts'o, Harshad Shirwadkar
  Cc: Andreas Dilger, linux-ext4, kernel-janitors

The ext4_find_extent() function never returns NULL, it returns error
pointers.

Fixes: 44059e503b03 ("ext4: fast commit recovery path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/ext4/extents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 6b33b9c86b00..a19d0e3a4126 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Fix an IS_ERR() vs NULL check
  2020-10-23 11:22 [PATCH] ext4: Fix an IS_ERR() vs NULL check Dan Carpenter
@ 2020-12-10 16:04 ` Jan Kara
  2020-12-13 16:25   ` Theodore Y. Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2020-12-10 16:04 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Theodore Ts'o, Harshad Shirwadkar, Andreas Dilger,
	linux-ext4, kernel-janitors

On Fri 23-10-20 14:22:32, Dan Carpenter wrote:
> The ext4_find_extent() function never returns NULL, it returns error
> pointers.
> 
> Fixes: 44059e503b03 ("ext4: fast commit recovery path")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

I think this fix has fallen through the cracks? It looks good to me so feel
free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/extents.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 6b33b9c86b00..a19d0e3a4126 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -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;
> -- 
> 2.28.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Fix an IS_ERR() vs NULL check
  2020-12-10 16:04 ` Jan Kara
@ 2020-12-13 16:25   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-12-13 16:25 UTC (permalink / raw)
  To: Jan Kara
  Cc: Dan Carpenter, Harshad Shirwadkar, Andreas Dilger, linux-ext4,
	kernel-janitors

On Thu, Dec 10, 2020 at 05:04:19PM +0100, Jan Kara wrote:
> On Fri 23-10-20 14:22:32, Dan Carpenter wrote:
> > The ext4_find_extent() function never returns NULL, it returns error
> > pointers.
> > 
> > Fixes: 44059e503b03 ("ext4: fast commit recovery path")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> I think this fix has fallen through the cracks? It looks good to me so feel
> free to add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

This had indeed slipped through the cracks.  Thanks for pointing it
out; I've applied it.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-13 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 11:22 [PATCH] ext4: Fix an IS_ERR() vs NULL check Dan Carpenter
2020-12-10 16:04 ` Jan Kara
2020-12-13 16:25   ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).