Seeking recommendation on whether a bahviour is right/wrong

From: Ajay Garg
Date: Fri Aug 19 2016 - 01:28:09 EST


Hi All.

I have been trying to debug a strange issue occurring on a "mostly
mainline"-linux-kernel, running on a proprietary embedded-platform.

I still haven't been able to zero-on the issue with 100% confirmation,
but I think the following might be happening ::

a)
A C-user-application is running, and a file is being written, one byte
at a time.
Let's say the file-name being written is "file1.txt"

b)
There's another file "file2.txt", which is in absolutely sane-state
(no open file-descriptors, etc.)

c)
Now, a cron-script reboots the machine via /sbin/reboot "abruptly"
(i.e. without closing the open-file-descriptor of "file1.txt").

d)
When the machine comes up, we find that "file2.txt" is corrupted.


In this behaviour, is the kernel at fault?
Or the cron-job is the culprit for abrupt reboot?



Thanks and Regards,
Ajay