linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Hudson <joshudson@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
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 07:39:03 -0700	[thread overview]
Message-ID: <CA+jjjYRY4+ZwX6OJQ1Ax16i5roRh-BPePPjyGv7coxvBrxXiEQ@mail.gmail.com> (raw)
In-Reply-To: <20230827041716.GR3390869@ZenIV>

On Sat, Aug 26, 2023 at 9:17 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Sat, Aug 26, 2023 at 07:38:57PM -0700, Joshua Hudson wrote:
> > "Whole disk and all partitions have page caches of their own."
> >
> > That's so bad.
> >
> > I can think of numerous cases where this will cause problems; including
> > some I encountered last year and did not understand at the time. Manipulating
> > EFI partitions through the whole disk device makes sense because FAT filesystems
> > *know their offset on the disk*, and some of the existing tools really
> > don't like being
> > given a partition device.
>
> Explain, please.  How does FAT filesystem know its offset on disk?
> Since when?  It had always been possible to copy a FAT image into
> a partition verbatim and it works no matter where on disk that
> partition happens to be...
>
> Has that changed at some point?  Do you have any references?  Ideally
> with some kind of rationale for that weirdness...
>
> Or am I misparsing what you wrote?

(Good news: finally found the invisible button to edit reply quote)

Offset 0x1C into the FAT filesystem is defined as "Count of hidden
sectors preceding
the partition that contains this FAT volume." It's been there since
DOS 3.0. The Linux
Kernel does not care what's in this field, but I have tools that have
a hard time of it
not being there. One example of a tool is BootDuet.

The rationale is to reduce the number of tools that have to walk the
partition table, the
most obvious one being the boot sector itself which doesn't have room.

With random BIOS bugs in UEFI still; I would *not* want to find out
what happens with
a wrong value here on an EFI partition.

Source: https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system

(The field changed size; you actually want to read the entry under DOS 3.31)

  reply	other threads:[~2023-08-27 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 21:59 Cache coherency bug: stale reads on /dev/sda1 Joshua Hudson
2023-08-27  1:03 ` Bagas Sanjaya
2023-08-27  1:25   ` Joshua Hudson
2023-08-27  2:06     ` Al Viro
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 [this message]
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=CA+jjjYRY4+ZwX6OJQ1Ax16i5roRh-BPePPjyGv7coxvBrxXiEQ@mail.gmail.com \
    --to=joshudson@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bagasdotme@gmail.com \
    --cc=dlemoal@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).