Print this page
NEX-15279 support NFS server in zone
NEX-15520 online NFS shares cause zoneadm halt to hang in nfs_export_zone_fini
Portions contributed by: Dan Kruchinin dan.kruchinin@nexenta.com
Portions contributed by: Stepan Zastupov stepan.zastupov@gmail.com
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
       26 +
  25   27  /*
  26      - * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
       28 + * Copyright 2018 Nexenta Systems, Inc.
  27   29   */
  28   30  
  29   31  #include <sys/systm.h>
  30   32  #include <sys/cmn_err.h>
  31   33  #include <nfs/nfs.h>
  32   34  #include <nfs/export.h>
  33   35  #include <nfs/nfs4.h>
  34   36  #include <sys/ddi.h>
  35   37  #include <sys/door.h>
  36   38  #include <sys/sdt.h>
↓ open down ↓ 89 lines elided ↑ open up ↑
 126  128   */
 127  129  void
 128  130  rfs4_attr_init()
 129  131  {
 130  132          int i;
 131  133          struct nfs4_svgetit_arg sarg;
 132  134          struct compound_state cs;
 133  135          struct statvfs64 sb;
 134  136  
 135  137          rfs4_init_compound_state(&cs);
 136      -        cs.vp = rootvp;
      138 +        cs.vp = ZONE_ROOTVP();
 137  139          cs.fh.nfs_fh4_val = NULL;
 138  140          cs.cr = kcred;
 139  141  
 140  142          /*
 141  143           * Get all the supported attributes
 142  144           */
 143  145          sarg.op = NFS4ATTR_SUPPORTED;
 144  146          sarg.cs = &cs;
 145  147          sarg.vap->va_mask = AT_ALL;
 146  148          sarg.sbp = &sb;
↓ open down ↓ 1162 lines elided ↑ open up ↑
1309 1311                  stubvp = untraverse(vp);
1310 1312  
1311 1313                  /*
1312 1314                   * If vp/stubvp are same, we must be at system
1313 1315                   * root because untraverse returned same vp
1314 1316                   * for a VROOT object.  sarg->vap was setup
1315 1317                   * before we got here, so there's no need to do
1316 1318                   * another getattr -- just use the one in sarg.
1317 1319                   */
1318 1320                  if (VN_CMP(vp, stubvp)) {
1319      -                        ASSERT(VN_CMP(vp, rootdir));
     1321 +                        ASSERT(VN_CMP(vp, ZONE_ROOTVP()));
1320 1322                          vap = sarg->vap;
1321 1323                  } else {
1322 1324                          va.va_mask = AT_NODEID;
1323 1325                          vap = &va;
1324 1326                          error = rfs4_vop_getattr(stubvp, vap, 0, sarg->cs->cr);
1325 1327                  }
1326 1328  
1327 1329                  /*
1328 1330                   * Done with stub, time to rele.  If vp and stubvp
1329 1331                   * were the same, then we need to rele either vp or
↓ open down ↓ 1531 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX