summaryrefslogtreecommitdiff
path: root/usr/src/cmd/dumpadm
diff options
context:
space:
mode:
authorGeorge Wilson <george.wilson@delphix.com>2013-02-20 22:50:16 -0800
committerChristopher Siden <chris.siden@delphix.com>2013-02-20 22:56:33 -0800
commitc61ea5668634a215fd1c9000beb7f6d2853b3468 (patch)
tree7aa0b42e6083d14aaf6a8fc56daf961216204b88 /usr/src/cmd/dumpadm
parent9eb57f7f3fbb970d4b9b89dcd5ecf543fe2414d5 (diff)
downloadillumos-joyent-c61ea5668634a215fd1c9000beb7f6d2853b3468.tar.gz
3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
3558 setting the volsize on a dump device does not return back ENOSPC 3559 setting a volsize larger than the space available sometimes succeeds 3560 dumpadm should be able to remove a dump device Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Approved by: Albert Lee <trisk@nexenta.com>
Diffstat (limited to 'usr/src/cmd/dumpadm')
-rw-r--r--usr/src/cmd/dumpadm/dconf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/cmd/dumpadm/dconf.c b/usr/src/cmd/dumpadm/dconf.c
index 488b802462..81b0db25c1 100644
--- a/usr/src/cmd/dumpadm/dconf.c
+++ b/usr/src/cmd/dumpadm/dconf.c
@@ -70,6 +70,7 @@ static const char DC_STR_OFF[] = "off"; /* Off string */
static const char DC_STR_YES[] = "yes"; /* Enable on string */
static const char DC_STR_NO[] = "no"; /* Enable off string */
static const char DC_STR_SWAP[] = "swap"; /* Default dump device */
+static const char DC_STR_NONE[] = "none";
/* The pages included in the dump */
static const char DC_STR_KERNEL[] = "kernel"; /* Kernel only */
@@ -367,7 +368,7 @@ dconf_dev_ioctl(dumpconf_t *dcp, int cmd)
int
dconf_update(dumpconf_t *dcp, int checkinuse)
{
- int oconf;
+ int oconf;
int error;
char *msg;
@@ -438,6 +439,11 @@ dconf_update(dumpconf_t *dcp, int checkinuse)
}
free(swt);
+ } else if (strcmp(dcp->dc_device, DC_STR_NONE) == 0) {
+ if (ioctl(dcp->dc_dump_fd, DIOCRMDEV, NULL) == -1) {
+ warn(gettext("failed to remove dump device"));
+ return (-1);
+ }
} else if (dcp->dc_device[0] != '\0') {
/*
* If we're not in forcible update mode, then fail the change
@@ -564,6 +570,11 @@ dconf_str2device(dumpconf_t *dcp, char *buf)
return (0);
}
+ if (strcasecmp(buf, DC_STR_NONE) == 0) {
+ (void) strcpy(dcp->dc_device, DC_STR_NONE);
+ return (0);
+ }
+
if (valid_abspath(buf)) {
(void) strcpy(dcp->dc_device, buf);
return (0);