Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp958216imp; Thu, 21 Feb 2019 15:06:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IYwES3PxCyYQ+DpWFTQgnT1ejq+pkYsQ9xpcI9hDpkoBJPf0K6+eJo8gmTO7grkuE7WKiWJ X-Received: by 2002:a17:902:8504:: with SMTP id bj4mr980221plb.200.1550790368166; Thu, 21 Feb 2019 15:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550790368; cv=none; d=google.com; s=arc-20160816; b=yHLxVZmT7F4SPf8lDCwFd/UnZSO7cHn22oNYd/Hup9nGnCiQ+5cvuCq0wELXYGepIz dbLnioHs/26zp10VV73ualWiExfJNHEUDysEgEOCmE8hxBHmkzfxTQ8iyto61UvTC+wl 5mncOQHAsIHfe/UlN9+IJlPPUv1e/qAJbbg9hjinUiNNLdU5lfQCwg3kn20GqTzONN/l 2/1Q6fHeOeG5O8Qy05bLfZvLDg0lj8BYy/LlLKnqwtewMop1Kr3h/CtyuO315NCLnW4J lNmcHssJa8KR69DYlZKGyzfNShqZQgl+6Ipk8LTjJj5ci5zZuPMw1T6+BD+SGqNvxfUB aorA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=M18y1j6N0BCPC6Qvm+oCd9cTgbTHzAhsGLH6qTZCOZg=; b=1BQlWHZIWMLbrgdEO8J6PJxErmu/ZmN+sxVt8ECDrJVOg/98Q/aBvjZTZXfMNjtPJt 3OXfVAEwZS7S7y34d7XjDQkBT09JEK1cZWZJEIZCbxKVwPbmmWkZv5bM+lFpVb4wjTpx 42U6C0K4PmgPKLZhK1P7u4tJ3UmjkKfYb4PVZqX22DGAkwBh7l576wVbw88IHAnALY8y yMIgRWf11ycAGoIiHawziBbV3XykVFbs6kxEEpe3Ur+Vcvp8uUAkQYaWUHYz2dTAImDT 301TKYXhi8rnG/kc8Xd8x76M119tnVCO9IdwuuLNGvIZTHJq4EKLOza5VJoIG3IohSlI xSpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="UB3Pt/TA"; 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 e17si136281pgo.44.2019.02.21.15.05.51; Thu, 21 Feb 2019 15:06:08 -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="UB3Pt/TA"; 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 S1726202AbfBUXF3 (ORCPT + 99 others); Thu, 21 Feb 2019 18:05:29 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:50613 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbfBUXF3 (ORCPT ); Thu, 21 Feb 2019 18:05:29 -0500 Received: by mail-it1-f193.google.com with SMTP id m137so507347ita.0 for ; Thu, 21 Feb 2019 15:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M18y1j6N0BCPC6Qvm+oCd9cTgbTHzAhsGLH6qTZCOZg=; b=UB3Pt/TAhv5IjOxRvaiLS/aDHOu0BHqJAaVmztbR3nDBwQMq68zY37bNnLJk5cpjAB iu8TAGjqmYJIfj38mb/ku00WfoC93c+VgT8uJQj/x00JD7K0ssTVyNK5UuR0CHPIk+0H kezIq4fbNbZgHihpQAvGp5Q0s3N7D5gskOGd8xCaqoI/byLj11Zt7v+dlCHPr5szjucw MA0hqIUv+SEGGAop89a+I9fQMRbx4WSL0d+AgoeABwVuu92wu6NxTqswkAFcHvV21zXf 2H3I6QmWyznNZx5eJuWCSKJAqBev3Auc0bRFN5Nld84Vsg+CkrftiMbGKsI5J5B3YU+B PqAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M18y1j6N0BCPC6Qvm+oCd9cTgbTHzAhsGLH6qTZCOZg=; b=KjdNIxACYsKrbDWput6g2T//5Z2AO7Zv72jvVCWOhLxf2jKqszdLy/wpwUEEFLQFPl HRHVCgFvU0GeJ2OU/erwrjuDdPtUeh1BAPdCO28xYByBq7zLI7WBUuhxY+vEaOY8ocmd gLt5SU659Us8ptVWOs7/ReszOQ1Xi+j/DrgcDB7Ec1fk5JOUATPoGxHUIb5VvvpurnlE J+41IJMazF6u0KneT7y5OZlNFXGorMi81HWbgNGqvM/3Bq0EqcrADB+c4VWoHB8TzxAq wtqOihAG5JrvsUmAlgm+pWi8r0uuNn4XgMzJLAWZVS+GmagDpDRbP5+XSmG9X7O/2ebP worg== X-Gm-Message-State: AHQUAuaSyX5B0gzdPGryaKulZqnnqne+oTYEtCnrGbduvXTYDkTE11/A qd2r5nK5YYEUHrnl59r1/XG1xdJ+J984Rf7CAqG5rw== X-Received: by 2002:a24:2ec2:: with SMTP id i185mr637247ita.62.1550790327967; Thu, 21 Feb 2019 15:05:27 -0800 (PST) MIME-Version: 1.0 References: <20190221222123.GC6474@magnolia> In-Reply-To: <20190221222123.GC6474@magnolia> From: Hugh Dickins Date: Thu, 21 Feb 2019 15:05:01 -0800 Message-ID: Subject: Re: [PATCH] tmpfs: fix uninitialized return value in shmem_link To: "Darrick J. Wong" Cc: Andrew Morton , Matej Kupljen , linux-kernel , Linux-FSDevel , linux-mm , David Rientjes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 2:21 PM Darrick J. Wong wrote: > > From: Darrick J. Wong > > 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. > > Fixes: "tmpfs: fix link accounting when a tmpfile is linked in" > Reported-by: dan.carpenter@oracle.com > Signed-off-by: Darrick J. Wong Gosh, yes indeed: thanks Dan and Darrick, I'm very sorry for not noticing that. Acked-by: Hugh Dickins (and sorry if this mail is garbled: it's from gmail, I cannot use alpine at the moment). > --- > mm/shmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index 0905215fb016..2c012eee133d 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -2848,7 +2848,7 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode, > static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) > { > struct inode *inode = d_inode(old_dentry); > - int ret; > + int ret = 0; > > /* > * No ordinary (disk based) filesystem counts links as inodes;