Re: [PATCH] btrfs: zoned: limit ordered extent to zoned append size
From: David Sterba <hidden>
Date: 2021-06-01 19:01:23
On Tue, Jun 01, 2021 at 07:44:29AM +0000, Johannes Thumshirn wrote:
On 31/05/2021 21:01, David Sterba wrote:quoted
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.
Ah right, self tests have some exceptions regarding fsinfo though IIRC ther's always some but maybe not fully setup or with some artifical nodesize etc to test the structures that are just in memory. I'd rather not pull selftets-specific code so if it really crashed in tests then let's please fix the tests.