From: Li Zefan Date: Mon, 28 Mar 2011 02:01:25 +0000 (+0000) Subject: Btrfs: Fix uninitialized root flags for subvolumes X-Git-Tag: v2.6.39-rc2~6^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08fe4db170b4193603d9d31f40ebaf652d07ac9c;p=pandora-kernel.git Btrfs: Fix uninitialized root flags for subvolumes root_item->flags and root_item->byte_limit are not initialized when a subvolume is created. This bug is not revealed until we added readonly snapshot support - now you mount a btrfs filesystem and you may find the subvolumes in it are readonly. To work around this problem, we steal a bit from root_item->inode_item->flags, and use it to indicate if those fields have been properly initialized. When we read a tree root from disk, we check if the bit is set, and if not we'll set the flag and initialize the two fields of the root item. Reported-by: Andreas Philipp Signed-off-by: Li Zefan Tested-by: Andreas Philipp cc: stable@kernel.org Signed-off-by: Chris Mason --- Reading git-diff-tree failed