Hi,
In testing on ppc64, I ran into the following error when making a file
system:
# ./mkfs.xfs -b size=65536 -f /dev/ram0
illegal sector size 65536
Which is odd, because I didn't specify a sector size! The problem is
that validate_sectorsize defaults to the physical sector size, but in
this case, the physical sector size is bigger than XFS_MAX_SECTORSIZE.
# cat /sys/block/ram0/queue/physical_block_size
65536
Fall back to the default (logical sector size) if the physical sector
size is greater than XFS_MAX_SECTORSIZE.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: shorten subject, rebase]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
if (!ft->lsectorsize)
ft->lsectorsize = dft->sectorsize;
- /* Older kernels may not have physical/logical distinction */
- if (!ft->psectorsize)
+ /*
+ * Older kernels may not have physical/logical distinction.
+ *
+ * Some architectures have a page size > XFS_MAX_SECTORSIZE.
+ * In that case, a ramdisk or persistent memory device may
+ * advertise a physical sector size that is too big to use.
+ */
+ if (!ft->psectorsize || ft->psectorsize > XFS_MAX_SECTORSIZE)
ft->psectorsize = ft->lsectorsize;
cfg->sectorsize = ft->psectorsize;