mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 11:07:32 +07:00
btrfs: Fix error handling in zlib
Return failure if alloc_page() fails to allocate memory, and the upper code will just give up compression. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
This commit is contained in:
parent
8844355df7
commit
4b72029dc3
@ -225,6 +225,10 @@ int btrfs_zlib_compress_pages(struct address_space *mapping,
|
|||||||
data_in = kmap(in_page);
|
data_in = kmap(in_page);
|
||||||
|
|
||||||
out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
|
out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
|
||||||
|
if (out_page == NULL) {
|
||||||
|
ret = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
cpage_out = kmap(out_page);
|
cpage_out = kmap(out_page);
|
||||||
pages[0] = out_page;
|
pages[0] = out_page;
|
||||||
nr_pages = 1;
|
nr_pages = 1;
|
||||||
@ -263,6 +267,10 @@ int btrfs_zlib_compress_pages(struct address_space *mapping,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
|
out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
|
||||||
|
if (out_page == NULL) {
|
||||||
|
ret = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
cpage_out = kmap(out_page);
|
cpage_out = kmap(out_page);
|
||||||
pages[nr_pages] = out_page;
|
pages[nr_pages] = out_page;
|
||||||
nr_pages++;
|
nr_pages++;
|
||||||
|
Loading…
Reference in New Issue
Block a user