]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: simplify check for zoned NODATASUM writes in btrfs_submit_chunk()
authorZhen Ni <zhen.ni@easystack.cn>
Fri, 19 Dec 2025 07:36:49 +0000 (15:36 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:50:26 +0000 (07:50 +0100)
commitfdb945f6659374c9628509517901d49035b0e984
treea8c348ba5154f0084257d7404283371f91b8a6e5
parent8d206b0c21ef9b230627ff742170130912a1db3a
btrfs: simplify check for zoned NODATASUM writes in btrfs_submit_chunk()

This function already dereferences 'inode' multiple times earlier,
making the additional NULL check at line 840 redundant since the
function would have crashed already if inode were NULL.

After commit 81cea6cd7041 ("btrfs: remove btrfs_bio::fs_info by
extracting it from btrfs_bio::inode"), the btrfs_bio::inode field is
mandatory for all btrfs_bio allocations and is guaranteed to be
non-NULL.

Simplify the condition for allocating dummy checksums for zoned
NODATASUM data by removing the unnecessary 'inode &&' check.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/bio.c