linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix atari label false positives
@ 2018-06-05 14:30 Phillip Susi
       [not found] ` <20180605143045.23875-1-psusi-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Phillip Susi @ 2018-06-05 14:30 UTC (permalink / raw)
  To: glaubitz-1Olz3AKvcsuAKZTfuerNgRvVK+yQ3ZXh
  Cc: debian-68k-0aAXYlwwYIJuHlm7Suoebg,
	linux-m68k-u79uwXL29TY76Z2rM5mHXA,
	parted-devel-XbBxUvOt3X2LieD7tvxI8l/i77bcL1HB

The atari label gets false positives easily, so probe it after
all other labels have said no.
---
 NEWS                  | 2 ++
 libparted/libparted.c | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 2c903ca5..a5ec44ee 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ GNU parted NEWS                                    -*- outline -*-
 
 ** Bug Fixes
 
+  Fix atari disklabel false positives by probing other labels first.
+
   Fix set and disk_set to not crash when there are no flags to set.
 
   Fix resizepart to adjust the end to be -1 sector when using iec
diff --git a/libparted/libparted.c b/libparted/libparted.c
index d855d0e6..e864d1b3 100644
--- a/libparted/libparted.c
+++ b/libparted/libparted.c
@@ -85,7 +85,7 @@ init_disk_types ()
 #if defined __s390__ || defined __s390x__
 	ped_disk_dasd_init();
 #endif
-
+	ped_disk_atari_init ();
 	ped_disk_sun_init ();
 #ifdef ENABLE_PC98
 	ped_disk_pc98_init ();
@@ -97,7 +97,6 @@ init_disk_types ()
 	ped_disk_bsd_init ();
 	ped_disk_amiga_init ();
 	ped_disk_aix_init ();
-	ped_disk_atari_init ();
 }
 
 extern void ped_file_system_amiga_init (void);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix atari label false positives
       [not found] ` <20180605143045.23875-1-psusi-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
@ 2018-06-05 14:35   ` John Paul Adrian Glaubitz
  2018-06-05 14:40     ` Phillip Susi
  2018-06-05 20:08   ` Håkon Løvdal
  1 sibling, 1 reply; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2018-06-05 14:35 UTC (permalink / raw)
  To: Phillip Susi
  Cc: debian-68k-0aAXYlwwYIJuHlm7Suoebg,
	linux-m68k-u79uwXL29TY76Z2rM5mHXA,
	parted-devel-XbBxUvOt3X2LieD7tvxI8l/i77bcL1HB



On 06/05/2018 04:30 PM, Phillip Susi wrote:
> diff --git a/libparted/libparted.c b/libparted/libparted.c
> index d855d0e6..e864d1b3 100644
> --- a/libparted/libparted.c
> +++ b/libparted/libparted.c
> @@ -85,7 +85,7 @@ init_disk_types ()
>  #if defined __s390__ || defined __s390x__
>  	ped_disk_dasd_init();
>  #endif
> -
> +	ped_disk_atari_init ();
>  	ped_disk_sun_init ();
>  #ifdef ENABLE_PC98
>  	ped_disk_pc98_init ();
> @@ -97,7 +97,6 @@ init_disk_types ()
>  	ped_disk_bsd_init ();
>  	ped_disk_amiga_init ();
>  	ped_disk_aix_init ();
> -	ped_disk_atari_init ();
>  }

Is that the reversed patch? I thought you wanted to move the atari
probing to the bottom?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org
`. `'   Freie Universitaet Berlin - glaubitz-1Olz3AKvcsuAKZTfuerNgRvVK+yQ3ZXh@public.gmane.org
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix atari label false positives
  2018-06-05 14:35   ` John Paul Adrian Glaubitz
@ 2018-06-05 14:40     ` Phillip Susi
       [not found]       ` <208fded9-0bfc-0578-7a57-98b5c3af78dc-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Phillip Susi @ 2018-06-05 14:40 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: parted-devel, linux-m68k, debian-68k


