xfs: annotate functions that trip static checker locking checks
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 6 Nov 2019 16:41:20 +0000 (08:41 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 10 Nov 2019 18:21:58 +0000 (10:21 -0800)
Add some lock annotations to helper functions that seem to have
unbalanced locking that confuses the static analyzers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_log.c
fs/xfs/xfs_log_priv.h

index d7d3bfd..3806674 100644 (file)
@@ -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);
index 4f19375..c47aa2c 100644 (file)
@@ -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);