From: Wang Shilong Date: Tue, 13 May 2014 09:05:06 +0000 (+0800) Subject: Btrfs: set right total device count for seeding support X-Git-Tag: omap-for-v3.16/fixes-against-rc1~54^2~37 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=298658414a2f0bea1f05a81876a45c1cd96aa2e0;p=pandora-kernel.git Btrfs: set right total device count for seeding support Seeding device support allows us to create a new filesystem based on existed filesystem. However newly created filesystem's @total_devices should include seed devices. This patch fix the following problem: # mkfs.btrfs -f /dev/sdb # btrfstune -S 1 /dev/sdb # mount /dev/sdb /mnt # btrfs device add -f /dev/sdc /mnt --->fs_devices->total_devices = 1 # umount /mnt # mount /dev/sdc /mnt --->fs_devices->total_devices = 2 This is because we record right @total_devices in superblock, but @fs_devices->total_devices is reset to be 0 in btrfs_prepare_sprout(). Fix this problem by not resetting @fs_devices->total_devices. Signed-off-by: Wang Shilong Signed-off-by: Chris Mason --- Reading git-diff-tree failed