···820820 * call into reclaim to find it in a clean state instead of waiting for821821 * it now. We also don't return errors here - if the error is transient822822 * then the next reclaim pass will flush the inode, and if the error823823- * is permanent then the next sync reclaim will relcaim the inode and823823+ * is permanent then the next sync reclaim will reclaim the inode and824824 * pass on the error.825825 */826826- if (error && !XFS_FORCED_SHUTDOWN(ip->i_mount)) {826826+ if (error && error != EAGAIN && !XFS_FORCED_SHUTDOWN(ip->i_mount)) {827827 xfs_fs_cmn_err(CE_WARN, ip->i_mount,828828 "inode 0x%llx background reclaim flush failed with %d",829829 (long long)ip->i_ino, error);
+26-12
fs/xfs/xfs_log.c
···745745746746/*747747 * Determine if we have a transaction that has gone to disk748748- * that needs to be covered. Log activity needs to be idle (no AIL and749749- * nothing in the iclogs). And, we need to be in the right state indicating750750- * something has gone out.748748+ * that needs to be covered. To begin the transition to the idle state749749+ * firstly the log needs to be idle (no AIL and nothing in the iclogs).750750+ * If we are then in a state where covering is needed, the caller is informed751751+ * that dummy transactions are required to move the log into the idle state.752752+ *753753+ * Because this is called as part of the sync process, we should also indicate754754+ * that dummy transactions should be issued in anything but the covered or755755+ * idle states. This ensures that the log tail is accurately reflected in756756+ * the log at the end of the sync, hence if a crash occurrs avoids replay757757+ * of transactions where the metadata is already on disk.751758 */752759int753760xfs_log_need_covered(xfs_mount_t *mp)···766759 return 0;767760768761 spin_lock(&log->l_icloglock);769769- if (((log->l_covered_state == XLOG_STATE_COVER_NEED) ||770770- (log->l_covered_state == XLOG_STATE_COVER_NEED2))771771- && !xfs_trans_ail_tail(log->l_ailp)772772- && xlog_iclogs_empty(log)) {773773- if (log->l_covered_state == XLOG_STATE_COVER_NEED)774774- log->l_covered_state = XLOG_STATE_COVER_DONE;775775- else {776776- ASSERT(log->l_covered_state == XLOG_STATE_COVER_NEED2);777777- log->l_covered_state = XLOG_STATE_COVER_DONE2;762762+ switch (log->l_covered_state) {763763+ case XLOG_STATE_COVER_DONE:764764+ case XLOG_STATE_COVER_DONE2:765765+ case XLOG_STATE_COVER_IDLE:766766+ break;767767+ case XLOG_STATE_COVER_NEED:768768+ case XLOG_STATE_COVER_NEED2:769769+ if (!xfs_trans_ail_tail(log->l_ailp) &&770770+ xlog_iclogs_empty(log)) {771771+ if (log->l_covered_state == XLOG_STATE_COVER_NEED)772772+ log->l_covered_state = XLOG_STATE_COVER_DONE;773773+ else774774+ log->l_covered_state = XLOG_STATE_COVER_DONE2;778775 }776776+ /* FALLTHRU */777777+ default:779778 needed = 1;779779+ break;780780 }781781 spin_unlock(&log->l_icloglock);782782 return needed;