diff options
author | Chandan Babu R <chandan.babu@oracle.com> | 2023-11-06 18:40:35 +0530 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2023-11-21 14:09:36 +0100 |
commit | 0d3650b23a3a79a03c1e4968593ec695b6d575ff (patch) | |
tree | 7a073df2d32b294793590239754318b13d16a3d7 | |
parent | 3ea310101abf621b3807ee6bebd04d2490930be6 (diff) | |
download | xfsprogs-dev-0d3650b23a3a79a03c1e4968593ec695b6d575ff.tar.gz |
mdrestore: Fix logic used to check if target device is large enough
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>
-rw-r--r-- | mdrestore/xfs_mdrestore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 7c1a66c400..333282ed2a 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -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); |