]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
da23017d NS |
2 | * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
dfc130f3 | 4 | * |
da23017d NS |
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 | |
2bd0ea18 | 7 | * published by the Free Software Foundation. |
dfc130f3 | 8 | * |
da23017d NS |
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. | |
dfc130f3 | 13 | * |
da23017d NS |
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 | |
2bd0ea18 | 17 | */ |
6b803e5a CH |
18 | #include "libxfs.h" |
19 | #include "libxlog.h" | |
2bd0ea18 NS |
20 | |
21 | #include "logprint.h" | |
22 | ||
23 | void | |
24 | xlog_recover_print_trans_head( | |
72c5917e | 25 | xlog_recover_t *tr) |
2bd0ea18 | 26 | { |
4fd2b075 HT |
27 | printf(_("TRANS: tid:0x%x #items:%d trans:0x%x q:0x%lx\n"), |
28 | tr->r_log_tid, | |
dfc130f3 | 29 | tr->r_theader.th_num_items, |
c40bdaa2 | 30 | tr->r_theader.th_tid, (long)&tr->r_itemq); |
72c5917e | 31 | } |
2bd0ea18 NS |
32 | |
33 | int | |
72c5917e | 34 | xlog_recover_do_trans( |
999f0b9c | 35 | struct xlog *log, |
72c5917e NS |
36 | xlog_recover_t *trans, |
37 | int pass) | |
2bd0ea18 | 38 | { |
c40bdaa2 | 39 | xlog_recover_print_trans(trans, &trans->r_itemq, 3); |
2bd0ea18 | 40 | return 0; |
72c5917e | 41 | } |
2bd0ea18 NS |
42 | |
43 | void | |
72c5917e | 44 | xfs_log_print_trans( |
999f0b9c | 45 | struct xlog *log, |
72c5917e | 46 | int print_block_start) |
2bd0ea18 NS |
47 | { |
48 | xfs_daddr_t head_blk, tail_blk; | |
dc0bd4a0 | 49 | int error; |
2bd0ea18 | 50 | |
5e656dbb BN |
51 | error = xlog_find_tail(log, &head_blk, &tail_blk); |
52 | if (error) { | |
9ee7055c | 53 | fprintf(stderr, _("%s: failed to find head and tail, error: %d\n"), |
dc0bd4a0 | 54 | progname, error); |
72c5917e | 55 | exit(1); |
dc0bd4a0 | 56 | } |
dfc130f3 | 57 | |
9ee7055c | 58 | printf(_(" log tail: %lld head: %lld state: %s\n"), |
dfc130f3 RC |
59 | (long long)tail_blk, |
60 | (long long)head_blk, | |
61 | (tail_blk == head_blk)?"<CLEAN>":"<DIRTY>"); | |
62 | ||
63 | if (print_block_start != -1) { | |
9ee7055c | 64 | printf(_(" override tail: %d\n"), print_block_start); |
72c5917e | 65 | tail_blk = print_block_start; |
dfc130f3 RC |
66 | } |
67 | printf("\n"); | |
68 | ||
72c5917e | 69 | print_record_header = 1; |
2bd0ea18 | 70 | |
72c5917e NS |
71 | if (head_blk == tail_blk) |
72 | return; | |
6567f1f9 DC |
73 | |
74 | /* | |
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. | |
79 | */ | |
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)) { | |
83 | printf(_( | |
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)); | |
89 | } | |
90 | ||
dc0bd4a0 | 91 | if ((error = xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))) { |
9ee7055c | 92 | fprintf(stderr, _("%s: failed in xfs_do_recovery_pass, error: %d\n"), |
dc0bd4a0 | 93 | progname, error); |
72c5917e | 94 | exit(1); |
dc0bd4a0 | 95 | } |
72c5917e | 96 | } |