Thread (86 messages) 86 messages, 7 authors, 2021-01-15

Re: [PATCH v11 35/40] btrfs: enable relocation in ZONED mode

From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-01-12 19:44:37
Also in: linux-fsdevel

On 12/21/20 10:49 PM, Naohiro Aota wrote:
quoted hunk ↗ jump to hunk
To serialize allocation and submit_bio, we introduced mutex around them. As
a result, preallocation must be completely disabled to avoid a deadlock.

Since current relocation process relies on preallocation to move file data
extents, it must be handled in another way. In ZONED mode, we just truncate
the inode to the size that we wanted to pre-allocate. Then, we flush dirty
pages on the file before finishing relocation process.
run_delalloc_zoned() will handle all the allocation and submit IOs to the
underlying layers.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
  fs/btrfs/relocation.c | 35 +++++++++++++++++++++++++++++++++--
  1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 30a80669647f..94c72bea6a43 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2553,6 +2553,32 @@ static noinline_for_stack int prealloc_file_extent_cluster(
  	if (ret)
  		return ret;
  
+	/*
+	 * In ZONED mode, we cannot preallocate the file region. Instead, we
+	 * dirty and fiemap_write the region.
+	 */
+
nit: extra newline.

otherwise you can add

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help