Currently, writing reboot paramter into INFORM partition fails
infrequently.
Resolve this issue by calling sync_filesystem function so that it writes
out and waits upon all dirty data associated with this superblock.
Change-Id: Ic62df0c3c4e565ca7211eb85661ead6979f0ad8d
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
if (fd >= 0) {
file = fget(fd);
if (file) {
+ struct super_block *sb = file->f_path.dentry->d_sb;
+
if (cmd) {
if (!strncmp(cmd, "fota", 4))
cmd = "upgr";
cmd = "norm";
vfs_write(file, cmd, strlen(cmd), &pos);
- vfs_fsync(file, 0);
+
+ down_read(&sb->s_umount);
+ sync_filesystem(sb);
+ up_read(&sb->s_umount);
+
fput(file);
}
sys_close(fd);
- /* to guarantee all file data and metadata sync */
- emergency_sync();
} else {
pr_err("Reboot parameter passing is failed.\n"
"Inform file path should be described correctly in config.\n");