All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allison Collins <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, sandeen@sandeen.net
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] mkfs: fix reflink/rmap logic w.r.t. realtime devices and crc=0 support
Date: Thu, 10 Sep 2020 19:57:55 -0700	[thread overview]
Message-ID: <677a25f9-fc75-a72f-c03c-469a97a82540@oracle.com> (raw)
In-Reply-To: <159950110896.567664.15989009829117632135.stgit@magnolia>



On 9/7/20 10:51 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> mkfs has some logic to deal with situations where reflink or rmapbt are
> turned on and the administrator has configured a realtime device or a V4
> filesystem; such configurations are not allowed.
> 
> The logic ought to disable reflink and/or rmapbt if they're enabled due
> to being the defaults, and it ought to complain and abort if they're
> enabled because the admin explicitly turned them on.
> 
> Unfortunately, the logic here doesn't do that and makes no sense at all
> since usage() exits the program.  Fix it to follow what everything else
> does.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Ok makes sense
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

> ---
>   mkfs/xfs_mkfs.c |   18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
> 
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 39fad9576088..6b55ca3e4c57 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -1973,7 +1973,7 @@ _("sparse inodes not supported without CRC support\n"));
>   		}
>   		cli->sb_feat.spinodes = false;
>   
> -		if (cli->sb_feat.rmapbt) {
> +		if (cli->sb_feat.rmapbt && cli_opt_set(&mopts, M_RMAPBT)) {
>   			fprintf(stderr,
>   _("rmapbt not supported without CRC support\n"));
>   			usage();
> @@ -1995,17 +1995,19 @@ _("cowextsize not supported without reflink support\n"));
>   		usage();
>   	}
>   
> -	if (cli->sb_feat.reflink && cli->xi->rtname) {
> -		fprintf(stderr,
> +	if (cli->xi->rtname) {
> +		if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) {
> +			fprintf(stderr,
>   _("reflink not supported with realtime devices\n"));
> -		usage();
> +			usage();
> +		}
>   		cli->sb_feat.reflink = false;
> -	}
>   
> -	if (cli->sb_feat.rmapbt && cli->xi->rtname) {
> -		fprintf(stderr,
> +		if (cli->sb_feat.rmapbt && cli_opt_set(&mopts, M_RMAPBT)) {
> +			fprintf(stderr,
>   _("rmapbt not supported with realtime devices\n"));
> -		usage();
> +			usage();
> +		}
>   		cli->sb_feat.rmapbt = false;
>   	}
>   
> 

  parent reply	other threads:[~2020-09-11  2:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07 17:51 [PATCH 0/4] xfsprogs: various fixes for 5.9 Darrick J. Wong
2020-09-07 17:51 ` [PATCH 1/4] man: install all manpages that redirect to another manpage Darrick J. Wong
2020-09-08 14:34   ` Christoph Hellwig
2020-09-09 19:11     ` Darrick J. Wong
2020-09-11  2:57   ` Allison Collins
2020-09-07 17:51 ` [PATCH 2/4] mkfs.xfs: tweak wording of external log device size complaint Darrick J. Wong
2020-09-08 14:36   ` Christoph Hellwig
2020-09-11  2:57   ` Allison Collins
2020-09-07 17:51 ` [PATCH 3/4] mkfs: fix reflink/rmap logic w.r.t. realtime devices and crc=0 support Darrick J. Wong
2020-09-08 14:38   ` Christoph Hellwig
2020-09-11  2:57   ` Allison Collins [this message]
2020-09-07 17:51 ` [PATCH 4/4] mkfs: set required parts of the realtime geometry before computing log geometry Darrick J. Wong
2020-09-08 14:40   ` Christoph Hellwig
2020-09-09 19:12     ` Darrick J. Wong
2020-09-11  2:58   ` Allison Collins

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=677a25f9-fc75-a72f-c03c-469a97a82540@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.