Skip to content

Commit

Permalink
Btrfs: stop refusing the relocation of chunk 0
Browse files Browse the repository at this point in the history
AFAICT chunk 0 is no longer special, and so it should be restriped just
like every other chunk.  One reason for this change is us refusing the
relocation can lead to filesystems that can only be mounted ro, and
never rw -- see the bugzilla [1] for details.  The other reason is that
device removal code is already doing this: it will happily relocate
chunk 0 is part of shrinking the device.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=60594

Reported-by: Xavier Bassery <xavier@bartica.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Ilya Dryomov authored and Chris Mason committed Sep 1, 2013
1 parent d8f9803 commit 795a332
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2997,10 +2997,6 @@ static int __btrfs_balance(struct btrfs_fs_info *fs_info)
if (found_key.objectid != key.objectid)
break;

/* chunk zero is special */
if (found_key.offset == 0)
break;

chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);

if (!counting) {
Expand Down Expand Up @@ -3036,6 +3032,8 @@ static int __btrfs_balance(struct btrfs_fs_info *fs_info)
spin_unlock(&fs_info->balance_lock);
}
loop:
if (found_key.offset == 0)
break;
key.offset = found_key.offset - 1;
}

Expand Down

0 comments on commit 795a332

Please sign in to comment.