From: Colin Ian King Date: Tue, 27 Feb 2018 04:43:18 +0000 (-0600) Subject: xfs: fix check on struct_version for versions 4 or greater X-Git-Tag: v4.16.0-rc1~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfcfc5f1aac7eb29d94eca4d45d9254eb96499a8;p=thirdparty%2Fxfsprogs-dev.git xfs: fix check on struct_version for versions 4 or greater Source kernel commit: a8789a5ae28f69d7f3791a0e74f8c44222f3108b It appears that the check for versions 4 or more is incorrect and is off-by-one. Fix this. Detected by CoverityScan, CID#1463775 ("Logically dead code") Fixes: ac503a4cc9e8 ("xfs: refactor the geometry structure filling function") Signed-off-by: Colin Ian King Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index 1aeb6b034..57c88d220 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -933,7 +933,7 @@ xfs_fs_geometry( geo->rtsectsize = sbp->sb_blocksize; geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp); - if (struct_version < 3) + if (struct_version < 4) return 0; if (xfs_sb_version_haslogv2(sbp))