Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1471639pxu; Thu, 8 Oct 2020 12:17:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2kEG+0dDD5kXdnab7pUTZogWSDVLI767En8fxWXTZh6ilf0LhHy4LhciiUEQUEY/5StuT X-Received: by 2002:aa7:d449:: with SMTP id q9mr3011584edr.321.1602184641572; Thu, 08 Oct 2020 12:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602184641; cv=none; d=google.com; s=arc-20160816; b=aWqZrEJKXu8ur0WUTPkIAn2zNsGKC9D7Nj9CCOnOUY7wy/e+u1SMW/yvZ72O+vWrBh +py3Dj+vvxDZ4+BbdPrwt4+zGMHERWrxq63fdHSdgZpx/C0NstOzkyHD7D/3EttBJvPE lETk3qzvDjVMgii+XxLnW/lhyR2CZMOAf+TdwuAsg2/DAsXjsXEw2FZrSZUtOZ423jJp V1Lb9RHCDKZEUtWdGwE61f6iD7E76WXmjWFNVE7GlYLejhYsdSi5+5o8uLXpOovCqMBh pr/AJBx54D26lsBtJt3klehTLc5S+C/G35uUdNruDwF6xNWw8O/ulPpil8JRAi3PtHOq aCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=go/mQinsir2ZKF5yFd6HEjWhDN+qTAPq9d3DUGWHHLk=; b=bLlxvPcSIB0tGXH96g7aP6jgRxJQKDepc8RyhUuU/UnawCKqBI51KQ4o/KcNSh8cYA BQSW1Z6tUBMRGB+QrN4YOZJxRyTopxy60W4vdno6x1eJE2EyvnNKKxcGEZ/yuTegfqNY 13rrjqfeLv4WMSC5aiO+/lqGWfidPPwknFkcnfe86IQwobkCtPYDfn+bCriwYHmhUHnJ 9hEy6Z9gufol8xueqjfbyAOHQySZ04tzgvtmBffwApWvq0lwhN/R4nM6ma9nGbnoU69G zylfqQp6TsEGIBvt0Q5kIWYSxp+R+9WG15631BF1EEDhx/rLeSCgSRWeWa8pRItW4RmP T4Zg== 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 y22si4424903ejf.306.2020.10.08.12.16.58; Thu, 08 Oct 2020 12:17:21 -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 S1728790AbgJHSX5 (ORCPT + 99 others); Thu, 8 Oct 2020 14:23:57 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37296 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbgJHSX5 (ORCPT ); Thu, 8 Oct 2020 14:23:57 -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 1kQaa3-0003dS-IM; Thu, 08 Oct 2020 18:23:55 +0000 To: Jens Axboe Cc: Alexander Viro , linux-fsdevel , io-uring@vger.kernel.org, "linux-kernel@vger.kernel.org" From: Colin Ian King Subject: re: io_uring: process task work in io_uring_register() Message-ID: Date: Thu, 8 Oct 2020 19:23:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Static analysis with Coverity has detected a "dead-code" issue with the following commit: commit af9c1a44f8dee7a958e07977f24ba40e3c770987 Author: Jens Axboe Date: Thu Sep 24 13:32:18 2020 -0600 io_uring: process task work in io_uring_register() The analysis is as follows: 9513 do { 9514 ret = wait_for_completion_interruptible(&ctx->ref_comp); cond_const: Condition ret, taking false branch. Now the value of ret is equal to 0. 9515 if (!ret) 9516 break; 9517 if (io_run_task_work_sig() > 0) 9518 continue; 9519 } while (1); 9520 9521 mutex_lock(&ctx->uring_lock); 9522 const: At condition ret, the value of ret must be equal to 0. dead_error_condition: The condition ret cannot be true. 9523 if (ret) { Logically dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: 9524 percpu_ref_resurrect(&ctx->refs); 9525 ret = -EINTR; 9526 goto out_quiesce; 9527 } 9528 } 9529 Colin