linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-fsdevel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC][PATCH] do d_instantiate/unlock_new_inode combinations safely
Date: Fri, 11 May 2018 20:56:17 +0100	[thread overview]
Message-ID: <20180511195616.GD30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180511030029.GW23861@dastard>

On Fri, May 11, 2018 at 01:00:29PM +1000, Dave Chinner wrote:
> On Fri, May 11, 2018 at 03:18:43AM +0100, Al Viro wrote:
> > On Fri, May 11, 2018 at 11:32:08AM +1000, Dave Chinner wrote:
> > 
> > > i.e. we already have code in xfs_setup_inode() that sets the xfs
> > > inode ILOCK rwsem dir/non-dir lockdep class before the new inode is
> > > unlocked - we could just do the i_rwsem lockdep setup there, too.
> > 
> > ... which would suffice -
> > 
> >         if (S_ISDIR(inode->i_mode)) {
> >                 struct file_system_type *type = inode->i_sb->s_type;
> > 
> >                 /* Set new key only if filesystem hasn't already changed it */
> >                 if (lockdep_match_class(&inode->i_rwsem, &type->i_mutex_key)) {
> > 
> > in lockdep_annotate_inode_mutex_key() would make sure that ->i_rwsem will be
> > left alone by unlock_new_inode().
> 
> Ok, If you are happy with XFs doing that, I'll put together a patch
> and send it out.

That should probably go through xfs tree - no impact outside of fs/xfs...

  reply	other threads:[~2018-05-11 19:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 18:20 [RFC][PATCH] do d_instantiate/unlock_new_inode combinations safely Al Viro
2018-05-10 19:11 ` Andreas Dilger
2018-05-10 19:32   ` Al Viro
2018-05-10 20:44 ` Mike Marshall
2018-05-10 22:56 ` Dave Chinner
2018-05-11  0:39   ` Al Viro
2018-05-11  1:32     ` Dave Chinner
2018-05-11  2:18       ` Al Viro
2018-05-11  3:00         ` Dave Chinner
2018-05-11 19:56           ` Al Viro [this message]
2018-05-11  6:15     ` Ritesh Harjani

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=20180511195616.GD30522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).