]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mdrestore: Fix logic used to check if target device is large enough
authorChandan Babu R <chandan.babu@oracle.com>
Mon, 6 Nov 2023 13:10:35 +0000 (18:40 +0530)
committerCarlos Maiolino <cem@kernel.org>
Tue, 21 Nov 2023 13:09:36 +0000 (14:09 +0100)
The device size verification code should be writing XFS_MAX_SECTORSIZE bytes
to the end of the device rather than "sizeof(char *) * XFS_MAX_SECTORSIZE"
bytes.

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

index 7c1a66c4001995ced4206835f8b0c220cdc7a38a..333282ed2a91dec92dfd0feec12b1ee37c3280ed 100644 (file)
@@ -115,7 +115,7 @@ perform_restore(
        } else  {
                /* ensure device is sufficiently large enough */
 
-               char            *lb[XFS_MAX_SECTORSIZE] = { NULL };
+               char            lb[XFS_MAX_SECTORSIZE] = { 0 };
                off64_t         off;
 
                off = sb.sb_dblocks * sb.sb_blocksize - sizeof(lb);