diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-03-28 02:01:25 +0000 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2011-04-28 08:20:52 -0700 |
commit | f86c63dd724d6779a6b193206d31008e0dc53c12 (patch) | |
tree | eb3aca432c569987033d07492275989f15c35de2 /fs/ubifs/commit.c | |
parent | 18569f1467745ca8ebe929ecc43046ab71fd01a5 (diff) |
Btrfs: Fix uninitialized root flags for subvolumes
commit 08fe4db170b4193603d9d31f40ebaf652d07ac9c 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>
Signed-off-by: Andi Kleen <ak@linux.intel.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>
Diffstat (limited to 'fs/ubifs/commit.c')
0 files changed, 0 insertions, 0 deletions