2001-10-04 14:35:38

by Karl Pitrich

[permalink] [raw]
Subject: 100% sync block device on 2.2 ?


hi.

i wrote a block driver for a custom battery-backup'ed sram-isa card
which is io mapped. (kernel is 2.2.16, switch to 2.4.x impossible)

i have a minix fs on it.

everything works fine, except that i need my sram-disk _absolutely_
in sync. i mounted -o sync, but the kernel does'nt seem to sync
immediately.
so after any reboot my data is corrupt, which is a problem.

this is my /proc/sys/vm/bdflush, which i tuned:
1 5000 5 25 1 100 100 1 1

so, it should flush dirty buffers all 100hz, if i am right.

is there any way to bypass/disable buffer cache for my block device?
why does this work in floppy.c?
how does sct's rawdevice stuff do this?
(i checked both .c but cant get the clue)

thanks a lot for help, karl.


2001-10-04 18:16:08

by lk

[permalink] [raw]
Subject: Re: 100% sync block device on 2.2 ?

> 1 5000 5 25 1 100 100 1 1
>
> so, it should flush dirty buffers all 100hz, if i am right.
>
> is there any way to bypass/disable buffer cache for my block device?
> why does this work in floppy.c?
> how does sct's rawdevice stuff do this?
> (i checked both .c but cant get the clue)
>

while :; do sync ; done


and everything should be in sync :)


> thanks a lot for help, karl.
>
>

2001-10-04 18:23:57

by Karl Pitrich

[permalink] [raw]
Subject: Re: 100% sync block device on 2.2 ?

On Thu, 4 Oct 2001, [email protected] wrote:

>
> while :; do sync ; done
>
>
> and everything should be in sync :)

sync does not call fsync_dev(), nor it calls this flush ioctl i
implemented in my driver.
sync seems just to sync the vfs.

2001-10-04 18:33:48

by lk

[permalink] [raw]
Subject: Re: 100% sync block device on 2.2 ?

> >
> > while :; do sync ; done
> >
> >
> > and everything should be in sync :)
>
> sync does not call fsync_dev(), nor it calls this flush ioctl i
> implemented in my driver.
> sync seems just to sync the vfs.

from my experience, sync flush all the buffers to disk just like the
kernel does when it receies a halt or reboot command.

>
>

2001-10-04 18:38:48

by Alan

[permalink] [raw]
Subject: Re: 100% sync block device on 2.2 ?

> i wrote a block driver for a custom battery-backup'ed sram-isa card
> which is io mapped. (kernel is 2.2.16, switch to 2.4.x impossible)
> i have a minix fs on it.
> everything works fine, except that i need my sram-disk _absolutely_
> in sync. i mounted -o sync, but the kernel does'nt seem to sync
> immediately.
> so after any reboot my data is corrupt, which is a problem.

You cannot achieve what you are trying to do without a journalling or
logging file system. JFFS and ext3 are available as 2.4 patches