From: Theodore Ts'o <tytso@mit.edu>
To: Matthew Wilcox <willy@linux.intel.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Race affecting superblock buffer_head
Date: Wed, 2 Apr 2014 10:37:04 -0400 [thread overview]
Message-ID: <20140402143703.GB6901@thunk.org> (raw)
In-Reply-To: <20140402140757.GE5667@linux.intel.com>
On Wed, Apr 02, 2014 at 10:07:57AM -0400, Matthew Wilcox wrote:
> Looking forther down the call stack, this call to ext4_commit_super()
> comes via __ext4_abort's call to save_error_info() which calls
> ext4_commit_super(). I've had a good look around, and I can't see any
> locking that prevents ext4_commit_super() from being called in parallel
> with ... well, anything else.
Ext4_commit_super() only gets called:
* When mounting and unmounting the file system (where the code path
has exclusive access to the superblock)
* When remounting the file system read-only
* When reporting an error
So what you're probably seeing is a case where we have multiple cpu's
calling some form of ext4_error* in parallel, and indeed there is
nothing prevent us from trying to update the superblock and calling
ext4_commit_super() in parallel.
We'll need to be careful because at the moment we don't make any
assumptions about any mutexes being locked --- or not locked --- when
we call into ext4_error().
Since this is happening on the error paths, and these are just
warnings, it's not a disaster. But we really should do something to
clean up the warning, and the fact that we aren't being careful about
what happens if two CPU's are trying to update the s_last_error_*
information might mean that the information that we get back is
misleading, so this is something we should fix.
Thanks for pointing this out!
- Ted
prev parent reply other threads:[~2014-04-02 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 14:07 Race affecting superblock buffer_head Matthew Wilcox
2014-04-02 14:37 ` Theodore Ts'o [this message]
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=20140402143703.GB6901@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=willy@linux.intel.com \
/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).