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

Commit b9aa55be authored by Liu Bo's avatar Liu Bo Committed by Josef Bacik
Browse files

Btrfs: return errno if possible when we fail to allocate memory



We need to set return value explicitly, otherwise we'll lose the error
value.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent d88033db
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -714,8 +714,10 @@ static noinline int submit_compressed_extents(struct inode *inode,
					async_extent->ram_size - 1, 0);

		em = alloc_extent_map();
		if (!em)
		if (!em) {
			ret = -ENOMEM;
			goto out_free_reserve;
		}
		em->start = async_extent->start;
		em->len = async_extent->ram_size;
		em->orig_start = em->start;
@@ -922,8 +924,10 @@ static noinline int __cow_file_range(struct btrfs_trans_handle *trans,
		}

		em = alloc_extent_map();
		if (!em)
		if (!em) {
			ret = -ENOMEM;
			goto out_reserve;
		}
		em->start = start;
		em->orig_start = em->start;
		ram_size = ins.offset;