Skip to content

Commit 6337032

Browse files
committed
xfs: trace log intent item recovery failures
Add a trace point so that we can capture when a recovered log intent item fails to recover. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com>
1 parent da5de11 commit 6337032

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

fs/xfs/xfs_log_recover.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,8 +2559,11 @@ xlog_recover_process_intents(
25592559
spin_unlock(&ailp->ail_lock);
25602560
error = lip->li_ops->iop_recover(lip, &capture_list);
25612561
spin_lock(&ailp->ail_lock);
2562-
if (error)
2562+
if (error) {
2563+
trace_xlog_intent_recovery_failed(log->l_mp, error,
2564+
lip->li_ops->iop_recover);
25632565
break;
2566+
}
25642567
}
25652568

25662569
xfs_trans_ail_cursor_done(&cur);

fs/xfs/xfs_trace.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
103103
DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
104104
DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
105105

106+
TRACE_EVENT(xlog_intent_recovery_failed,
107+
TP_PROTO(struct xfs_mount *mp, int error, void *function),
108+
TP_ARGS(mp, error, function),
109+
TP_STRUCT__entry(
110+
__field(dev_t, dev)
111+
__field(int, error)
112+
__field(void *, function)
113+
),
114+
TP_fast_assign(
115+
__entry->dev = mp->m_super->s_dev;
116+
__entry->error = error;
117+
__entry->function = function;
118+
),
119+
TP_printk("dev %d:%d error %d function %pS",
120+
MAJOR(__entry->dev), MINOR(__entry->dev),
121+
__entry->error, __entry->function)
122+
);
123+
106124
DECLARE_EVENT_CLASS(xfs_perag_class,
107125
TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
108126
unsigned long caller_ip),

0 commit comments

Comments
 (0)