On Sun, Aug 27, 2023 at 08:56:46AM -0700, Darrick J. Wong wrote: > On Sun, Aug 27, 2023 at 09:06:44PM +0800, Zorro Lang wrote: > > On Tue, Aug 22, 2023 at 06:02:39PM -0700, Darrick J. Wong wrote: > > > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > > > > > Dave Chinner reported that xfs/273 fails if the AG size happens to be an > > > exact power of two. I traced this to an agbno integer overflow when the > > > current GETFSMAP call is a continuation of a previous GETFSMAP call, and > > > the last record returned was non-shareable space at the end of an AG. > > > > > > This is the regression test for that bug. > > > > > > Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> ..... > > > +echo "desired asize=$desired_agsize" >> $seqres.full > > > +_scratch_mkfs -d "agsize=${desired_agsize}b" | _filter_mkfs 2> $tmp.mkfs >> $seqres.full > > > +source $tmp.mkfs > > > + > > > +test "$desired_agsize" -eq "$agsize" || _notrun "wanted agsize=$desired_agsize, got $agsize" > > > + > > > +_scratch_mount > > > +$XFS_IO_PROG -c 'fsmap -n 1024 -v' $SCRATCH_MNT >> $tmp.big > > > +$XFS_IO_PROG -c 'fsmap -n 1 -v' $SCRATCH_MNT >> $tmp.small > > > > This line reports: > > > > xfs_io: xfsctl(XFS_IOC_GETFSMAP) iflags=0x0 ["/mnt/xfstests/scratch"]: Invalid argument > > > > when the test case fails. Is that normal? > > Yes. The attached bugfix should make that go away. The kernel bug fix fixes the same problem with xfs/273; I haven't tested this specific new regression test. -Dave. -- Dave Chinner david@xxxxxxxxxxxxx