linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
Cc: Horst Schirmeier <horst.schirmeier@tu-dortmund.de>,
	Jan Kara <jack@suse.cz>, Jan Kara <jack@suse.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] inode.i_opflags - Usage of two different locking schemes
Date: Fri, 5 Mar 2021 10:18:16 -0500	[thread overview]
Message-ID: <YEJLuP6+Zy8/dq+D@mit.edu> (raw)
In-Reply-To: <a4709bc4-ee62-2cdc-0628-32e8fa73e8f9@tu-dortmund.de>

On Fri, Mar 05, 2021 at 02:10:09PM +0100, Alexander Lochmann wrote:
> Hi folks,
> 
> I've stumbled across an interesting locking scheme. It's related to struct
> inode, more precisely it is an mqueue inode.
> Our results show that inode:mqueue.i_opflags is read with i_rwsem being
> hold.
> In d_flags_for_inode, and do_inode_permission the i_lock is used to read and
> write i_opflags.
> Is this a real locking scheme? Is a lock needed to access i_opflags at all?
> What is the magic behind this contradiction?
> 
> I've put the report of the counterexamples on our webserver:
> https://ess.cs.tu-dortmund.de/lockdoc-bugs/cex-inode-mqueue.html.
> It contains the stacktraces leading to those accesses, and the locks that
> were actually held.

1)  I don't see where i_opflags is being read in ipc/mqueue.c at all,
either with or without i_rwsem.

2)  I'm not sure what this has to do with ext4?

        	    	      	       	  - Ted

  reply	other threads:[~2021-03-05 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f63dd495-defb-adc4-aa91-6aacd7f441c7@tu-dortmund.de>
2021-03-05 13:10 ` [RFC] inode.i_opflags - Usage of two different locking schemes Alexander Lochmann
2021-03-05 15:18   ` Theodore Ts'o [this message]
2021-03-05 15:35     ` Alexander Lochmann
2021-03-05 16:04       ` Theodore Ts'o
2021-03-08 14:05         ` Alexander Lochmann
2021-03-16 17:14           ` Jan Kara
2021-03-26 16:37             ` Alexander Lochmann

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=YEJLuP6+Zy8/dq+D@mit.edu \
    --to=tytso@mit.edu \
    --cc=alexander.lochmann@tu-dortmund.de \
    --cc=horst.schirmeier@tu-dortmund.de \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).