diff mbox series

[03/30] xfs: Add missing annotation to xfs_ail_check()

Message ID 20200223231711.157699-4-jbi.octave@gmail.com (mailing list archive)
State Accepted
Headers show
Series None | expand

Commit Message

Jules Irenge Feb. 23, 2020, 11:16 p.m. UTC
Sparse reports a warning at xfs_ail_check()

warning: context imbalance in xfs_ail_check() - unexpected unlock

The root cause is the missing annotation at xfs_ail_check()

Add the missing __must_hold(&ailp->ail_lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 fs/xfs/xfs_trans_ail.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Darrick J. Wong Feb. 25, 2020, 3:44 p.m. UTC | #1
On Sun, Feb 23, 2020 at 11:16:44PM +0000, Jules Irenge wrote:
> Sparse reports a warning at xfs_ail_check()
> 
> warning: context imbalance in xfs_ail_check() - unexpected unlock
> 
> The root cause is the missing annotation at xfs_ail_check()
> 
> Add the missing __must_hold(&ailp->ail_lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Seems reasonable, though I'm wondering if this is a treewide change you
seek to apply yourself, or merely a large patch series to merge through
the individual subsystem maintainers?

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_trans_ail.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
> index 00cc5b8734be..58d4ef1b4c05 100644
> --- a/fs/xfs/xfs_trans_ail.c
> +++ b/fs/xfs/xfs_trans_ail.c
> @@ -32,6 +32,7 @@ STATIC void
>  xfs_ail_check(
>  	struct xfs_ail		*ailp,
>  	struct xfs_log_item	*lip)
> +	__must_hold(&ailp->ail_lock)
>  {
>  	struct xfs_log_item	*prev_lip;
>  	struct xfs_log_item	*next_lip;
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 00cc5b8734be..58d4ef1b4c05 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -32,6 +32,7 @@  STATIC void
 xfs_ail_check(
 	struct xfs_ail		*ailp,
 	struct xfs_log_item	*lip)
+	__must_hold(&ailp->ail_lock)
 {
 	struct xfs_log_item	*prev_lip;
 	struct xfs_log_item	*next_lip;