aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2010-11-12 18:17:56 -0500
committerChris Mason <chris.mason@oracle.com>2010-11-21 22:26:04 -0500
commit6f33434850ed87dc5e56b60ebbad3d3cf405f296 (patch)
treee70433c2c1fe59180bb8a92341f73931eff7ddb0 /fs
parente65e1535542931e51189832264cd282e5899e4b9 (diff)
btrfs: Fix early enospc because 'unused' calculated with wrong sign.
'unused' calculated with wrong sign in reserve_metadata_bytes(). This might have lead to unwanted over-reservations. Signed-off-by: Arne Jansen <sensille@gmx.net> Reviewed-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a541bc87f04c..ddaf6340fe7f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3413,7 +3413,7 @@ again:
3413 * our reservation. 3413 * our reservation.
3414 */ 3414 */
3415 if (unused <= space_info->total_bytes) { 3415 if (unused <= space_info->total_bytes) {
3416 unused -= space_info->total_bytes; 3416 unused = space_info->total_bytes - unused;
3417 if (unused >= num_bytes) { 3417 if (unused >= num_bytes) {
3418 if (!reserved) 3418 if (!reserved)
3419 space_info->bytes_reserved += orig_bytes; 3419 space_info->bytes_reserved += orig_bytes;