* [PATCH] btrfs-progs: ins: print uuid only if it exists
@ 2017-10-31 5:39 Misono, Tomohiro
2017-10-31 5:50 ` Qu Wenruo
0 siblings, 1 reply; 2+ messages in thread
From: Misono, Tomohiro @ 2017-10-31 5:39 UTC (permalink / raw)
To: linux-btrfs
UUID of ROOT_ITEM is empty if it is not subvolume (and not created by
kernel). So, just skip it if it is empty just like parent/received UUID.
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
print-tree.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/print-tree.c b/print-tree.c
index 8abd760..9d1b862 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -581,8 +581,10 @@ static void print_root_item(struct extent_buffer *leaf, int slot)
flags_str);
if (root_item.generation == root_item.generation_v2) {
- uuid_unparse(root_item.uuid, uuid_str);
- printf("\t\tuuid %s\n", uuid_str);
+ if (!empty_uuid(root_item.uuid)) {
+ uuid_unparse(root_item.uuid, uuid_str);
+ printf("\t\tuuid %s\n", uuid_str);
+ }
if (!empty_uuid(root_item.parent_uuid)) {
uuid_unparse(root_item.parent_uuid, uuid_str);
printf("\t\tparent_uuid %s\n", uuid_str);
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] btrfs-progs: ins: print uuid only if it exists
2017-10-31 5:39 [PATCH] btrfs-progs: ins: print uuid only if it exists Misono, Tomohiro
@ 2017-10-31 5:50 ` Qu Wenruo
0 siblings, 0 replies; 2+ messages in thread
From: Qu Wenruo @ 2017-10-31 5:50 UTC (permalink / raw)
To: Misono, Tomohiro, linux-btrfs
[-- Attachment #1.1: Type: text/plain, Size: 1100 bytes --]
On 2017年10月31日 13:39, Misono, Tomohiro wrote:
> UUID of ROOT_ITEM is empty if it is not subvolume (and not created by
> kernel). So, just skip it if it is empty just like parent/received UUID.
>
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> print-tree.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/print-tree.c b/print-tree.c
> index 8abd760..9d1b862 100644
> --- a/print-tree.c
> +++ b/print-tree.c
> @@ -581,8 +581,10 @@ static void print_root_item(struct extent_buffer *leaf, int slot)
> flags_str);
>
> if (root_item.generation == root_item.generation_v2) {
> - uuid_unparse(root_item.uuid, uuid_str);
> - printf("\t\tuuid %s\n", uuid_str);
> + if (!empty_uuid(root_item.uuid)) {
> + uuid_unparse(root_item.uuid, uuid_str);
> + printf("\t\tuuid %s\n", uuid_str);
> + }
> if (!empty_uuid(root_item.parent_uuid)) {
> uuid_unparse(root_item.parent_uuid, uuid_str);
> printf("\t\tparent_uuid %s\n", uuid_str);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 504 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-31 5:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-31 5:39 [PATCH] btrfs-progs: ins: print uuid only if it exists Misono, Tomohiro
2017-10-31 5:50 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).