This is a note to let you know that I've just added the patch titled btrfs: zoned: use regular writes for relocation to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-zoned-use-regular-writes-for-relocation.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Nov 19 01:33:42 PM CET 2021 From: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Date: Thu, 18 Nov 2021 17:58:16 +0900 Subject: btrfs: zoned: use regular writes for relocation To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: linux-btrfs@xxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, Naohiro Aota <naohiro.aota@xxxxxxx>, David Sterba <dsterba@xxxxxxxx>, Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Message-ID: <a6aa5997187d6e0172652cc29aea76be851c4cf6.1637225333.git.johannes.thumshirn@xxxxxxx> From: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> commit e6d261e3b1f777b499ce8f535ed44dd1b69278b7 upstream Now that we have a dedicated block group for relocation, we can use REQ_OP_WRITE instead of REQ_OP_ZONE_APPEND for writing out the data on relocation. Reviewed-by: Naohiro Aota <naohiro.aota@xxxxxxx> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/zoned.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -1304,6 +1304,17 @@ bool btrfs_use_zone_append(struct btrfs_ if (!is_data_inode(&inode->vfs_inode)) return false; + /* + * Using REQ_OP_ZONE_APPNED for relocation can break assumptions on the + * extent layout the relocation code has. + * Furthermore we have set aside own block-group from which only the + * relocation "process" can allocate and make sure only one process at a + * time can add pages to an extent that gets relocated, so it's safe to + * use regular REQ_OP_WRITE for this special case. + */ + if (btrfs_is_data_reloc_root(inode->root)) + return false; + cache = btrfs_lookup_block_group(fs_info, start); ASSERT(cache); if (!cache) Patches currently in stable-queue which might be from johannes.thumshirn@xxxxxxx are queue-5.15/btrfs-zoned-add-a-dedicated-data-relocation-block-group.patch queue-5.15/btrfs-check-for-relocation-inodes-on-zoned-btrfs-in-should_nocow.patch queue-5.15/btrfs-zoned-use-regular-writes-for-relocation.patch queue-5.15/btrfs-introduce-btrfs_is_data_reloc_root.patch queue-5.15/btrfs-zoned-allow-preallocation-for-relocation-inodes.patch queue-5.15/btrfs-zoned-only-allow-one-process-to-add-pages-to-a-relocation-inode.patch