Module Name: src
Committed By: martin
Date: Thu Feb 6 11:46:35 UTC 2020
Modified Files:
src/usr.sbin/sysinst: disklabel.c
Log Message:
Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.
Modified files:
Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.34 src/usr.sbin/sysinst/disklabel.c:1.35
--- src/usr.sbin/sysinst/disklabel.c:1.34 Mon Jan 27 21:21:22 2020
+++ src/usr.sbin/sysinst/disklabel.c Thu Feb 6 11:46:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.34 2020/01/27 21:21:22 martin Exp $ */
+/* $NetBSD: disklabel.c,v 1.35 2020/02/06 11:46:35 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -237,8 +237,12 @@ disklabel_parts_read(const char *disk, d
daddr_t dlend = start +
parts->l.d_partitions[RAW_PART-1].p_size;
- if (dlstart < start && dlend > (start+len)) {
- assert(false);
+ if (dlstart < start || dlend > (start+len)) {
+ /*
+ * Kernel assumes different outer partion
+ * (probably not yet written back to disk)
+ * so this label is invalid.
+ */
free(parts);
close(fd);
return NULL;