All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naohiro Aota <Naohiro.Aota@wdc.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: David Sterba <dsterba@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>
Subject: Re: [PATCH 2/6] btrfs: zoned: add a dedicated data relocation block group
Date: Tue, 7 Sep 2021 11:37:01 +0000	[thread overview]
Message-ID: <20210907113700.bgneqghxnqpzqvt2@naota-xeon> (raw)
In-Reply-To: <ac2e5fc11c47dfc3626999460f606b980b0f5523.1630679569.git.johannes.thumshirn@wdc.com>

On Fri, Sep 03, 2021 at 11:44:43PM +0900, Johannes Thumshirn wrote:
> Relocation in a zoned filesystem can fail with a transaction abort with
> error -22 (EINVAL). This happens because the relocation code assumes that
> the extents we relocated the data to have the same size the source extents
> had and ensures this by preallocating the extents.
> 
> But in a zoned filesystem we currently can't preallocate the extents as
> this would break the sequential write required rule. Therefore it can
> happen that the writeback process kicks in while we're still adding pages
> to a delallocation range and starts writing out dirty pages.
> 
> This then creates destination extents that are smaller than the source
> extents, triggering the following safety check in get_new_location():
> 
>  1034         if (num_bytes != btrfs_file_extent_disk_num_bytes(leaf, fi)) {
>  1035                 ret = -EINVAL;
>  1036                 goto out;
>  1037         }
> 
> Temporarily create a dedicated block group for the relocation process, so
> no non-relocation data writes can interfere with the relocation writes.
> 
> This is needed that we can switch the relocation process on a zoned
> filesystem from the REQ_OP_ZONE_APPEND writing we use for data to a scheme
> like in a non-zoned filesystem using REQ_OP_WRITE and preallocation.
> 
> Fixes: 32430c614844 ("btrfs: zoned: enable relocation on a zoned filesystem")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---

Looks good,
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>

  reply	other threads:[~2021-09-07 11:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 14:44 [PATCH 0/6] btrfs: zoned: unify relocation on a zoned and regular FS Johannes Thumshirn
2021-09-03 14:44 ` [PATCH 1/6] btrfs: introduce btrfs_is_data_reloc_root Johannes Thumshirn
2021-09-07 11:36   ` Naohiro Aota
2021-09-03 14:44 ` [PATCH 2/6] btrfs: zoned: add a dedicated data relocation block group Johannes Thumshirn
2021-09-07 11:37   ` Naohiro Aota [this message]
2021-09-07 11:52   ` David Sterba
2021-09-07 12:43   ` David Sterba
2021-09-03 14:44 ` [PATCH 3/6] btrfs: zoned: use regular writes for relocation Johannes Thumshirn
2021-09-07 11:39   ` Naohiro Aota
2021-09-03 14:44 ` [PATCH 4/6] btrfs: check for relocation inodes on zoned btrfs in should_nocow Johannes Thumshirn
2021-09-07 11:40   ` Naohiro Aota
2021-09-03 14:44 ` [PATCH 5/6] btrfs: zoned: allow preallocation for relocation inodes Johannes Thumshirn
2021-09-03 14:44 ` [PATCH 6/6] btrfs: rename setup_extent_mapping in relocation code Johannes Thumshirn

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=20210907113700.bgneqghxnqpzqvt2@naota-xeon \
    --to=naohiro.aota@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.