public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc
@ 2015-04-06 17:28 Eric Sandeen
  2015-04-07 13:37 ` Brian Foster
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2015-04-06 17:28 UTC (permalink / raw)
  To: xfs-oss

This code does:

        if (!ialloc_context && !ip)
                return;

        // if !ip here, ialloc_context must be true

        if (ialloc_context) {
                ...
                if (!ip)
                        error = ENOSPC;
                if (error)
                        return error;
                // if !ip in this block we've returned
        }

        // so (!ip) cannot be true here
        if (!ip)
                error = ENOSPC;

(cherry picked this one out of Coverity reports)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/libxfs/util.c b/libxfs/util.c
index 6464a1b..49eb76d 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -700,8 +700,6 @@ libxfs_inode_alloc(
 		if (error)
 			return error;
 	}
-	if (!ip)
-		error = ENOSPC;
 
 	*ipp = ip;
 	return error;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc
  2015-04-06 17:28 [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc Eric Sandeen
@ 2015-04-07 13:37 ` Brian Foster
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2015-04-07 13:37 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Mon, Apr 06, 2015 at 12:28:14PM -0500, Eric Sandeen wrote:
> This code does:
> 
>         if (!ialloc_context && !ip)
>                 return;
> 
>         // if !ip here, ialloc_context must be true
> 
>         if (ialloc_context) {
>                 ...
>                 if (!ip)
>                         error = ENOSPC;
>                 if (error)
>                         return error;
>                 // if !ip in this block we've returned
>         }
> 
>         // so (!ip) cannot be true here
>         if (!ip)
>                 error = ENOSPC;
> 
> (cherry picked this one out of Coverity reports)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/libxfs/util.c b/libxfs/util.c
> index 6464a1b..49eb76d 100644
> --- a/libxfs/util.c
> +++ b/libxfs/util.c
> @@ -700,8 +700,6 @@ libxfs_inode_alloc(
>  		if (error)
>  			return error;
>  	}
> -	if (!ip)
> -		error = ENOSPC;
>  
>  	*ipp = ip;
>  	return error;
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2015-04-07 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06 17:28 [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc Eric Sandeen
2015-04-07 13:37 ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox