mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
Btrfs: remove BUG_ON() in compress_file_range()
It's not a big deal if we fail to allocate the array, and instead of panic we can just give up compressing. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
This commit is contained in:
parent
a05a9bb18a
commit
560f7d7545
@ -393,7 +393,10 @@ again:
|
||||
(BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS))) {
|
||||
WARN_ON(pages);
|
||||
pages = kzalloc(sizeof(struct page *) * nr_pages, GFP_NOFS);
|
||||
BUG_ON(!pages);
|
||||
if (!pages) {
|
||||
/* just bail out to the uncompressed code */
|
||||
goto cont;
|
||||
}
|
||||
|
||||
if (BTRFS_I(inode)->force_compress)
|
||||
compress_type = BTRFS_I(inode)->force_compress;
|
||||
@ -424,6 +427,7 @@ again:
|
||||
will_compress = 1;
|
||||
}
|
||||
}
|
||||
cont:
|
||||
if (start == 0) {
|
||||
trans = btrfs_join_transaction(root);
|
||||
BUG_ON(IS_ERR(trans));
|
||||
|
Loading…
Reference in New Issue
Block a user