Re: [PATCH] btrfs: Don't generate UUID for non-fs tree

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

 



On Tue, Oct 31, 2017 at 02:08:16PM +0800, Qu Wenruo wrote:
> btrfs_create_tree() will unconditionally generate UUID for any root.
> So for quota tree and data reloc tree created by kernel, they will have
> unique UUIDs.
> 
> However UUID in root item is only referred by UUID tree, which only
> records UUID for fs trees.
> This makes unique UUIDs for quota/data reloc tree meaningless.
> 
> Leave the UUID as zero for non-fs tree, making btrfs-debug-tree output
> less confusing.
> 
> Reported-by: Misono Tomohiro <misono.tomohiro@xxxxxxxxxxxxxx>
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
> ---
>  fs/btrfs/disk-io.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index dfdab849037b..d85e04a675fe 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1403,7 +1403,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
>  	struct btrfs_root *root;
>  	struct btrfs_key key;
>  	int ret = 0;
> -	uuid_le uuid;
> +	uuid_le uuid = { 0 };

I get a warning with gcc 4.8.5

fs/btrfs/disk-io.c:1236:2: warning: missing braces around initializer [-Wmissing-braces]

but no warning with gcc 7.2.1 (built as 'make ccflags-y=-Wmissing-braces
and checking that the option is really there). I think we should use
NULL_UUID_LE.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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