Files
linux/fs/btrfs
Li Zefan e8a798830e Btrfs: Fix uninitialized root flags for subvolumes
commit 08fe4db170 upstream.

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 <philipp.andreas@gmail.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Tested-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-14 16:53:27 -07:00
..
2008-09-25 11:04:06 -04:00
2009-02-04 09:28:28 -05:00
2009-04-02 16:46:06 -04:00
2010-08-13 13:19:57 -07:00
2009-01-05 21:25:51 -05:00