From: Darrick J. Wong Date: Wed, 20 Dec 2023 16:53:45 +0000 (-0800) Subject: xfs_mdrestore: EXTERNALLOG is a compat value, not incompat X-Git-Tag: v6.6.0~5^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c0c39802f70c3fedd1038742782c59e9a28ea7d1;p=xfsprogs-dev.git xfs_mdrestore: EXTERNALLOG is a compat value, not incompat Fix this check to look at the correct header field. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R --- diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 3190e07e4..1d65765da 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -268,7 +268,7 @@ read_header_v2( union mdrestore_headers *h, FILE *md_fp) { - bool want_external_log; + unsigned int compat; if (fread((uint8_t *)&(h->v2) + sizeof(h->v2.xmh_magic), sizeof(h->v2) - sizeof(h->v2.xmh_magic), 1, md_fp) != 1) @@ -280,10 +280,9 @@ read_header_v2( if (h->v2.xmh_reserved != 0) fatal("Metadump header's reserved field has a non-zero value\n"); - want_external_log = !!(be32_to_cpu(h->v2.xmh_incompat_flags) & - XFS_MD2_COMPAT_EXTERNALLOG); + compat = be32_to_cpu(h->v2.xmh_compat_flags); - if (want_external_log && !mdrestore.external_log) + if (!mdrestore.external_log && (compat & XFS_MD2_COMPAT_EXTERNALLOG)) fatal("External Log device is required\n"); }