]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
mdrestore: Detect metadump v1 magic before reading the header
authorChandan Babu R <chandan.babu@oracle.com>
Mon, 6 Nov 2023 13:10:48 +0000 (18:40 +0530)
committerCarlos Maiolino <cem@kernel.org>
Tue, 21 Nov 2023 13:09:36 +0000 (14:09 +0100)
commit214bf0a21363d5d00a2bdd27aa2a3551c106ccb7
tree766d509a0cc394c71ce1e406cb7c01134f7b543d
parent1fb3dccce21331633069f8b87b740e46f6fb91c7
mdrestore: Detect metadump v1 magic before reading the header

In order to support both v1 and v2 versions of metadump, mdrestore will have
to detect the format in which the metadump file has been stored on the disk
and then read the ondisk structures accordingly. In a step in that direction,
this commit splits the work of reading the metadump header from disk into two
parts,
1. Read the first 4 bytes containing the metadump magic code.
2. Read the remaining part of the header.

A future commit will take appropriate action based on the value of the magic
code.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
mdrestore/xfs_mdrestore.c