Fix atari label false positives
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
@@ -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
@@ -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]
Quoted 14 lines · Phillip Susi
libparted/libparted.c +1
-1@@ -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
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]
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
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
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.