public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Mika Eloranta <mel@ohmu.fi>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] mkfs.xfs: add [-U uuid] option
Date: Tue, 22 Sep 2015 08:18:39 +1000	[thread overview]
Message-ID: <20150921221839.GC19114@dastard> (raw)
In-Reply-To: <1442855060-38259-1-git-send-email-mel@ohmu.fi>

On Mon, Sep 21, 2015 at 08:04:20PM +0300, Mika Eloranta wrote:
> The UUID can now be optionally specified during filesystem
> creation.

Which UUID are you wanting to set - the metadata uuid or the user
visible UUID label? Or both? Can you explain the use case for this?
i.e. I'm trying to work out why Why doesn't mkfs.xfs +
xfs_admin -U <uuid> doesn't work for you?

We need some explaination in the commit message so that when we look
at this in a couple of years time we know why we added this to
mkfs...

> @@ -948,6 +948,7 @@ main(
>  	bool			finobtflag;
>  	int			spinodes;
>  
> +	platform_uuid_clear(&uuid);
>  	progname = basename(argv[0]);
>  	setlocale(LC_ALL, "");
>  	bindtextdomain(PACKAGE, LOCALEDIR);
> @@ -990,7 +991,7 @@ main(
>  	xi.isdirect = LIBXFS_DIRECT;
>  	xi.isreadonly = LIBXFS_EXCLUSIVELY;
>  
> -	while ((c = getopt(argc, argv, "b:d:i:l:L:m:n:KNp:qr:s:CfV")) != EOF) {
> +	while ((c = getopt(argc, argv, "b:d:i:l:L:U:m:n:KNp:qr:s:CfV")) != EOF) {
>  		switch (c) {
>  		case 'C':
>  		case 'f':
> @@ -1465,6 +1466,10 @@ main(
>  				illegal(optarg, "L");
>  			label = optarg;
>  			break;
> +		case 'U':
> +			if (platform_uuid_parse(optarg, &uuid))
> +				illegal(optarg, "U");
> +			break;

I'd prefer not to introduce new top level options if possible - this
seems to fit under the -m (global metadata options) option subgroup
(i.e. -m uuid=<UUID>).

>  		case 'm':
>  			p = optarg;
>  			while (*p != '\0') {
> @@ -2550,7 +2555,9 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
>  	sbp->sb_dblocks = dblocks;
>  	sbp->sb_rblocks = rtblocks;
>  	sbp->sb_rextents = rtextents;
> -	platform_uuid_generate(&uuid);
> +	if (platform_uuid_is_null(&uuid)) {
> +	    platform_uuid_generate(&uuid);
> +	}

Just generate the uuid initially and then it gets overwritten by the
CLI option if it is set. No need for null detection and generation
here.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-09-21 22:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 17:04 [PATCH] mkfs.xfs: add [-U uuid] option Mika Eloranta
2015-09-21 22:18 ` Dave Chinner [this message]
2015-09-21 22:56   ` Mika Eloranta
2015-09-21 23:36     ` Dave Chinner
2015-09-22  6:43       ` Mika Eloranta
2015-09-22  7:22         ` Carlos Maiolino
2015-09-22  7:52         ` Dave Chinner
2015-09-22  8:06           ` Mika Eloranta
2015-09-22  8:25             ` Dave Chinner
2015-09-22  1:42   ` Eric Sandeen

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=20150921221839.GC19114@dastard \
    --to=david@fromorbit.com \
    --cc=mel@ohmu.fi \
    --cc=xfs@oss.sgi.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