From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20180822085522.GA14354@veci.piliscsaba.redhat.com> In-Reply-To: <20180822085522.GA14354@veci.piliscsaba.redhat.com> From: Linus Torvalds Date: Wed, 22 Aug 2018 07:53:08 -0700 Message-ID: Subject: Re: [PATCH] ovl: set I_CREATING on inode being created To: Miklos Szeredi Cc: Linux Kernel Mailing List , linux-fsdevel , linux-unionfs@vger.kernel.org, Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Aug 22, 2018 at 1:55 AM Miklos Szeredi wrote: > > + spin_lock(&inode->i_lock); > + inode->i_state |= I_CREATING; > + spin_unlock(&inode->i_lock); > + Why is that spinlock protection there? Isn't this a new inode that cannot possibly be reached any other way yet? NOTE! This is a question. Maybe there is something I missed, and there *are* other ways to reach that inode. But if that's true, isn't it already too late to set I_CREATING? So I'd like some clarification on this point before applying it. It's possible that the spinlock is required, I just want to understand why. Linus