NetBSD Problem Report #56886

From tsutsui@ceres.dti.ne.jp  Wed Jun 15 11:02:40 2022
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0C5111A921F
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Jun 2022 11:02:40 +0000 (UTC)
Message-Id: <202206151102.25FB2RuU024412@ceres.dti.ne.jp>
Date: Wed, 15 Jun 2022 20:02:27 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: sysinst doesn't show "Add a partition" menu after deleting partitions
X-Send-Pr-Version: 3.95

>Number:         56886
>Category:       install
>Synopsis:       sysinst doesn't show "Add a partition" menu after deleting partitions
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 15 11:05:00 +0000 2022
>Closed-Date:    Sat Dec 31 05:31:04 +0000 2022
>Last-Modified:  Sat Dec 31 05:31:04 +0000 2022
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.99.97 2202206130350Z daily snapshot
>Organization:
>Environment:
System: NetBSD 9.2 (GENERIC)
Architecture: i386, but maybe MI issue
Machine: i386
>Description:
The sysinst inner (disklabel) partition editor doesn't show
"Add a partition" menu item even after deleting partition
or resizing partition smaller.

>How-To-Repeat:
% ftp http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/202206130350Z/images/NetBSD-9.99.97-i386.iso
% dd if=/dev/zero of=test.img bs=1m count=1024
% qemu-system-i386 -hda test.img -cdrom NetBSD-9.99.97-i386.iso

After sysinst starts:
 - a: Installation messages in English
 - a: Install NetBSD to hard disk 
 - b: Yes 
 - a: wd0 (1.0G, QEMU HARDDISK)
 - b: Master Boot Record (MBR)
 - a: This is the correct geometry
 - b: Use the entire disk
 - a: Set sizes of NetBSD partitions
 - x: Go on.  Free space 0 sec.

Here, there is no "Add a partition" menu item, maybe because
there is no free space. Maybe this is intended behaviour.
However we can never add partitions even after deleting or changing
existing partitions.

- case 1:
 - (select a: partition)
 - n: Delete partition
  -> Then the menu claims "free: 340M" but
     still no "Add a partition" menu item.

- case 2:
 - (select b: partition)
 - c:             size : 1400769 sec
 - (set 65536 sec (or a value smaller than before)
 - x: OK
  -> Then the menu still claims "free: 0B" and
     still no "Add a partition" menu item.

>Fix:
Handle dp.free_space in disklabel_delete() (and all other related
functions that update partition size) in disklabel.c properly?

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: install-manager->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Wed, 15 Jun 2022 11:07:38 +0000
Responsible-Changed-Why:
probably my bug


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/56886: sysinst doesn't show "Add a partition" menu after
 deleting partitions
Date: Wed, 15 Jun 2022 13:37:16 +0200

 Side note, unrelated to the bug correctly described in this PR:

 >  - a: Set sizes of NetBSD partitions

 The easiest way to add other partitions is at this point, before sysinst
 has extended the "+" marked partition (usually /) to the maximum size.

 >  - x: Go on.  Free space 0 sec.

 .. but of course it needs to work here too.

 Martin

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56886 CVS commit: src/usr.sbin/sysinst
Date: Tue, 21 Jun 2022 15:41:29 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jun 21 15:41:29 UTC 2022

 Modified Files:
 	src/usr.sbin/sysinst: disklabel.c

 Log Message:
 disklabel_can_add_partition() did not consider additional partitions
 (while there still is space in the disklabel). Part of PR 56886.


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/sysinst/disklabel.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56886 CVS commit: src/usr.sbin/sysinst
Date: Tue, 21 Jun 2022 15:42:44 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jun 21 15:42:44 UTC 2022

 Modified Files:
 	src/usr.sbin/sysinst: disklabel.c

 Log Message:
 Fix free space accounting for partition size changes and deletions.
 Part of PR 56886.


 To generate a diff of this commit:
 cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/disklabel.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56886 CVS commit: src/usr.sbin/sysinst
Date: Tue, 21 Jun 2022 15:46:11 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jun 21 15:46:11 UTC 2022

 Modified Files:
 	src/usr.sbin/sysinst: label.c

 Log Message:
 Fix free space accounting when partitions change size or are deleted.
 Part of PR 56886.


 To generate a diff of this commit:
 cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/label.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56886 CVS commit: src/usr.sbin/sysinst
Date: Tue, 21 Jun 2022 16:08:25 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jun 21 16:08:25 UTC 2022

 Modified Files:
 	src/usr.sbin/sysinst: disklabel.c

 Log Message:
 Fix inverted condition in previous and only apply special handling for
 the "all of NetBSD" partition when we have an outer MBR label.
 Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


 To generate a diff of this commit:
 cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/disklabel.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Thu, 29 Dec 2022 20:48:56 +0000
State-Changed-Why:
netbsd-9 affected


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 30 Dec 2022 15:04:40 +0000
State-Changed-Why:
[pullup-9 #1558]


From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56886 CVS commit: [netbsd-9] src/usr.sbin/sysinst
Date: Sat, 31 Dec 2022 05:03:14 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Sat Dec 31 05:03:14 UTC 2022

 Modified Files:
 	src/usr.sbin/sysinst [netbsd-9]: disklabel.c label.c

 Log Message:
 Pull up following revision(s) (requested by martin in ticket #1558):
 	usr.sbin/sysinst/disklabel.c: 1.46-1.48
 	usr.sbin/sysinst/label.c: 1.40-1.41

 disklabel_can_add_partition() did not consider additional partitions
 (while there still is space in the disklabel). Part of PR 56886.

 Fix free space accounting for partition size changes and deletions.
 Part of PR 56886.

 renumber_partitions() needs to deal with removed/added partitions.

 Fix free space accounting when partitions change size or are deleted.
 Part of PR 56886.

 Fix inverted condition in previous and only apply special handling for
 the "all of NetBSD" partition when we have an outer MBR label.
 Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


 To generate a diff of this commit:
 cvs rdiff -u -r1.10.2.10 -r1.10.2.11 src/usr.sbin/sysinst/disklabel.c
 cvs rdiff -u -r1.10.2.8 -r1.10.2.9 src/usr.sbin/sysinst/label.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 31 Dec 2022 05:31:04 +0000
State-Changed-Why:
pulled up, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.