博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Data loss in embedded file system UBIFS after shutdown of system
阅读量:4285 次
发布时间:2019-05-27

本文共 1090 字,大约阅读时间需要 3 分钟。

轉載自 

 

 

Q:

Whenever I run my application on UBIFS file system and do a write operation on any file(provided file has proper read and write modes),immediately after power off and on, I see that the content written to the file is missing.The size of the file is zero.The same thing if performed on JFFS2 file system does not pose this issue.I have tried using sync command but still rarely this problem exists.

For example:

I need to write some data in a file called myfile and during run time i open this and write some data as "Hi..Hello.."(if i open the file and check after write operation,data is written properly), then after shutdown/restart, i find that the content "Hi..Hello.." is not there and size of the file is zero bytes.

Note : Problem occurs only after shutdown or restart of the system.

 

UBIFS does less frequent sync. So if file is important call , In user application you must call fsync(). I suggest you to perform one of the following to prevent data loss in UBIFS:

  • After critical writes call 
  • Open files with O_SYNC flag
  • Mount ubifs with -o sync (write buffers are bypassed )

转载地址:http://twpgi.baihongyu.com/

你可能感兴趣的文章
Sublime Text 插件之Emmet
查看>>
SublimeText插件之CodeFormatter
查看>>
Node.Js 全局对象与全局属性(一)
查看>>
Node.Js Path模块-文件或文件夹路径字符串操作
查看>>
Node.Js fs模块文件夹操作
查看>>
Bootstrap 弹出框modal上层的输入框不能获得焦点问题
查看>>
EF Invalid column name 'Discriminator'
查看>>
Node.Js fs模块文件操作(一)
查看>>
Node.Js fs模块操作文件(二)
查看>>
Node.Js fs模块文件操作(三)
查看>>
Node.Js url模块详解
查看>>
Node.Js util模块
查看>>
Node.Js http模块(一)-发送http请求实例
查看>>
Node.Js cheerio模块--操作/解析Html
查看>>
Node.Js cheerio模块简单API
查看>>
C# sha1加密
查看>>
Node.Js v4.4.0版本以上支持lambda表达式
查看>>
Node.js events模块(一)事件循环
查看>>
Node.Js events模块(二)-EventEmitter自定义操作事件
查看>>
HTML5 WebSocket实例(三)-文件上传处理
查看>>