aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-08-04 21:28:23 -0500
committerEric Sandeen <sandeen@sandeen.net>2022-08-04 21:28:23 -0500
commitdb5b866537e78669f7b84590345b0c37f841f701 (patch)
tree925045fe3c1429ea9cf441d61a82f1802409230a
parent6e0ed3d19c54603f0f7d628ea04b550151d8a262 (diff)
downloadxfsprogs-dev-db5b866537e78669f7b84590345b0c37f841f701.tar.gz
mkfs: complain about impossible log size constraints
xfs/042 trips over an impossible fs geometry when nrext64 is enabled. The minimum log size calculation comes out to 4287 blocks, but the mkfs parameters specify an AG size of 4096 blocks. This eventually causes mkfs to complain that the autoselected log size doesn't meet the minimum size, but we could be a little more explicit in pointing out that the two size constraints make for an impossible geometry. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--mkfs/xfs_mkfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 12994edca1..9dd0e79c6b 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -3490,6 +3490,13 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\
* an AG.
*/
max_logblocks = libxfs_alloc_ag_max_usable(mp) - 1;
+ if (max_logblocks < min_logblocks) {
+ fprintf(stderr,
+_("max log size %d smaller than min log size %d, filesystem is too small\n"),
+ max_logblocks,
+ min_logblocks);
+ usage();
+ }
/* internal log - if no size specified, calculate automatically */
if (!cfg->logblocks) {