···820 * call into reclaim to find it in a clean state instead of waiting for821 * it now. We also don't return errors here - if the error is transient822 * then the next reclaim pass will flush the inode, and if the error823- * is permanent then the next sync reclaim will relcaim the inode and824 * pass on the error.825 */826- if (error && !XFS_FORCED_SHUTDOWN(ip->i_mount)) {827 xfs_fs_cmn_err(CE_WARN, ip->i_mount,828 "inode 0x%llx background reclaim flush failed with %d",829 (long long)ip->i_ino, error);
···820 * call into reclaim to find it in a clean state instead of waiting for821 * it now. We also don't return errors here - if the error is transient822 * then the next reclaim pass will flush the inode, and if the error823+ * is permanent then the next sync reclaim will reclaim the inode and824 * pass on the error.825 */826+ if (error && error != EAGAIN && !XFS_FORCED_SHUTDOWN(ip->i_mount)) {827 xfs_fs_cmn_err(CE_WARN, ip->i_mount,828 "inode 0x%llx background reclaim flush failed with %d",829 (long long)ip->i_ino, error);
+26-12
fs/xfs/xfs_log.c
···745746/*747 * Determine if we have a transaction that has gone to disk748- * that needs to be covered. Log activity needs to be idle (no AIL and749- * nothing in the iclogs). And, we need to be in the right state indicating750- * something has gone out.0000000751 */752int753xfs_log_need_covered(xfs_mount_t *mp)···766 return 0;767768 spin_lock(&log->l_icloglock);769- if (((log->l_covered_state == XLOG_STATE_COVER_NEED) ||770- (log->l_covered_state == XLOG_STATE_COVER_NEED2))771- && !xfs_trans_ail_tail(log->l_ailp)772- && xlog_iclogs_empty(log)) {773- if (log->l_covered_state == XLOG_STATE_COVER_NEED)774- log->l_covered_state = XLOG_STATE_COVER_DONE;775- else {776- ASSERT(log->l_covered_state == XLOG_STATE_COVER_NEED2);777- log->l_covered_state = XLOG_STATE_COVER_DONE2;0000778 }00779 needed = 1;0780 }781 spin_unlock(&log->l_icloglock);782 return needed;
···745746/*747 * Determine if we have a transaction that has gone to disk748+ * that needs to be covered. To begin the transition to the idle state749+ * firstly the log needs to be idle (no AIL and nothing in the iclogs).750+ * If we are then in a state where covering is needed, the caller is informed751+ * that dummy transactions are required to move the log into the idle state.752+ *753+ * Because this is called as part of the sync process, we should also indicate754+ * that dummy transactions should be issued in anything but the covered or755+ * idle states. This ensures that the log tail is accurately reflected in756+ * the log at the end of the sync, hence if a crash occurrs avoids replay757+ * of transactions where the metadata is already on disk.758 */759int760xfs_log_need_covered(xfs_mount_t *mp)···759 return 0;760761 spin_lock(&log->l_icloglock);762+ switch (log->l_covered_state) {763+ case XLOG_STATE_COVER_DONE:764+ case XLOG_STATE_COVER_DONE2:765+ case XLOG_STATE_COVER_IDLE:766+ break;767+ case XLOG_STATE_COVER_NEED:768+ case XLOG_STATE_COVER_NEED2:769+ if (!xfs_trans_ail_tail(log->l_ailp) &&770+ xlog_iclogs_empty(log)) {771+ if (log->l_covered_state == XLOG_STATE_COVER_NEED)772+ log->l_covered_state = XLOG_STATE_COVER_DONE;773+ else774+ log->l_covered_state = XLOG_STATE_COVER_DONE2;775 }776+ /* FALLTHRU */777+ default:778 needed = 1;779+ break;780 }781 spin_unlock(&log->l_icloglock);782 return needed;