Btrfs: set error return value in btrfs_get_blocks_direct
authorFilipe Manana <fdmanana@suse.com>
Mon, 7 Jul 2014 11:35:21 +0000 (12:35 +0100)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:37:32 +0000 (13:37 -0700)
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 <fdmanana@suse.com>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c

index 2370d72972e91b1f2aeb80b860bc9d2380455809..177508abb865d433be19acd96813bdb15f1da157 100644 (file)
@@ -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,