Skip to content

Commit ca84913

Browse files
fdmananakdave
authored andcommitted
btrfs: remove superfluous return value check at btrfs_dio_iomap_begin()
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 <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d3914d6 commit ca84913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/btrfs/direct-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ static int btrfs_dio_iomap_begin(struct inode *inode, loff_t start,
439439
start, data_alloc_len, false);
440440
if (!ret)
441441
dio_data->data_space_reserved = true;
442-
else if (ret && !(BTRFS_I(inode)->flags &
443-
(BTRFS_INODE_NODATACOW | BTRFS_INODE_PREALLOC)))
442+
else if (!(BTRFS_I(inode)->flags &
443+
(BTRFS_INODE_NODATACOW | BTRFS_INODE_PREALLOC)))
444444
goto err;
445445
}
446446

0 commit comments

Comments
 (0)