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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux