lkml.org 
[lkml]   [2021]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: build warning after merge of the xfs tree
On Mon, Jan 25, 2021 at 08:26:16AM -0500, Brian Foster wrote:
> On Mon, Jan 25, 2021 at 09:55:32AM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the xfs tree, today's linux-next build (powerpc
> > ppc64_defconfig) produced this warning:
> >
> > fs/xfs/xfs_log.c: In function 'xfs_log_cover':
> > fs/xfs/xfs_log.c:1111:16: warning: unused variable 'log' [-Wunused-variable]
> > 1111 | struct xlog *log = mp->m_log;
> > | ^~~
> >
> > Introduced by commit
> >
> > 303591a0a947 ("xfs: cover the log during log quiesce")
> >
>
> Oops, patch below. Feel free to apply or squash into the original
> commit.
>
> Brian
>
> --- 8< ---
>
> From 6078f06e2bd4c82111a85a2032c39a56654b0be6 Mon Sep 17 00:00:00 2001
> From: Brian Foster <bfoster@redhat.com>
> Date: Mon, 25 Jan 2021 08:22:56 -0500
> Subject: [PATCH] xfs: fix unused log variable in xfs_log_cover()
>
> The log variable is only used in kernels with asserts enabled.
> Remove it and open code the dereference to avoid unused variable
> warnings.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks ok to me...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
> fs/xfs/xfs_log.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 58699881c100..d8b814227734 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -1108,12 +1108,11 @@ static int
> xfs_log_cover(
> struct xfs_mount *mp)
> {
> - struct xlog *log = mp->m_log;
> int error = 0;
> bool need_covered;
>
> - ASSERT((xlog_cil_empty(log) && xlog_iclogs_empty(log) &&
> - !xfs_ail_min_lsn(log->l_ailp)) ||
> + ASSERT((xlog_cil_empty(mp->m_log) && xlog_iclogs_empty(mp->m_log) &&
> + !xfs_ail_min_lsn(mp->m_log->l_ailp)) ||
> XFS_FORCED_SHUTDOWN(mp));
>
> if (!xfs_log_writable(mp))
> --
> 2.26.2
>

\
 
 \ /
  Last update: 2021-01-27 07:00    [W:0.062 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site