From: Jan Tulak <jtulak@redhat.com>
To: xfs@oss.sgi.com
Subject: mkfs: a possible bad
Date: Wed, 17 Jun 2015 10:28:38 -0400 (EDT) [thread overview]
Message-ID: <551099978.15978267.1434551318983.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <919039035.15967379.1434550287476.JavaMail.zimbra@redhat.com>
Hi,
I'm looking into mkfs/xfs_mkfs.c and I wonder, is "if (xi.dbsize > sectorsize)" correct?
It is a check for:
Warning: the data subvolume sector size %u is less than the sector size reported by the device (%u).
But psectorsize is assigned to sectorsize, not to xi.dbsize, so the two values seems to be swapped in the condition (and as arguments of the printf too).
I think this gone without noticing because usually, when creating a partition, the two values are the same. So even if the condition is wrong, nothing happens.
And when -bsize=X is passed, then it is catched earlier and nothing happens again.
Only when I apply a patch that changes how mkfs acts when it gets a file instead of a block device, I start to see the warning, although physical sector size is 512 and block size is set to 4096. The numbers are swapped in the warning too...
I tried to run ./check -g quick and it seems that the change breaks nothing.
Cheers,
Jan
--
Jan Tulak
jtulak@redhat.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next parent reply other threads:[~2015-06-17 14:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <919039035.15967379.1434550287476.JavaMail.zimbra@redhat.com>
2015-06-17 14:28 ` Jan Tulak [this message]
2015-06-17 19:43 ` mkfs: a possible bad Eric Sandeen
2015-06-18 8:53 ` Jan Tulak
2015-06-18 14:55 ` Eric Sandeen
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=551099978.15978267.1434551318983.JavaMail.zimbra@redhat.com \
--to=jtulak@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox