From 45dac7076a3a14c8c4af7be188454da7151d3c0b Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Thu, 8 Sep 2011 10:22:01 +0800 Subject: [PATCH] --- yaml --- r: 274666 b: refs/heads/master c: 560f7d75457f86a43970aa413e334e394082dce4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/inode.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e7d1aac1e2ee..7badc3c9afa5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a05a9bb18ae0abec0b513b5fde876c47905fa13e +refs/heads/master: 560f7d75457f86a43970aa413e334e394082dce4 diff --git a/trunk/fs/btrfs/inode.c b/trunk/fs/btrfs/inode.c index f12747c9447b..81d4f68f35c9 100644 --- a/trunk/fs/btrfs/inode.c +++ b/trunk/fs/btrfs/inode.c @@ -393,7 +393,10 @@ static noinline int compress_file_range(struct inode *inode, (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 @@ static noinline int compress_file_range(struct inode *inode, will_compress = 1; } } +cont: if (start == 0) { trans = btrfs_join_transaction(root); BUG_ON(IS_ERR(trans));