linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Daniel J Blueman <daniel@quora.org>
Cc: Chris Mason <chris.mason@oracle.com>,
	Josef Bacik <josef@redhat.com>,
	Linux BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: worker list corruption crash
Date: Fri, 27 Apr 2012 09:41:02 -0400	[thread overview]
Message-ID: <20120427134102.GA2088@localhost.localdomain> (raw)
In-Reply-To: <CAMVG2ssoaPFDj9cBtBByE4xXuENYo=SXipgP=XxrXKmqaK=78w@mail.gmail.com>

On Fri, Apr 27, 2012 at 10:26:27AM +0800, Daniel J Blueman wrote:
> In 3.4-rc4, I've come across worker list corruption while scrubbing,
> leading to (in two separate cases) warning [1] and crashing [2]. The
> connection with scrubbing is likely the increased rate of worker
> threads starting and stopping.
> 
> In btrfs_stop_workers, access to worker->worker_list is done without
> holding worker->lock (it is in all other callsites). We can't take
> worker->lock there due to lock inversion deadlock (as it is the outer
> lock), and if we drop the workers->lock to acquire worker->lock and
> then workers->lock, we can't guarantee worker is still valid.
> 
> If feels like a global workers list pointer should be used and it's
> lock should be the outer one to avoid this scenario, or maybe I'm
> missing something?
> 

I think you are missing something, as I read it we're always holding
workers->lock when we touch the worker_list, so we should be safe, so I wonder
what could be going on here...

Josef

      reply	other threads:[~2012-04-27 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  2:26 worker list corruption crash Daniel J Blueman
2012-04-27 13:41 ` Josef Bacik [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=20120427134102.GA2088@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=daniel@quora.org \
    --cc=linux-btrfs@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).