Print this page
*** NO COMMENTS ***

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs3_srv.c
          +++ new/usr/src/uts/common/fs/nfs/nfs3_srv.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   * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   *
  24      - * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  25   25   */
  26   26  
  27   27  /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  28   28  /* All Rights Reserved */
  29   29  
  30   30  #include <sys/param.h>
  31   31  #include <sys/types.h>
  32   32  #include <sys/systm.h>
  33   33  #include <sys/cred.h>
  34   34  #include <sys/buf.h>
↓ open down ↓ 340 lines elided ↑ open up ↑
 375  375          struct vattr *dvap;
 376  376          struct vattr dva;
 377  377          nfs_fh3 *fhp;
 378  378          struct sec_ol sec = {0, 0};
 379  379          bool_t publicfh_flag = FALSE, auth_weak = FALSE;
 380  380          struct sockaddr *ca;
 381  381          char *name = NULL;
 382  382  
 383  383          dvap = NULL;
 384  384  
      385 +        /* Take an extra hold here in case of 'exi' switching */
      386 +        if (exi != NULL)
      387 +                exi_hold(exi);
      388 +
 385  389          /*
 386  390           * Allow lookups from the root - the default
 387  391           * location of the public filehandle.
 388  392           */
 389  393          if (exi != NULL && (exi->exi_export.ex_flags & EX_PUBLIC)) {
 390  394                  dvp = rootdir;
 391  395                  VN_HOLD(dvp);
 392  396  
 393  397                  DTRACE_NFSV3_4(op__lookup__start, struct svc_req *, req,
 394  398                      cred_t *, cr, vnode_t *, dvp, LOOKUP3args *, args);
↓ open down ↓ 31 lines elided ↑ open up ↑
 426  430  
 427  431          ca = (struct sockaddr *)svc_getrpccaller(req->rq_xprt)->buf;
 428  432          name = nfscmd_convname(ca, exi, args->what.name,
 429  433              NFSCMD_CONV_INBOUND, MAXPATHLEN + 1);
 430  434  
 431  435          if (name == NULL) {
 432  436                  resp->status = NFS3ERR_ACCES;
 433  437                  goto out1;
 434  438          }
 435  439  
 436      -        exi_hold(exi);
 437      -
 438  440          /*
 439  441           * If the public filehandle is used then allow
 440  442           * a multi-component lookup
 441  443           */
 442  444          if (PUBLIC_FH3(&args->what.dir)) {
 443  445                  struct exportinfo *new;
 444  446  
 445  447                  publicfh_flag = TRUE;
 446  448  
 447  449                  error = rfs_publicfh_mclookup(name, dvp, cr, &vp,
↓ open down ↓ 94 lines elided ↑ open up ↑
 542  544          if (auth_weak)
 543  545                  resp->status = (enum nfsstat3)WNFSERR_CLNT_FLAVOR;
 544  546  
 545  547          DTRACE_NFSV3_4(op__lookup__done, struct svc_req *, req,
 546  548              cred_t *, cr, vnode_t *, dvp, LOOKUP3res *, resp);
 547  549          VN_RELE(dvp);
 548  550  
 549  551          return;
 550  552  
 551  553  out:
 552      -        /*
 553      -         * The passed argument exportinfo is released by the
 554      -         * caller, common_dispatch
 555      -         */
 556      -        exi_rele(exi);
 557      -
 558  554          if (curthread->t_flag & T_WOULDBLOCK) {
 559  555                  curthread->t_flag &= ~T_WOULDBLOCK;
 560  556                  resp->status = NFS3ERR_JUKEBOX;
 561  557          } else
 562  558                  resp->status = puterrno3(error);
 563  559  out1:
      560 +        if (exi != NULL)
      561 +                exi_rele(exi);
      562 +
 564  563          DTRACE_NFSV3_4(op__lookup__done, struct svc_req *, req,
 565  564              cred_t *, cr, vnode_t *, dvp, LOOKUP3res *, resp);
 566  565  
 567  566          if (dvp != NULL)
 568  567                  VN_RELE(dvp);
 569  568          vattr_to_post_op_attr(dvap, &resp->resfail.dir_attributes);
 570  569  
 571  570  }
 572  571  
 573  572  void *
↓ open down ↓ 3774 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX