lkml.org 
[lkml]   [2023]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Cache coherency bug: stale reads on /dev/sda1
On Sat, Aug 26, 2023 at 06:25:58PM -0700, Joshua Hudson wrote:
> I am presuming you mean "Are you sure this not a hardware issue?"
>
> I am sure it is not, for two reasons.
>
> 1) If it were a hardware issue I would still expect the two device
> nodes (whole disk and partition) to report the *same* data.
>
> 2) I have since developed a workaround involving BLKFLSDEV. The
> workaround is really ugly.

Whole disk and all partitions have page caches of their own.
There is no coherency between those; write through one, then
read through another and you are not guaranteed that read won't
see the stale cached data.

Doctor, it hurts when I do it...

Incidentally, read from device/write to the place you've read via
file/read from device again also has no coherency warranties, for
exact same reason.

IOW, not a bug.

\
 
 \ /
  Last update: 2023-08-27 04:09    [W:0.141 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site