Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs: zoned: unify relocation on a zoned and regular FS
@ 2021-09-03 14:44 Johannes Thumshirn
  2021-09-03 14:44 ` [PATCH 1/6] btrfs: introduce btrfs_is_data_reloc_root Johannes Thumshirn
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Johannes Thumshirn @ 2021-09-03 14:44 UTC (permalink / raw)
  To: David Sterba
  Cc: Johannes Thumshirn, linux-btrfs, Filipe Manana, Damien Le Moal,
	Naohiro Aota

A while ago David reported a bug in zoned btrfs' relocation code. The bug is
triggered because relocation on a zoned filesystem does not preallocate the
extents it copies and a writeback process running in parallel can cause a
split of the written extent. But splitting extents is currently not allowed on
relocation as it assumes a one to one copy of the relocated extents.

This causes transaction aborts and the fielssytem switching to read-only in
order to prevent further damage.

The first patch in this series is just a preparation to avoid overly long
lines in follow up patches. Patch number two adds a dedicated block group for
relocation on a zoned filesystem. Patch three switches relocation from
REQ_OP_ZONE_APPEND to regular REQ_OP_WRITE, four prepares an ASSERT()ion that
we can enter the nocow path on a  zoned filesystem under very special
circumstances and the fifth patch then switches the relocation code for a
zoned filesystem to using the same code path as we use on a non zoned
filesystem. As the changes before have made the prerequisites to do so. The
last patch in this series is jsut a simple rename of a function whose name we
have twice in the btrfs codebase but with a different purpose in different
files.

Johannes Thumshirn (6):
  btrfs: introduce btrfs_is_data_reloc_root
  btrfs: zoned: add a dedicated data relocation block group
  btrfs: zoned: use regular writes for relocation
  btrfs: check for relocation inodes on zoned btrfs in should_nocow
  btrfs: zoned: allow preallocation for relocation inodes
  btrfs: rename setup_extent_mapping in relocation code

 fs/btrfs/block-group.c |  1 +
 fs/btrfs/ctree.h       |  7 ++++++
 fs/btrfs/disk-io.c     |  3 ++-
 fs/btrfs/extent-tree.c | 52 +++++++++++++++++++++++++++++++++++++++---
 fs/btrfs/inode.c       | 22 ++++++++----------
 fs/btrfs/relocation.c  | 43 +++++-----------------------------
 fs/btrfs/zoned.c       |  3 +++
 fs/btrfs/zoned.h       |  9 ++++++++
 8 files changed, 87 insertions(+), 53 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-07 12:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox