diff options
author | Brian Foster <bfoster@redhat.com> | 2019-02-08 09:02:29 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-11 16:07:01 -0800 |
commit | 670105de15cd98f0ad6e34464c720cf9c96f4e6e (patch) | |
tree | 6824c279982eee8148abef5347721dd30bb5ecfd /fs/xfs/xfs_inode.c | |
parent | 9228d751ebf9c7876902db6458a33c26674f7ccc (diff) | |
download | linux-670105de15cd98f0ad6e34464c720cf9c96f4e6e.tar.gz linux-670105de15cd98f0ad6e34464c720cf9c96f4e6e.tar.bz2 linux-670105de15cd98f0ad6e34464c720cf9c96f4e6e.zip |
xfs: compile time offset checks for common v4/v5 metadata
The v5 superblock format added various metadata fields (such as crc,
metadata lsn, owner uuid, etc.) to v4 metadata headers or created
new v5 headers for blocks where no such headers existed on v4. Where
v4 headers did exist, the v5 structures are careful to place v4
metadata at the original location. For example, the magic value is
expected to be at the same location in certain blocks to facilitate
version detection.
While failure of this invariant is likely to cause severe and
obvious problems at runtime, we can detect this condition at compile
time via the more recently added on-disk format check
infrastructure. Since there is no runtime cost, add some offset
checks that start with v5 structure definitions, traverse down to
the first bit of common metadata with v4 and ensure that common
metadata is at the expected offset. Note that we don't care about
blocks which had no v4 header because there is no common metadata in
those cases. No functional changes.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
0 files changed, 0 insertions, 0 deletions