From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFE09C6FA90 for ; Mon, 26 Sep 2022 10:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234291AbiIZKui (ORCPT ); Mon, 26 Sep 2022 06:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236570AbiIZKqw (ORCPT ); Mon, 26 Sep 2022 06:46:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B38B957232; Mon, 26 Sep 2022 03:25:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BB772B80915; Mon, 26 Sep 2022 10:25:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2714FC433D7; Mon, 26 Sep 2022 10:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187955; bh=e/6xeRdBd9WX29GIdGG1MC2Ct7nHdPDSrGxL1c8Rg5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UnxVW89f4ggI4TP7VkB7ZnlMO+946TTChNENx7MbzA+vSPVTW2aX9o24JrD/Cd7Ij ae7sLmrOx4/3Wx5DsmZAcXLfu87P8ZhjgC7lFGIqKEBgaF+1NX8nFBX5L8xlYsopkv XSljZ5fPMAbDGie5BOmj30L0t89Hy74GNxkbCrdM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian Foster , Eric Sandeen , "Darrick J. Wong" , "Darrick J. Wong" , Chandan Babu R Subject: [PATCH 5.4 115/120] xfs: use bitops interface for buf log item AIL flag check Date: Mon, 26 Sep 2022 12:12:28 +0200 Message-Id: <20220926100755.121201939@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Foster commit 826f7e34130a4ce756138540170cbe935c537a47 upstream. The xfs_log_item flags were converted to atomic bitops as of commit 22525c17ed ("xfs: log item flags are racy"). The assert check for AIL presence in xfs_buf_item_relse() still uses the old value based check. This likely went unnoticed as XFS_LI_IN_AIL evaluates to 0 and causes the assert to unconditionally pass. Fix up the check. Signed-off-by: Brian Foster Fixes: 22525c17ed ("xfs: log item flags are racy") Reviewed-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Acked-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_buf_item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -956,7 +956,7 @@ xfs_buf_item_relse( struct xfs_buf_log_item *bip = bp->b_log_item; trace_xfs_buf_item_relse(bp, _RET_IP_); - ASSERT(!(bip->bli_item.li_flags & XFS_LI_IN_AIL)); + ASSERT(!test_bit(XFS_LI_IN_AIL, &bip->bli_item.li_flags)); bp->b_log_item = NULL; if (list_empty(&bp->b_li_list))