* [PATCH] xfs: use bitops interface for buf log item AIL flag check
@ 2019-12-17 18:42 Brian Foster
2019-12-17 20:01 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Brian Foster @ 2019-12-17 18:42 UTC (permalink / raw)
To: linux-xfs
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>
---
fs/xfs/xfs_buf_item.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 3458a1264a3f..3984779e5911 100644
--- 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))
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: use bitops interface for buf log item AIL flag check
2019-12-17 18:42 [PATCH] xfs: use bitops interface for buf log item AIL flag check Brian Foster
@ 2019-12-17 20:01 ` Eric Sandeen
2019-12-17 21:51 ` Darrick J. Wong
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2019-12-17 20:01 UTC (permalink / raw)
To: Brian Foster, linux-xfs
On 12/17/19 12:42 PM, Brian Foster wrote:
> 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>
Whoops.
Fixes: 22525c17ed ("xfs: log item flags are racy")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> fs/xfs/xfs_buf_item.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> index 3458a1264a3f..3984779e5911 100644
> --- 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))
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: use bitops interface for buf log item AIL flag check
2019-12-17 20:01 ` Eric Sandeen
@ 2019-12-17 21:51 ` Darrick J. Wong
0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2019-12-17 21:51 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Brian Foster, linux-xfs
On Tue, Dec 17, 2019 at 02:01:26PM -0600, Eric Sandeen wrote:
> On 12/17/19 12:42 PM, Brian Foster wrote:
> > 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>
>
> Whoops.
>
> Fixes: 22525c17ed ("xfs: log item flags are racy")
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
>
Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> > ---
> > fs/xfs/xfs_buf_item.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> > index 3458a1264a3f..3984779e5911 100644
> > --- 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))
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-17 21:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 18:42 [PATCH] xfs: use bitops interface for buf log item AIL flag check Brian Foster
2019-12-17 20:01 ` Eric Sandeen
2019-12-17 21:51 ` Darrick J. Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.