summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2010-11-12 23:17:56 +0000
committerChris Mason <chris.mason@oracle.com>2010-11-21 22:26:04 -0500
commit6f33434850ed87dc5e56b60ebbad3d3cf405f296 (patch)
treee70433c2c1fe59180bb8a92341f73931eff7ddb0
parente65e1535542931e51189832264cd282e5899e4b9 (diff)
downloadlinux-stable-6f33434850ed87dc5e56b60ebbad3d3cf405f296.tar.gz
linux-stable-6f33434850ed87dc5e56b60ebbad3d3cf405f296.tar.bz2
linux-stable-6f33434850ed87dc5e56b60ebbad3d3cf405f296.zip
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>
-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:
* our reservation.
*/
if (unused <= space_info->total_bytes) {
- unused -= space_info->total_bytes;
+ unused = space_info->total_bytes - unused;
if (unused >= num_bytes) {
if (!reserved)
space_info->bytes_reserved += orig_bytes;