<div dir="ltr">Thanks all,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 30, 2014 at 9:59 PM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sat, 29 Mar 2014 18:17:52 +0530, Sankar P said:<br>
<br>
&gt; However, there is no guarantee that the data will be actually written<br>
&gt; to disk. I have heard instances where a caching layer in the disk<br>
&gt; tells the filesystem that the data is written but the data was not<br>
&gt; written and there was a power failure and an ensuing loss of data.<br>
<br>
</div>Actually, let me go a step further - I know of no current disks which<br>
support write caching that *don&#39;t* lie to the OS and say &quot;I/O complete,<br>
data is on the disk&quot; when it lands in the cache (leaving you vulnerable<br>
if there&#39;s a power hit before it flushes the cashe).<br>
<br>
Even more evil - although you&#39;d *think* that the solution is to just disable<br>
the write cache so the disk can&#39;t lie and has to wait for the data to hit<br>
the platters, that&#39;s not quite true.  There&#39;s been disks (especially on the<br>
very low end where they Just Don&#39;t Care, and on the high end were numbers<br>
are everything) that will *say* they disabled the write cache, but it&#39;s still<br>
doing it inside....<br>
</blockquote></div><br><br clear="all"></div><div class="gmail_extra">Though I can&#39;t be still sure of that the data has been flushed to disk <br><br>something like wait_on_buffer() will help me a bit <br><br></div><div class="gmail_extra">

I am still curious to know what happens in journalling, as the journal NEEDS to be committed to the disk, before data writes/modifcation proceed.<br><br></div><div class="gmail_extra">Same for Direct IO as Vineet Suggested<br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">I could not look at the code, will look the code.<br></div><div class="gmail_extra"><br>-- <br>Regards,<br>Rishi Agrawal<br>
</div></div>