<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"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></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>
> However, there is no guarantee that the data will be actually written<br>
> to disk. I have heard instances where a caching layer in the disk<br>
> tells the filesystem that the data is written but the data was not<br>
> 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't* lie to the OS and say "I/O complete,<br>
data is on the disk" when it lands in the cache (leaving you vulnerable<br>
if there's a power hit before it flushes the cashe).<br>
<br>
Even more evil - although you'd *think* that the solution is to just disable<br>
the write cache so the disk can't lie and has to wait for the data to hit<br>
the platters, that's not quite true. There's been disks (especially on the<br>
very low end where they Just Don't Care, and on the high end were numbers<br>
are everything) that will *say* they disabled the write cache, but it's still<br>
doing it inside....<br>
</blockquote></div><br><br clear="all"></div><div class="gmail_extra">Though I can'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>