Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3932875imm; Mon, 8 Oct 2018 11:55:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV62ImuWuWUyjIYOoMcDGUUv6yT2bxsFKVDmV1dIVSE3hTLrflHeGm/MzWidg0325I2F04YTc X-Received: by 2002:a62:509a:: with SMTP id g26-v6mr26053447pfj.62.1539024915443; Mon, 08 Oct 2018 11:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024915; cv=none; d=google.com; s=arc-20160816; b=B0Z8+oDUFxX3Hef7KFq1HytG5qd9z/ThW0b1Ak4VbmsPz6JA0JvxbtMbXoUeXftJXw znwxB/T3AoXrXZV8K1vnC3DcZKzhrgJc0oqJRasp1+JSar1fgg4clq0Ui0iFrs9GrsRm dkF2PiHeWUpKnZ6O7LCuKIeFHufBYFibJ0kKXg5ssgN8MClsg4rpVR0erRz33mpmiMk6 fU06wzjbH9taoAwDWyByjcZslk4FfR3X8mGdvQ2un3gkEKz84FeWyZ5WGHY+4Jm0fTVv 2VEAqIzMzk9o8xPE9UokKAcyZ6vZdeu6MbPG1ITWgry6OBiUOpHFl9PYYc6++GOvAewY vpsA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S35jyG0UkKjhOD0jZO14xiDbp8SK9S/craw1jbgTtcM=; b=k2iYFiIRdtKy+ho9ZGoOB97p7b9BS4K5DdNNUQnxRUJRSGP8VtEaEWcD65zJag68by Z3gkTCtRpkXmBgQAEjw8c/xNWLPDuK1HkcbnShaqirBRtj16R6ss+rR3paV+neUSGcD2 MFWnaQWhflqdSAwGKubGc7aSeS9l3OkIYOXCJcKyDoOQjcnUlIpe4S1I3NpmTELclqls OFQRYa19mpebbAXc44nHnXiPbD+mrVPFGBV4ZHOfBhrjLoBoqmjKhPtTRVwp7sGqi3Qv vEHT0hAqPSXoZtOXM8Z41kxfXSC4K0w60iEgOLWrS4QFSIffP8547At2lpDRaPS2iVHR 9k/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eHey3ik0; 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 o24-v6si14476464pgv.242.2018.10.08.11.55.00; Mon, 08 Oct 2018 11:55:15 -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.org header.s=default header.b=eHey3ik0; 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 S1732847AbeJICHH (ORCPT + 99 others); Mon, 8 Oct 2018 22:07:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:57544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727670AbeJICHF (ORCPT ); Mon, 8 Oct 2018 22:07:05 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2806720645; Mon, 8 Oct 2018 18:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024837; bh=dWomnRs3jUX/NbOTgrSt9VS19q6KggzLFkFOJ/BOQsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eHey3ik02i1mYkNt5OegphMwPY9YeqqQ4iegYdGSwH9rXTtpPGepcM7eNpq8iM0nv 8DH9OneaOTzdPBIUXO1ngbfX0SIdqdHT3C6dWFvqiRECxkzTbCGsErmjD1N4MGUwCQ ZKEOL68FC2eOt9snY/ZHRAZDfhRimAffpdluQrbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Amir Goldstein Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi , Linus Torvalds Subject: [PATCH 4.18 146/168] ovl: set I_CREATING on inode being created Date: Mon, 8 Oct 2018 20:32:06 +0200 Message-Id: <20181008175625.580565339@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miklos Szeredi commit 6faf05c2b2b4fe70d9068067437649401531de0a upstream. ...otherwise there will be list corruption due to inode_sb_list_add() being called for inode already on the sb list. Signed-off-by: Miklos Szeredi Fixes: e950564b97fd ("vfs: don't evict uninitialized inode") Signed-off-by: Linus Torvalds To: Amir Goldstein Signed-off-by: Greg Kroah-Hartman --- fs/overlayfs/dir.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -601,6 +601,10 @@ static int ovl_create_object(struct dent if (!inode) goto out_drop_write; + spin_lock(&inode->i_lock); + inode->i_state |= I_CREATING; + spin_unlock(&inode->i_lock); + inode_init_owner(inode, dentry->d_parent->d_inode, mode); attr.mode = inode->i_mode;