Re: [PATCH blktests v2 4/4] common/xfs: check for max supported sector size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 07, 2025 at 11:58:29AM +0000, Shinichiro Kawasaki wrote:
> On Feb 04, 2025 / 14:57, Luis Chamberlain wrote:
> > mkfs.xfs will use the sector size exposed by the device, if this
> > is larger than 32k this will fail as the largest sector size on XFS
> > is 32k. Provide a sanity check to ensure we skip creating a filesystem
> > if the sector size is larger than what XFS supports.
> > 
> > Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> > ---
> >  common/xfs | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/common/xfs b/common/xfs
> > index 8b068837fa37..dbae572e4390 100644
> > --- a/common/xfs
> > +++ b/common/xfs
> > @@ -15,11 +15,18 @@ _xfs_mkfs_and_mount() {
> >  	local mount_dir=$2
> >  	local bs=$(_min_io $bdev)
> >  	local xfs_logsize="64m"
> > +	local sysfs="/sys/block/${bdev#/dev/}"
> > +	local logical_block_size=$(cat $sysfs/queue/logical_block_size)
> >  
> >  	if [[ $bs -gt 4096 ]]; then
> >  		xfs_logsize="128m"
> >  	fi
> >  
> > +	if [[ $logical_block_size -gt 32768 ]]; then
> > +		SKIP_REASONS+=("max sector size for XFS is 32768 but device $bdev has a larger sector size $logical_block_size")
> 
> Adding SKIP_REASONS here is not ideal, since this function is called from
> test() or test_device(). It's the better to check the requirement in
> requires() or device_requires(), before touching the test target devices.
> 
> If test() calls _xfs_mkfs_and_mount(), the test case should be able to
> control the sector size smaller than 32k, so no need to check the
> requirement.

I see, I'll fix.

> I think block/032 and nvme/012 fall in this category.

Indeed. I also noted _min_io() needs to return 4096 by default too as we
want to use it as default in case we get a lower value to retain
backward compatbility. That fixed some block/032 and nvme/012 issues
with 512 min-io values.

  Luis




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux