mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Naohiro Aota <naohiro.aota@hgst.com>, <linux-btrfs@vger.kernel.org>
Cc: Josef Bacik <jbacik@fb.com>, David Sterba <dsterba@suse.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs
Date: Mon, 10 Oct 2016 17:04:03 -0400	[thread overview]
Message-ID: <7ac97eed-6bc1-3b23-38cf-89c5eda49f23@fb.com> (raw)
In-Reply-To: <1472802392-10851-1-git-send-email-naohiro.aota@hgst.com>

On 09/02/2016 03:46 AM, Naohiro Aota wrote:
> Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But
> the work can be done by btrfs_delete_unused_bgs() (and it's better since it
> trim the BG). Let's dedupe the code.
>
> While btrfs_delete_unused_bgs() is already hitting the relocated BG, it
> skip the BG since the BG has "ro" flag set (to keep balancing BG intact).
> On the other hand, btrfs cannot drop "ro" flag here to prevent additional
> writes. So this patch make use of "removed" flag.
> btrfs_delete_unused_bgs() now detect the flag to distinguish whether a
> read-only BG is relocating or not.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@hgst.com>

This runs into trouble with btrfs_rm_device(), I've been triggering 
crashes with btrfs/101 here.

The problem is that by the time we get around to running 
btrfs_delete_unused_bgs(), btrfs_rm_device() has long since free'd the 
device.

I thought about calling btrfs_delete_unused_bgs() directly from 
btrfs_rm_device(), but it might bail out without returning an error for 
a number of reasons.

For now, I've reverted this patch from the pull, but we can bring it 
back once the device removal path is covered.

-chris

      parent reply	other threads:[~2016-10-10 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  7:46 Naohiro Aota
2016-09-02 13:35 ` Josef Bacik
2016-09-05  4:32   ` Naohiro Aota
2016-09-06 12:52     ` Josef Bacik
2016-10-10 21:04 ` Chris Mason [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=7ac97eed-6bc1-3b23-38cf-89c5eda49f23@fb.com \
    --to=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naohiro.aota@hgst.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

all inboxes | Powered by JetHome®