]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs.xfs: if either sunit or swidth is nonzero, the other must be as well
authorEric Sandeen <sandeen@redhat.com>
Thu, 31 May 2018 19:09:55 +0000 (14:09 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 31 May 2018 19:09:55 +0000 (14:09 -0500)
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>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index 2de0171308317fd4de0a880b294ce58fc5be3df3..a135e06e72155dd4428dbf8dc9d9fc50d3f67be7 100644 (file)
@@ -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);