linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well
@ 2018-05-17 18:33 Eric Sandeen
  2018-05-17 19:44 ` Darrick J. Wong
  2018-05-17 21:11 ` Bill O'Donnell
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2018-05-17 18:33 UTC (permalink / raw)
  To: linux-xfs

Don't allow the user to set one but not the other.

Reported-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 78d0ce5..b356d4d 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2271,7 +2271,8 @@ _("data stripe width (%lld) is too large of a multiple of the data stripe unit (
  		dswidth = big_dswidth;
  	}
  
-	if (dsunit && (!dswidth || (dswidth % dsunit != 0))) {
+	if ((dsunit && !dswidth) || (!dsunit && dswidth) ||
+           (dsunit && (dswidth % dsunit != 0))) {
  		fprintf(stderr,
  _("data stripe width (%d) must be a multiple of the data stripe unit (%d)\n"),
  			dswidth, dsunit);



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well
  2018-05-17 18:33 [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well Eric Sandeen
@ 2018-05-17 19:44 ` Darrick J. Wong
  2018-05-17 21:11 ` Bill O'Donnell
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-05-17 19:44 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Thu, May 17, 2018 at 01:33:29PM -0500, Eric Sandeen wrote:
> Don't allow the user to set one but not the other.
> 
> Reported-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 78d0ce5..b356d4d 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2271,7 +2271,8 @@ _("data stripe width (%lld) is too large of a multiple of the data stripe unit (
>  		dswidth = big_dswidth;
>  	}
> -	if (dsunit && (!dswidth || (dswidth % dsunit != 0))) {
> +	if ((dsunit && !dswidth) || (!dsunit && dswidth) ||
> +           (dsunit && (dswidth % dsunit != 0))) {
>  		fprintf(stderr,
>  _("data stripe width (%d) must be a multiple of the data stripe unit (%d)\n"),
>  			dswidth, dsunit);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well
  2018-05-17 18:33 [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well Eric Sandeen
  2018-05-17 19:44 ` Darrick J. Wong
@ 2018-05-17 21:11 ` Bill O'Donnell
  1 sibling, 0 replies; 3+ messages in thread
From: Bill O'Donnell @ 2018-05-17 21:11 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Thu, May 17, 2018 at 01:33:29PM -0500, Eric Sandeen wrote:
> Don't allow the user to set one but not the other.
> 
> Reported-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

looks fine.

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 78d0ce5..b356d4d 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2271,7 +2271,8 @@ _("data stripe width (%lld) is too large of a multiple of the data stripe unit (
>  		dswidth = big_dswidth;
>  	}
> -	if (dsunit && (!dswidth || (dswidth % dsunit != 0))) {
> +	if ((dsunit && !dswidth) || (!dsunit && dswidth) ||
> +           (dsunit && (dswidth % dsunit != 0))) {
>  		fprintf(stderr,
>  _("data stripe width (%d) must be a multiple of the data stripe unit (%d)\n"),
>  			dswidth, dsunit);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 18:33 [PATCH] mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well Eric Sandeen
2018-05-17 19:44 ` Darrick J. Wong
2018-05-17 21:11 ` Bill O'Donnell

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).