| To: | Eric Sandeen <sandeen@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc |
| From: | Brian Foster <bfoster@xxxxxxxxxx> |
| Date: | Tue, 7 Apr 2015 09:37:19 -0400 |
| Cc: | xfs-oss <xfs@xxxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <5522C22E.4000107@xxxxxxxxxx> |
| References: | <5522C22E.4000107@xxxxxxxxxx> |
| User-agent: | Mutt/1.5.23 (2014-03-12) |
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@xxxxxxxxxx>
> ---
Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>
>
> 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@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Paper Cone Special in Chemical Fiber, Sales.199@xxxxxxxxxxxxxxxxx |
|---|---|
| Next by Date: | Re: [PATCH] xfs_db: disallow sb UUID write on v5 filesystems, Brian Foster |
| Previous by Thread: | [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc, Eric Sandeen |
| Next by Thread: | Re: [PATCH 4/8] xfs: add DAX block zeroing support, Brian Foster |
| Indexes: | [Date] [Thread] [Top] [All Lists] |