From patchwork Wed Aug 22 08:55:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10572761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11CE6112E for ; Wed, 22 Aug 2018 08:55:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04BCD2B018 for ; Wed, 22 Aug 2018 08:55:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBE8A2B03D; Wed, 22 Aug 2018 08:55:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94C2A2B018 for ; Wed, 22 Aug 2018 08:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728618AbeHVMT3 (ORCPT ); Wed, 22 Aug 2018 08:19:29 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38789 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbeHVMT2 (ORCPT ); Wed, 22 Aug 2018 08:19:28 -0400 Received: by mail-wr1-f65.google.com with SMTP id w11-v6so957278wrc.5 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=iBRh+kwsWWr2vcs40jY8Mk6lr9nGyLX42Vrn6hEIwuS96pisBMKRaqXhLqlkzon7K/ NcxxaoPgys9zTtuw6fyTofqbs4HR2Tfzb2SFCquVtjhNXcAKPpi67oOIJVHy6jMf4Tpd HqTGL4uHSIneALdxUwUYQbJK6SDfJZAnamwrWuWyYgbItFdgAkBtep0al5kGCV52Jn6w rpT+vJP1ZM0JW6TXFmOBV//ki2Mf5t1fqa5AhLWTM5wIvW1IN89I77kq9Bl8ZhB+1c5D yAnDHldXGlTgNE48FqPp7Fe1qABkooewjXWSKIhdOYV2e57jK+/Ab13mnzf7mDgh2l3E Zcqw== X-Gm-Message-State: AOUpUlH6b1x9wzy/aIrpF2jJ/TFilNpeBO0gPKSlmMYDRAjWzutMtQOz 0MB2RfgpGlD6VVgx+pf1FqgC8w== X-Google-Smtp-Source: AA+uWPxuaht3b80DXZTFzjT3khNZ4CWls14WKBN/2KLgvWMsLXpxYHs0fxsxxKVSxOyuTVSHsAZT+Q== 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-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ...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;