Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2764306ybf; Mon, 2 Mar 2020 15:13:35 -0800 (PST) X-Google-Smtp-Source: ADFU+vsrmdsUlqPfAQDPWGy1B/sdItAzfhHEl5fhHvI/2Whqv4DSBKgPxwTAOLaBNimzwzVv8EaY X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr1290232otr.16.1583190815375; Mon, 02 Mar 2020 15:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583190815; cv=none; d=google.com; s=arc-20160816; b=Pht10+n7v85v8Tml4THZBBnNlvlPKmxMw7nspYn7wFCh+yMmvu9k7QF1SUt/MW62q+ +2EMP/YWykDFTfYRmszj1OWC30bn7yqseT4jludsvNrzYuG2FOh1pminB8qf5sPFDXjg ioo0i2U0AGbMyCvb/Pl32aV0PScXObfLM7KnuTcw4yvdytkZPBM7RhXNKSaOkj0oT4rI J7Tj/U9KiEdKfDZuVaTth8vZp5bh1i/IHlQ2wtJ+aU6wZiDj9zmnsomedfm8wjjCFUGF L7Av81hUYJ4XArVDYx8QFdUe+wbtEJRvS/3iHyus0nGaIshdpFTi36z9unpTj54B9Q5D Gb4g== 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:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PGCq0Yxy6j7pG4Hgd2v0OpuTunQST9E5OQ5veDQNTCg=; b=rMb++bsHSQZYM9mgf45A7peg+QUUBrn6LVths5BUinY+XQGKn+KNmu6QZT9HikvIXj gJqDcAwZWJgclcUmsiXbH0HG1dnJbq+o5fk9w84cOiL1k3thyVjRJbsc2RveGA4QtSaZ ib1FR7q7xljN/Cmir6nLXLaowVbJ6+gN06IYuULlVDa/Fek/HsUvzlwVVAr23X7cgwb+ RzbMumVZ9v07FmQHzYUUS0kZY1MHPmcKm9ryuOeJJgSr4n9ZileFKSK8q7ltXLbd/hfS tsWig9q9oTs0rjUmKPlcEmJ7lfS13ttyVb0RfJxO3fXQVjHpVpjQegsazmr/g0F33ovg qAUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=KrHXnZUY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j36si7111347ota.58.2020.03.02.15.13.09; Mon, 02 Mar 2020 15:13:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=KrHXnZUY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbgCBXMv (ORCPT + 99 others); Mon, 2 Mar 2020 18:12:51 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34082 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbgCBXMv (ORCPT ); Mon, 2 Mar 2020 18:12:51 -0500 Received: by mail-pg1-f194.google.com with SMTP id t3so570615pgn.1 for ; Mon, 02 Mar 2020 15:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PGCq0Yxy6j7pG4Hgd2v0OpuTunQST9E5OQ5veDQNTCg=; b=KrHXnZUYAhKGPwUXQ7QATo42DDOE+114Ge1Ieb8g15n1qqbGcfEQwltwgTA1D+lH4i qfQy1RhrgyxdN+HTFUf3qDSoXHXfu8vYjFhMoDhQMxk+YqtkRWevbLTtfzKzomvfD0YB C4X5GhQz/J7LzuG7cXtkEwTxChsQQOsT2S8I5VMuV3v6PRduAmACWb2VicfhPJw3Revt YFl82Ix73WEG5QlH/JbydfuKSEd/fTMpVQg5FCC6hhq478J28Uy34XkiG7Bpf90cOOll ySatTnIc6JtVrvtvOJilc7o8YsGC/x30Ee3su3mO/6r1+5fbQdoCcZlS6ou+gup3KZ91 VSyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PGCq0Yxy6j7pG4Hgd2v0OpuTunQST9E5OQ5veDQNTCg=; b=QeL+IFMCE7Doau7rBhC+cM4EZ+Jv32Di97eJdJpVRt2G/cEOyHAfWTbniyhHWcfI8O lF7Xip8A1W3CbpMTGnXHtwioX12JTVAYipZaBOFJIdYTZpXb5d1bPjqaPYpljamyTYNb jybbpVOGY0nQ0FQA1XkZBJJ9IAOGiUOHdi2v2YIl06l80DEpmZvVyfNAWeg2R8eZr2hj CmXZ47h6G66RSpWpQLf1VMfZku6ihHo36JTXQYSp7XJG1Uk1uoXLH8jeKksxfMddMhWj SxrYO/3x5O85ZVc1b5d1GTZKQ6ZdWo9vq6epDsKxN4gSHGwK5gAQFcUZNiLxXL8O7ByK WI4w== X-Gm-Message-State: ANhLgQ3JM25N16KUB/KSXuZ9fKWvkrdwVvjIT2xABUQz3vlKa/cOq5dE F5UsjWnGcSdq25/rNwQcVv8r9Q== X-Received: by 2002:a63:aa07:: with SMTP id e7mr1193941pgf.90.1583190770018; Mon, 02 Mar 2020 15:12:50 -0800 (PST) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id k5sm6476833pfp.66.2020.03.02.15.12.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2020 15:12:49 -0800 (PST) Subject: Re: [PATCH -next] io_uring: Ensure mask is initialized in io_arm_poll_handler To: Nathan Chancellor Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <20200302230118.12060-1-natechancellor@gmail.com> From: Jens Axboe Message-ID: Date: Mon, 2 Mar 2020 16:12:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200302230118.12060-1-natechancellor@gmail.com> 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 On 3/2/20 4:01 PM, Nathan Chancellor wrote: > Clang warns: > > fs/io_uring.c:4178:6: warning: variable 'mask' is used uninitialized > whenever 'if' condition is false [-Wsometimes-uninitialized] > if (def->pollin) > ^~~~~~~~~~~ > fs/io_uring.c:4182:2: note: uninitialized use occurs here > mask |= POLLERR | POLLPRI; > ^~~~ > fs/io_uring.c:4178:2: note: remove the 'if' if its condition is always > true > if (def->pollin) > ^~~~~~~~~~~~~~~~ > fs/io_uring.c:4154:15: note: initialize the variable 'mask' to silence > this warning > __poll_t mask, ret; > ^ > = 0 > 1 warning generated. > > io_op_defs has many definitions where pollin is not set so mask indeed > might be uninitialized. Initialize it to zero and change the next > assignment to |=, in case further masks are added in the future to avoid > missing changing the assignment then. > > Fixes: d7718a9d25a6 ("io_uring: use poll driven retry for files that support it") > Link: https://github.com/ClangBuiltLinux/linux/issues/916 > Signed-off-by: Nathan Chancellor > --- > > I noticed that for-next has been force pushed; if you want to squash > this into the commit that it fixes (or fix it in a different way), feel > free. Great thanks, applied. I wonder why gcc doesn't warn about that... -- Jens Axboe