linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz
Subject: Re: [PATCH] btrfs: Don't generate UUID for non-fs tree
Date: Wed, 3 Jan 2018 15:37:08 +0100	[thread overview]
Message-ID: <20180103143708.GC3553@twin.jikos.cz> (raw)
In-Reply-To: <20171031060816.683-1-wqu@suse.com>

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@jp.fujitsu.com>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  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.

  parent reply	other threads:[~2018-01-03 14:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  6:08 [PATCH] btrfs: Don't generate UUID for non-fs tree Qu Wenruo
2017-11-06 15:28 ` David Sterba
2017-11-07  0:43   ` Qu Wenruo
2018-01-03 14:37 ` David Sterba [this message]
2018-01-04  1:38   ` Qu Wenruo
2018-01-05 12:48     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180103143708.GC3553@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).