2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 xlog_recover_print_trans_head(
27 printf(_("TRANS: tid:0x%x #items:%d trans:0x%x q:0x%lx\n"),
29 tr
->r_theader
.th_num_items
,
30 tr
->r_theader
.th_tid
, (long)&tr
->r_itemq
);
34 xlog_recover_do_trans(
36 xlog_recover_t
*trans
,
39 xlog_recover_print_trans(trans
, &trans
->r_itemq
, 3);
46 int print_block_start
)
48 xfs_daddr_t head_blk
, tail_blk
;
51 error
= xlog_find_tail(log
, &head_blk
, &tail_blk
);
53 fprintf(stderr
, _("%s: failed to find head and tail, error: %d\n"),
58 printf(_(" log tail: %lld head: %lld state: %s\n"),
61 (tail_blk
== head_blk
)?"<CLEAN>":"<DIRTY>");
63 if (print_block_start
!= -1) {
64 printf(_(" override tail: %d\n"), print_block_start
);
65 tail_blk
= print_block_start
;
69 print_record_header
= 1;
71 if (head_blk
== tail_blk
)
75 * Version 5 superblock log feature mask validation. We know the
76 * log is dirty so check if there are any unknown log features
77 * in what we need to recover. If there are unknown features
78 * (e.g. unsupported transactions) then warn about it.
80 if (XFS_SB_VERSION_NUM(&log
->l_mp
->m_sb
) == XFS_SB_VERSION_5
&&
81 xfs_sb_has_incompat_log_feature(&log
->l_mp
->m_sb
,
82 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN
)) {
84 "Superblock has unknown incompatible log features (0x%x) enabled.\n"
85 "Output may be incomplete or inaccurate. It is recommended that you\n"
86 "upgrade your xfsprogs installation to match the filesystem features.\n"),
87 (log
->l_mp
->m_sb
.sb_features_log_incompat
&
88 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN
));
91 if ((error
= xlog_do_recovery_pass(log
, head_blk
, tail_blk
, XLOG_RECOVER_PASS1
))) {
92 fprintf(stderr
, _("%s: failed in xfs_do_recovery_pass, error: %d\n"),