lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210204180739.GD3721376@bfoster>
Date:   Thu, 4 Feb 2021 13:07:39 -0500
From:   Brian Foster <bfoster@...hat.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     "Darrick J. Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org,
        Allison Henderson <allison.henderson@...cle.com>,
        Arnd Bergmann <arnd@...db.de>,
        Dave Chinner <dchinner@...hat.com>,
        Gao Xiang <hsiangkao@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: fix unused variable warning

On Thu, Feb 04, 2021 at 05:03:44PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> When debugging is disabled, the ASSERT() is left out and
> the 'log' variable becomes unused:
> 
> fs/xfs/xfs_log.c:1111:16: error: unused variable 'log' [-Werror,-Wunused-variable]
> 
> Remove the variable declaration and open-code it inside
> of the assertion.
> 
> Fixes: 303591a0a947 ("xfs: cover the log during log quiesce")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---

I sent basically the same patch[1] about a week ago, but either one is
fine with me:

Reviewed-by: Brian Foster <bfoster@...hat.com>

[1] https://lore.kernel.org/linux-xfs/20210125132616.GB2047559@bfoster/

>  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.29.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