Btrfs-progs: fix wrong way to check if the root item contains otime and uuid
authorMiao Xie <miaox@cn.fujitsu.com>
Sat, 1 Sep 2012 08:45:30 +0000 (16:45 +0800)
committerroot <root@localhost.localdomain>
Thu, 4 Oct 2012 20:26:32 +0000 (16:26 -0400)
commit7cb1cf754229062ea412aa651a0f750ce42c113d
tree8a06b465224bcc81b9c69be3c96c69a5fa07cef2
parentf0d08f254cf502ffbd69df543b6e938c9e1fe583
Btrfs-progs: fix wrong way to check if the root item contains otime and uuid

Now we check if the root item contains otime and uuid or not by comparing
->generation_v2 and ->generation of the btrfs_root_item structure, it is
wrong because it is possbile that ->generation may equal to the first
variant of the next item. We fix this problem by check the size of btrfs_root_item,
if it is larger than the original one, the new btrfs_root_item contains otime
and uuid. we needn't worry the case that the new filesystem is mounted on the
old kernel. because the otime and uuid are not changed on the old kernel, we can
get the correct result even on the kernel.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
btrfs-list.c
ctree.h