How to Sync properly ?
David Woodhouse
dwmw2 at infradead.org
Mon Jan 7 08:59:20 EST 2002
pallaire at gameloft.com said:
> If I want to move a file from a ram drive to the flash, I will issue
> a 'mv' command followed by a 'sync' command. Sometime it will be
> updated but sometime it wont !!! 'sync' should not return until the
> flash is updated ? no ?
> To see what was happening I added some printk in the driver, in the
> delete and write ! I saw some stranges behaviour. After a 'mv',
> sometimes the sync command does not do any things, sometime I see
> somes delteting and writing of buffers but not all of the blocks ...
> the remaining block will be written to the flash in a delay from 1 to
> 5 mintutes later ... and sometime the sync work fine !!!
What file system? If you're using a 'normal' filesystem on the mtdblock
device, you shouldn't expect it to be reliable.
Linux stupidly just assumes that block devices never do any write caching,
and a sync request is therefore never passed to the block device driver.
--
dwmw2
More information about the linux-mtd
mailing list