aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2012-11-05 12:29:28 -0500
committerJosef Bacik <jbacik@fusionio.com>2012-12-12 17:15:39 -0500
commit63a212abc2315972b245f93cb11ae3acf3c0b513 (patch)
tree65d9f4020795b6a3521bf0a94922a082ae4ede6f /fs/btrfs/extent-tree.c
parent5ac00addc7ac09110995fe967071d191b5981cc1 (diff)
Btrfs: disallow some operations on the device replace target device
This patch adds some code to disallow operations on the device that is used as the target for the device replace operation. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b4d438f6c2b..98af8379895 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7468,7 +7468,8 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
7468 * check to make sure we can actually find a chunk with enough 7468 * check to make sure we can actually find a chunk with enough
7469 * space to fit our block group in. 7469 * space to fit our block group in.
7470 */ 7470 */
7471 if (device->total_bytes > device->bytes_used + min_free) { 7471 if (device->total_bytes > device->bytes_used + min_free &&
7472 !device->is_tgtdev_for_dev_replace) {
7472 ret = find_free_dev_extent(device, min_free, 7473 ret = find_free_dev_extent(device, min_free,
7473 &dev_offset, NULL); 7474 &dev_offset, NULL);
7474 if (!ret) 7475 if (!ret)