[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <kcngaxzwlgh4jm53j632mnlp2ebo6ddf4wvkaicn2mllos5p4k@xwyhwq5lbl3d>
Date: Tue, 24 Sep 2024 07:07:00 +0000
From: Naohiro Aota <Naohiro.Aota@....com>
To: Johannes Thumshirn <jth@...nel.org>
CC: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>, David Sterba
<dsterba@...e.com>, "open list:BTRFS FILE SYSTEM"
<linux-btrfs@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>,
WenRuo Qu <wqu@...e.com>, Johannes Thumshirn <Johannes.Thumshirn@....com>
Subject: Re: [PATCH] btrfs: also add stripe entries for NOCOW writes
On Mon, Sep 23, 2024 at 08:45:47AM GMT, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@....com>
>
> NOCOW writes do not generate stripe_extent entries in the RAID stripe
> tree, as the RAID stripe-tree feature initially was designed with a
> zoned filesystem in mind and on a zoned filesystem, we do not allow NOCOW
> writes. But the RAID stripe-tree feature is independent from the zoned
> feature, so we must also allow NOCOW writes for zoned filesystems.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
The NCOW case itself looks fine for me.
Reviewed-by: Naohiro Aota <naohiro.aota@....com>
But, looking around the context, since there are some duplication among
regular and NOCOW case, it would be good time to merge them.
Apparently, btrfs_insert_raid_extent() in the regular case (current code)
should abort the transaction as same as this patch. With that fixed, code
will become really similar.
> ---
> fs/btrfs/inode.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index edac499fd83d..c6e4b58c334c 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -3111,6 +3111,11 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
> ret = btrfs_update_inode_fallback(trans, inode);
> if (ret) /* -ENOMEM or corruption */
> btrfs_abort_transaction(trans, ret);
> +
> + ret = btrfs_insert_raid_extent(trans, ordered_extent);
> + if (ret)
> + btrfs_abort_transaction(trans, ret);
> +
> goto out;
> }
>
> --
> 2.43.0
>
Powered by blists - more mailing lists