summaryrefslogtreecommitdiff
path: root/sbin/disklabel/editor.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-03-02 04:48:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-03-02 04:48:25 +0000
commit0d0ebe0388bd8745ed2407c6b044fd6d9cb88148 (patch)
tree74f6747cee61258a2f2eb65aab81915be1f14378 /sbin/disklabel/editor.c
parentfc512c486d666608efa5bafc8f886d53205755b5 (diff)
Every time the user updates the bounds of the OpenBSD area of the disk, either explicitly
or implicitly, update the start and end sector of the OpenBSD area in the disklabel with DL_SEBEND/DL_SETBSTART. Otherwise the new bounds would not be saved to disk. ok miod@ deraadt@
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r--sbin/disklabel/editor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 6855682e7e0..e34657af2f9 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.248 2011/02/19 21:18:59 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.249 2011/03/02 04:48:24 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -1465,8 +1465,10 @@ edit_parms(struct disklabel *lp)
break;
}
/* Adjust ending_sector if necessary. */
- if (ending_sector > ui)
+ if (ending_sector > ui) {
ending_sector = ui;
+ DL_SETBEND(lp, ending_sector);
+ }
DL_SETDSIZE(lp, ui);
}
@@ -1607,7 +1609,9 @@ set_bounds(struct disklabel *lp)
}
} while (ui > DL_GETDSIZE(lp) - start_temp);
ending_sector = start_temp + ui;
+ DL_SETBEND(lp, ending_sector);
starting_sector = start_temp;
+ DL_SETBSTART(lp, starting_sector);
}
/*