Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1944504ybn; Thu, 26 Sep 2019 04:44:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxITY3Eo2/3/FaSMkco85smbqnVgkpUDE5ux3VwRi7IiF8iWnpEm6JMFNNybdBKZgldM/2i X-Received: by 2002:a17:906:1659:: with SMTP id n25mr2692256ejd.258.1569498262514; Thu, 26 Sep 2019 04:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569498262; cv=none; d=google.com; s=arc-20160816; b=F84bNRJBJcMqYxmgM2bJzJzGapVY6hT1CXPTHyANrw5LA16PeC7WWYAoyu3po+aZJE onF+fGcivU4G+hXuruXjePxEyflLLakvTFvZP8ot9dUpT1v2PL9EjdnYdXEhBl5qxyCm eRRluNQC+pjKWWxnaDWo98JjaEee2Gti720QZjMn/2/02r48glqzqSFNK8qbmCoOvbM4 cBsXWAODQaUqW3wJbb/iiSMCCS2lISjsOnepah6h2wK+izf7ioUorR2FKQAYMKtKIkcy aOJ3FTs5xsWMIrtBMXhTQWzUePfbW8f2EQqNBOvtfGlve0HIro0ouyC3SXcErkaYQ+HQ rPSQ== 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=xonFLYW+K9R2/V+E4nxIJtaZUYsUbdcdHfLF2kKtcoo=; b=QthNpKyb3bWNcdgGdrwAF7Kf/n+YEHYycE9j44KIqhoMNbD+YPnBV3uQg8O3gTI1zx YI+WAFdzjfuLem7N88JbsFrDmQmgfw6XPSyqwlNCGYf2umkBmwS2F/voMkr8pWt3XAbN gORIVtMmeKxeK2FuBUwQpM0Y1jHF9EBIYXUzdvEmcSg9DtV8pXKzbzV3uSd6a2Km6Agf jz23SXgA4QiIGE9DVPlg1KdauP7hNSM5yNfg51sttfq1xQcLyMy0B1rZgxMYg5DJfC1H 15iF9GpV4o/JCRwaWVzwVlIagjfmWPjJSMuBLezgCteDbuFvQmU7tXYLUdJzdSkOrVK/ +uaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=Ps5n17nT; 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 e1si1214812ede.268.2019.09.26.04.43.58; Thu, 26 Sep 2019 04:44:22 -0700 (PDT) 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=Ps5n17nT; 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 S1726170AbfIZLmM (ORCPT + 99 others); Thu, 26 Sep 2019 07:42:12 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53569 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfIZLmL (ORCPT ); Thu, 26 Sep 2019 07:42:11 -0400 Received: by mail-wm1-f66.google.com with SMTP id i16so2369974wmd.3 for ; Thu, 26 Sep 2019 04:42:11 -0700 (PDT) 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=xonFLYW+K9R2/V+E4nxIJtaZUYsUbdcdHfLF2kKtcoo=; b=Ps5n17nT4qWciZsC9oJ6IGnJHFHbWG4ZlXnBU/vo5CoFtTTcFz1daOUpKD/ipU4JTw ihs76iwMZ80RxUQMFVHFi5rvs5M1rcujs9NFUDyQiF6XVkF7SXmgG5B5WQ8wviB0n/0h viAE+GuDsrSXXAsyoxOa/u6wTXedWKEzGWG5iTpCje/HyXMDQP1QKsdJjeT8SaTNVvM9 i5p1PVAP4pUIcDVmmC2qPUG+ZcG/GbmHpma7NTM9SxfdP5B5FUU7xlF/mHrARsTiCPop zVz4CSRj4Q1mP/877rHOBVyN5jMUa4ylMJrwXwyxxRAIiR9nZ+CFHeifrJsIveeE+ygL 45Qw== 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=xonFLYW+K9R2/V+E4nxIJtaZUYsUbdcdHfLF2kKtcoo=; b=KUcaiqKCbb39nKe4LGwf45b/4Y4sX2HPLG2Nf8lmEji8v1sFtGTI7PYAf+VquQk4hT 8c3g/OiDS0ArQgmIOABIjBHaaE+pQsdFaRpE/9vhsn8yJrIOg1eoOoo9t6Eis1POmGO6 R2x33VYkmsaDruSA5I1RP8q8h4leaRCC+yIWJM1y4X+BiQxxaDtkFfHAhoBik6JqJD6P hZ9K7c91rnXKYEr2UZLYLGv7IfM3urMQhZ9anzvp3PvWR3I2lHegittqxZwnm94kDpnr qISDG76tyaJsXiwkX31oa4ljn9eczqGyGvtLEYKdZulFflilBHx5R0025vRUtHEaRToC P0jQ== X-Gm-Message-State: APjAAAVkrUCHB/Wv1JIRhtxHew+A9IGVsTb4uozyMBWYt9a5kN7A9iDI OOGMG52MEYhci+jZFfVZ1aWNVnPbeN8WaRkG X-Received: by 2002:a1c:1981:: with SMTP id 123mr2593496wmz.88.1569498129864; Thu, 26 Sep 2019 04:42:09 -0700 (PDT) Received: from [192.168.1.145] ([65.39.69.237]) by smtp.gmail.com with ESMTPSA id s12sm5719744wra.82.2019.09.26.04.42.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2019 04:42:09 -0700 (PDT) Subject: Re: [PATCH][next] io_uring: ensure variable ret is initialized to zero To: Dan Carpenter Cc: Colin King , Alexander Viro , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190926095012.31826-1-colin.king@canonical.com> <3aa821ea-3041-fb56-2458-ec643963c511@kernel.dk> <20190926113329.GE27389@kadam> From: Jens Axboe Message-ID: <04262621-68fd-a4bb-ab0c-83954c03fbb0@kernel.dk> Date: Thu, 26 Sep 2019 13:42:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190926113329.GE27389@kadam> 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 9/26/19 1:33 PM, Dan Carpenter wrote: > On Thu, Sep 26, 2019 at 11:56:30AM +0200, Jens Axboe wrote: >> On 9/26/19 11:50 AM, Colin King wrote: >>> From: Colin Ian King >>> >>> In the case where sig is NULL the error variable ret is not initialized >>> and may contain a garbage value on the final checks to see if ret is >>> -ERESTARTSYS. Best to initialize ret to zero before the do loop to >>> ensure the ret does not accidentially contain -ERESTARTSYS before the >>> loop. >> >> Oops, weird it didn't complain. I've folded in this fix, as that commit >> isn't upstream yet. Thanks! > > There is a bug in GCC where at certain optimization levels, instead of > complaining, it initializes it to zero. That's awfully nice of it ;-) Tried with -O0 and still didn't complain for me. $ gcc --version gcc (Ubuntu 9.1.0-2ubuntu2~18.04) 9.1.0 Tried gcc 5/6/7/8 as well. Might have to go look at what code it's generating. -- Jens Axboe