diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-07-27 21:57:44 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-07-27 22:11:41 +0200 |
commit | 75c195a2cac2c3c8366c0b87de2d6814c4f4d638 (patch) | |
tree | 82ac06d2c8f3746a3d438853d03239311c2a71a1 /fs | |
parent | Btrfs: use the commit_root for reading free_space_inode crcs (diff) | |
download | linux-75c195a2cac2c3c8366c0b87de2d6814c4f4d638.tar.xz linux-75c195a2cac2c3c8366c0b87de2d6814c4f4d638.zip |
Btrfs: make sure reserve_metadata_bytes doesn't leak out strange errors
The btrfs transaction code will return any errors that come from
reserve_metadata_bytes. We need to make sure we don't return funny
things like 1 or EAGAIN.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 06a5ee29b446..4d08ed79405d 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3474,6 +3474,8 @@ again: if (ret < 0) goto out; + ret = 0; + /* * So if we were overcommitted it's possible that somebody else flushed * out enough space and we simply didn't have enough space to reclaim, @@ -3496,10 +3498,13 @@ again: goto out; ret = -EAGAIN; - if (trans || committed) + if (trans) goto out; ret = -ENOSPC; + if (committed) + goto out; + trans = btrfs_join_transaction(root); if (IS_ERR(trans)) goto out; |