public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: make log/size consistent for mkfs's -s option
@ 2013-09-27  9:09 Li Zhong
  2013-09-27 17:29 ` Eric Sandeen
  0 siblings, 1 reply; 11+ messages in thread
From: Li Zhong @ 2013-09-27  9:09 UTC (permalink / raw)
  To: xfsprogs

It seems using -s log is not able to set the sectsz correctly. Because slflag
is set but ignored by later codes, so the advertised sector size of the device
is used instead.

$ mkfs.xfs -f -s size=4096 /dev/sdd
meta-data=/dev/sdd               isize=256    agcount=2, agsize=4096 blks
         =                       sectsz=4096  attr=2, projid32bit=1
	 ......

$ mkfs.xfs -f -s log=12 /dev/sdd
meta-data=/dev/sdd               isize=256    agcount=2, agsize=4096 blks
         =                       sectsz=2048  attr=2, projid32bit=1
	 ......

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 mkfs/xfs_mkfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index eafbed3..9243044 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1693,7 +1693,7 @@ main(
 		 * ft.sectoralign will never be set.
 		 */
 		sectorsize = blocksize;
-	} else if (!ssflag) {
+	} else if (!ssflag && !slflag) {
 		/*
 		 * Unless specified manually on the command line use the
 		 * advertised sector size of the device.  We use the physical
@@ -1721,7 +1721,7 @@ _("switching to logical sector size %d\n"),
 		}
 	}
 
-	if (ft.sectoralign || !ssflag) {
+	if (ft.sectoralign || !ssflag || !slflag) {
 		sectorlog = libxfs_highbit32(sectorsize);
 		if (loginternal) {
 			lsectorsize = sectorsize;
@@ -1731,7 +1731,7 @@ _("switching to logical sector size %d\n"),
 
 	if (sectorsize < XFS_MIN_SECTORSIZE ||
 	    sectorsize > XFS_MAX_SECTORSIZE || sectorsize > blocksize) {
-		if (ssflag)
+		if (ssflag || slflag)
 			fprintf(stderr, _("illegal sector size %d\n"), sectorsize);
 		else
 			fprintf(stderr,
-- 
1.8.1.4



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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-09-30  5:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27  9:09 [PATCH] xfsprogs: make log/size consistent for mkfs's -s option Li Zhong
2013-09-27 17:29 ` Eric Sandeen
2013-09-27 23:39   ` Dave Chinner
2013-09-29  6:45   ` Li Zhong
2013-09-29  6:50   ` [PATCH v2] " Li Zhong
2013-09-29  9:12     ` [PATCH] xfsprogs: cleanup size/log setting flags of mkfs Li Zhong
2013-09-29 23:06       ` Dave Chinner
2013-09-30  3:04         ` Li Zhong
2013-09-30  3:14           ` Eric Sandeen
2013-09-30  5:24             ` Li Zhong
2013-09-30  5:20         ` [PATCH v2] " Li Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox