Re: Subject: UBIFS and small dynamic files

Artem Bityutskiy
2011-10-25T07:52:57Z

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

On Fri, 2011-10-21 at 16:31 +0200, Daniel Wagener wrote:
> Ahoi,
>
> we are having trouble with the side effects of the UBIFS write buffer
> described in http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writebuffer
> We have certain config files that are quite small and get rewritten very
> frequently by their applications.
> Matchbox-panels' ~/.matchbox/mbdock.session is a fine example as it gets
> emptied on a power cut or hard reset resulting in an empty and therefore
> useless panel on the next start.

Well, all the docs about the synchronization are at the web site. There
is also a description with links of what other FSes do:
http://linux-mtd.infradead.org/doc/ubifs.html#L_sync_exceptions

>
> The document above mentions the '-o sync' option which disables the
> write buffer on a partition, but this is not an option for us because we
> do not want to reduce the write performance. And there is also the issue
> of a synchronously mounted UBIFS that can make things even worse in case
> of power cuts.

You can do fsync(), or you can set the "S" flag to the file and make it
always be synchronous (see man chattr).

--
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]