From 555e12864063762964433139dee651c5b859a047 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Mon, 7 Jul 2014 12:35:21 +0100 Subject: [PATCH] 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: Filipe Manana Reviewed-by: Satoru Takeuchi Signed-off-by: Chris Mason --- fs/btrfs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2370d72972e9..177508abb865 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7143,8 +7143,10 @@ 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, -- 2.20.1