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


[-- Attachment #1.1: Type: text/plain, Size: 939 bytes --]

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.

Regards,
Alex

-- 
Technische Universität Dortmund
Alexander Lochmann                PGP key: 0xBC3EF6FD
Otto-Hahn-Str. 16                 phone:  +49.231.7556141
D-44227 Dortmund                  fax:    +49.231.7556116
http://ess.cs.tu-dortmund.de/Staff/al


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

       reply	other threads:[~2021-03-05 13:11 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 ` Alexander Lochmann [this message]
2021-03-05 15:18   ` [RFC] inode.i_opflags - Usage of two different locking schemes Theodore Ts'o
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=a4709bc4-ee62-2cdc-0628-32e8fa73e8f9@tu-dortmund.de \
    --to=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 \
    --cc=tytso@mit.edu \
    /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).