Message ID | 20240117173312.868103-6-hch@lst.de (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/5] libxfs: remove the unused fs_topology_t typedef | expand |
On Wed, Jan 17, 2024 at 06:33:12PM +0100, Christoph Hellwig wrote: > Currently the XFS log sector size defaults to the 512 bytes unless > explicitly overriden. Default to the device logical block size queried > by get_topology instead. If that is also 512 nothing changes, and if > the device logical block size is larger this prevents a mkfs failure > because the libxfs buffer cache blows up and as we obviously can't > use a smaller than hardware supported sector size. This fixes xfs/157 > with a 4k block size device. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > Reviewed-by: Darrick J. Wong <djwong@kernel.org> > --- I tested out this patch, and it indeeds fixes xfs/157 for 4k device logical block size. Tested-by: Pankaj Raghav <p.raghav@samsung.com>
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index be65ccc1e..022a11a7f 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -2075,7 +2075,8 @@ static void validate_log_sectorsize( struct mkfs_params *cfg, struct cli_params *cli, - struct mkfs_default_params *dft) + struct mkfs_default_params *dft, + struct fs_topology *ft) { if (cli->loginternal && cli->lsectorsize && @@ -2090,7 +2091,7 @@ _("Can't change sector size on internal log!\n")); else if (cli->loginternal) cfg->lsectorsize = cfg->sectorsize; else - cfg->lsectorsize = dft->sectorsize; + cfg->lsectorsize = ft->log.logical_sector_size; cfg->lsectorlog = libxfs_highbit32(cfg->lsectorsize); if (cfg->lsectorsize < XFS_MIN_SECTORSIZE || @@ -4196,7 +4197,7 @@ main( blocksize = cfg.blocksize; sectorsize = cfg.sectorsize; - validate_log_sectorsize(&cfg, &cli, &dft); + validate_log_sectorsize(&cfg, &cli, &dft, &ft); validate_sb_features(&cfg, &cli); /*