Print this page
7378 exported_lock held during nfs4 compound processing

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_srv_readdir.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_srv_readdir.c
↓ open down ↓ 184 lines elided ↑ open up ↑
 185  185                          VN_RELE(vp);
 186  186                          VN_RELE(pre_tvp);
 187  187                          return (error);
 188  188                  }
 189  189                  /* go back to vnode that is "under" mount */
 190  190                  VN_RELE(vp);
 191  191                  *vpp = pre_tvp;
 192  192                  return (0);
 193  193          }
 194  194  
 195      -        newexi = checkexport4(&vp->v_vfsp->vfs_fsid, &fid, vp);
      195 +        newexi = checkexport(&vp->v_vfsp->vfs_fsid, &fid, vp);
 196  196          if (newexi == NULL) {
 197  197                  if (ismntpt == 0) {
 198  198                          *vpp = vp;
 199  199                  } else {
 200  200                          VN_RELE(vp);
 201  201                          *vpp = pre_tvp;
 202  202                  }
 203  203                  return (0);
 204  204          }
 205  205  
↓ open down ↓ 12 lines elided ↑ open up ↑
 218  218  
 219  219          crfree(cs->cr);
 220  220          cs->cr = scr;
 221  221          cs->exi = saveexi;
 222  222  
 223  223          /* Reset what call_checkauth4() may have set */
 224  224          *cs->statusp = NFS4_OK;
 225  225  
 226  226          if (status != NFS4_OK) {
 227  227                  VN_RELE(vp);
      228 +                exi_rele(newexi);
 228  229                  if (status == NFS4ERR_DELAY)
 229  230                          status = NFS4ERR_ACCESS;
 230  231                  return (status);
 231  232          }
 232  233          *vpp = vp;
 233  234          *exi = newexi;
 234  235  
 235  236          return (0);
 236  237  }
 237  238  
↓ open down ↓ 450 lines elided ↑ open up ↑
 688  689              !no_space && rddir_result_size > 0; dp = nextdp(dp)) {
 689  690  
 690  691                  /* reset expseudo */
 691  692                  expseudo = 0;
 692  693  
 693  694                  if (vp) {
 694  695                          VN_RELE(vp);
 695  696                          vp = NULL;
 696  697                  }
 697  698  
 698      -                if (newexi)
      699 +                if (newexi) {
      700 +                        exi_rele(newexi);
 699  701                          newexi = NULL;
      702 +                }
 700  703  
 701  704                  rddir_result_size -= dp->d_reclen;
 702  705  
 703  706                  /* skip "." and ".." entries */
 704  707                  if (dp->d_ino == 0 || NFS_IS_DOTNAME(dp->d_name)) {
 705  708                          rddir_next_offset = dp->d_off;
 706  709                          continue;
 707  710                  }
 708  711  
 709  712                  if (check_visible &&
↓ open down ↓ 773 lines elided ↑ open up ↑
1483 1486                          IXDR_PUT_HYPER(attrmask_ptr, ae);
1484 1487                  }
1485 1488  
1486 1489                  /* END OF ATTRIBUTE ENCODING */
1487 1490  
1488 1491                  lastentry_ptr = ptr;
1489 1492                  nents++;
1490 1493                  rddir_next_offset = dp->d_off;
1491 1494          }
1492 1495  
     1496 +        if (newexi) {
     1497 +                exi_rele(newexi);
     1498 +                newexi = NULL;
     1499 +        }
     1500 +
1493 1501          /*
1494 1502           * Check for the case that another VOP_READDIR() has to be done.
1495 1503           * - no space encoding error
1496 1504           * - no entry successfully encoded
1497 1505           * - still more directory to read
1498 1506           */
1499 1507          if (!no_space && nents == 0 && !iseofdir)
1500 1508                  goto readagain;
1501 1509  
1502 1510          *cs->statusp = resp->status = NFS4_OK;
↓ open down ↓ 44 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX