Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1570835pxb; Thu, 4 Feb 2021 17:11:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoDLDs1J2B/tBq+cwIOZC/F3wRVAnQT3BNlCoYE8ugrWMGsgIyfQQubpmO+0WODLtgygpP X-Received: by 2002:a17:906:ae50:: with SMTP id lf16mr1786225ejb.66.1612487494357; Thu, 04 Feb 2021 17:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612487494; cv=none; d=google.com; s=arc-20160816; b=eXND/dpOTblZIz4IsmbUq2ouV2YeJl/Sq1iXuxF+I/Pb1TOiwiddylO21vB1nUhbMN SV6ObbHszXwjsFIqeX286XBwr5LMjlqRc4Ze1fmSATreASVXBCpurCKGNbh3v7s2eFZS 41FI4mXZRQnVWMWG0ByZLlU53BJvuE2+eG1TfMd2WInKuZa9kL/NR9weeL/XNVnqpMgZ pn1d3CufL6Avj7FhDxKgJ68JcCtQehDormb1SUpL6M/kpaFg70pMXimC7YVh4ozbpXrX HqqsFzMGMkmSiAHzS2GtcHBeu74/Oce9UatjHK+oZTNGf9G478Xb3rnVTIxohKOdAGLA eeDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2uqBOHayoK9VQ4lj587O369rpP5nIS/wiQsdo323rcY=; b=KLzx1uCxpRicKQ9zMGJ8brn0QEB4PvAIrQTJLrvmPQ3AGahFBwa4VFta9RhotZlHOW wbTKeQIHQXIwQDH0YsiDDxenUIw+Lo/2HjHaiYfAx9TFjcGt/ZHzOWeTIn6ZnDWZNI0A 73rHriKNPUEwpeP3cQw1M7fs8YiucW4onUD147A1QNORRHF3m0ZkNnonBQMBGApNkpKo Ver1TNzUc8Cm3uImbiGAUjg14fit2GjkrTq0Hmj6hEYsxR37oi8MPt04FEAjw/rUiJ0A h8WMpzVPEvFyUqsN34WE8pD6TYXJU3RxKOBSAQ3DrggZUfhMcEuiMuXrmcnKcWHDa/j2 00pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dGW0YRNs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg13si4984670ejc.669.2021.02.04.17.11.10; Thu, 04 Feb 2021 17:11:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dGW0YRNs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238763AbhBDSKI (ORCPT + 99 others); Thu, 4 Feb 2021 13:10:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48767 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238741AbhBDSJP (ORCPT ); Thu, 4 Feb 2021 13:09:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612462069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2uqBOHayoK9VQ4lj587O369rpP5nIS/wiQsdo323rcY=; b=dGW0YRNsIkH+PnIJlBQfpq85jRjdsR+ZRrdi234dSe3w8zjBXgtmL9gt9C+2O57HxnVdnR JgloQAFVozuNmkrWe/oJc6259jdGKh7S1oMUlmm3+Q3I2rCaUuXMfal5D4DFez7l9wtwPU Bp85CI5kBYP/HHpn3LACXT0F2hfIHBA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-181-J5Es6aY6Pd6KUIxbGUP8_w-1; Thu, 04 Feb 2021 13:07:47 -0500 X-MC-Unique: J5Es6aY6Pd6KUIxbGUP8_w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1AE7801960; Thu, 4 Feb 2021 18:07:45 +0000 (UTC) Received: from bfoster (ovpn-114-23.rdu2.redhat.com [10.10.114.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3394760C05; Thu, 4 Feb 2021 18:07:42 +0000 (UTC) Date: Thu, 4 Feb 2021 13:07:39 -0500 From: Brian Foster To: Arnd Bergmann Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org, Allison Henderson , Arnd Bergmann , Dave Chinner , Gao Xiang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: fix unused variable warning Message-ID: <20210204180739.GD3721376@bfoster> References: <20210204160427.2303504-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210204160427.2303504-1-arnd@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 05:03:44PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > 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 > --- I sent basically the same patch[1] about a week ago, but either one is fine with me: Reviewed-by: Brian Foster [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 >