Browse Source

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 <chris.mason@oracle.com>
Chris Mason 14 years ago
parent
commit
c309df0786
1 changed files with 2 additions and 1 deletions
  1. 2 1
      fs/btrfs/extent_io.c

+ 2 - 1
fs/btrfs/extent_io.c

@@ -485,7 +485,8 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
 again:
 again:
 	if (!prealloc && (mask & __GFP_WAIT)) {
 	if (!prealloc && (mask & __GFP_WAIT)) {
 		prealloc = alloc_extent_state(mask);
 		prealloc = alloc_extent_state(mask);
-		BUG_ON(!prealloc);
+		if (!prealloc)
+			return -ENOMEM;
 	}
 	}
 
 
 	spin_lock(&tree->lock);
 	spin_lock(&tree->lock);