Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp191187pxk; Fri, 11 Sep 2020 04:19:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3L2BxZwp7d8VmEbJWUnjq7P0+AqK7nKgeERrN9pmT29RwO18lpxk/cWkH/hsDJBD//xQS X-Received: by 2002:a17:906:2a04:: with SMTP id j4mr1641438eje.440.1599823148953; Fri, 11 Sep 2020 04:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599823148; cv=none; d=google.com; s=arc-20160816; b=GSValshoELYy+QYkhYfGMLi0/mVwPVRHgy6/FVDRkXfqr86RlCFN5z02TjGn4ramWW uvbT87MqmpsP8A+alyKMvGkZVLPVjFopVjW9rFtr+zIoceKImV7h1P+Q2qaKvj8nsBCa xWjRh0S0vEGUR3jGWsGjGFVGq7vCtwljq6HWZl8ul59InU+cIzdWJ/M9jSSXcA0YIKvg 9856R/AllTUkVGkRZMiyBQ4VeoW0iQOU7oB8IvzKB0khGz6OqNC4x202VoL/w4vtQD0E WZHKdOscZSEQNm6FrSKC5lNP9YaFjm0Ck72YkAAlyyYt6uRMxSm65xk7WX5CP6BBd64n piuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:cc:subject :to:from; bh=D212a0R+lm2txm8e/ZGr6O/AH8HcHhx4Bzy8v+fi7yQ=; b=q9XfOVhuiVj5j8XbG66I093qpFXVn95oLoFpNpexm7WyaXJa3Pp3gBKya+N3bREwYk g2qoS/nhxznlvSYn3YV1yQa17QnKoZ0/3c8oxhfU3YmPnT6107+cK9egwYfXOg5jnXh1 +jm2JB0aS/+wBUdt0X7Q3cSelVISsEvtjqgfwif/FbR1JD9KunFpXJRCZ+0IPSySqZ5f 3AUcu9g+ha5OW5zz2vrflWzu0aFgd6MJRS+CmIBag7Ug1nld1BMOALgtfq10Tn57+v4h ANVUIOvmyXqqwnWOsdgPHkrPPmo95xGg6Bek1n94Efvgr7OUnEM+wkCeyO//cc4npdX2 z1gA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si1241982edx.134.2020.09.11.04.18.45; Fri, 11 Sep 2020 04:19:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725777AbgIKLR3 (ORCPT + 99 others); Fri, 11 Sep 2020 07:17:29 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38045 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725833AbgIKLQg (ORCPT ); Fri, 11 Sep 2020 07:16:36 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kGh2g-0007mi-2D; Fri, 11 Sep 2020 11:16:34 +0000 From: Colin Ian King To: "Darrick J. Wong" , linux-xfs@vger.kernel.org, Brian Foster Subject: re: xfs: support inode btree blockcounts in online repair Cc: "linux-kernel@vger.kernel.org" Message-ID: <7c612801-682a-0115-2b37-5d21b933960d@canonical.com> Date: Fri, 11 Sep 2020 12:16:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); 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.