All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][xfs-next] xfs: fix check on struct_version for versions 4 or greater
@ 2018-01-12 16:37 Colin King
  2018-01-12 16:47   ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-01-12 16:37 UTC (permalink / raw)
  To: Darrick J . Wong, linux-xfs, Brian Foster, Dave Chinner, Eric Sandeen
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 fs/xfs/libxfs/xfs_sb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 35b005d66977..869a2f3f0375 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -951,7 +951,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))
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][xfs-next] xfs: fix check on struct_version for versions 4 or greater
  2018-01-12 16:37 [PATCH][xfs-next] xfs: fix check on struct_version for versions 4 or greater Colin King
@ 2018-01-12 16:47   ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-01-12 16:47 UTC (permalink / raw)
  To: Colin King
  Cc: linux-xfs, Brian Foster, Dave Chinner, Eric Sandeen,
	kernel-janitors, linux-kernel

On Fri, Jan 12, 2018 at 04:37:15PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> ---
>  fs/xfs/libxfs/xfs_sb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index 35b005d66977..869a2f3f0375 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -951,7 +951,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))
> -- 
> 2.15.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][xfs-next] xfs: fix check on struct_version for versions 4 or greater
@ 2018-01-12 16:47   ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-01-12 16:47 UTC (permalink / raw)
  To: Colin King
  Cc: linux-xfs, Brian Foster, Dave Chinner, Eric Sandeen,
	kernel-janitors, linux-kernel

On Fri, Jan 12, 2018 at 04:37:15PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> ---
>  fs/xfs/libxfs/xfs_sb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index 35b005d66977..869a2f3f0375 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -951,7 +951,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))
> -- 
> 2.15.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-12 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 16:37 [PATCH][xfs-next] xfs: fix check on struct_version for versions 4 or greater Colin King
2018-01-12 16:47 ` Darrick J. Wong
2018-01-12 16:47   ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.