diff options
author | Alexander Eremin <a.eremin@nexenta.com> | 2013-11-23 11:10:14 +0400 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2013-12-03 20:28:34 -0500 |
commit | 40ccc6ad48401a6fe660d7d49d6f60e9320403c9 (patch) | |
tree | 63ea168e03ff05149ea3383f6186a54600adf0f6 /usr/src | |
parent | 2efb3bf9c7f4cf34038896f1431531c93d3f57c2 (diff) | |
download | illumos-gate-40ccc6ad48401a6fe660d7d49d6f60e9320403c9.tar.gz |
4220 beadm mount of old BE with zones fails "Read only filesystem"
4235 beadm(1M) mount options undocumented in man page
Reviewed by: Ilya Usvyatsky <ilya.usvyatsky@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/beadm/beadm.c | 4 | ||||
-rw-r--r-- | usr/src/lib/libbe/common/be_mount.c | 23 | ||||
-rw-r--r-- | usr/src/man/man1m/beadm.1m | 15 |
3 files changed, 26 insertions, 16 deletions
diff --git a/usr/src/cmd/beadm/beadm.c b/usr/src/cmd/beadm/beadm.c index d1212082bd..4fb22b9bcc 100644 --- a/usr/src/cmd/beadm/beadm.c +++ b/usr/src/cmd/beadm/beadm.c @@ -1269,6 +1269,10 @@ be_do_mount(int argc, char **argv) (void) fprintf(stderr, _("You have insufficient privileges to " "execute this command.\n")); break; + case BE_ERR_NO_MOUNTED_ZONE: + (void) fprintf(stderr, _("Mounted on '%s'.\nUnable to mount " + "one of %s's zone BE's.\n"), mountpoint, obe_name); + break; default: (void) fprintf(stderr, _("Unable to mount %s.\n"), obe_name); (void) fprintf(stderr, "%s\n", be_err_to_str(err)); diff --git a/usr/src/lib/libbe/common/be_mount.c b/usr/src/lib/libbe/common/be_mount.c index bda2b20b12..70ad9c4ac3 100644 --- a/usr/src/lib/libbe/common/be_mount.c +++ b/usr/src/lib/libbe/common/be_mount.c @@ -382,12 +382,8 @@ _be_mount(char *be_name, char **altroot, int flags) if (getzoneid() == GLOBAL_ZONEID && !(flags & BE_MOUNT_FLAG_NO_ZONES) && be_get_uuid(bt.obe_root_ds, &uu) == BE_SUCCESS) { - if ((ret = be_mount_zones(zhp, &md)) != BE_SUCCESS) { - (void) _be_unmount(bt.obe_name, 0); - if (gen_tmp_altroot) - free(tmp_altroot); - ZFS_CLOSE(zhp); - return (ret); + if (be_mount_zones(zhp, &md) != BE_SUCCESS) { + ret = BE_ERR_NO_MOUNTED_ZONE; } } @@ -397,10 +393,14 @@ _be_mount(char *be_name, char **altroot, int flags) * If a NULL altroot was passed in, pass the generated altroot * back to the caller in altroot. */ - if (gen_tmp_altroot) - *altroot = tmp_altroot; + if (gen_tmp_altroot) { + if (ret == BE_SUCCESS || ret == BE_ERR_NO_MOUNTED_ZONE) + *altroot = tmp_altroot; + else + free(tmp_altroot); + } - return (BE_SUCCESS); + return (ret); } /* @@ -1712,10 +1712,7 @@ loopback_mount_shared_fs(zfs_handle_t *zhp, be_mount_data_t *md) /* * Function: loopback_mount_zonepath * Description: This function loopback mounts a zonepath into the altroot - * area of the BE being mounted. Since these are shared file - * systems, they are expected to be already mounted for the - * current BE, and this function just loopback mounts them into - * the BE mountpoint. + * area of the BE being mounted. * Parameters: * zonepath - pointer to zone path in the current BE * md - be_mount_data_t pointer diff --git a/usr/src/man/man1m/beadm.1m b/usr/src/man/man1m/beadm.1m index c53d5d9488..76533db951 100644 --- a/usr/src/man/man1m/beadm.1m +++ b/usr/src/man/man1m/beadm.1m @@ -1,6 +1,6 @@ '\" te .\" Copyright 2013 Nexenta Systems, Inc. All rights reserved. -.TH BEADM 1M "Jul 25, 2013" +.TH BEADM 1M "Nov 11, 2013" .SH NAME beadm \- utility for managing zfs boot environments .SH SYNOPSIS @@ -29,7 +29,7 @@ beadm \- utility for managing zfs boot environments .LP .nf -\fBbeadm\fR \fBmount\fR [\fB-v\fR] \fIbeName\fR \fImountpoint\fR +\fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR .fi .LP @@ -407,7 +407,7 @@ Verbose mode. Displays verbose error messages from \fBbeadm\fR. .sp .ne 2 .na -\fBbeadm\fR \fBmount\fR [\fB-v\fR] \fIbeName\fR \fImountpoint\fR +\fBbeadm\fR \fBmount\fR [\fB-s\fR \fBro\fR|\fBrw\fR] [\fB-v\fR] \fIbeName\fR \fImountpoint\fR .ad .sp .6 .RS 4n @@ -416,6 +416,15 @@ already existing empty directory. .sp .ne 2 .na +\fB-s\fR \fBro\fR|\fBrw\fR +.ad +.sp .6 +.RS 4n +Mount the shared filesystems of the BE in read-only or read-write mode. +.RE +.sp +.ne 2 +.na \fB-v\fR .ad .sp .6 |