Btrfs: Clear space_info full when adding new devices

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 19, 2009 - 2:59 pm

Gitweb:     http://git.kernel.org/linus/913d952eb573c3d1f7487e83b5590e13e7cae2bd
Commit:     913d952eb573c3d1f7487e83b5590e13e7cae2bd
Parent:     4184ea7f908d95f329febc3665cf66da8568b467
Author:     Chris Mason <chris.mason@oracle.com>
AuthorDate: Tue Mar 10 13:17:18 2009 -0400
Committer:  Chris Mason <chris.mason@oracle.com>
CommitDate: Tue Mar 10 13:17:18 2009 -0400

    Btrfs: Clear space_info full when adding new devices
    
    The full flag on the space info structs tells the allocator not to try
    and allocate more chunks because the devices in the FS are fully allocated.
    
    When more devices are added, we need to clear the full flag so the allocator
    knows it has more space available.
    
    Signed-off-by: Chris Mason <chris.mason@oracle.com>
---
 fs/btrfs/volumes.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 7aa3810..dd06e18 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1374,6 +1374,12 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
 		ret = btrfs_add_device(trans, root, device);
 	}
 
+	/*
+	 * we've got more storage, clear any full flags on the space
+	 * infos
+	 */
+	btrfs_clear_space_info_full(root->fs_info);
+
 	unlock_chunks(root);
 	btrfs_commit_transaction(trans, root);
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Btrfs: Clear space_info full when adding new devices, Linux Kernel Mailing ..., (Thu Mar 19, 2:59 pm)