Thread (30 messages) read the whole thread 30 messages, 8 authors, 2018-06-09

Re: [PATCH] xfs: fix incorrect log_flushed on fsync

From: Christoph Hellwig <hch@lst.de>
Date: 2017-09-01 09:47:09
Also in: linux-fsdevel, linux-xfs

On Thu, Aug 31, 2017 at 05:37:06PM +0300, Amir Goldstein wrote:
quoted
index bcb2f860e508..3c0cbb98581e 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2922,6 +2922,8 @@ xlog_state_done_syncing(
                iclog->ic_state = XLOG_STATE_DONE_SYNC;
        }

+       log->l_mp->m_flushseq++;
I recon this should use WRITE_ONCE or smp_wmb()
and then also increment m_flush_submitted_seq *before*
issueing flush
It's under l_icloglock, so we shouldn't need a WRITE_ONCE.
If we did we'd need an atomic_t.
If state machine does not allow more than a single flush
to be in flight (?) then the 2 seq counters could be reduced
to single seq counter with (m_flushseq % 2) == 1 for submitted
and  (m_flushseq % 2) == 0 for completed and the test in fsync
would be (flushseq % 2) == (READ_ONCE(mp->m_flushseq) % 2)
The state machine allows multiple flushes to in flight.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help