While learning the enhanceio, I have a question about status change.
According to my understanding, if an IO(A) do cache_write , and some cache block will turn into VALID|CACHEWRITEINPROG in function eio_write_peek().
At the same time , if another IO(B) hit the same cache block ,it will do uncached_write which actually only write disk.
When the IO(B) finished , the callback function will update these blocks status. Because of the IO(A) had finished ,the block in VALID|CACHEWRITEINPROG changes to ALREADY_DIRTY . It will not be invalid by IO(B) although it has old data.
Will it lead to data inconsistencies ?
Maybe my expression is not very clear. I try to draw the flowchart.
If I understand correctly, B is issued before A is completed. Linux does not quarantee order of on-going write requests if you don't provide some flags in requests.
While learning the enhanceio, I have a question about status change.
According to my understanding, if an IO(A) do cache_write , and some cache block will turn into VALID|CACHEWRITEINPROG in function eio_write_peek(). At the same time , if another IO(B) hit the same cache block ,it will do uncached_write which actually only write disk.
When the IO(B) finished , the callback function will update these blocks status. Because of the IO(A) had finished ,the block in VALID|CACHEWRITEINPROG changes to ALREADY_DIRTY . It will not be invalid by IO(B) although it has old data.
Will it lead to data inconsistencies ? Maybe my expression is not very clear. I try to draw the flowchart.
Would you please explain it ?