xfs
[Top] [All Lists]

[PATCH] mkfs: test that -l su is a multiple of block size

To: xfs@xxxxxxxxxxx
Subject: [PATCH] mkfs: test that -l su is a multiple of block size
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Thu, 9 Jun 2016 15:41:40 +0200
Cc: Jan Tulak <jtulak@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
lsunit was already tested, but lsu was not. So a thing like -l su=4097 was
possible. This commit adds a check to fix it.

Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
---
 mkfs/xfs_mkfs.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 455bf11..b9b50fe 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2875,6 +2875,15 @@ an AG size that is one stripe unit smaller, for example 
%llu.\n"),
                lsunit = dsunit;
        }
 
+       if (lsu) {
+               if (lsu % blocksize != 0) {
+                       fprintf(stderr,
+       _("log stripe unit (%d) must be a multiple of the block size (%d)\n"),
+                       lsu, blocksize);
+                       exit(1);
+               }
+       }
+
        if (sb_feat.log_version == 2 && (lsunit * blocksize) > 256 * 1024) {
                /* Warn only if specified on commandline */
                if (lsuflag || lsunitflag) {
-- 
2.5.5

<Prev in Thread] Current Thread [Next in Thread>