From: Linus Torvalds <torvalds@linux-foundation.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-unionfs@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] ovl: set I_CREATING on inode being created
Date: Wed, 22 Aug 2018 07:53:08 -0700 [thread overview]
Message-ID: <CA+55aFzd53LwrBfvdtKx7e_bQPhzsKEvCME1rGbrrY4pG94d=Q@mail.gmail.com> (raw)
In-Reply-To: <20180822085522.GA14354@veci.piliscsaba.redhat.com>
On Wed, Aug 22, 2018 at 1:55 AM Miklos Szeredi <miklos@szeredi.hu> 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
next prev parent reply other threads:[~2018-08-22 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 8:55 [PATCH] ovl: set I_CREATING on inode being created Miklos Szeredi
2018-08-22 14:53 ` Linus Torvalds [this message]
2018-08-22 19:58 ` Miklos Szeredi
2018-08-22 20:14 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+55aFzd53LwrBfvdtKx7e_bQPhzsKEvCME1rGbrrY4pG94d=Q@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).