]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
common/populate: Ensure that S_IFDIR.FMT_BTREE is in btree format
authorZiyang Zhang <ZiyangZhang@linux.alibaba.com>
Mon, 12 Dec 2022 05:56:45 +0000 (13:56 +0800)
committerZorro Lang <zlang@kernel.org>
Tue, 13 Dec 2022 09:14:49 +0000 (17:14 +0800)
commit8fc059413cc1a9e4efa56e7a627ff9166c2842a4
tree58285bedc5f7dc38572bd7a446e9b1ba439eaf13
parentbe957968f6fade15d0a7a6058ae270141263bd64
common/populate: Ensure that S_IFDIR.FMT_BTREE is in btree format

Sometimes "$((128 * dblksz / 40))" dirents cannot make sure that
S_IFDIR.FMT_BTREE could become btree format for its DATA fork.

Actually we just observed it can fail after apply our inode
extent-to-btree workaround. The root cause is that the kernel may be
too good at allocating consecutive blocks so that the data fork is
still in extents format.

Therefore instead of using a fixed number, let's make sure the number
of extents is large enough than (inode size - inode core size) /
sizeof(xfs_bmbt_rec_t).

Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/populate
common/xfs