Re: [PATCH] btrfs: zoned: limit ordered extent to zoned append size
From: Johannes Thumshirn <hidden>
Date: 2021-06-01 07:44:35
On 31/05/2021 21:01, David Sterba wrote:
On Fri, May 21, 2021 at 06:11:04PM +0900, Johannes Thumshirn wrote:quoted
--- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c@@ -1860,6 +1860,7 @@ noinline_for_stack bool find_lock_delalloc_range(struct inode *inode, u64 *end) { struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; + struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); u64 max_bytes = BTRFS_MAX_EXTENT_SIZE; u64 delalloc_start; u64 delalloc_end;@@ -1868,6 +1869,9 @@ noinline_for_stack bool find_lock_delalloc_range(struct inode *inode, int ret; int loops = 0; + if (fs_info && fs_info->max_zone_append_size)Do you really need to check for a valid fs_info? It's derived from an inode so it must be valid or something is seriously wrong.
I thought it was because some selftest tripped over a NULL pointer, but it looks very much like cargo cult. I'll recheck.
quoted
+ max_bytes = ALIGN_DOWN(fs_info->max_zone_append_size, + PAGE_SIZE);Right now the page alignment sounds ok because the delalloc code works on page granularity. There's the implicit assumpption that data blocks are page-sized, but the whole delalloc engine works on pages so no reason to use anything else.