Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Fix free space accounting when partitions c...
details: https://anonhg.NetBSD.org/src/rev/d18c617382dd
branches: trunk
changeset: 367678:d18c617382dd
user: martin <martin%NetBSD.org@localhost>
date: Tue Jun 21 15:46:10 2022 +0000
description:
Fix free space accounting when partitions change size or are deleted.
Part of PR 56886.
diffstat:
usr.sbin/sysinst/label.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 2759e00a08e6 -r d18c617382dd usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c Tue Jun 21 15:45:03 2022 +0000
+++ b/usr.sbin/sysinst/label.c Tue Jun 21 15:46:10 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $ */
+/* $NetBSD: label.c,v 1.41 2022/06/21 15:46:10 martin Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.40 2022/06/21 15:45:03 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.41 2022/06/21 15:46:10 martin Exp $");
#endif
#include <sys/types.h>
@@ -1007,6 +1007,9 @@
if (!pset->parts->pscheme->set_part_info(pset->parts,
edit.id, &edit.info, &err))
err_msg_win(err);
+ else
+ pset->cur_free_space += edit.old_info.size -
+ edit.info.size;
}
/*
@@ -1036,7 +1039,7 @@
}
remember_deleted(pset,
pset->infos[edit.index].parts);
- pset->cur_free_space += pset->infos[edit.index].size;
+ pset->cur_free_space += edit.info.size;
memmove(pset->infos+edit.index,
pset->infos+edit.index+1,
sizeof(*pset->infos)*(pset->num-edit.index));
Home |
Main Index |
Thread Index |
Old Index