[-- Attachment #1.1: Type: text/plain, Size: 359 bytes --]

On 6/5/2018 10:35 AM, John Paul Adrian Glaubitz wrote:
> Is that the reversed patch? I thought you wanted to move the atari
> probing to the bottom?

No; the order they are probed in is the reverse of the order they are
initialized in because the fs registration puts the new one on the head
and slides the previously registered ones further down.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix atari label false positives
       [not found]       ` <208fded9-0bfc-0578-7a57-98b5c3af78dc-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
@ 2018-06-05 14:43         ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2018-06-05 14:43 UTC (permalink / raw)
  To: Phillip Susi
  Cc: debian-68k-0aAXYlwwYIJuHlm7Suoebg,
	linux-m68k-u79uwXL29TY76Z2rM5mHXA,
	parted-devel-XbBxUvOt3X2LieD7tvxI8l/i77bcL1HB

On 06/05/2018 04:40 PM, Phillip Susi wrote:
> On 6/5/2018 10:35 AM, John Paul Adrian Glaubitz wrote:
>> Is that the reversed patch? I thought you wanted to move the atari
>> probing to the bottom?
> 
> No; the order they are probed in is the reverse of the order they are
> initialized in because the fs registration puts the new one on the head
> and slides the previously registered ones further down.

I see, thanks for the explanation.

I hope that I can fix the partition atari detection code sometime in the
future. I need to have a look at the partition probing code in the Linux
kernel where it works without false positives.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org
`. `'   Freie Universitaet Berlin - glaubitz-1Olz3AKvcsuAKZTfuerNgRvVK+yQ3ZXh@public.gmane.org
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix atari label false positives
       [not found] ` <20180605143045.23875-1-psusi-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
  2018-06-05 14:35   ` John Paul Adrian Glaubitz
@ 2018-06-05 20:08   ` Håkon Løvdal
       [not found]     ` <CAACXqO8f-=-Bj6JiddnQM5GMFenDUj-MBO7ZTUcPh1tAKWtTmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Håkon Løvdal @ 2018-06-05 20:08 UTC (permalink / raw)
  To: Phillip Susi
  Cc: GNU Parted developers' list,
	linux-m68k-u79uwXL29TY76Z2rM5mHXA,
	debian-68k-0aAXYlwwYIJuHlm7Suoebg

While the commit message contains the relevant information, this really
ought to be present as a comment directly in the code as well. And
the un-obviousness of the code vs check order deserves a mention as
well, so please add a commen like

+       ped_disk_atari_init (); // NB! Must be first so that it is checked last.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix atari label false positives
       [not found]     ` <CAACXqO8f-=-Bj6JiddnQM5GMFenDUj-MBO7ZTUcPh1tAKWtTmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-06-06 13:14       ` Phillip Susi
  0 siblings, 0 replies; 6+ messages in thread
From: Phillip Susi @ 2018-06-06 13:14 UTC (permalink / raw)
  To: Håkon Løvdal
  Cc: GNU Parted developers' list,
	linux-m68k-u79uwXL29TY76Z2rM5mHXA,
	debian-68k-0aAXYlwwYIJuHlm7Suoebg


[-- Attachment #1.1: Type: text/plain, Size: 399 bytes --]

On 6/5/2018 4:08 PM, Håkon Løvdal wrote:
> While the commit message contains the relevant information, this really
> ought to be present as a comment directly in the code as well. And
> the un-obviousness of the code vs check order deserves a mention as
> well, so please add a commen like
> 
> +       ped_disk_atari_init (); // NB! Must be first so that it is checked last.

Will do.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-06 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 14:30 [PATCH] Fix atari label false positives Phillip Susi
     [not found] ` <20180605143045.23875-1-psusi-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2018-06-05 14:35   ` John Paul Adrian Glaubitz
2018-06-05 14:40     ` Phillip Susi
     [not found]       ` <208fded9-0bfc-0578-7a57-98b5c3af78dc-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2018-06-05 14:43         ` John Paul Adrian Glaubitz
2018-06-05 20:08   ` Håkon Løvdal
     [not found]     ` <CAACXqO8f-=-Bj6JiddnQM5GMFenDUj-MBO7ZTUcPh1tAKWtTmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-06 13:14       ` Phillip Susi

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).