]> git.itanic.dy.fi Git - linux-stable/commitdiff
xfs: use bitops interface for buf log item AIL flag check
authorBrian Foster <bfoster@redhat.com>
Sat, 24 Sep 2022 12:56:51 +0000 (18:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:04:11 +0000 (11:04 +0200)
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 <bfoster@redhat.com>
Fixes: 22525c17ed ("xfs: log item flags are racy")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_buf_item.c

index d74fbd1e9d3eab6feac9d34e11ad00a9b7450bdb..b1452117e442978b5dd295d31bd55dbbb10f1940 100644 (file)
@@ -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))