All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changman Lee <cm224.lee@samsung.com>
To: Paolo Minazzi <Paolo.Minazzi@mitrol.it>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: f2fs, mount -o sync, sync and cut-off power
Date: Fri, 31 Oct 2014 08:11:03 +0900	[thread overview]
Message-ID: <20141030231103.GA19190@lcm> (raw)
In-Reply-To: <5451EA4C.2040304@mitrol.it>

Hi,

When see the manpage of mount, it is written as 'the sync option has
effect only for ext2, ext3, fat, vfat and ufs.' and in case of media
with limited number of write cycles (e.g. some flash drivers) "sync" may
cause life-cycle shortening.

Anyway, you should use O_SYNC when you open a file or call fsync for not
losing your data. Nevertheless this way can not avoid recovery time as well.

Thanks

On Thu, Oct 30, 2014 at 08:35:40AM +0100, Paolo Minazzi wrote:
> 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
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------

  reply	other threads:[~2014-10-30 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  7:35 f2fs, mount -o sync, sync and cut-off power Paolo Minazzi
2014-10-30 23:11 ` Changman Lee [this message]
2014-10-31  6:22 ` Jaegeuk Kim
2014-10-31  9:17   ` Paolo Minazzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141030231103.GA19190@lcm \
    --to=cm224.lee@samsung.com \
    --cc=Paolo.Minazzi@mitrol.it \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.