projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d88033d
)
Btrfs: return errno if possible when we fail to allocate memory
author
Liu Bo
<
[email protected]
>
Tue, 14 May 2013 02:12:15 +0000
(
02:12
+0000)
committer
Josef Bacik
<
[email protected]
>
Sat, 18 May 2013 01:40:27 +0000
(21:40 -0400)
We need to set return value explicitly, otherwise we'll lose the error
value.
Signed-off-by: Liu Bo <
[email protected]
>
Signed-off-by: Josef Bacik <
[email protected]
>
fs/btrfs/inode.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/inode.c
b/fs/btrfs/inode.c
index 1669c3b4be2f4ba1f318d9e677f336df87ea41b2..99a9c25d36a6b8eb2eb074362e61ac205aa6715e 100644
(file)
--- a/
fs/btrfs/inode.c
+++ b/
fs/btrfs/inode.c
@@
-714,8
+714,10
@@
retry:
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;