I'm looking into mkfs/xfs_mkfs.c and I wonder, is "if (xi.dbsize > sectorsize)"
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
And when -bsize=X is passed, then it is catched earlier and nothing happens
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
I tried to run ./check -g quick and it seems that the change breaks nothing.