diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-07-27 15:57:44 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-07-27 16:11:41 -0400 |
commit | 75c195a2cac2c3c8366c0b87de2d6814c4f4d638 (patch) | |
tree | 82ac06d2c8f3746a3d438853d03239311c2a71a1 | |
parent | 2cf8572dac62cc2ff7e995173e95b6c694401b3f (diff) |
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>
-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: | |||
3474 | if (ret < 0) | 3474 | if (ret < 0) |
3475 | goto out; | 3475 | goto out; |
3476 | 3476 | ||
3477 | ret = 0; | ||
3478 | |||
3477 | /* | 3479 | /* |
3478 | * So if we were overcommitted it's possible that somebody else flushed | 3480 | * So if we were overcommitted it's possible that somebody else flushed |
3479 | * out enough space and we simply didn't have enough space to reclaim, | 3481 | * out enough space and we simply didn't have enough space to reclaim, |
@@ -3496,10 +3498,13 @@ again: | |||
3496 | goto out; | 3498 | goto out; |
3497 | 3499 | ||
3498 | ret = -EAGAIN; | 3500 | ret = -EAGAIN; |
3499 | if (trans || committed) | 3501 | if (trans) |
3500 | goto out; | 3502 | goto out; |
3501 | 3503 | ||
3502 | ret = -ENOSPC; | 3504 | ret = -ENOSPC; |
3505 | if (committed) | ||
3506 | goto out; | ||
3507 | |||
3503 | trans = btrfs_join_transaction(root); | 3508 | trans = btrfs_join_transaction(root); |
3504 | if (IS_ERR(trans)) | 3509 | if (IS_ERR(trans)) |
3505 | goto out; | 3510 | goto out; |