From: Liu Bo Date: Fri, 11 May 2012 10:11:26 +0000 (+0800) Subject: Btrfs: do not do balance in readonly mode X-Git-Tag: v3.5-rc1~17^2~1^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba1f6e44ed7a1fa52d3f292508bf921b5054172;p=pandora-kernel.git Btrfs: do not do balance in readonly mode In normal cases, we would not be allowed to do balance in RO mode. However, when we're using a seeding device and adding another device to sprout, things will change: $ mkfs.btrfs /dev/sdb7 $ btrfstune -S 1 /dev/sdb7 $ mount /dev/sdb7 /mnt/btrfs -o ro $ btrfs fi bal /mnt/btrfs -----------------------> fail. $ btrfs dev add /dev/sdb8 /mnt/btrfs $ btrfs fi bal /mnt/btrfs -----------------------> works! It should not be designed as an exception, and we'd better add another check for mnt flags. Signed-off-by: Liu Bo Reviewed-by: Josef Bacik --- Reading git-diff-tree failed