Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4867591imc; Mon, 25 Feb 2019 12:35:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWdEQYCXvf6KKWNCaGUBDIIYRybHnt4oYSmr/j3wpKovn7N91iDJSeA8yemYK3vKIIAeAl X-Received: by 2002:a63:ec48:: with SMTP id r8mr20818274pgj.50.1551126940620; Mon, 25 Feb 2019 12:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551126940; cv=none; d=google.com; s=arc-20160816; b=XSy7g3QP/TVPBbp6g+BNQMRfCqR+cpWaX4cFziaCoXZgP5GpsFiazrEco9QzxVSCAa p/pC32FZTz8uRR/gG42akDx0kzMHOjIJJr6MLKbZWwHI0hUDPtiRIxV10xp8Jx8wFaVk 0NUg1Ih8nNZoDxfyYXcLs6nKyfPwi0BFQiF9B3hMmoi/pMFYiCrU2FIFocaaQxRXxNJe nD2Dz5ti255b0/BYscCr6NTrlVlaJlGwaKAWvuDq+wGoywIZoZCPX90HW6646B1p4kKA qBnliIjg1HtBog5/VF5nZ/VL0vN55oH/dxrQpeHXbD90FuYHtvN8XupiRTsVPug5lkF8 YASg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=FmHMOey5zYjBqir8BQ2Fm5h9ilU4HwTBdoph5KPL7ck=; b=mcUBoGjDiRxAPzlzrBT9hvgyu4WH1YB8LGDdKYtqlgTpUU+ZbtKXfclotLaGW3Yu7y WXShtbKL0yn6H6KFMABwRA2Hwem5/PGHY5Lemis+/rAyBbxeJj53qi1Ma59zpGPPYbTd bik9GdoZeJSwVWB/2jab6HMpe4KjsY8bYUu0cw/Pa7MJCH19+r8lSZwZi9XDADl9lwT4 OTfMbeHQCmitf1jczN3r9h150nZKLRkFHkVP2oHinoTb+xrKZDa6C2oTepqgYNs/2XG/ x5YVVT8SGc2Rbt5oZzmWZ5JRk2o+ColHdBGiKsWNfCWkUgWXMaMfPERWrAD3dDatK7vk aVvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=reFt6qLk; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13si3192074pfh.75.2019.02.25.12.35.25; Mon, 25 Feb 2019 12:35:40 -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=@google.com header.s=20161025 header.b=reFt6qLk; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbfBYUes (ORCPT + 99 others); Mon, 25 Feb 2019 15:34:48 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39667 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727230AbfBYUer (ORCPT ); Mon, 25 Feb 2019 15:34:47 -0500 Received: by mail-pg1-f193.google.com with SMTP id h8so4508126pgp.6 for ; Mon, 25 Feb 2019 12:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=FmHMOey5zYjBqir8BQ2Fm5h9ilU4HwTBdoph5KPL7ck=; b=reFt6qLkikr9MV68tRlb6/U2JuvM9MZ/xzIst8WXo2yxanz2wdmpZf05dcf0bLx8er MBn4Ws5i620Rle3Zk+XgZb4UNrUa1zbCocRizS/ESBMQgucJespj897PEvYrT6HHxRt2 xiAChdipZi7OZmIgTZ6wS5pS8jtmufH8qJKevVWtqWcmY1PJaqUNjNLzKGSuKUTmZXD0 C6k3eKIX+OGC7OtYmWmGwpuAj2AHPc3lZSOn1mEI7+LLr2W7jS50bv5LRUMgXrU9gEiJ vQB35q+afCKz3T9efbDrfY90Jph3/DWI59rp4+Wg+FeOCcloJyGf6As2LPWDnHczSYYv 9kfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=FmHMOey5zYjBqir8BQ2Fm5h9ilU4HwTBdoph5KPL7ck=; b=SE1Kkh9SV0Oqehe0Z7ABmUWLjipbOIEn2RXlhq9ym1CGihcMhFYxzx4I5eFc6oMo3W PVTv/coWPzikMIoPiZKXZicg00ZyIcGW8kt1E8aQ1cHg7v10CPaYUseDYFe71T6S/lpC KN2oGS7KQdCsjBm1tcd3c77HndvUMW9FyWd3Oc8+o48PVi1yzcGulKNYNAhwxD2oEoLF LgChNnBJbFj6M/Dj45p7pB4CN/uu6rfw1oKTO2dgiGNDJVsT90mzPk0bUtd7lT6Vo59T /f8crc5ryjtj8sfREwxLHDZ93anQB6AUMqWkCRxicHNUc+qg4Ktk+BCtfFV5+JyV7HOg BYSA== X-Gm-Message-State: AHQUAuYxbMZ2C4E3FwCbyO524pzo8OiUpx+Obdu7q4HLjWVHxSCv84Q0 LHAMiB7c2HgnfSIGJtVjf985ug== X-Received: by 2002:a63:d442:: with SMTP id i2mr20511933pgj.246.1551126885979; Mon, 25 Feb 2019 12:34:45 -0800 (PST) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id m64sm25530706pfi.149.2019.02.25.12.34.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 12:34:45 -0800 (PST) Date: Mon, 25 Feb 2019 12:34:21 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Linus Torvalds cc: Hugh Dickins , "Darrick J. Wong" , Andrew Morton , Matej Kupljen , Al Viro , Dan Carpenter , Linux List Kernel Mailing , linux-fsdevel , Linux-MM Subject: Re: [PATCH] tmpfs: fix uninitialized return value in shmem_link In-Reply-To: Message-ID: References: <20190221222123.GC6474@magnolia> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Feb 2019, Linus Torvalds wrote: > On Fri, Feb 22, 2019 at 10:35 PM Hugh Dickins wrote: > > > > When we made the shmem_reserve_inode call in shmem_link conditional, we > > forgot to update the declaration for ret so that it always has a known > > value. Dan Carpenter pointed out this deficiency in the original patch. > > Applied. Thanks. And I apologize for letting that slip through: Darrick sent the patch fragment, I dressed it up, and more or less tricked him into taking ownership of the bug, when it's I who should have been more careful. But I'm glad it confirmed your rc8 instinct, rather than messing final :) > > Side note: how come gcc didn't warn about this? Yes, we disable that > warning for some cases because of lots of false positives, but I > thought the *default* setup still had it. I thought so too, and have been puzzled by it. If I try removing the initialization of inode from the next function, shmem_unlink(), I do get the expected warning for that. > > Is it just that the goto ends up confusing gcc enough that it never notices? Since the goto route did have ret properly initialized, I don't see why it might have been confusing, but what do I know... I thought it might be because outside the goto route, ret was used for nothing but the return value. But that's disproved: I tried a very silly "inode->i_flags = ret;" just after d_instantiate(), and still no warning when ret is uninitialized. Seems like a gcc bug? But I don't have a decent recent gcc to hand to submit a proper report, hope someone else can shed light on it. Hugh