All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: align max_zone_append_size to the sector size
@ 2022-07-14  9:16 Christoph Hellwig
  2022-07-14  9:21 ` Johannes Thumshirn
  2022-07-14 12:52 ` David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2022-07-14  9:16 UTC (permalink / raw)
  To: clm, josef, dsterba, naohiro.aota; +Cc: linux-btrfs

max_zone_append_size and thus the maximum extent size needs to be aligned
to the sector size, else a lot code becomes rather unhappy and various
alignment asserts trigger.

Fixes: 385ea2aea011 ("btrfs: replace BTRFS_MAX_EXTENT_SIZE with fs_info->max_extent_size")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/btrfs/zoned.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 3b45b35aa945c..fbad2e489dc80 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -739,7 +739,8 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 	}
 
 	fs_info->zone_size = zone_size;
-	fs_info->max_zone_append_size = max_zone_append_size;
+	fs_info->max_zone_append_size =
+		ALIGN(max_zone_append_size, fs_info->sectorsize);
 	fs_info->fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_ZONED;
 	if (fs_info->max_zone_append_size < fs_info->max_extent_size)
 		fs_info->max_extent_size = fs_info->max_zone_append_size;
-- 
2.30.2


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

end of thread, other threads:[~2022-07-18 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-14  9:16 [PATCH] btrfs: align max_zone_append_size to the sector size Christoph Hellwig
2022-07-14  9:21 ` Johannes Thumshirn
2022-07-14 12:52 ` David Sterba
2022-07-18  8:11   ` Christoph Hellwig
2022-07-18 14:31     ` David Sterba

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.