Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp371243pxk; Fri, 11 Sep 2020 09:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvXVljiNje+eJDTyzRGXhiNMuQSSswywkegXU4j1fbbjxi/xOJ76nrwzJ1xAv9VykMhf80 X-Received: by 2002:a17:906:d11a:: with SMTP id b26mr2629581ejz.191.1599840523516; Fri, 11 Sep 2020 09:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599840523; cv=none; d=google.com; s=arc-20160816; b=WKXmgzhCKB8VKAzBSmWLTxUWim8Wn4t+tOVd9NHP7F6RBn53BhigrYk3W5AbEVuhYf dpNfMiV9r3M7yHCoRso37fUrG8rUcnFoyMvJsvV8I2Tbv5itNuQkeeFSpndUbY9JZwlg 95vIk9WDM9qB4sU+Qe8JEKqFb1QhEPerPzcvzVvCJrs/+JCeQH3yBL5WLyYAI/FGjOh5 7IuCSSjibh7CLOm6ff9JrF5JKGq8gsyNTPFpqF7dT43eDWQQfsi6OzQFHgUCYDKEIOO3 rluNCTxyHD8WH1m97f4NsEV10roYzMlu5SOLRngZYgW+NPHfgTUlNbQPkDft2BoRTOVP ti4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1w3n2CMiZHvxkG6zJpt/AznDLnSWylpcUPu/2eleBX4=; b=sF9HaczLFF0twiGgydaiGbYr+yJMNOTEWxVs8ScX8/THpDKyTh/w/uj6u+lhKtGq5Z ZVJgnxX/raE37p+v6U382ukdxwb7pxbeeI/mOw2dgSWRZ6EOuMTSwwJsua+YPVBj4ewz UrjMGeyP6uMZCvHpv0RExhHzPz0P8tHnlSJ8ZmLPVvlUjhqMBBalqK3yx+KojFz5DpwB i66088L4HLzhrbhED253JWAINi7cWTMY3DXKpSODKj9AbIwW0eExj/VGc2LWrLqCVr3E 3t4rKOxZ5Gf4Cy1YoJ9XSuUe1BAY2WasJ8ZUU+n+0CvZfQCFZvZgwOZSkkSeMnBB5moQ 7xIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="HO5og/R7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si1516026ejx.584.2020.09.11.09.08.20; Fri, 11 Sep 2020 09:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="HO5og/R7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726580AbgIKQFI (ORCPT + 99 others); Fri, 11 Sep 2020 12:05:08 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57166 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbgIKQDx (ORCPT ); Fri, 11 Sep 2020 12:03:53 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08BG0CTU107632; Fri, 11 Sep 2020 16:03:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=1w3n2CMiZHvxkG6zJpt/AznDLnSWylpcUPu/2eleBX4=; b=HO5og/R7qh/342P5DPHI/Og6bfNp5kU5q/MtvwFb1AaBrxH8dxW0km3hZgYba1/BRaGa AG137wdK+nEY0Tj/f/JSDFzZ7+ZVidjVY6QCQ6W/bSC9PwE/zO9iJvSuWzHqxM1o14ba Pi8JubAARLaIvp2na1zX6gvY3V56zbjbbl/vpCrDwpy00MkbaQD0f6Y0p3vyLQhVKU1n ZbhlLSh+jJ9nJeWMePYf0nF95+MGUZ0+wjNxMVPLhWDtC5ze3+V6R0tQW8T4tFr8YozB afZ9PcCiQFHnvBnmfAfqnn0S56aKk2y+i0vdH6hI5Dt/tDEnzJiXQMz5XJvSwiDiZz6t fw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 33c3anf051-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Sep 2020 16:03:49 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08BG1Eba103298; Fri, 11 Sep 2020 16:03:48 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 33cmkdc657-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Sep 2020 16:03:48 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08BG3kbb004122; Fri, 11 Sep 2020 16:03:47 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 11 Sep 2020 09:03:46 -0700 Date: Fri, 11 Sep 2020 09:03:45 -0700 From: "Darrick J. Wong" To: Colin Ian King Cc: linux-xfs@vger.kernel.org, Brian Foster , "linux-kernel@vger.kernel.org" Subject: Re: xfs: support inode btree blockcounts in online repair Message-ID: <20200911160345.GT7955@magnolia> References: <7c612801-682a-0115-2b37-5d21b933960d@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c612801-682a-0115-2b37-5d21b933960d@canonical.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9741 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009110130 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9741 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 priorityscore=1501 clxscore=1011 bulkscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=1 adultscore=0 mlxscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009110130 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11, 2020 at 12:16:33PM +0100, Colin Ian King wrote: > Hi, > > Static analysis with Coverity has detected an issue with the following > commit: > > commit 30deae31eab501f568aadea45cfb3258b9e522f5 > Author: Darrick J. Wong > Date: Wed Aug 26 10:48:50 2020 -0700 > > xfs: support inode btree blockcounts in online repair > > the analysis is as follows: > > 830 cur = xfs_inobt_init_cursor(mp, sc->tp, agi_bp, > sc->sa.agno, > 831 XFS_BTNUM_FINO); xfs_inobt_init_cursor can't return NULL (because we guarantee the allocation cannot fail) so all that really needs to be done here is to remove the pointless error check in lines 832-833. --D > const: At condition error, the value of error must be equal to 0. > dead_error_condition: The condition error cannot be true. > > 832 if (error) > > CID: Logically dead code (DEADCODE)dead_error_line: Execution cannot > reach this statement: goto err;. > > 833 goto err; > > While it is tempting to change the if (error) check to if (cur), the > exit error path uses the errnoeous cur as follows: > > 842 err: > 843 xfs_btree_del_cursor(cur, error); > 844 return error; > > so the error exit path needs some sorting out too.