Btrfs: Fix space checking during fs resize
authorDaniel J Blueman <daniel@quora.org>
Fri, 27 Apr 2012 16:41:46 +0000 (12:41 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 27 Apr 2012 17:55:14 +0000 (13:55 -0400)
Fix out-of-space checking, addressing a warning and potential resource
leak when resizing the filesystem down while allocating blocks.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

fs/btrfs/relocation.c

index 5a105a0..646ee21 100644 (file)
@@ -3813,7 +3813,7 @@ restart:
 
                ret = btrfs_block_rsv_check(rc->extent_root, rc->block_rsv, 5);
                if (ret < 0) {
-                       if (ret != -EAGAIN) {
+                       if (ret != -ENOSPC) {
                                err = ret;
                                WARN_ON(1);
                                break;