From: Eric Sandeen Date: Thu, 31 May 2018 19:09:55 +0000 (-0500) Subject: mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well X-Git-Tag: v4.17.0-rc1~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14c57d50de912fae821f8c1e717144f3602566de;p=thirdparty%2Fxfsprogs-dev.git mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well Don't allow the user to set one but not the other. Reported-by: Xiao Yang Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Reviewed-by: Bill O'Donnell Signed-off-by: Eric Sandeen --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 2de017130..a135e06e7 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);