Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp2034367imm; Fri, 6 Jul 2018 10:36:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe1/nUddb8g5BtAaIiSFSPaoAcbWKWoLvPNLamTy5jNG14RGj6jOIqWHPRLP5elDu0bLFnF X-Received: by 2002:a17:902:b589:: with SMTP id a9-v6mr11221429pls.140.1530898597681; Fri, 06 Jul 2018 10:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530898597; cv=none; d=google.com; s=arc-20160816; b=Q5na+AqtsxTGERPiULEbkzz/wmXTySbrusRuktzA3vjBkDztslopyuJd0oi3Fg8ZwK m4qwtFOnoy3xmVdmp0qwr7LBxz+4AHmYAHSmqPQPhzk/Rgm/7o2W7io73JWVCr6AgmOD B8YGLjToRLK48LcSUpNJf3+xShDFKEpSBaQMphBjAn5miPua4iBUE8UaCMYneYgoqVqr jQWS8qOTV27YhzAw68UOLnh8DZCAqSBt11XyH24gugVE5mHVpztQSdEOXMu/uGgGEZui Sf2iOMfFxoC3O239kyFkSkMdmVTgs6YOzsYUN/0Okln8q8UxAyXHx35sARvBQXYOPMD6 XtZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3iVTvsok2RB+PkU8USrETtpgYbDd5pEtB4u8P4zQwuA=; b=QecIuh4zaz6sPFjTewPU4sZoBMCQE1j1pjvZP8DQr3Mm5THjkIpLfqm0tsoiMgPrjs Ib93tAMOuA4CWqixiJlOL6DXVNUnjzGxUF7r9U2jkxfkXvcoTkNM6EztFM17wGjDc5z8 tvM2EFwRMA6DZ1kupDfZ6PtemDFC0sekALF3RmoeXqiAEiV0FBPGCNIWpNUiOqwFMYDT MlcI6LNN4crx0829NChNbeU7fmtqr3c5nz3iDZIjcbnmyvzVXxebiyyMQxhZpsfAXEqg 1KwTeZPVL8RYie2ogJgx/A2pkOATX3EW/IcgHjDHikhL+2aeb2dHSVvrSFQe/pMe7zGu mrQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a190-v6si8408330pgc.241.2018.07.06.10.36.20; Fri, 06 Jul 2018 10:36:37 -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; 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 S933733AbeGFRfn (ORCPT + 99 others); Fri, 6 Jul 2018 13:35:43 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47684 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933090AbeGFRfm (ORCPT ); Fri, 6 Jul 2018 13:35:42 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fbUdw-0002Qr-Kk; Fri, 06 Jul 2018 17:35:40 +0000 Date: Fri, 6 Jul 2018 18:35:40 +0100 From: Al Viro To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH (v4.18 regression fix)] vfs: don't evict uninitialized inode Message-ID: <20180706173540.GD30522@ZenIV.linux.org.uk> References: <20180706153548.23287-1-mszeredi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706153548.23287-1-mszeredi@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 05:35:48PM +0200, Miklos Szeredi wrote: > iput() ends up calling ->evict() on new inode, which is not yet initialized > by owning fs. So use destroy_inode() instead. > > Add to sb->s_inodes list only after the inode has been inserted into the > hash. The exact point at which the inode is added onto the sb list > shouldn't matter as long as it is done while the inode is in the I_NEW > state. > > Reported-by: Al Viro > Signed-off-by: Miklos Szeredi > Fixes: 80ea09a002bf ("vfs: factor out inode_insert5()") Check 22dc9a168272 (new primitive: discard_new_inode()) in vfs.git; IMO yours should go on top of that and I would seriously consider going for just alloc_inode() - to hell with new_inode_pseudo(). I_CREATING gives an easy way for insert_inode5() to decide whether we need to move into ->i_sb_list...