Print this page
Caution with use after exi_rele()


 518             MAXPATHLEN);
 519 
 520         if (name == NULL) {
 521                 error = NFSERR_ACCES;
 522                 goto out;
 523         }
 524 
 525         /*
 526          * If the public filehandle is used then allow
 527          * a multi-component lookup, i.e. evaluate
 528          * a pathname and follow symbolic links if
 529          * necessary.
 530          *
 531          * This may result in a vnode in another filesystem
 532          * which is OK as long as the filesystem is exported.
 533          */
 534         if (PUBLIC_FH2(fhp)) {
 535                 publicfh_flag = TRUE;
 536 
 537                 exi_rele(exi);

 538 
 539                 error = rfs_publicfh_mclookup(name, dvp, cr, &vp, &exi,
 540                     &sec);
 541         } else {
 542                 /*
 543                  * Do a normal single component lookup.
 544                  */
 545                 error = VOP_LOOKUP(dvp, name, &vp, NULL, 0, NULL, cr,
 546                     NULL, NULL, NULL);
 547         }
 548 
 549         if (name != da->da_name)
 550                 kmem_free(name, MAXPATHLEN);
 551 
 552         if (error == 0 && vn_ismntpt(vp)) {
 553                 error = rfs_cross_mnt(&vp, &exi);
 554                 if (error)
 555                         VN_RELE(vp);
 556         }
 557 




 518             MAXPATHLEN);
 519 
 520         if (name == NULL) {
 521                 error = NFSERR_ACCES;
 522                 goto out;
 523         }
 524 
 525         /*
 526          * If the public filehandle is used then allow
 527          * a multi-component lookup, i.e. evaluate
 528          * a pathname and follow symbolic links if
 529          * necessary.
 530          *
 531          * This may result in a vnode in another filesystem
 532          * which is OK as long as the filesystem is exported.
 533          */
 534         if (PUBLIC_FH2(fhp)) {
 535                 publicfh_flag = TRUE;
 536 
 537                 exi_rele(exi);
 538                 exi = NULL;
 539 
 540                 error = rfs_publicfh_mclookup(name, dvp, cr, &vp, &exi,
 541                     &sec);
 542         } else {
 543                 /*
 544                  * Do a normal single component lookup.
 545                  */
 546                 error = VOP_LOOKUP(dvp, name, &vp, NULL, 0, NULL, cr,
 547                     NULL, NULL, NULL);
 548         }
 549 
 550         if (name != da->da_name)
 551                 kmem_free(name, MAXPATHLEN);
 552 
 553         if (error == 0 && vn_ismntpt(vp)) {
 554                 error = rfs_cross_mnt(&vp, &exi);
 555                 if (error)
 556                         VN_RELE(vp);
 557         }
 558