From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1E0217F63 for ; Tue, 7 Apr 2015 08:37:25 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0D93E3041EC for ; Tue, 7 Apr 2015 06:37:24 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id n7sN3gNIBlseoR3Y (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 07 Apr 2015 06:37:21 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 5580838590E for ; Tue, 7 Apr 2015 13:37:20 +0000 (UTC) Date: Tue, 7 Apr 2015 09:37:19 -0400 From: Brian Foster Subject: Re: [PATCH] xfsprogs: remove unreachable code in libxfs_inode_alloc Message-ID: <20150407133718.GF23208@bfoster.bfoster> References: <5522C22E.4000107@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5522C22E.4000107@redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com 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 > --- Reviewed-by: Brian Foster > > 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