Re: [PATCH] btrfs-progs: ins: print uuid only if it exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxx>

Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>

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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux