From: Chris Mason Date: Thu, 26 May 2011 21:43:59 +0000 (-0400) Subject: Btrfs: return -ENOMEM in clear_extent_bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c309df07868baa8b05d2a70637096465746fdbb5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Btrfs: return -ENOMEM in clear_extent_bit The btrfs releasepage function depends on ENOMEM coming back when it is called atomic. Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index a90c4a12556b..0e0fe0f6ec75 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -485,7 +485,8 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, again: if (!prealloc && (mask & __GFP_WAIT)) { prealloc = alloc_extent_state(mask); - BUG_ON(!prealloc); + if (!prealloc) + return -ENOMEM; } spin_lock(&tree->lock);