Btrfs: handle no memory properly in prepare_pages
authorJosef Bacik <josef@redhat.com>
Tue, 25 Jan 2011 22:11:54 +0000 (22:11 +0000)
committerChris Mason <chris.mason@oracle.com>
Fri, 28 Jan 2011 21:42:34 +0000 (16:42 -0500)
commit7adf5dfbb3af65a00e20b3ead224c3a1b40e4ec4
tree5723e9679a7926ea744c242cc8351e64ce7503e4
parentad0397a7a97f55fd7f70998ec208c5d8b90310ff
Btrfs: handle no memory properly in prepare_pages

Instead of doing a BUG_ON(1) in prepare_pages if grab_cache_page() fails, just
loop through the pages we've already grabbed and unlock and release them, then
return -ENOMEM like we should.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/file.c