diff options
author | Josef Bacik <josef@redhat.com> | 2011-08-19 10:31:56 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 15:12:38 -0400 |
commit | 482e6dc5261406fdb921946e70b51467b0305bad (patch) | |
tree | b3acb0574ea5b7a8bd4991c346f5166f0317bbf4 /fs/btrfs/relocation.c | |
parent | 07127184efb629f1336c0592bfdacec258cab731 (diff) |
Btrfs: allow callers to specify if flushing can occur for btrfs_block_rsv_check
If you run xfstest 224 it you will get lots of messages about not being able to
delete inodes and that they will be cleaned up next mount. This is because
btrfs_block_rsv_check was not calling reserve_metadata_bytes with the ability to
flush, so if there was not enough space, it simply failed. But in truncate and
evict case we could easily flush space to try and get enough space to do our
work, so make btrfs_block_rsv_check take a flush argument to pass down to
reserve_metadata_bytes. Now xfstests 224 runs fine without all those
complaints. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index aeaed99e9cfe..fd9ac66434b0 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2042,7 +2042,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc, | |||
2042 | trans->block_rsv = rc->block_rsv; | 2042 | trans->block_rsv = rc->block_rsv; |
2043 | 2043 | ||
2044 | ret = btrfs_block_rsv_check(trans, root, rc->block_rsv, | 2044 | ret = btrfs_block_rsv_check(trans, root, rc->block_rsv, |
2045 | min_reserved, 0); | 2045 | min_reserved, 0, 0); |
2046 | if (ret) { | 2046 | if (ret) { |
2047 | BUG_ON(ret != -EAGAIN); | 2047 | BUG_ON(ret != -EAGAIN); |
2048 | ret = btrfs_commit_transaction(trans, root); | 2048 | ret = btrfs_commit_transaction(trans, root); |
@@ -3775,7 +3775,7 @@ restart: | |||
3775 | } | 3775 | } |
3776 | 3776 | ||
3777 | ret = btrfs_block_rsv_check(trans, rc->extent_root, | 3777 | ret = btrfs_block_rsv_check(trans, rc->extent_root, |
3778 | rc->block_rsv, 0, 5); | 3778 | rc->block_rsv, 0, 5, 0); |
3779 | if (ret < 0) { | 3779 | if (ret < 0) { |
3780 | if (ret != -EAGAIN) { | 3780 | if (ret != -EAGAIN) { |
3781 | err = ret; | 3781 | err = ret; |