Hi, I am trying to write a bio to a disk block directly using submit_bio(), it works without any errors but on read it shows the old data until I reboot the machine. Is there any way I can flush the particular bio/dirty page immediately or force it to flush before the next read ? code : https://github.com/prashants/km/blob/master/writeblock/writeblock.c Regards.
On Tue, Aug 6, 2013 at 12:39 PM, Prashant Shah <pshah.mumbai@gmail.com> wrote:
Hi,
I am trying to write a bio to a disk block directly using submit_bio(), it works without any errors but on read it shows the old data until I reboot the machine. Is there any way I can flush the particular bio/dirty page immediately or force it to flush before the next read ?
How are you reading and writing? What is your test utility? 'dd' has an option to specify iflag/oflag=direct, which would bypass buffer cache. But anyways this problem should not happen even if data is written to cache, you should read it back from cache.
code : https://github.com/prashants/km/blob/master/writeblock/writeblock.c
Regards.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Rajat
Hi, On Tue, Aug 6, 2013 at 1:15 PM, Rajat Sharma <fs.rajat@gmail.com> wrote:
How are you reading and writing? What is your test utility? 'dd' has an option to specify iflag/oflag=direct, which would bypass buffer cache. But anyways this problem should not happen even if data is written to cache, you should read it back from cache.
I am using cat command. Its a block that belongs to a file and I am directly writing to the block. On reading the file I am getting stale data. Regards.
participants (2)
-
Prashant Shah -
Rajat Sharma