Paolo Minazzi
2014-10-30 07:35:40 UTC
I'm Paolo.
I'm integrating f2fs on an ARM board.
I do not have the power-off button.
The normal way to power-off is to cut-off the power.
I tried to mount in sync mode
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
I realize that if I cut-off the power after "echo" finishes, at the new
boot I see that f2fs execute the recovery that can be also very long.
If I add the "sync" command
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
sync
I realize that if I cut-off the power after "sync" finishes, at the new
boot I do not see the f2fs
recovery and the boot process is very fast.
This means that -o sync is different that execute a sync command after
each write.
I study deeper the problem reading the source code and I realize that
"sync" produce a checkpoint.
I tried to add the code to make a checkpoint every n writes. It works
but is not a clean solution.
I read and tried ipu-policy but I do not think it is realted to my needs.
Is there a solution to force a checkpoint automatically after each write ?
I need
- not lose data on cut-off
- fast boot (I would like to avoid different mount time)
For me the spped of write is not so important.
I would like avoid the following ...
while true
do
sync
sleep 1
done
Thanks for your time and for this great project
Paolo Minazzi
------------------------------------------------------------------------------
I'm integrating f2fs on an ARM board.
I do not have the power-off button.
The normal way to power-off is to cut-off the power.
I tried to mount in sync mode
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
I realize that if I cut-off the power after "echo" finishes, at the new
boot I see that f2fs execute the recovery that can be also very long.
If I add the "sync" command
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
sync
I realize that if I cut-off the power after "sync" finishes, at the new
boot I do not see the f2fs
recovery and the boot process is very fast.
This means that -o sync is different that execute a sync command after
each write.
I study deeper the problem reading the source code and I realize that
"sync" produce a checkpoint.
I tried to add the code to make a checkpoint every n writes. It works
but is not a clean solution.
I read and tried ipu-policy but I do not think it is realted to my needs.
Is there a solution to force a checkpoint automatically after each write ?
I need
- not lose data on cut-off
- fast boot (I would like to avoid different mount time)
For me the spped of write is not so important.
I would like avoid the following ...
while true
do
sync
sleep 1
done
Thanks for your time and for this great project
Paolo Minazzi
------------------------------------------------------------------------------