]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove superfluous return value check at btrfs_dio_iomap_begin()
authorFilipe Manana <fdmanana@suse.com>
Fri, 9 May 2025 16:29:55 +0000 (17:29 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:57 +0000 (14:30 +0200)
In the if statement that checks the return value from
btrfs_check_data_free_space(), there's no point to check if 'ret' is not
zero in the else branch, since the main if branch checked that it's zero,
so in the else branch it necessarily has a non-zero value.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/direct-io.c

index 546410c8fac0fee1fa136b7d0b604eecfabf8f35..fe9a4bd7e6e6831b61b7b8f9f4242363e492b2fa 100644 (file)
@@ -439,8 +439,8 @@ static int btrfs_dio_iomap_begin(struct inode *inode, loff_t start,
                                                  start, data_alloc_len, false);
                if (!ret)
                        dio_data->data_space_reserved = true;
-               else if (ret && !(BTRFS_I(inode)->flags &
-                                 (BTRFS_INODE_NODATACOW | BTRFS_INODE_PREALLOC)))
+               else if (!(BTRFS_I(inode)->flags &
+                          (BTRFS_INODE_NODATACOW | BTRFS_INODE_PREALLOC)))
                        goto err;
        }