]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
mkfs: validate rt extent size hint when rtinherit is set
authorDarrick J. Wong <djwong@kernel.org>
Fri, 14 May 2021 17:20:01 +0000 (10:20 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 2 Jul 2021 23:28:41 +0000 (16:28 -0700)
commit76fd2b4a6a608ce71de76cd706e189ad802dc067
treeb3ba5363b8e445e2a35d4ff2138191fa0d1dc2e5
parenta7658029ee258cd61c8bc7d91fe4aedf80ba765d
mkfs: validate rt extent size hint when rtinherit is set

Extent size hints exist to nudge the behavior of the file data block
allocator towards trying to make aligned allocations.  Therefore, it
doesn't make sense to allow a hint that isn't a multiple of the
fundamental allocation unit for a given file.

This means that if the sysadmin is formatting with rtinherit set on the
root dir, validate_extsize_hint needs to check the hint value on a
simulated realtime file to make sure that it's correct.  Unfortunately,
the gate check here was for a nonzero rt extent size, which is wrong
since we never format with rtextsize==0.  This leads to absurd failures
such as:

# mkfs.xfs -f /dev/sdf -r extsize=7b -d rtinherit=0,extszinherit=13
illegal extent size hint 13, must be less than 649088 and a multiple of 7.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
mkfs/xfs_mkfs.c