All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zhong <zhong@linux.vnet.ibm.com>
To: xfsprogs <xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: make log/size consistent for mkfs's -s option
Date: Fri, 27 Sep 2013 17:09:33 +0800	[thread overview]
Message-ID: <1380272973.2836.5.camel@ThinkPad-T5421> (raw)

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

             reply	other threads:[~2013-09-27  9:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27  9:09 Li Zhong [this message]
2013-09-27 17:29 ` [PATCH] xfsprogs: make log/size consistent for mkfs's -s option 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380272973.2836.5.camel@ThinkPad-T5421 \
    --to=zhong@linux.vnet.ibm.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.