Skip to content

Commit 881a3a1

Browse files
Pavel Machekkdave
authored andcommitted
btrfs: fix return value mixup in btrfs_get_extent
btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err so the error code is lost. Fixes: 6bf9e4b ("btrfs: inode: Verify inode mode to avoid NULL pointer dereference") CC: [email protected] # 5.4+ Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Pavel Machek (CIP) <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 62ab2cc commit 881a3a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6627,7 +6627,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
66276627
extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
66286628
/* Only regular file could have regular/prealloc extent */
66296629
if (!S_ISREG(inode->vfs_inode.i_mode)) {
6630-
ret = -EUCLEAN;
6630+
err = -EUCLEAN;
66316631
btrfs_crit(fs_info,
66326632
"regular/prealloc extent found for non-regular inode %llu",
66336633
btrfs_ino(inode));

0 commit comments

Comments
 (0)