aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_log.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 31f2b04f2c97..2e35077ff6b2 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2813,15 +2813,13 @@ xlog_state_put_ticket(xlog_t *log,
2813 * 2813 *
2814 */ 2814 */
2815STATIC int 2815STATIC int
2816xlog_state_release_iclog(xlog_t *log, 2816xlog_state_release_iclog(
2817 xlog_in_core_t *iclog) 2817 xlog_t *log,
2818 xlog_in_core_t *iclog)
2818{ 2819{
2819 int sync = 0; /* do we sync? */ 2820 int sync = 0; /* do we sync? */
2820 2821
2821 xlog_assign_tail_lsn(log->l_mp);
2822
2823 spin_lock(&log->l_icloglock); 2822 spin_lock(&log->l_icloglock);
2824
2825 if (iclog->ic_state & XLOG_STATE_IOERROR) { 2823 if (iclog->ic_state & XLOG_STATE_IOERROR) {
2826 spin_unlock(&log->l_icloglock); 2824 spin_unlock(&log->l_icloglock);
2827 return XFS_ERROR(EIO); 2825 return XFS_ERROR(EIO);
@@ -2833,13 +2831,14 @@ xlog_state_release_iclog(xlog_t *log,
2833 2831
2834 if (--iclog->ic_refcnt == 0 && 2832 if (--iclog->ic_refcnt == 0 &&
2835 iclog->ic_state == XLOG_STATE_WANT_SYNC) { 2833 iclog->ic_state == XLOG_STATE_WANT_SYNC) {
2834 /* update tail before writing to iclog */
2835 xlog_assign_tail_lsn(log->l_mp);
2836 sync++; 2836 sync++;
2837 iclog->ic_state = XLOG_STATE_SYNCING; 2837 iclog->ic_state = XLOG_STATE_SYNCING;
2838 iclog->ic_header.h_tail_lsn = cpu_to_be64(log->l_tail_lsn); 2838 iclog->ic_header.h_tail_lsn = cpu_to_be64(log->l_tail_lsn);
2839 xlog_verify_tail_lsn(log, iclog, log->l_tail_lsn); 2839 xlog_verify_tail_lsn(log, iclog, log->l_tail_lsn);
2840 /* cycle incremented when incrementing curr_block */ 2840 /* cycle incremented when incrementing curr_block */
2841 } 2841 }
2842
2843 spin_unlock(&log->l_icloglock); 2842 spin_unlock(&log->l_icloglock);
2844 2843
2845 /* 2844 /*
@@ -2849,11 +2848,9 @@ xlog_state_release_iclog(xlog_t *log,
2849 * this iclog has consistent data, so we ignore IOERROR 2848 * this iclog has consistent data, so we ignore IOERROR
2850 * flags after this point. 2849 * flags after this point.
2851 */ 2850 */
2852 if (sync) { 2851 if (sync)
2853 return xlog_sync(log, iclog); 2852 return xlog_sync(log, iclog);
2854 }
2855 return 0; 2853 return 0;
2856
2857} /* xlog_state_release_iclog */ 2854} /* xlog_state_release_iclog */
2858 2855
2859 2856