* UBIFS synchronisation questions about file create/delete
@ 2009-11-26 21:06 Ronny Dierckx
2009-11-27 8:19 ` Adrian Hunter
0 siblings, 1 reply; 6+ messages in thread
From: Ronny Dierckx @ 2009-11-26 21:06 UTC (permalink / raw)
To: linux-mtd
Hi,
I'm using UBIFS (git://git.infradead.org/~dedekind/ubifs-v2.6.27.git)
on an ARM device with OneNAND flash.
I've been reading the documentation, FAQ, ... about sync/fsync/fdatasync and
the
write-back buffers, but there are still some things I don't understand.
I create a file with vi, write some data in it, close it, don't call sync.
Then
after waiting 10 minutes I cut the power. When the system is restarted, the
file is
not there anymore?! Is this normal behavior? Shouldn't there be at least
a file of 0 bytes because "UBIFS operations which change directory entries
are synchronous"?
Doesn't this mean that creating or deleting a file entry doesn't require a
sync ?
Thanks,
Ronny Dierckx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS synchronisation questions about file create/delete
2009-11-26 21:06 UBIFS synchronisation questions about file create/delete Ronny Dierckx
@ 2009-11-27 8:19 ` Adrian Hunter
2009-11-27 8:53 ` Jamie Lokier
2009-11-27 13:26 ` Ronny Dierckx
0 siblings, 2 replies; 6+ messages in thread
From: Adrian Hunter @ 2009-11-27 8:19 UTC (permalink / raw)
To: Ronny Dierckx; +Cc: linux-mtd@lists.infradead.org
Ronny Dierckx wrote:
> Hi,
>
> I'm using UBIFS (git://git.infradead.org/~dedekind/ubifs-v2.6.27.git)
> on an ARM device with OneNAND flash.
>
> I've been reading the documentation, FAQ, ... about sync/fsync/fdatasync and
> the
> write-back buffers, but there are still some things I don't understand.
>
> I create a file with vi, write some data in it, close it, don't call sync.
> Then
> after waiting 10 minutes I cut the power. When the system is restarted, the
> file is
> not there anymore?! Is this normal behavior? Shouldn't there be at least
> a file of 0 bytes because "UBIFS operations which change directory entries
> are synchronous"?
> Doesn't this mean that creating or deleting a file entry doesn't require a
> sync ?
No it is not normal behaviour.
10 minutes is long enough for everything to be written and flushed. The file
should be completely intact.
No UBIFS operations which change directory entries are not entirely
synchronous. There is a NAND-page-sized buffer which must be flushed.
It is flushed every 5 seconds or so. Otherwise you must do some kind of
sync.
I can only guess that that version of UBIFS is somehow broken.
Please send a bug report as described here:
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_how_send_bugreport
but set the Default message level to 1.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS synchronisation questions about file create/delete
2009-11-27 8:19 ` Adrian Hunter
@ 2009-11-27 8:53 ` Jamie Lokier
2009-11-27 13:26 ` Ronny Dierckx
1 sibling, 0 replies; 6+ messages in thread
From: Jamie Lokier @ 2009-11-27 8:53 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd@lists.infradead.org, Ronny Dierckx
Adrian Hunter wrote:
> 10 minutes is long enough for everything to be written and flushed. The
> file should be completely intact.
Unless laptop_mode is used. It is normally for letting disks spin
down by not flushing writes quickly.
-- Jamie
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: UBIFS synchronisation questions about file create/delete
2009-11-27 8:19 ` Adrian Hunter
2009-11-27 8:53 ` Jamie Lokier
@ 2009-11-27 13:26 ` Ronny Dierckx
2009-11-27 13:44 ` Adrian Hunter
1 sibling, 1 reply; 6+ messages in thread
From: Ronny Dierckx @ 2009-11-27 13:26 UTC (permalink / raw)
To: 'Adrian Hunter'; +Cc: linux-mtd
>No it is not normal behaviour.
>
>10 minutes is long enough for everything to be written and flushed. The
file
>should be completely intact.
>
>No UBIFS operations which change directory entries are not entirely
>synchronous. There is a NAND-page-sized buffer which must be flushed.
>It is flushed every 5 seconds or so. Otherwise you must do some kind of
>sync.
>
>I can only guess that that version of UBIFS is somehow broken.
Hi Adrian,
I tried some different versions from
git://git.infradead.org/~dedekind/ubifs-v2.6.27.git
and the problem is caused by commit " UBIFS: fix 64-bit divisions in debug
print "
9d016dc4b3006ef3493b21442394028614e26da5 :
dbg_io("set timer for jhead %d, %llu millisecs", wbuf->jhead,
- ktime_to_ns(wbuf->hardlimit)/USEC_PER_SEC);
- hrtimer_start(&wbuf->timer, wbuf->hardlimit, HRTIMER_MODE_REL);
+ div_u64(ktime_to_ns(wbuf->hardlimit), USEC_PER_SEC));
}
As you can see the timer is no longer started. Could you please fix this ?
Thanks,
Ronny Dierckx
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: UBIFS synchronisation questions about file create/delete
2009-11-27 13:26 ` Ronny Dierckx
@ 2009-11-27 13:44 ` Adrian Hunter
2009-11-27 14:21 ` Artem Bityutskiy
0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2009-11-27 13:44 UTC (permalink / raw)
To: Artem Bityutskiy
Cc: Ronny Dierckx, linux-mtd@lists.infradead.org,
Bityutskiy Artem (Nokia-M/Helsinki)
Ronny Dierckx wrote:
>> No it is not normal behaviour.
>>
>> 10 minutes is long enough for everything to be written and flushed. The
> file
>> should be completely intact.
>>
>> No UBIFS operations which change directory entries are not entirely
>> synchronous. There is a NAND-page-sized buffer which must be flushed.
>> It is flushed every 5 seconds or so. Otherwise you must do some kind of
>> sync.
>>
>> I can only guess that that version of UBIFS is somehow broken.
>
> Hi Adrian,
>
> I tried some different versions from
> git://git.infradead.org/~dedekind/ubifs-v2.6.27.git
> and the problem is caused by commit " UBIFS: fix 64-bit divisions in debug
> print "
> 9d016dc4b3006ef3493b21442394028614e26da5 :
>
> dbg_io("set timer for jhead %d, %llu millisecs", wbuf->jhead,
> - ktime_to_ns(wbuf->hardlimit)/USEC_PER_SEC);
> - hrtimer_start(&wbuf->timer, wbuf->hardlimit, HRTIMER_MODE_REL);
> + div_u64(ktime_to_ns(wbuf->hardlimit), USEC_PER_SEC));
> }
>
> As you can see the timer is no longer started. Could you please fix this ?
It is Artem's git tree.
Artem, can you look at this?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: UBIFS synchronisation questions about file create/delete
2009-11-27 13:44 ` Adrian Hunter
@ 2009-11-27 14:21 ` Artem Bityutskiy
0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-11-27 14:21 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd@lists.infradead.org, Ronny Dierckx
On Fri, 2009-11-27 at 15:44 +0200, Adrian Hunter wrote:
> > I tried some different versions from
> > git://git.infradead.org/~dedekind/ubifs-v2.6.27.git
> > and the problem is caused by commit " UBIFS: fix 64-bit divisions in debug
> > print "
> > 9d016dc4b3006ef3493b21442394028614e26da5 :
> >
> > dbg_io("set timer for jhead %d, %llu millisecs", wbuf->jhead,
> > - ktime_to_ns(wbuf->hardlimit)/USEC_PER_SEC);
> > - hrtimer_start(&wbuf->timer, wbuf->hardlimit, HRTIMER_MODE_REL);
> > + div_u64(ktime_to_ns(wbuf->hardlimit), USEC_PER_SEC));
> > }
> >
> > As you can see the timer is no longer started. Could you please fix this ?
>
> It is Artem's git tree.
>
> Artem, can you look at this?
Done.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-27 14:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 21:06 UBIFS synchronisation questions about file create/delete Ronny Dierckx
2009-11-27 8:19 ` Adrian Hunter
2009-11-27 8:53 ` Jamie Lokier
2009-11-27 13:26 ` Ronny Dierckx
2009-11-27 13:44 ` Adrian Hunter
2009-11-27 14:21 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox