Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp227812imm; Wed, 22 Aug 2018 03:09:15 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy5YtbvQ0IMa9wh5naIwdv1bNZcZHHDUKT0oQsgVzt/Q/uxbQPSxOtlEuJDwrfr/bciZAOA X-Received: by 2002:a17:902:a9ca:: with SMTP id b10-v6mr25298529plr.198.1534932555451; Wed, 22 Aug 2018 03:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534932555; cv=none; d=google.com; s=arc-20160816; b=Ib+6FoMD+uKU1nDKMSVS4ThY/rutYK2UYGKcGMB01eAranyiEEc118qFz3vwl3Kxtt wplQyydHYHpKuucGTzfqX0pis5AIgwQRXOlRBzmsvnChRXRG0qX3ZKcnqJf5AEB4l6Gi N/1c3iTpTv2MfN586bHxFtrb6AxJg0mE3GvpYMdbi9+ErQrngW5udCSXejCihR540UvK PHF08V5vk8i8riLljeGJiBSiVvnZQnA5rY3QZPijT1oUwZS0O6QAvYTGofyMrm0nAcxR XgWFjSsIAONCx2Zd8gjL5jBJn4rQMG8xA1+ml5wj2I1MklG+H110lbYB36xev+GvlJiW yKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Y7bygxqp+oUBKrjqJLXJ+RdXwP95pqwW6urLGjhbdH8=; b=s9vFLNmtNJlGhABWH4p0otN4Xon7pBwtAVMpfZqrAf7gN/NRqZp2f/hwGukIUNGqB6 y5JwMMoxOlFII0iyhEjRk2D4HrRVdnqSxnJUrYlC64D8Cv9tg34FHI57At53wYiCqXbx fIgWd80te6Ta9M2KuVI+l7Gv6b0DpbMbfF+SpIL190dcWIEjaUjI3Df3SCIA3AKw1SWd Lu4CxM/9oiAMoc9NrXPeTowZpmuTph+jGa66jQSf0VSUa0my7onF15qPeFrdO3js+aQJ c46OJ1vogruSa6FEbMnJdW5AIrjZROtCLP41sYZKlxcee3Yg/RiJ61SawafEIISJKSsu qDxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=bKD7DZ7T; 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 d3-v6si1325540pgk.610.2018.08.22.03.08.35; Wed, 22 Aug 2018 03:09: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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=bKD7DZ7T; 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 S1728052AbeHVMT3 (ORCPT + 99 others); Wed, 22 Aug 2018 08:19:29 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37859 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728522AbeHVMT2 (ORCPT ); Wed, 22 Aug 2018 08:19:28 -0400 Received: by mail-wr1-f66.google.com with SMTP id u12-v6so955530wrr.4 for ; Wed, 22 Aug 2018 01:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Y7bygxqp+oUBKrjqJLXJ+RdXwP95pqwW6urLGjhbdH8=; b=bKD7DZ7TtzPUiW1okzqVUqtcO4boWKs+MKO1LeS3umH9gboifQBhhuCzw7zaQAKqCN z5t1O+N5sGt9cuX8MXA7ODRAGw5/9dQwOl/EMBCzU16H5EeL3k9pcodmMCe4+6qqjT8T a9tlonaRvyo+aOWM7cxAC2AfiDcbqd2Q2Norw= 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:message-id:mime-version :content-disposition:user-agent; bh=Y7bygxqp+oUBKrjqJLXJ+RdXwP95pqwW6urLGjhbdH8=; b=kQAyw0dbYVJoi6YYuWBZjnuU8qAbRlSRb1Lm0Kzhv5CL0rYVcm9WAQTWZEeZ68RSv4 MSoqZBahfP400LcCZish1WdQpR8lUiy8JsP1g4clNMBN9s3DsVXBoOKxRxrUXdbEgKMa vScu02yicS8tZ9YSIx9i+QTE1XSLjZNP29NieM7y0u1kBehyDcWHncYrKIfqQwpAsNv8 4wCR94u5Wdf8bUaW6j+J9M4c11DNqN1UjNqHCoxdwEqY7CslZL/Knvu00rZZhLSaH4P9 8A1NHl5ZtUwh8TsaROK1u+iAcuzLcSm+NkV91bgFPhg0uaPjtxq/k8WyEOH+5dTuRO7k xdbg== X-Gm-Message-State: AOUpUlHXQFy0fiM+k+zL1VyYewg/jV0QSUa7WO8I+Cm/qmJel4wrErgc /V42Sj2yf1eySLfKdcTUXkdW3A== X-Received: by 2002:adf:dc4c:: with SMTP id m12-v6mr36769160wrj.84.1534928130218; Wed, 22 Aug 2018 01:55:30 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id l18-v6sm1728670wru.75.2018.08.22.01.55.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Aug 2018 01:55:29 -0700 (PDT) Date: Wed, 22 Aug 2018 10:55:22 +0200 From: Miklos Szeredi To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, viro@zeniv.linux.org.uk Subject: [PATCH] ovl: set I_CREATING on inode being created Message-ID: <20180822085522.GA14354@veci.piliscsaba.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ...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") --- This missed the 4.19 overlay pull request, because it fixes a bug introduced by patch not in said pull (buggy patch is also mine, incidentally). fs/overlayfs/dir.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -603,6 +603,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;