From: Al Viro <viro@zeniv.linux.org.uk>
To: Joshua Hudson <joshudson@gmail.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux IDE and libata <linux-ide@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>, Jens Axboe <axboe@kernel.dk>,
Damien Le Moal <dlemoal@kernel.org>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: Re: Cache coherency bug: stale reads on /dev/sda1
Date: Sun, 27 Aug 2023 03:06:35 +0100 [thread overview]
Message-ID: <20230827020635.GQ3390869@ZenIV> (raw)
In-Reply-To: <CA+jjjYT6+NJwB2Kn0jWLKtmz3dWH6UnVJNA6vDbPXnnJnHMf9Q@mail.gmail.com>
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.
next prev parent reply other threads:[~2023-08-27 2:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+jjjYTk=5wn2o46uNB+bJYX8xLgMP==dsJuvC94DvtN2f_6Yw@mail.gmail.com>
2023-08-27 1:03 ` Cache coherency bug: stale reads on /dev/sda1 Bagas Sanjaya
2023-08-27 1:25 ` Joshua Hudson
2023-08-27 2:06 ` Al Viro [this message]
2023-08-27 2:38 ` Joshua Hudson
2023-08-27 2:50 ` Bagas Sanjaya
2023-08-27 4:17 ` Al Viro
2023-08-27 14:39 ` Joshua Hudson
2023-08-27 16:30 ` Al Viro
2023-08-27 18:33 ` Joshua Hudson
2023-09-06 7:42 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230827020635.GQ3390869@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=axboe@kernel.dk \
--cc=bagasdotme@gmail.com \
--cc=dlemoal@kernel.org \
--cc=hdegoede@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=joshudson@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox