OSDN Git Service

xfs: Add missing annotation to xfs_ail_check()
authorJules Irenge <jbi.octave@gmail.com>
Wed, 26 Feb 2020 17:37:15 +0000 (09:37 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 3 Mar 2020 04:55:51 +0000 (20:55 -0800)
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>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_trans_ail.c

index 00cc5b8..58d4ef1 100644 (file)
@@ -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;