btrfs: flush_space: treat return value of do_chunk_alloc properly
[cascardo/linux.git] / fs / btrfs / extent-tree.c
index e962b0e..d2cc16f 100644 (file)
@@ -4882,7 +4882,7 @@ static int flush_space(struct btrfs_root *root,
                                     btrfs_get_alloc_profile(root, 0),
                                     CHUNK_ALLOC_NO_FORCE);
                btrfs_end_transaction(trans, root);
-               if (ret == -ENOSPC)
+               if (ret > 0 || ret == -ENOSPC)
                        ret = 0;
                break;
        case COMMIT_TRANS: