<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 5, 2021 at 12:48 AM jaeho jo <<a href="mailto:hot486two@gmail.com">hot486two@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello!<div><br></div><div>I am testing filesystem recovery and I have a question.</div><div><br></div><div>If the reset is not a power-on reset, my application attempts to restore the filesystem.</div><div><br></div><div>If the file was closed prior to reset, the file was restored.</div><div><br></div><div>If a reset occurs while a file is open, the file was not recovered after the reset. The file was created, but its size is 0. Is this the intended behavior of RTEMS?</div><div><br></div><div>I tested the OS version using RTEMS4.11.1 and 5.1, and the file system using RFS and dosFS. The results were all the same. A file of size 0 has been created.<br></div></div></blockquote><div><br></div><div>If the file and underlying disk buffers are not flushed before reset, then nothing has been committed to the non-volatile storage.</div><div><br></div><div>I would say this is expected and intended behavior if you do not have an orderly write of a file on shutdown/reset on any operating system.</div><div><br></div><div>My quick look at the source code for both filesystems you mention indicate the sync calls like fsync() and fdatasync() are supported. Here is the POSIX page for fsync(). Notice the discussion at the bottom about automated testing and reset.</div><div><br></div><div><a href="https://pubs.opengroup.org/onlinepubs/009695399/functions/fsync.html">https://pubs.opengroup.org/onlinepubs/009695399/functions/fsync.html</a></div><div><br></div><div>I assume this also flushes the block device cache but I didn't look beyond the file system implementations.</div><div><br></div><div>--joel</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>thanks!</div><div>jhjo</div></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div>