btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Fri, 23 Mar 2018 08:16:49 +0000 (17:16 +0900)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 20:15:54 +0000 (22:15 +0200)
commit0a0a03554aaf56a6e7245e74fa7d8b3c53f1c20f
treec78e8b0fb65cd6516fb4cec7569182688ab4fe3e
parent30b852cd7e2299ba7795cd302d783724d88e101f
btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE

Currently, the top-level subvolume lacks the UUID. As a result, both
non-snapshot subvolume and snapshot of top-level subvolume do not have
Parent UUID and cannot be distinguisued. Therefore "fi show" of
top-level lists all the subvolumes which lacks the UUID in
"Snapshot(s)" filed.  Also, it lacks the otime information.

Fix this by adding the UUID and otime at the mkfs time.  As a
consequence, snapshots of top-level subvolume now have a Parent UUID and
UUID tree will create an entry for top-level subvolume at mount time.
This should not cause the problem for current kernel, but user program
which relies on the empty Parent UUID may be affected by this change.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
mkfs/common.c
mkfs/main.c