public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@yandex.ru>
To: Kyungmin Park <kmpark@infradead.org>
Cc: Artem.Bityutskiy@nokia.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: EXT4-ish "fixes" in UBIFS
Date: Sun, 29 Mar 2009 15:54:40 +0300	[thread overview]
Message-ID: <49CF6F90.9040609@yandex.ru> (raw)
In-Reply-To: <49CF6A08.3000704@yandex.ru>

Artem Bityutskiy wrote:
> Kyungmin Park wrote:
>> I also got these request. the file is empty at rename operatoin in
>> case of sudden power off.
>> they say it's different from jffs2. in case of jffs2, it points old
>> files even though power off.
> 
> Right, because JFFS2 is synchronous :-)
> 
>> then why is UBIFS different. fix it as before. I said it's not
>> filesystem bug. it's expected behaviors.
> 
> Right, this is what I've been always thinking. I've always been
> thinking the FS gives no guarantees, and if you want a 100%
> guarantee, use fsync() before renaming. Frankly, I still think
> so. But we'll make ext4-like changes in UBIFS as well to help
> the applications which do not do the sync.
> 
>> Frankly I'm not sure which one is better. how much filesystem support
>> it. but remember that application programmer also don't want to change
>> their application when filesystem is changed.
>> "The application is not changed, only filesystem is changed. so it's
>> filesystem problem, not us"
> 
> I hope Linux gurus will put it clearly after all - to fsync() or to
> not fsync(). We do need clear rules of the game. For now, I still
> assume the following:
> 
> 1. If applications want atomic update which gives 100% guarantee,
>   they should fsync before rename.
> 2. If the application does not use fsync, FS should try to minimize
>   the probability of data loss by running asynchronous write-back
>   on rename which unlinks a direntry.
> 3. All this performance vs. reliability hassle should be solved
>   by fixing the FS, by having good defaults, by having a
>   "fsync/not fsync" knobs in applications.
> 
> Indeed, people mostly talk about ext3, desktops, etc. But there
> is also the embedded world, where battery is removed randomly.

Let me elaborate why I tell about embedded. Looking into the
"Linux-2.6.29" thread, it _seems_ people assume that it is enough
if FS will start _asynchronous_ write-back after rename, so that
dirty data will not sit in the cache for long time. E.g., many
people are happy with ext3's 5 seconds. So for me it seems like
some people do not care about 100% atomicity guarantees, they are
fine with just low data loss probability.

So what I say, that in embedded we need 100% atomic updates,
because our power cuts may be frequent and random. And at this
moment only fsync() before rename may guarantee this.

And updating a file using truncate/rewrite does not guarantee
anything at all.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2009-03-29 12:55 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27 12:48 EXT4-ish "fixes" in UBIFS Artem Bityutskiy
2009-03-28  1:22 ` Kyungmin Park
2009-03-29 12:31   ` Artem Bityutskiy
2009-03-29 12:54     ` Artem Bityutskiy [this message]
2009-03-29 12:26 ` replace() system call needed (was Re: EXT4-ish "fixes" in UBIFS) Pavel Machek
2009-03-29 12:42   ` Artem Bityutskiy
2009-03-29 12:50     ` Pavel Machek
2009-03-29 13:00       ` Artem Bityutskiy
2009-03-29 13:02         ` Pavel Machek
2009-03-29 13:07           ` Artem Bityutskiy
2009-03-29 13:22             ` Andreas T.Auer
2009-03-29 13:55               ` Artem Bityutskiy
2009-03-29 13:40             ` Pavel Machek
2009-03-29 13:57               ` Artem Bityutskiy
2009-03-29 14:00                 ` Pavel Machek
2009-03-30 17:19       ` Ric Wheeler
2009-03-30 22:11         ` Pavel Machek
2009-03-29 13:01     ` Andreas T.Auer
2009-03-29 13:06       ` Artem Bityutskiy
2009-03-30 15:58   ` Diego Calleja
2009-04-03  0:09 ` EXT4-ish "fixes" in UBIFS Christian Kujau
2009-04-03  0:24   ` Trenton D. Adams
2009-04-03  0:28     ` Trenton D. Adams
2009-04-03  0:38       ` Christian Kujau
2009-04-03  0:54         ` Trenton D. Adams
2009-04-03  0:54         ` Trenton D. Adams
2009-04-03  0:59           ` Trenton D. Adams
2009-04-03  1:55       ` David Rees
2009-04-03  2:05         ` Trenton D. Adams
2009-04-03  2:19           ` David Rees
2009-04-03  2:28             ` Trenton D. Adams
2009-04-03  2:58               ` David Rees
2009-04-03  3:13                 ` Trenton D. Adams
2009-04-03  3:14                   ` Trenton D. Adams
2009-04-03  5:02                 ` Theodore Tso
2009-04-03  5:15                   ` Trenton D. Adams
2009-04-03  6:30                     ` Theodore Tso
2009-04-03 18:53                       ` Chris Adams
2009-04-03 18:05                   ` David Rees
2009-04-09 20:17                   ` Pavel Machek
2009-04-03  2:26         ` Trenton D. Adams
2009-04-03  2:05   ` Theodore Tso
2009-04-03  2:45     ` Christian Kujau
2009-04-03  2:49       ` Trenton D. Adams
2009-04-03  6:53   ` Artem Bityutskiy
     [not found] <cmFiD-8uc-9@gated-at.bofh.it>
     [not found] ` <cmFss-ft-15@gated-at.bofh.it>
     [not found]   ` <cmFsu-ft-23@gated-at.bofh.it>
     [not found]     ` <cmGRt-2hq-7@gated-at.bofh.it>
     [not found]       ` <cmH1b-2K0-11@gated-at.bofh.it>
     [not found]         ` <cmHkz-3d3-5@gated-at.bofh.it>
     [not found]           ` <cmHkA-3d3-7@gated-at.bofh.it>
     [not found]             ` <cmHND-3Oz-5@gated-at.bofh.it>
     [not found]               ` <cmJPm-7hd-5@gated-at.bofh.it>

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=49CF6F90.9040609@yandex.ru \
    --to=dedekind@yandex.ru \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=kmpark@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox