Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_dataset.c
          +++ new/usr/src/lib/libzfs/common/libzfs_dataset.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2019 Joyent, Inc.
       24 + */
       25 +
       26 +/*
       27 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  25   28   * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
  26   29   * Copyright (c) 2012 DEY Storage Systems, Inc.  All rights reserved.
  27   30   * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
  28   31   * Copyright (c) 2013 Martin Matuska. All rights reserved.
  29   32   * Copyright (c) 2013 Steven Hartland. All rights reserved.
  30   33   * Copyright (c) 2014 Integros [integros.com]
  31      - * Copyright 2017 Nexenta Systems, Inc.
       34 + * Copyright 2018 Nexenta Systems, Inc.
  32   35   * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
  33   36   * Copyright 2017-2018 RackTop Systems.
  34   37   */
  35   38  
  36   39  #include <ctype.h>
  37   40  #include <errno.h>
  38   41  #include <libintl.h>
  39   42  #include <math.h>
  40   43  #include <stdio.h>
  41   44  #include <stdlib.h>
↓ open down ↓ 1262 lines elided ↑ open up ↑
1304 1307                  case ZFS_PROP_SHARENFS:
1305 1308                          /*
1306 1309                           * For the mountpoint and sharenfs or sharesmb
1307 1310                           * properties, check if it can be set in a
1308 1311                           * global/non-global zone based on
1309 1312                           * the zoned property value:
1310 1313                           *
1311 1314                           *              global zone         non-global zone
1312 1315                           * --------------------------------------------------
1313 1316                           * zoned=on     mountpoint (no)     mountpoint (yes)
1314      -                         *              sharenfs (no)       sharenfs (no)
1315      -                         *              sharesmb (no)       sharesmb (no)
     1317 +                         *              sharenfs (no)       sharenfs (yes)
     1318 +                         *              sharesmb (no)       sharesmb (yes)
1316 1319                           *
1317 1320                           * zoned=off    mountpoint (yes)        N/A
1318 1321                           *              sharenfs (yes)
1319 1322                           *              sharesmb (yes)
1320 1323                           */
1321 1324                          if (zoned) {
1322 1325                                  if (getzoneid() == GLOBAL_ZONEID) {
1323 1326                                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1324 1327                                              "'%s' cannot be set on "
1325 1328                                              "dataset in a non-global zone"),
1326 1329                                              propname);
1327 1330                                          (void) zfs_error(hdl, EZFS_ZONED,
1328 1331                                              errbuf);
1329      -                                        goto error;
1330      -                                } else if (prop == ZFS_PROP_SHARENFS ||
1331      -                                    prop == ZFS_PROP_SHARESMB) {
1332      -                                        zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1333      -                                            "'%s' cannot be set in "
1334      -                                            "a non-global zone"), propname);
1335      -                                        (void) zfs_error(hdl, EZFS_ZONED,
1336      -                                            errbuf);
1337 1332                                          goto error;
1338 1333                                  }
1339 1334                          } else if (getzoneid() != GLOBAL_ZONEID) {
1340 1335                                  /*
1341 1336                                   * If zoned property is 'off', this must be in
1342 1337                                   * a global zone. If not, something is wrong.
1343 1338                                   */
1344 1339                                  zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1345 1340                                      "'%s' cannot be set while dataset "
1346 1341                                      "'zoned' property is set"), propname);
↓ open down ↓ 4082 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX