From: Darrick J. Wong Date: Wed, 6 Nov 2019 16:41:20 +0000 (-0800) Subject: xfs: annotate functions that trip static checker locking checks X-Git-Tag: v5.5-rc1~71^2~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f755979355d46ef088f9c9fdb5d11c4a425e738e;p=thirdparty%2Fkernel%2Flinux.git xfs: annotate functions that trip static checker locking checks Add some lock annotations to helper functions that seem to have unbalanced locking that confuses the static analyzers. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index d7d3bfd6a9200..3806674090ed4 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -2808,6 +2808,8 @@ xlog_state_do_iclog_callbacks( struct xlog *log, struct xlog_in_core *iclog, bool aborted) + __releases(&log->l_icloglock) + __acquires(&log->l_icloglock) { spin_unlock(&log->l_icloglock); spin_lock(&iclog->ic_callback_lock); diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index 4f19375f65920..c47aa2ca6dc72 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h @@ -537,7 +537,11 @@ xlog_cil_force(struct xlog *log) * by a spinlock. This matches the semantics of all the wait queues used in the * log code. */ -static inline void xlog_wait(wait_queue_head_t *wq, spinlock_t *lock) +static inline void +xlog_wait( + struct wait_queue_head *wq, + struct spinlock *lock) + __releases(lock) { DECLARE_WAITQUEUE(wait, current);