Skip to contentSkip to conversation

Fix atari label false positives

PATCH In review Phillip Susi 4 participants 6 messages Jun 5, 2018 – Jun 6, 2018 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix atari label false positives

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(-)
NEWS +2 -0
index 2c903ca5..a5ec44ee 100644
@@ -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
libparted/libparted.c +1 -2
index d855d0e6..e864d1b3 100644
@@ -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);
Signature · 1 line
2.17.0

A message that is not in the archive (sent off-list or not yet received): 20180605143045.23875-1-psusi-GeWIH/[email protected]

#2 lore raw
Quoted 14 lines · Phillip Susi
libparted/libparted.c +1 -1
index d855d0e6..e864d1b3 100644
@@ -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 ();

libparted/libparted.c init_disk_types () · line 100

Quoted 5 lines
libparted/libparted.c +0 -1
@@ -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

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#3 lore raw
Quoted 2 lines · John Paul Adrian Glaubitz

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.

A message that is not in the archive (sent off-list or not yet received): 208fded9-0bfc-0578-7a57-98b5c3af78dc-GeWIH/[email protected]

#5 lore raw
Quoted 7 lines · Phillip Susi
Quoted 2 lines · John Paul Adrian Glaubitz

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

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#6 lore raw
In reply to a message not in the archive

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.

A message that is not in the archive (sent off-list or not yet received): CAACXqO8f-=-Bj6JiddnQM5GMFenDUj-MBO7ZTUcPh1tAKWtTmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#8 lore raw
Quoted 6 lines · Håkon Løvdal

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.