linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: majianpeng <majianpeng@gmail.com>, tj <tj@kernel.org>,
	axboe <axboe@kernel.dk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [RESEND PATCH] writeback: Judge bdi->dev when set worker desc in bdi_writeback_workfn.
Date: Fri, 27 Sep 2013 08:59:09 +1000	[thread overview]
Message-ID: <20130926225909.GU26872@dastard> (raw)
In-Reply-To: <20130926174702.GA12274@infradead.org>

On Thu, Sep 26, 2013 at 10:47:02AM -0700, Christoph Hellwig wrote:
> On Thu, Sep 26, 2013 at 08:43:51AM +1000, Dave Chinner wrote:
> > You're just papering over the larger problem, in that the writeback
> > work is running concurrently with the bdi_unregister() function that
> > is tearing the bdi down. You should try to fix the underlying race
> > condition, as documented in bdi_destroy.
> 
> The problem is even worse than that, and it's the lack of a proper
> refcounting on the bdi as seen by gems like bdi_prune_sb and the moving
> of writeback requests in bdi_destroy.  The right fix is to dynamically
> allocate the bdi (or at least the bdi_writeback), and make sure that we
> keep it around as long as a filesystem and thus the writeback code
> refers to.  Then a block device going away can just set a flag to stop
> writeback from trying instead of having the bdi ripped out underneath
> it which is guaranteed to fail and historically has failed in a large
> number of misterious ways.

Yup, be nice to see this rat-hole cleaned up properly, especially
those silly "pull disk, unplug-runs-sync_fs, fs hangs trying to do
IO to the disk that just got unplugged" bugs we get reported every
so often.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2013-09-26 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  0:11 [RESEND PATCH] writeback: Judge bdi->dev when set worker desc in bdi_writeback_workfn majianpeng
2013-09-25  8:08 ` majianpeng
2013-09-25 22:43   ` Dave Chinner
2013-09-26 13:35     ` tj
2013-09-26 17:47     ` Christoph Hellwig
2013-09-26 22:59       ` Dave Chinner [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=20130926225909.GU26872@dastard \
    --to=david@fromorbit.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    --cc=tj@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).