Print this page
*** NO COMMENTS ***

*** 69,84 **** * These are the interface routines for the server side of the * Network File System. See the NFS version 3 protocol specification * for a description of this interface. */ - #ifdef DEBUG - int rfs3_do_pre_op_attr = 1; - int rfs3_do_post_op_attr = 1; - int rfs3_do_post_op_fh3 = 1; - #endif - static writeverf3 write3verf; static int sattr3_to_vattr(sattr3 *, struct vattr *); static int vattr_to_fattr3(struct vattr *, fattr3 *); static int vattr_to_wcc_attr(struct vattr *, wcc_attr *); --- 69,78 ----
*** 225,240 **** * right access checking. So, we'll fail the request. */ if (error) goto out; - #ifdef DEBUG - if (rfs3_do_pre_op_attr) - bvap = &bva; - #else bvap = &bva; - #endif if (rdonly(exi, req) || vn_is_readonly(vp)) { resp->status = NFS3ERR_ROFS; goto out1; } --- 219,229 ----
*** 320,339 **** if (error == EAGAIN && (ct.cc_flags & CC_WOULDBLOCK)) { resp->status = NFS3ERR_JUKEBOX; goto out1; } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - ava.va_mask = AT_ALL; - avap = rfs4_delegated_getattr(vp, &ava, 0, cr) ? NULL : &ava; - } else - avap = NULL; - #else ava.va_mask = AT_ALL; avap = rfs4_delegated_getattr(vp, &ava, 0, cr) ? NULL : &ava; - #endif /* * Force modified metadata out to stable storage. */ (void) VOP_FSYNC(vp, FNODSYNC, cr, &ct); --- 309,320 ----
*** 419,437 **** error = ESTALE; goto out; } } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - dva.va_mask = AT_ALL; - dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva; - } - #else dva.va_mask = AT_ALL; dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva; - #endif if (args->what.name == nfs3nametoolong) { resp->status = NFS3ERR_NAMETOOLONG; goto out1; } --- 400,411 ----
*** 455,474 **** if (name == NULL) { resp->status = NFS3ERR_ACCES; goto out1; } /* * If the public filehandle is used then allow * a multi-component lookup */ if (PUBLIC_FH3(&args->what.dir)) { publicfh_flag = TRUE; error = rfs_publicfh_mclookup(name, dvp, cr, &vp, ! &exi, &sec); ! if (error && exi != NULL) ! exi_rele(exi); /* See comment below Re: publicfh_flag */ /* * Since WebNFS may bypass MOUNT, we need to ensure this * request didn't come from an unlabeled admin_low client. */ if (is_system_labeled() && error == 0) { --- 429,457 ---- if (name == NULL) { resp->status = NFS3ERR_ACCES; goto out1; } + exi_hold(exi); + /* * If the public filehandle is used then allow * a multi-component lookup */ if (PUBLIC_FH3(&args->what.dir)) { + struct exportinfo *new; + publicfh_flag = TRUE; + error = rfs_publicfh_mclookup(name, dvp, cr, &vp, ! &new, &sec); ! ! if (error == 0) { ! exi_rele(exi); ! exi = new; ! } ! /* * Since WebNFS may bypass MOUNT, we need to ensure this * request didn't come from an unlabeled admin_low client. */ if (is_system_labeled() && error == 0) {
*** 486,497 **** } tp = find_tpc(ipaddr, addr_type, B_FALSE); if (tp == NULL || tp->tpc_tp.tp_doi != l_admin_low->tsl_doi || tp->tpc_tp.host_type != SUN_CIPSO) { - if (exi != NULL) - exi_rele(exi); VN_RELE(vp); resp->status = NFS3ERR_ACCES; error = 1; } if (tp != NULL) --- 469,478 ----
*** 503,541 **** } if (name != args->what.name) kmem_free(name, MAXPATHLEN + 1); if (is_system_labeled() && error == 0) { bslabel_t *clabel = req->rq_label; ASSERT(clabel != NULL); DTRACE_PROBE2(tx__rfs3__log__info__oplookup__clabel, char *, "got client label from request(1)", struct svc_req *, req); if (!blequal(&l_admin_low->tsl_label, clabel)) { if (!do_rfs_label_check(clabel, dvp, DOMINANCE_CHECK, exi)) { - if (publicfh_flag && exi != NULL) - exi_rele(exi); VN_RELE(vp); resp->status = NFS3ERR_ACCES; error = 1; } } } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { dva.va_mask = AT_ALL; dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva; - } else - dvap = NULL; - #else - dva.va_mask = AT_ALL; - dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva; - #endif if (error) goto out; if (sec.sec_flags & SEC_QUERY) { --- 484,518 ---- } if (name != args->what.name) kmem_free(name, MAXPATHLEN + 1); + if (error == 0 && vn_ismntpt(vp)) { + error = rfs_cross_mnt(&vp, &exi); + if (error) + VN_RELE(vp); + } + if (is_system_labeled() && error == 0) { bslabel_t *clabel = req->rq_label; ASSERT(clabel != NULL); DTRACE_PROBE2(tx__rfs3__log__info__oplookup__clabel, char *, "got client label from request(1)", struct svc_req *, req); if (!blequal(&l_admin_low->tsl_label, clabel)) { if (!do_rfs_label_check(clabel, dvp, DOMINANCE_CHECK, exi)) { VN_RELE(vp); resp->status = NFS3ERR_ACCES; error = 1; } } } dva.va_mask = AT_ALL; dvap = VOP_GETATTR(dvp, &dva, 0, cr, NULL) ? NULL : &dva; if (error) goto out; if (sec.sec_flags & SEC_QUERY) {
*** 549,578 **** if (error) { VN_RELE(vp); goto out; } - /* - * If publicfh_flag is true then we have called rfs_publicfh_mclookup - * and have obtained a new exportinfo in exi which needs to be - * released. Note the the original exportinfo pointed to by exi - * will be released by the caller, common_dispatch. - */ - if (publicfh_flag) - exi_rele(exi); - - #ifdef DEBUG - if (rfs3_do_post_op_attr) { va.va_mask = AT_ALL; vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; - } else - vap = NULL; - #else - va.va_mask = AT_ALL; - vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; - #endif VN_RELE(vp); resp->status = NFS3_OK; vattr_to_post_op_attr(vap, &resp->resok.obj_attributes); vattr_to_post_op_attr(dvap, &resp->resok.dir_attributes); --- 526,539 ---- if (error) { VN_RELE(vp); goto out; } va.va_mask = AT_ALL; vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; + exi_rele(exi); VN_RELE(vp); resp->status = NFS3_OK; vattr_to_post_op_attr(vap, &resp->resok.obj_attributes); vattr_to_post_op_attr(dvap, &resp->resok.dir_attributes);
*** 590,599 **** --- 551,566 ---- VN_RELE(dvp); return; out: + /* + * The passed argument exportinfo is released by the + * caller, common_dispatch + */ + exi_rele(exi); + if (curthread->t_flag & T_WOULDBLOCK) { curthread->t_flag &= ~T_WOULDBLOCK; resp->status = NFS3ERR_JUKEBOX; } else resp->status = puterrno3(error);
*** 660,675 **** va.va_mask = AT_MODE; error = VOP_GETATTR(vp, &va, 0, cr, NULL); if (error) goto out; - #ifdef DEBUG - if (rfs3_do_post_op_attr) - vap = &va; - #else vap = &va; - #endif resp->resok.access = 0; if (is_system_labeled()) { bslabel_t *clabel = req->rq_label; --- 627,637 ----
*** 740,759 **** (!is_system_labeled() || admin_low_client || dominant_label)) resp->resok.access |= ACCESS3_EXECUTE; } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; - #endif resp->status = NFS3_OK; vattr_to_post_op_attr(vap, &resp->resok.obj_attributes); DTRACE_NFSV3_4(op__access__done, struct svc_req *, req, --- 702,713 ----
*** 814,829 **** va.va_mask = AT_ALL; error = VOP_GETATTR(vp, &va, 0, cr, NULL); if (error) goto out; - #ifdef DEBUG - if (rfs3_do_post_op_attr) vap = &va; - #else - vap = &va; - #endif /* We lied about the object type for a referral */ if (vn_is_nfs_reparse(vp, cr)) is_referral = 1; --- 768,778 ----
*** 887,906 **** if (!error) *(data + MAXPATHLEN - uio.uio_resid) = '\0'; } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; ! #endif /* Lie about object type again just to be consistent */ if (is_referral && vap != NULL) vap->va_type = VLNK; #if 0 /* notyet */ --- 836,848 ---- if (!error) *(data + MAXPATHLEN - uio.uio_resid) = '\0'; } va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; ! /* Lie about object type again just to be consistent */ if (is_referral && vap != NULL) vap->va_type = VLNK; #if 0 /* notyet */
*** 1075,1090 **** * right access checking. So, we'll fail the request. */ if (error) goto out; - #ifdef DEBUG - if (rfs3_do_post_op_attr) vap = &va; - #else - vap = &va; - #endif if (vp->v_type != VREG) { resp->status = NFS3ERR_INVAL; goto out1; } --- 1017,1027 ----
*** 1230,1253 **** } va.va_mask = AT_ALL; error = VOP_GETATTR(vp, &va, 0, cr, &ct); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - if (error) - vap = NULL; - else - vap = &va; - } else - vap = NULL; - #else if (error) vap = NULL; else vap = &va; - #endif VOP_RWUNLOCK(vp, V_WRITELOCK_FALSE, &ct); if (in_crit) nbl_end_crit(vp); --- 1167,1180 ----
*** 1417,1430 **** */ if (error) goto err; bvap = &bva; - #ifdef DEBUG - if (!rfs3_do_pre_op_attr) - bvap = NULL; - #endif avap = bvap; if (args->count != args->data.data_len) { resp->status = NFS3ERR_INVAL; goto err1; --- 1344,1353 ----
*** 1532,1546 **** } ava.va_mask = AT_ALL; avap = VOP_GETATTR(vp, &ava, 0, cr, &ct) ? NULL : &ava; - #ifdef DEBUG - if (!rfs3_do_post_op_attr) - avap = NULL; - #endif - if (error) goto err; /* * If we were unable to get the V_WRITELOCK_TRUE, then we --- 1455,1464 ----
*** 1625,1644 **** if (dvp == NULL) { error = ESTALE; goto out; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { dbva.va_mask = AT_ALL; dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - } else - dbvap = NULL; - #else - dbva.va_mask = AT_ALL; - dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - #endif davap = dbvap; if (args->where.name == nfs3nametoolong) { resp->status = NFS3ERR_NAMETOOLONG; goto out1; --- 1543,1554 ----
*** 1797,1816 **** * passed as part of the arguments. */ error = VOP_CREATE(dvp, name, &va, excl, VWRITE, &vp, cr, 0, NULL, NULL); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - dava.va_mask = AT_ALL; - davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - } else - davap = NULL; - #else dava.va_mask = AT_ALL; davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - #endif if (error) { /* * If we got something other than file already exists * then just return this error. Otherwise, we got --- 1707,1718 ----
*** 1910,1937 **** } if (name != args->where.name) kmem_free(name, MAXPATHLEN + 1); - #ifdef DEBUG - if (!rfs3_do_post_op_attr) - vap = NULL; - #endif - - #ifdef DEBUG - if (!rfs3_do_post_op_fh3) - resp->resok.obj.handle_follows = FALSE; - else { - #endif error = makefh3(&resp->resok.obj.handle, vp, exi); if (error) resp->resok.obj.handle_follows = FALSE; else resp->resok.obj.handle_follows = TRUE; - #ifdef DEBUG - } - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, FNODSYNC, cr, NULL); --- 1812,1826 ----
*** 2011,2030 **** if (dvp == NULL) { error = ESTALE; goto out; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { dbva.va_mask = AT_ALL; dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - } else - dbvap = NULL; - #else - dbva.va_mask = AT_ALL; - dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - #endif davap = dbvap; if (args->where.name == nfs3nametoolong) { resp->status = NFS3ERR_NAMETOOLONG; goto out1; --- 1900,1911 ----
*** 2080,2132 **** error = VOP_MKDIR(dvp, name, &va, &vp, cr, NULL, 0, NULL); if (name != args->where.name) kmem_free(name, MAXPATHLEN + 1); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - dava.va_mask = AT_ALL; - davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - } else - davap = NULL; - #else dava.va_mask = AT_ALL; davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(dvp, 0, cr, NULL); if (error) goto out; - #ifdef DEBUG - if (!rfs3_do_post_op_fh3) - resp->resok.obj.handle_follows = FALSE; - else { - #endif error = makefh3(&resp->resok.obj.handle, vp, exi); if (error) resp->resok.obj.handle_follows = FALSE; else resp->resok.obj.handle_follows = TRUE; - #ifdef DEBUG - } - #endif - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, 0, cr, NULL); --- 1961,1989 ----
*** 2192,2211 **** if (dvp == NULL) { error = ESTALE; goto err; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { dbva.va_mask = AT_ALL; dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - } else - dbvap = NULL; - #else - dbva.va_mask = AT_ALL; - dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - #endif davap = dbvap; if (args->where.name == nfs3nametoolong) { resp->status = NFS3ERR_NAMETOOLONG; goto err1; --- 2049,2060 ----
*** 2273,2292 **** va.va_mask |= AT_TYPE; va.va_type = VLNK; error = VOP_SYMLINK(dvp, name, &va, symdata, cr, NULL, 0); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - dava.va_mask = AT_ALL; - davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - } else - davap = NULL; - #else dava.va_mask = AT_ALL; davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - #endif if (error) goto err; error = VOP_LOOKUP(dvp, name, &vp, NULL, 0, NULL, cr, --- 2122,2133 ----
*** 2304,2337 **** vattr_to_post_op_attr(NULL, &resp->resok.obj_attributes); vattr_to_wcc_data(dbvap, davap, &resp->resok.dir_wcc); goto out; } - #ifdef DEBUG - if (!rfs3_do_post_op_fh3) - resp->resok.obj.handle_follows = FALSE; - else { - #endif error = makefh3(&resp->resok.obj.handle, vp, exi); if (error) resp->resok.obj.handle_follows = FALSE; else resp->resok.obj.handle_follows = TRUE; - #ifdef DEBUG - } - #endif - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, 0, cr, NULL); --- 2145,2162 ----
*** 2400,2419 **** if (dvp == NULL) { error = ESTALE; goto out; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { dbva.va_mask = AT_ALL; dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - } else - dbvap = NULL; - #else - dbva.va_mask = AT_ALL; - dbvap = VOP_GETATTR(dvp, &dbva, 0, cr, NULL) ? NULL : &dbva; - #endif davap = dbvap; if (args->where.name == nfs3nametoolong) { resp->status = NFS3ERR_NAMETOOLONG; goto out1; --- 2225,2236 ----
*** 2511,2530 **** &vp, cr, 0, NULL, NULL); if (name != args->where.name) kmem_free(name, MAXPATHLEN + 1); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { dava.va_mask = AT_ALL; davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - } else - davap = NULL; - #else - dava.va_mask = AT_ALL; - davap = VOP_GETATTR(dvp, &dava, 0, cr, NULL) ? NULL : &dava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(dvp, 0, cr, NULL); --- 2328,2339 ----
*** 2532,2565 **** if (error) goto out; resp->status = NFS3_OK; - #ifdef DEBUG - if (!rfs3_do_post_op_fh3) - resp->resok.obj.handle_follows = FALSE; - else { - #endif error = makefh3(&resp->resok.obj.handle, vp, exi); if (error) resp->resok.obj.handle_follows = FALSE; else resp->resok.obj.handle_follows = TRUE; - #ifdef DEBUG - } - #endif - #ifdef DEBUG - if (rfs3_do_post_op_attr) { va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif /* * Force modified metadata out to stable storage. * * if a underlying vp exists, pass it to VOP_FSYNC --- 2341,2358 ----
*** 2624,2643 **** if (vp == NULL) { error = ESTALE; goto err; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - bva.va_mask = AT_ALL; - bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva; - } else - bvap = NULL; - #else bva.va_mask = AT_ALL; bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva; - #endif avap = bvap; if (vp->v_type != VDIR) { resp->status = NFS3ERR_NOTDIR; goto err1; --- 2417,2428 ----
*** 2709,2728 **** nbl_end_crit(targvp); } VN_RELE(targvp); targvp = NULL; - #ifdef DEBUG - if (rfs3_do_post_op_attr) { ava.va_mask = AT_ALL; avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - } else - avap = NULL; - #else - ava.va_mask = AT_ALL; - avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, 0, cr, NULL); --- 2494,2505 ----
*** 2784,2803 **** if (vp == NULL) { error = ESTALE; goto err; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - bva.va_mask = AT_ALL; - bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva; - } else - bvap = NULL; - #else bva.va_mask = AT_ALL; bvap = VOP_GETATTR(vp, &bva, 0, cr, NULL) ? NULL : &bva; - #endif avap = bvap; if (vp->v_type != VDIR) { resp->status = NFS3ERR_NOTDIR; goto err1; --- 2561,2572 ----
*** 2846,2865 **** error = VOP_RMDIR(vp, name, rootdir, cr, NULL, 0); if (name != args->object.name) kmem_free(name, MAXPATHLEN + 1); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - ava.va_mask = AT_ALL; - avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - } else - avap = NULL; - #else ava.va_mask = AT_ALL; avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, 0, cr, NULL); --- 2615,2626 ----
*** 2956,2975 **** goto err1; } } } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - fbva.va_mask = AT_ALL; - fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva; - } else - fbvap = NULL; - #else fbva.va_mask = AT_ALL; fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva; - #endif favap = fbvap; fh3 = &args->to.dir; to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3)); if (to_exi == NULL) { --- 2717,2728 ----
*** 2987,3006 **** if (tvp == NULL) { error = ESTALE; goto err; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - tbva.va_mask = AT_ALL; - tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva; - } else - tbvap = NULL; - #else tbva.va_mask = AT_ALL; tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva; - #endif tavap = tbvap; if (fvp->v_type != VDIR || tvp->v_type != VDIR) { resp->status = NFS3ERR_NOTDIR; goto err1; --- 2740,2751 ----
*** 3098,3123 **** vn_renamepath(tvp, srcvp, args->to.name, strlen(args->to.name)); VN_RELE(srcvp); srcvp = NULL; - #ifdef DEBUG - if (rfs3_do_post_op_attr) { fava.va_mask = AT_ALL; favap = VOP_GETATTR(fvp, &fava, 0, cr, NULL) ? NULL : &fava; tava.va_mask = AT_ALL; tavap = VOP_GETATTR(tvp, &tava, 0, cr, NULL) ? NULL : &tava; - } else { - favap = NULL; - tavap = NULL; - } - #else - fava.va_mask = AT_ALL; - favap = VOP_GETATTR(fvp, &fava, 0, cr, NULL) ? NULL : &fava; - tava.va_mask = AT_ALL; - tavap = VOP_GETATTR(tvp, &tava, 0, cr, NULL) ? NULL : &tava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(fvp, 0, cr, NULL); --- 2843,2856 ----
*** 3195,3214 **** if (vp == NULL) { error = ESTALE; goto out; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif fh3 = &args->link.dir; to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3)); if (to_exi == NULL) { resp->status = NFS3ERR_ACCES; --- 2928,2939 ----
*** 3241,3260 **** if (dvp == NULL) { error = ESTALE; goto out; } - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - bva.va_mask = AT_ALL; - bvap = VOP_GETATTR(dvp, &bva, 0, cr, NULL) ? NULL : &bva; - } else - bvap = NULL; - #else bva.va_mask = AT_ALL; bvap = VOP_GETATTR(dvp, &bva, 0, cr, NULL) ? NULL : &bva; - #endif if (dvp->v_type != VDIR) { resp->status = NFS3ERR_NOTDIR; goto out1; } --- 2966,2977 ----
*** 3296,3321 **** goto out1; } error = VOP_LINK(dvp, vp, name, cr, NULL, 0); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - ava.va_mask = AT_ALL; - avap = VOP_GETATTR(dvp, &ava, 0, cr, NULL) ? NULL : &ava; - } else { - vap = NULL; - avap = NULL; - } - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; ava.va_mask = AT_ALL; avap = VOP_GETATTR(dvp, &ava, 0, cr, NULL) ? NULL : &ava; - #endif /* * Force modified data and metadata out to stable storage. */ (void) VOP_FSYNC(vp, FNODSYNC, cr, NULL); --- 3013,3026 ----
*** 3440,3459 **** } } (void) VOP_RWLOCK(vp, V_WRITELOCK_FALSE, NULL); - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif if (vp->v_type != VDIR) { resp->status = NFS3ERR_NOTDIR; goto out1; } --- 3145,3156 ----
*** 3489,3508 **** uio.uio_loffset = (offset_t)args->cookie; uio.uio_resid = count; error = VOP_READDIR(vp, &uio, cr, &iseof, NULL, 0); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif if (error) { kmem_free(data, count); goto out; } --- 3186,3197 ----
*** 3728,3747 **** } } (void) VOP_RWLOCK(vp, V_WRITELOCK_FALSE, NULL); - #ifdef DEBUG - if (rfs3_do_pre_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif if (vp->v_type != VDIR) { error = ENOTDIR; goto out; } --- 3417,3428 ----
*** 3896,3918 **** if (space_left >= DIRENT64_RECLEN(MAXNAMELEN)) goto getmoredents; /* else, fall through */ } - good: - - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif VOP_RWUNLOCK(vp, V_WRITELOCK_FALSE, NULL); infop = kmem_alloc(nents * sizeof (struct entryplus3_info), KM_SLEEP); resp->resok.infop = infop; --- 3577,3589 ----
*** 3936,3975 **** infop[i].fh.handle_follows = FALSE; dp = nextdp(dp); continue; } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - nva.va_mask = AT_ALL; - nvap = rfs4_delegated_getattr(nvp, &nva, 0, cr) ? - NULL : &nva; - } else - nvap = NULL; - #else nva.va_mask = AT_ALL; nvap = rfs4_delegated_getattr(nvp, &nva, 0, cr) ? NULL : &nva; ! #endif /* Lie about the object type for a referral */ if (vn_is_nfs_reparse(nvp, cr)) nvap->va_type = VLNK; vattr_to_post_op_attr(nvap, &infop[i].attr); - #ifdef DEBUG - if (!rfs3_do_post_op_fh3) - infop[i].fh.handle_follows = FALSE; - else { - #endif error = makefh3(&infop[i].fh.handle, nvp, exi); if (!error) infop[i].fh.handle_follows = TRUE; else infop[i].fh.handle_follows = FALSE; - #ifdef DEBUG } - #endif VN_RELE(nvp); dp = nextdp(dp); } --- 3607,3635 ---- infop[i].fh.handle_follows = FALSE; dp = nextdp(dp); continue; } nva.va_mask = AT_ALL; nvap = rfs4_delegated_getattr(nvp, &nva, 0, cr) ? NULL : &nva; ! /* Lie about the object type for a referral */ if (vn_is_nfs_reparse(nvp, cr)) nvap->va_type = VLNK; + if (vn_ismntpt(nvp)) { + infop[i].attr.attributes = FALSE; + infop[i].fh.handle_follows = FALSE; + } else { vattr_to_post_op_attr(nvap, &infop[i].attr); error = makefh3(&infop[i].fh.handle, nvp, exi); if (!error) infop[i].fh.handle_follows = TRUE; else infop[i].fh.handle_follows = FALSE; } VN_RELE(nvp); dp = nextdp(dp); }
*** 4104,4123 **** } } error = VFS_STATVFS(vp->v_vfsp, &sb); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif if (error) goto out; resp->status = NFS3_OK; --- 3764,3775 ----
*** 4209,4228 **** goto out; } } } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif resp->status = NFS3_OK; vattr_to_post_op_attr(vap, &resp->resok.obj_attributes); xfer_size = rfs3_tsize(req); resp->resok.rtmax = xfer_size; --- 3861,3872 ----
*** 4321,4340 **** goto out1; } } } - #ifdef DEBUG - if (rfs3_do_post_op_attr) { - va.va_mask = AT_ALL; - vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - } else - vap = NULL; - #else va.va_mask = AT_ALL; vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va; - #endif error = VOP_PATHCONF(vp, _PC_LINK_MAX, &val, cr, NULL); if (error) goto out; resp->resok.info.link_max = (uint32)val; --- 3965,3976 ----
*** 4422,4439 **** * right access checking. So, we'll fail the request. */ if (error) goto out; - #ifdef DEBUG - if (rfs3_do_pre_op_attr) bvap = &bva; - else - bvap = NULL; - #else - bvap = &bva; - #endif if (rdonly(exi, req)) { resp->status = NFS3ERR_ROFS; goto out1; } --- 4058,4068 ----
*** 4463,4482 **** (error = VOP_ACCESS(vp, VWRITE, 0, cr, NULL))) goto out; error = VOP_FSYNC(vp, FSYNC, cr, NULL); - #ifdef DEBUG - if (rfs3_do_post_op_attr) { ava.va_mask = AT_ALL; avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - } else - avap = NULL; - #else - ava.va_mask = AT_ALL; - avap = VOP_GETATTR(vp, &ava, 0, cr, NULL) ? NULL : &ava; - #endif if (error) goto out; resp->status = NFS3_OK; --- 4092,4103 ----