[PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc
Brian Foster
bfoster at redhat.com
Tue Apr 7 08:37:19 CDT 2015
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 at redhat.com>
> ---
Reviewed-by: Brian Foster <bfoster at 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 at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
More information about the xfs
mailing list