]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Btrfs: Clear space_info full when adding new devices
authorChris Mason <chris.mason@oracle.com>
Tue, 10 Mar 2009 17:17:18 +0000 (13:17 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 10 Mar 2009 17:17:18 +0000 (13:17 -0400)
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

index 7aa3810d7f69523c81b5b6b45b08681f58dac848..dd06e18e5aac7518191e02791073345e6a0f51cd 100644 (file)
@@ -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);