]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: don't use xfs_verify_fsbno() before m_sb is fully set up
authorEric Sandeen <sandeen@redhat.com>
Wed, 10 Jul 2019 15:35:07 +0000 (11:35 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 10 Jul 2019 15:35:07 +0000 (11:35 -0400)
commit9c726ef0d2d829ae83756d3817f271e9c2c8777a
treecdf7fd41c04b8ea5abbfed851e9e9e7c7e8f15a0
parent8bfb5eac0f2856b529bb5bca00cc4a4984be152a
mkfs: don't use xfs_verify_fsbno() before m_sb is fully set up

Commit 8da5298 mkfs: validate start and end of aligned logs stopped
open-coding log end block checks, and used xfs_verify_fsbno() instead.
It also used xfs_verify_fsbno() to validate the log start.  This
seemed to make sense, but then xfs/306 started failing on 4k sector
filesystems, which leads to a log striep unite being set on a single
AG filesystem.

As it turns out, if xfs_verify_fsbno() is testing a block in the
last AG, it needs to have mp->m_sb.sb_dblocks set, which isn't done
until later.  With sb_dblocks unset we can't know how many blocks
are in the last AG, and hence can't validate it.

To fix all this, go back to open-coding the checks; note that this
/does/ rely on m_sb.sb_agblklog being set, but that /is/ already
done in the early call to start_superblock_setup().

Fixes: 8da5298 ("mkfs: validate start and end of aligned logs")
Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c