]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfs/{015,042,076}: fix mkfs failures with nrext64=1
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Aug 2022 21:00:37 +0000 (14:00 -0700)
committerZorro Lang <zlang@kernel.org>
Thu, 11 Aug 2022 16:27:30 +0000 (00:27 +0800)
commit04307f499d13020194dc27f5dc17d4197dbb32c3
treee5709d7dbd38410827685354699168418d5f4797
parent16ddbd1aee295f64695916cf3621aef57f1163ba
xfs/{015,042,076}: fix mkfs failures with nrext64=1

One of my XFS fstests systems is configured with multiple 34G block
devicesm each with a 4k LBA size for the scratch filesystem.  If I turn
on large extent counts with -i nrext64=1, I see the following failures
from each of these three tests:

-used inodes is in range
+max log size 4083 smaller than min log size 4287, filesystem is too small

Note that this particular output is dependent on having a recent
xfsprogs with "mkfs: complain about impossible log size constraints"
applied, else you get a far more obscure message about the log being too
small.

It turns out that you can simulate this pretty easily:

# truncate -s 34G /tmp/a; losetup -f -b 4096 /tmp/a
# truncate -s 34G /tmp/b; losetup -f -b 4096 /tmp/b
# mkfs.xfs -f -N /dev/loop0  -r rtdev=/dev/loop1 -d rtinherit=1,size=32m -i nrext64=1
max log size 4083 smaller than min log size 4287, filesystem is too small

If I turn off nrext64, the fs geometry I get is:

meta-data=/dev/loop0             isize=512    agcount=2, agsize=4096 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=0    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=8192, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=954, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =/dev/loop1             extsz=4096   blocks=8912896, rtextents=8912896

So it's pretty obvious what happened here -- the AG size is 4096 blocks.
mkfs has to leave enough free space in each AG to handle the AG space
btree roots, the AG headers, and the AGFL, which means the log can't be
more than 4083 blocks.  libxfs computes the minimum log size to be 4287
blocks, which is why the format fails.

Fix this problem by bumping the filesystems up to 96M, which provides
enough space in each AG to handle a ~20M internal log.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/015
tests/xfs/042
tests/xfs/042.out
tests/xfs/076