Btrfs: Fix the problem that the replace destroys the seed filesystem
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 24 Jul 2014 03:37:06 +0000 (11:37 +0800)
committerChris Mason <clm@fb.com>
Tue, 19 Aug 2014 15:52:16 +0000 (08:52 -0700)
The seed filesystem was destroyed by the device replace, the reproduce
method is:
 # mkfs.btrfs -f <dev0>
 # btrfstune -S 1 <dev0>
 # mount <dev0> <mnt>
 # btrfs device add <dev1> <mnt>
 # umount <mnt>
 # mount <dev1> <mnt>
 # btrfs replace start -f <dev0> <dev2> <mnt>
 # umount <mnt>
 # mount <dev0> <mnt>

It is because we erase the super block on the seed device. It is wrong,
we should not change anything on the seed device.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/volumes.c

Simple merge