public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Christian Zigotzky <chzigotzky@xenosoft.de>,
	Martin Steigerwald <martin@lichtvoll.de>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk,
	linux-m68k@vger.kernel.org, geert@linux-m68k.org, hch@lst.de,
	stable@vger.kernel.org, "R.T.Dickinson" <rtd2@xtra.co.nz>,
	Darren Stevens <darren@stevens-zone.net>,
	mad skateman <madskateman@gmail.com>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Christian Zigotzky <info@xenosoft.de>
Subject: Re: [PATCH] block: bugfix for Amiga partition overflow check patch
Date: Mon, 3 Jul 2023 13:57:10 +1200	[thread overview]
Message-ID: <c3a7f613-102b-add1-0d55-32f030e936b7@gmail.com> (raw)
In-Reply-To: <9785707F-E415-4E04-A8E5-AD984CE16AA0@xenosoft.de>

Hi Christian,

please stop placing your replies underneath the previous mail's 
signature separator. There are mail clients that won't copy such text 
when composing a reply.

Am 02.07.2023 um 21:34 schrieb Christian Zigotzky:
>
>
> On 2. Jul 2023, at 10:56, Christian Zigotzky <chzigotzky@xenosoft.de> wrote:
>
> On 2. Jul 2023, at 09:55, Martin Steigerwald <martin@lichtvoll.de> wrote:
>
> How many end users are you speaking of?
>
> Back then I thought I was the only one using a hard disk with mixed
> Amiga/Linux RDB setup.
>
> Best,
>
>
> Martin
>
>
>
> A lot.  I am speaking about the new A-EON machines.
>
>
>
> The end users have to fix their  RDBs if they want to use the new patched kernels.

So what you're saying is that you have let your end users use RDB 
partitions on the old kernels that had a bug against them in the RDB 
code for eleven years, and proposed bugfixes for as long, patches to 
resolve the problem submitted to linux-block for the last five years, 
and you never once stopped to investigate what the ramifications of this 
bug were, and what the consequences of the proposed bugfix would be?

The discussion of this bug among Martin, Joanne and Geert didn't leave a 
lot to imagination as regards data corruption potential.

> But a normal user can’t edit the RDB manually. What can we do for the end users?

End users can use whatever tool they happened to use to partition the 
disk in the first instance, and correct the partition table that way.

Leaving 8 GB unused at the end of the disk can't be some feature of 
Amiga partition editors, leastways not one that can't be overridden?


But if you want to support your large userbase by a convenient solution, 
may I suggest you write a small tool that gets the disks's end cylinder 
from the RDB (field rdb_HiCylinder, offset 0x8c), then walk the 
partition list starting from rdb_PartitionList for the first partition 
block, then pb_Next for the next one, find the last valid partition 
(where pb_Next is 0xffffffff), and check whether the partition size 
calculation for that partition (in 32 bit arithmetic) would cause the 
partition end to land beyond EOD. If that is the case, the old kernel 
code would have truncated that partition to exactly EOD, and you have to 
change the partition end cylinder value (offset 0xa8 from the start of 
that partition block) to the value of rdb_HiCylinder. Adjust the 
partition checksum (offset 0x8) by the difference of the old and new 
values (i.e. add (old-new) to the checksum stored there) and you should 
have a valid partition to the end of the disk.

Might be a bit tough in a shell script but not too hard in Perl or Python.

Putting that kind of fix in the kernel would be asking Jens and Linus 
(and quite a few others) to yell at me and call me names, and for very 
good reason (but of course you can always do that in kernels you 
distribute to your end users).

Cheers,

	Michael



  parent reply	other threads:[~2023-07-03  1:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  2:35 [PATCH] block: bugfix for Amiga partition overflow check patch Michael Schmitz
2023-07-01  6:40 ` Christian Zigotzky
2023-07-01  8:11   ` Michael Schmitz
2023-07-01  9:48     ` Christian Zigotzky
2023-07-02  2:17       ` Michael Schmitz
2023-07-02  3:45         ` Michael Schmitz
2023-07-02  4:37         ` Christian Zigotzky
2023-07-02  7:55           ` Martin Steigerwald
2023-07-02  8:56             ` Christian Zigotzky
2023-07-02  9:34               ` Christian Zigotzky
2023-07-02  9:51                 ` John Paul Adrian Glaubitz
2023-07-02 10:34                 ` Martin Steigerwald
2023-07-03  1:57                 ` Michael Schmitz [this message]
2023-07-02 20:22             ` Michael Schmitz
2023-07-03  7:05               ` Martin Steigerwald
2023-07-03 14:19                 ` Christian Zigotzky
2023-07-03 14:59                   ` Christian Zigotzky
2023-07-03 21:24                     ` Michael Schmitz
2023-07-03 21:27                       ` Jens Axboe
2023-07-03 22:43                         ` Michael Schmitz
2023-07-04  5:06                       ` John Paul Adrian Glaubitz
2023-07-04  5:44                         ` Michael Schmitz
2023-07-04  5:48                           ` John Paul Adrian Glaubitz
2023-07-04  5:58                             ` Michael Schmitz
2023-07-04  7:28                               ` Martin Steigerwald

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=c3a7f613-102b-add1-0d55-32f030e936b7@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=chzigotzky@xenosoft.de \
    --cc=darren@stevens-zone.net \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=hch@lst.de \
    --cc=info@xenosoft.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=madskateman@gmail.com \
    --cc=martin@lichtvoll.de \
    --cc=rtd2@xtra.co.nz \
    --cc=stable@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