Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 555e1286 authored by Filipe Manana's avatar Filipe Manana Committed by Chris Mason
Browse files

Btrfs: set error return value in btrfs_get_blocks_direct



We were returning with 0 (success) because we weren't extracting the
error code from em (PTR_ERR(em)). Fix it.

Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 27a3507d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7143,9 +7143,11 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
						       block_start, len,
						       orig_block_len,
						       ram_bytes, type);
				if (IS_ERR(em))
				if (IS_ERR(em)) {
					ret = PTR_ERR(em);
					goto unlock_err;
				}
			}

			ret = btrfs_add_ordered_extent_dio(inode, start,
					   block_start, len, len, type);