Lines Matching refs:log
57 struct xlog *log, in xlog_verify_bno() argument
61 if (blk_no < 0 || blk_no >= log->l_logBBsize) in xlog_verify_bno()
63 if (bbcount <= 0 || (blk_no + bbcount) > log->l_logBBsize) in xlog_verify_bno()
74 struct xlog *log, in xlog_alloc_buffer() argument
81 if (XFS_IS_CORRUPT(log->l_mp, !xlog_verify_bno(log, 0, nbblks))) { in xlog_alloc_buffer()
82 xfs_warn(log->l_mp, "Invalid block length (0x%x) for buffer", in xlog_alloc_buffer()
101 if (nbblks > 1 && log->l_sectBBsize > 1) in xlog_alloc_buffer()
102 nbblks += log->l_sectBBsize; in xlog_alloc_buffer()
103 nbblks = round_up(nbblks, log->l_sectBBsize); in xlog_alloc_buffer()
113 struct xlog *log, in xlog_align() argument
116 return BBTOB(blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1)); in xlog_align()
121 struct xlog *log, in xlog_do_io() argument
129 if (XFS_IS_CORRUPT(log->l_mp, !xlog_verify_bno(log, blk_no, nbblks))) { in xlog_do_io()
130 xfs_warn(log->l_mp, in xlog_do_io()
136 blk_no = round_down(blk_no, log->l_sectBBsize); in xlog_do_io()
137 nbblks = round_up(nbblks, log->l_sectBBsize); in xlog_do_io()
140 error = xfs_rw_bdev(log->l_targ->bt_bdev, log->l_logBBstart + blk_no, in xlog_do_io()
142 if (error && !xlog_is_shutdown(log)) { in xlog_do_io()
143 xfs_alert(log->l_mp, in xlog_do_io()
153 struct xlog *log, in xlog_bread_noalign() argument
158 return xlog_do_io(log, blk_no, nbblks, data, REQ_OP_READ); in xlog_bread_noalign()
163 struct xlog *log, in xlog_bread() argument
171 error = xlog_do_io(log, blk_no, nbblks, data, REQ_OP_READ); in xlog_bread()
173 *offset = data + xlog_align(log, blk_no); in xlog_bread()
179 struct xlog *log, in xlog_bwrite() argument
184 return xlog_do_io(log, blk_no, nbblks, data, REQ_OP_WRITE); in xlog_bwrite()
270 struct xlog *log, in xlog_find_cycle_start() argument
285 error = xlog_bread(log, mid_blk, 1, buffer, &offset); in xlog_find_cycle_start()
313 struct xlog *log, in xlog_find_verify_cycle() argument
333 while (bufblks > log->l_logBBsize) in xlog_find_verify_cycle()
335 while (!(buffer = xlog_alloc_buffer(log, bufblks))) { in xlog_find_verify_cycle()
337 if (bufblks < log->l_sectBBsize) in xlog_find_verify_cycle()
346 error = xlog_bread(log, i, bcount, buffer, &buf); in xlog_find_verify_cycle()
369 xlog_logrec_hblks(struct xlog *log, struct xlog_rec_header *rh) in xlog_logrec_hblks() argument
371 if (xfs_has_logv2(log->l_mp)) { in xlog_logrec_hblks()
395 struct xlog *log, in xlog_find_verify_log_record() argument
411 buffer = xlog_alloc_buffer(log, num_blks); in xlog_find_verify_log_record()
413 buffer = xlog_alloc_buffer(log, 1); in xlog_find_verify_log_record()
418 error = xlog_bread(log, start_blk, num_blks, buffer, &offset); in xlog_find_verify_log_record()
427 xfs_warn(log->l_mp, in xlog_find_verify_log_record()
435 error = xlog_bread(log, i, 1, buffer, &offset); in xlog_find_verify_log_record()
463 if ((error = xlog_header_check_mount(log->l_mp, head))) in xlog_find_verify_log_record()
473 xhdrs = xlog_logrec_hblks(log, head); in xlog_find_verify_log_record()
499 struct xlog *log, in xlog_find_head() argument
508 int error, log_bbnum = log->l_logBBsize; in xlog_find_head()
511 error = xlog_find_zeroed(log, &first_blk); in xlog_find_head()
513 xfs_warn(log->l_mp, "empty log check failed"); in xlog_find_head()
525 xfs_warn(log->l_mp, "totally zeroed log"); in xlog_find_head()
532 buffer = xlog_alloc_buffer(log, 1); in xlog_find_head()
536 error = xlog_bread(log, 0, 1, buffer, &offset); in xlog_find_head()
543 error = xlog_bread(log, last_blk, 1, buffer, &offset); in xlog_find_head()
613 error = xlog_find_cycle_start(log, buffer, first_blk, &head_blk, in xlog_find_head()
626 num_scan_bblks = min_t(int, log_bbnum, XLOG_TOTAL_REC_SHIFT(log)); in xlog_find_head()
633 if ((error = xlog_find_verify_cycle(log, in xlog_find_head()
670 if ((error = xlog_find_verify_cycle(log, start_blk, in xlog_find_head()
686 if ((error = xlog_find_verify_cycle(log, in xlog_find_head()
699 num_scan_bblks = XLOG_REC_SHIFT(log); in xlog_find_head()
704 error = xlog_find_verify_log_record(log, start_blk, &head_blk, 0); in xlog_find_head()
712 error = xlog_find_verify_log_record(log, start_blk, &head_blk, 0); in xlog_find_head()
722 error = xlog_find_verify_log_record(log, start_blk, in xlog_find_head()
750 xfs_warn(log->l_mp, "failed to find log head"); in xlog_find_head()
764 struct xlog *log, in xlog_rseek_logrec_hdr() argument
787 error = xlog_bread(log, i, 1, buffer, &offset); in xlog_rseek_logrec_hdr()
805 for (i = log->l_logBBsize - 1; i >= (int) tail_blk; i--) { in xlog_rseek_logrec_hdr()
806 error = xlog_bread(log, i, 1, buffer, &offset); in xlog_rseek_logrec_hdr()
838 struct xlog *log, in xlog_seek_logrec_hdr() argument
859 end_blk = head_blk > tail_blk ? head_blk : log->l_logBBsize - 1; in xlog_seek_logrec_hdr()
861 error = xlog_bread(log, i, 1, buffer, &offset); in xlog_seek_logrec_hdr()
879 error = xlog_bread(log, i, 1, buffer, &offset); in xlog_seek_logrec_hdr()
905 struct xlog *log, in xlog_tail_distance() argument
912 return tail_blk + (log->l_logBBsize - head_blk); in xlog_tail_distance()
936 struct xlog *log, in xlog_verify_tail() argument
949 buffer = xlog_alloc_buffer(log, 1); in xlog_verify_tail()
957 error = xlog_seek_logrec_hdr(log, head_blk, *tail_blk, 1, buffer, in xlog_verify_tail()
972 error = xlog_do_recovery_pass(log, head_blk, *tail_blk, in xlog_verify_tail()
981 tail_distance = xlog_tail_distance(log, head_blk, first_bad); in xlog_verify_tail()
986 error = xlog_seek_logrec_hdr(log, head_blk, first_bad, 2, in xlog_verify_tail()
993 error = xlog_do_recovery_pass(log, head_blk, *tail_blk, in xlog_verify_tail()
998 xfs_warn(log->l_mp, in xlog_verify_tail()
1021 struct xlog *log, in xlog_verify_head() argument
1043 tmp_buffer = xlog_alloc_buffer(log, 1); in xlog_verify_head()
1046 error = xlog_rseek_logrec_hdr(log, *head_blk, *tail_blk, in xlog_verify_head()
1058 error = xlog_do_recovery_pass(log, *head_blk, tmp_rhead_blk, in xlog_verify_head()
1066 xfs_warn(log->l_mp, in xlog_verify_head()
1078 found = xlog_rseek_logrec_hdr(log, first_bad, *tail_blk, 1, in xlog_verify_head()
1104 return xlog_verify_tail(log, *head_blk, tail_blk, in xlog_verify_head()
1118 struct xlog *log, in xlog_wrap_logbno() argument
1123 div_s64_rem(bno, log->l_logBBsize, &mod); in xlog_wrap_logbno()
1134 struct xlog *log, in xlog_check_unmount_rec() argument
1160 hblks = xlog_logrec_hblks(log, rhead); in xlog_check_unmount_rec()
1161 after_umount_blk = xlog_wrap_logbno(log, in xlog_check_unmount_rec()
1166 umount_data_blk = xlog_wrap_logbno(log, rhead_blk + hblks); in xlog_check_unmount_rec()
1167 error = xlog_bread(log, umount_data_blk, 1, buffer, &offset); in xlog_check_unmount_rec()
1178 xlog_assign_atomic_lsn(&log->l_tail_lsn, in xlog_check_unmount_rec()
1179 log->l_curr_cycle, after_umount_blk); in xlog_check_unmount_rec()
1180 xlog_assign_atomic_lsn(&log->l_last_sync_lsn, in xlog_check_unmount_rec()
1181 log->l_curr_cycle, after_umount_blk); in xlog_check_unmount_rec()
1193 struct xlog *log, in xlog_set_state() argument
1209 log->l_prev_block = rhead_blk; in xlog_set_state()
1210 log->l_curr_block = (int)head_blk; in xlog_set_state()
1211 log->l_curr_cycle = be32_to_cpu(rhead->h_cycle); in xlog_set_state()
1213 log->l_curr_cycle++; in xlog_set_state()
1214 atomic64_set(&log->l_tail_lsn, be64_to_cpu(rhead->h_tail_lsn)); in xlog_set_state()
1215 atomic64_set(&log->l_last_sync_lsn, be64_to_cpu(rhead->h_lsn)); in xlog_set_state()
1216 xlog_assign_grant_head(&log->l_reserve_head.grant, log->l_curr_cycle, in xlog_set_state()
1217 BBTOB(log->l_curr_block)); in xlog_set_state()
1218 xlog_assign_grant_head(&log->l_write_head.grant, log->l_curr_cycle, in xlog_set_state()
1219 BBTOB(log->l_curr_block)); in xlog_set_state()
1240 struct xlog *log, in xlog_find_tail() argument
1256 if ((error = xlog_find_head(log, head_blk))) in xlog_find_tail()
1260 buffer = xlog_alloc_buffer(log, 1); in xlog_find_tail()
1264 error = xlog_bread(log, 0, 1, buffer, &offset); in xlog_find_tail()
1280 error = xlog_rseek_logrec_hdr(log, *head_blk, *head_blk, 1, buffer, in xlog_find_tail()
1285 xfs_warn(log->l_mp, "%s: couldn't find sync record", __func__); in xlog_find_tail()
1294 xlog_set_state(log, *head_blk, rhead, rhead_blk, wrapped); in xlog_find_tail()
1295 tail_lsn = atomic64_read(&log->l_tail_lsn); in xlog_find_tail()
1301 error = xlog_check_unmount_rec(log, head_blk, tail_blk, rhead, in xlog_find_tail()
1319 error = xlog_verify_head(log, head_blk, tail_blk, buffer, in xlog_find_tail()
1326 xlog_set_state(log, *head_blk, rhead, rhead_blk, in xlog_find_tail()
1328 tail_lsn = atomic64_read(&log->l_tail_lsn); in xlog_find_tail()
1329 error = xlog_check_unmount_rec(log, head_blk, tail_blk, in xlog_find_tail()
1343 set_bit(XFS_OPSTATE_CLEAN, &log->l_mp->m_opstate); in xlog_find_tail()
1364 if (!xfs_readonly_buftarg(log->l_targ)) in xlog_find_tail()
1365 error = xlog_clear_stale_blocks(log, tail_lsn); in xlog_find_tail()
1371 xfs_warn(log->l_mp, "failed to locate log tail"); in xlog_find_tail()
1393 struct xlog *log, in xlog_find_zeroed() argument
1401 int error, log_bbnum = log->l_logBBsize; in xlog_find_zeroed()
1406 buffer = xlog_alloc_buffer(log, 1); in xlog_find_zeroed()
1409 error = xlog_bread(log, 0, 1, buffer, &offset); in xlog_find_zeroed()
1421 error = xlog_bread(log, log_bbnum-1, 1, buffer, &offset); in xlog_find_zeroed()
1433 error = xlog_find_cycle_start(log, buffer, 0, &last_blk, 0); in xlog_find_zeroed()
1443 num_scan_bblks = XLOG_TOTAL_REC_SHIFT(log); in xlog_find_zeroed()
1456 if ((error = xlog_find_verify_cycle(log, start_blk, in xlog_find_zeroed()
1466 error = xlog_find_verify_log_record(log, start_blk, &last_blk, 0); in xlog_find_zeroed()
1487 struct xlog *log, in xlog_add_record() argument
1500 xfs_has_logv2(log->l_mp) ? 2 : 1); in xlog_add_record()
1504 memcpy(&recp->h_fs_uuid, &log->l_mp->m_sb.sb_uuid, sizeof(uuid_t)); in xlog_add_record()
1509 struct xlog *log, in xlog_write_log_records() argument
1519 int sectbb = log->l_sectBBsize; in xlog_write_log_records()
1532 while (bufblks > log->l_logBBsize) in xlog_write_log_records()
1534 while (!(buffer = xlog_alloc_buffer(log, bufblks))) { in xlog_write_log_records()
1546 error = xlog_bread_noalign(log, start_block, 1, buffer); in xlog_write_log_records()
1565 error = xlog_bread_noalign(log, ealign, sectbb, in xlog_write_log_records()
1572 offset = buffer + xlog_align(log, start_block); in xlog_write_log_records()
1574 xlog_add_record(log, offset, cycle, i+j, in xlog_write_log_records()
1578 error = xlog_bwrite(log, start_block, endcount, buffer); in xlog_write_log_records()
1608 struct xlog *log, in xlog_clear_stale_blocks() argument
1619 head_cycle = log->l_curr_cycle; in xlog_clear_stale_blocks()
1620 head_block = log->l_curr_block; in xlog_clear_stale_blocks()
1636 if (XFS_IS_CORRUPT(log->l_mp, in xlog_clear_stale_blocks()
1638 head_block >= log->l_logBBsize)) in xlog_clear_stale_blocks()
1640 tail_distance = tail_block + (log->l_logBBsize - head_block); in xlog_clear_stale_blocks()
1647 if (XFS_IS_CORRUPT(log->l_mp, in xlog_clear_stale_blocks()
1663 max_distance = XLOG_TOTAL_REC_SHIFT(log); in xlog_clear_stale_blocks()
1673 if ((head_block + max_distance) <= log->l_logBBsize) { in xlog_clear_stale_blocks()
1681 error = xlog_write_log_records(log, (head_cycle - 1), in xlog_clear_stale_blocks()
1694 distance = log->l_logBBsize - head_block; in xlog_clear_stale_blocks()
1695 error = xlog_write_log_records(log, (head_cycle - 1), in xlog_clear_stale_blocks()
1710 distance = max_distance - (log->l_logBBsize - head_block); in xlog_clear_stale_blocks()
1711 error = xlog_write_log_records(log, head_cycle, 0, distance, in xlog_clear_stale_blocks()
1726 struct xlog *log, in xlog_recover_release_intent() argument
1732 struct xfs_ail *ailp = log->l_ailp; in xlog_recover_release_intent()
1864 struct xlog *log, in xlog_recover_reorder_trans() argument
1882 xfs_warn(log->l_mp, in xlog_recover_reorder_trans()
1904 trace_xfs_log_recover_item_reorder_head(log, in xlog_recover_reorder_trans()
1912 trace_xfs_log_recover_item_reorder_tail(log, in xlog_recover_reorder_trans()
1933 struct xlog *log, in xlog_buf_readahead() argument
1938 if (!xlog_is_buffer_cancelled(log, blkno, len)) in xlog_buf_readahead()
1939 xfs_buf_readahead(log->l_mp->m_ddev_targp, blkno, len, ops); in xlog_buf_readahead()
1944 struct xlog *log, in xlog_recover_items_pass2() argument
1953 trace_xfs_log_recover_item_recover(log, trans, item, in xlog_recover_items_pass2()
1957 error = item->ri_ops->commit_pass2(log, buffer_list, in xlog_recover_items_pass2()
1974 struct xlog *log, in xlog_recover_commit_trans() argument
1990 error = xlog_recover_reorder_trans(log, trans, pass); in xlog_recover_commit_trans()
1995 trace_xfs_log_recover_item_recover(log, trans, item, pass); in xlog_recover_commit_trans()
2000 error = item->ri_ops->commit_pass1(log, item); in xlog_recover_commit_trans()
2004 item->ri_ops->ra_pass2(log, item); in xlog_recover_commit_trans()
2008 error = xlog_recover_items_pass2(log, trans, in xlog_recover_commit_trans()
2026 error = xlog_recover_items_pass2(log, trans, in xlog_recover_commit_trans()
2050 struct xlog *log, in xlog_recover_add_to_cont_trans() argument
2066 xfs_warn(log->l_mp, "%s: bad header length", __func__); in xlog_recover_add_to_cont_trans()
2090 trace_xfs_log_recover_item_add_cont(log, trans, item, 0); in xlog_recover_add_to_cont_trans()
2109 struct xlog *log, in xlog_recover_add_to_trans() argument
2123 xfs_warn(log->l_mp, "%s: bad header magic number", in xlog_recover_add_to_trans()
2130 xfs_warn(log->l_mp, "%s: bad header length", __func__); in xlog_recover_add_to_trans()
2164 xfs_warn(log->l_mp, in xlog_recover_add_to_trans()
2179 xfs_warn(log->l_mp, in xlog_recover_add_to_trans()
2191 trace_xfs_log_recover_item_add(log, trans, item, 0); in xlog_recover_add_to_trans()
2227 struct xlog *log, in xlog_recovery_process_trans() argument
2251 error = xlog_recover_add_to_trans(log, trans, dp, len); in xlog_recovery_process_trans()
2254 error = xlog_recover_add_to_cont_trans(log, trans, dp, len); in xlog_recovery_process_trans()
2257 error = xlog_recover_commit_trans(log, trans, pass, in xlog_recovery_process_trans()
2266 xfs_warn(log->l_mp, "%s: Unmount LR", __func__); in xlog_recovery_process_trans()
2271 xfs_warn(log->l_mp, "%s: bad flag 0x%x", __func__, flags); in xlog_recovery_process_trans()
2334 struct xlog *log, in xlog_recover_process_ophdr() argument
2350 xfs_warn(log->l_mp, "%s: bad clientid 0x%x", in xlog_recover_process_ophdr()
2361 xfs_warn(log->l_mp, "%s: bad length 0x%x", __func__, len); in xlog_recover_process_ophdr()
2395 if (log->l_recovery_lsn != trans->r_lsn && in xlog_recover_process_ophdr()
2400 log->l_recovery_lsn = trans->r_lsn; in xlog_recover_process_ophdr()
2403 return xlog_recovery_process_trans(log, trans, dp, len, in xlog_recover_process_ophdr()
2418 struct xlog *log, in xlog_recover_process_data() argument
2434 if (xlog_header_check_recover(log->l_mp, rhead)) in xlog_recover_process_data()
2437 trace_xfs_log_recover_record(log, rhead, pass); in xlog_recover_process_data()
2445 error = xlog_recover_process_ophdr(log, rhash, rhead, ohead, in xlog_recover_process_data()
2536 struct xlog *log) in xlog_recover_process_intents() argument
2547 ailp = log->l_ailp; in xlog_recover_process_intents()
2550 last_lsn = xlog_assign_lsn(log->l_curr_cycle, log->l_curr_block); in xlog_recover_process_intents()
2581 trace_xlog_intent_recovery_failed(log->l_mp, error, in xlog_recover_process_intents()
2592 error = xlog_finish_defer_ops(log->l_mp, &capture_list); in xlog_recover_process_intents()
2598 xlog_abort_defer_ops(log->l_mp, &capture_list); in xlog_recover_process_intents()
2609 struct xlog *log) in xlog_recover_cancel_intents() argument
2615 ailp = log->l_ailp; in xlog_recover_cancel_intents()
2802 struct xlog *log) in xlog_recover_process_iunlinks() argument
2807 for_each_perag(log->l_mp, agno, pag) in xlog_recover_process_iunlinks()
2815 xfs_inodegc_flush(log->l_mp); in xlog_recover_process_iunlinks()
2822 struct xlog *log) in xlog_unpack_data() argument
2832 if (xfs_has_logv2(log->l_mp)) { in xlog_unpack_data()
2848 struct xlog *log, in xlog_recover_process() argument
2858 crc = xlog_cksum(log, rhead, dp, be32_to_cpu(rhead->h_len)); in xlog_recover_process()
2880 if (old_crc || xfs_has_crc(log->l_mp)) { in xlog_recover_process()
2881 xfs_alert(log->l_mp, in xlog_recover_process()
2892 if (xfs_has_crc(log->l_mp)) { in xlog_recover_process()
2893 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, log->l_mp); in xlog_recover_process()
2898 xlog_unpack_data(rhead, dp, log); in xlog_recover_process()
2900 return xlog_recover_process_data(log, rhash, rhead, dp, pass, in xlog_recover_process()
2906 struct xlog *log, in xlog_valid_rec_header() argument
2913 if (XFS_IS_CORRUPT(log->l_mp, in xlog_valid_rec_header()
2916 if (XFS_IS_CORRUPT(log->l_mp, in xlog_valid_rec_header()
2920 xfs_warn(log->l_mp, "%s: unrecognised log version (%d).", in xlog_valid_rec_header()
2930 if (XFS_IS_CORRUPT(log->l_mp, hlen <= 0 || hlen > bufsize)) in xlog_valid_rec_header()
2933 if (XFS_IS_CORRUPT(log->l_mp, in xlog_valid_rec_header()
2934 blkno > log->l_logBBsize || blkno > INT_MAX)) in xlog_valid_rec_header()
2949 struct xlog *log, in xlog_do_recovery_pass() argument
2978 if (xfs_has_logv2(log->l_mp)) { in xlog_do_recovery_pass()
2984 hbp = xlog_alloc_buffer(log, 1); in xlog_do_recovery_pass()
2988 error = xlog_bread(log, tail_blk, 1, hbp, &offset); in xlog_do_recovery_pass()
3007 if (h_len > h_size && h_len <= log->l_mp->m_logbsize && in xlog_do_recovery_pass()
3009 xfs_warn(log->l_mp, in xlog_do_recovery_pass()
3011 h_size, log->l_mp->m_logbsize); in xlog_do_recovery_pass()
3012 h_size = log->l_mp->m_logbsize; in xlog_do_recovery_pass()
3015 error = xlog_valid_rec_header(log, rhead, tail_blk, h_size); in xlog_do_recovery_pass()
3019 hblks = xlog_logrec_hblks(log, rhead); in xlog_do_recovery_pass()
3022 hbp = xlog_alloc_buffer(log, hblks); in xlog_do_recovery_pass()
3025 ASSERT(log->l_sectBBsize == 1); in xlog_do_recovery_pass()
3027 hbp = xlog_alloc_buffer(log, 1); in xlog_do_recovery_pass()
3033 dbp = xlog_alloc_buffer(log, BTOBB(h_size)); in xlog_do_recovery_pass()
3046 while (blk_no < log->l_logBBsize) { in xlog_do_recovery_pass()
3053 if (blk_no + hblks <= log->l_logBBsize) { in xlog_do_recovery_pass()
3055 error = xlog_bread(log, blk_no, hblks, hbp, in xlog_do_recovery_pass()
3061 if (blk_no != log->l_logBBsize) { in xlog_do_recovery_pass()
3064 split_hblks = log->l_logBBsize - (int)blk_no; in xlog_do_recovery_pass()
3066 error = xlog_bread(log, blk_no, in xlog_do_recovery_pass()
3086 error = xlog_bread_noalign(log, 0, in xlog_do_recovery_pass()
3093 error = xlog_valid_rec_header(log, rhead, in xlog_do_recovery_pass()
3108 if (blk_no + bblks <= log->l_logBBsize || in xlog_do_recovery_pass()
3109 blk_no >= log->l_logBBsize) { in xlog_do_recovery_pass()
3110 rblk_no = xlog_wrap_logbno(log, blk_no); in xlog_do_recovery_pass()
3111 error = xlog_bread(log, rblk_no, bblks, dbp, in xlog_do_recovery_pass()
3120 if (blk_no != log->l_logBBsize) { in xlog_do_recovery_pass()
3126 log->l_logBBsize - (int)blk_no; in xlog_do_recovery_pass()
3128 error = xlog_bread(log, blk_no, in xlog_do_recovery_pass()
3147 error = xlog_bread_noalign(log, 0, in xlog_do_recovery_pass()
3154 error = xlog_recover_process(log, rhash, rhead, offset, in xlog_do_recovery_pass()
3163 ASSERT(blk_no >= log->l_logBBsize); in xlog_do_recovery_pass()
3164 blk_no -= log->l_logBBsize; in xlog_do_recovery_pass()
3170 error = xlog_bread(log, blk_no, hblks, hbp, &offset); in xlog_do_recovery_pass()
3175 error = xlog_valid_rec_header(log, rhead, blk_no, h_size); in xlog_do_recovery_pass()
3181 error = xlog_bread(log, blk_no+hblks, bblks, dbp, in xlog_do_recovery_pass()
3186 error = xlog_recover_process(log, rhash, rhead, offset, pass, in xlog_do_recovery_pass()
3241 struct xlog *log, in xlog_do_log_recovery() argument
3253 error = xlog_alloc_buf_cancel_table(log); in xlog_do_log_recovery()
3257 error = xlog_do_recovery_pass(log, head_blk, tail_blk, in xlog_do_log_recovery()
3266 error = xlog_do_recovery_pass(log, head_blk, tail_blk, in xlog_do_log_recovery()
3269 xlog_check_buf_cancel_table(log); in xlog_do_log_recovery()
3271 xlog_free_buf_cancel_table(log); in xlog_do_log_recovery()
3280 struct xlog *log, in xlog_do_recover() argument
3284 struct xfs_mount *mp = log->l_mp; in xlog_do_recover()
3289 trace_xfs_log_recover(log, head_blk, tail_blk); in xlog_do_recover()
3294 error = xlog_do_log_recovery(log, head_blk, tail_blk); in xlog_do_recover()
3298 if (xlog_is_shutdown(log)) in xlog_do_recover()
3320 if (!xlog_is_shutdown(log)) { in xlog_do_recover()
3344 clear_bit(XLOG_ACTIVE_RECOVERY, &log->l_opstate); in xlog_do_recover()
3355 struct xlog *log) in xlog_recover() argument
3361 error = xlog_find_tail(log, &head_blk, &tail_blk); in xlog_recover()
3370 if (xfs_has_crc(log->l_mp) && in xlog_recover()
3371 !xfs_log_check_lsn(log->l_mp, log->l_mp->m_sb.sb_lsn)) in xlog_recover()
3386 if ((error = xfs_dev_is_read_only(log->l_mp, "recovery"))) { in xlog_recover()
3397 if (xfs_sb_is_v5(&log->l_mp->m_sb) && in xlog_recover()
3398 xfs_sb_has_incompat_log_feature(&log->l_mp->m_sb, in xlog_recover()
3400 xfs_warn(log->l_mp, in xlog_recover()
3402 (log->l_mp->m_sb.sb_features_log_incompat & in xlog_recover()
3404 xfs_warn(log->l_mp, in xlog_recover()
3406 xfs_warn(log->l_mp, in xlog_recover()
3417 xfs_notice(log->l_mp, in xlog_recover()
3423 xfs_notice(log->l_mp, "Starting recovery (logdev: %s)", in xlog_recover()
3424 log->l_mp->m_logname ? log->l_mp->m_logname in xlog_recover()
3427 error = xlog_do_recover(log, head_blk, tail_blk); in xlog_recover()
3428 set_bit(XLOG_RECOVERY_NEEDED, &log->l_opstate); in xlog_recover()
3443 struct xlog *log) in xlog_recover_finish() argument
3447 error = xlog_recover_process_intents(log); in xlog_recover_finish()
3456 xlog_recover_cancel_intents(log); in xlog_recover_finish()
3457 xfs_alert(log->l_mp, "Failed to recover intents"); in xlog_recover_finish()
3458 xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR); in xlog_recover_finish()
3467 xfs_log_force(log->l_mp, XFS_LOG_SYNC); in xlog_recover_finish()
3475 if (xfs_clear_incompat_log_features(log->l_mp)) { in xlog_recover_finish()
3476 error = xfs_sync_sb(log->l_mp, false); in xlog_recover_finish()
3478 xfs_alert(log->l_mp, in xlog_recover_finish()
3484 xlog_recover_process_iunlinks(log); in xlog_recover_finish()
3493 error = xfs_reflink_recover_cow(log->l_mp); in xlog_recover_finish()
3495 xfs_alert(log->l_mp, in xlog_recover_finish()
3504 xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR); in xlog_recover_finish()
3512 struct xlog *log) in xlog_recover_cancel() argument
3514 if (xlog_recovery_needed(log)) in xlog_recover_cancel()
3515 xlog_recover_cancel_intents(log); in xlog_recover_cancel()