Print this page
Send zone's rootvp to untraverse()


 956         struct exportinfo *exi;
 957         fid_t fid;
 958         uint_t count, i;
 959         secinfo4 *resok_val;
 960         struct secinfo *secp;
 961         seconfig_t *si;
 962         bool_t did_traverse = FALSE;
 963         int dotdot, walk;
 964         nfs_export_t *ne = nfs_get_export();
 965 
 966         dvp = cs->vp;
 967         exi = cs->exi;
 968         ASSERT(exi != NULL);
 969         dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
 970 
 971         /*
 972          * If dotdotting, then need to check whether it's above the
 973          * root of a filesystem, or above an export point.
 974          */
 975         if (dotdot) {
 976                 ASSERT3U(exi->exi_zoneid, ==, curzone->zone_id);


 977                 /*
 978                  * If dotdotting at the root of a filesystem, then
 979                  * need to traverse back to the mounted-on filesystem
 980                  * and do the dotdot lookup there.
 981                  */
 982                 if ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp)) {
 983 
 984                         /*
 985                          * If at the system root, then can
 986                          * go up no further.
 987                          */
 988                         if (VN_CMP(dvp, ZONE_ROOTVP()))
 989                                 return (puterrno4(ENOENT));
 990 
 991                         /*
 992                          * Traverse back to the mounted-on filesystem
 993                          */
 994                         dvp = untraverse(dvp);
 995 
 996                         /*
 997                          * Set the different_export flag so we remember
 998                          * to pick up a new exportinfo entry for
 999                          * this new filesystem.
1000                          */
1001                         different_export = 1;
1002                 } else {
1003 
1004                         /*
1005                          * If dotdotting above an export point then set
1006                          * the different_export to get new export info.
1007                          */
1008                         different_export = nfs_exported(exi, dvp);
1009                 }
1010         }
1011 
1012         /*
1013          * Get the vnode for the component "nm".
1014          */


2702         fid_t fid;
2703         int attrdir, dotdot, walk;
2704         bool_t is_newvp = FALSE;
2705 
2706         if (cs->vp->v_flag & V_XATTRDIR) {
2707                 attrdir = 1;
2708                 ASSERT(get_fh4_flag(&cs->fh, FH4_ATTRDIR));
2709         } else {
2710                 attrdir = 0;
2711                 ASSERT(! get_fh4_flag(&cs->fh, FH4_ATTRDIR));
2712         }
2713 
2714         dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
2715 
2716         /*
2717          * If dotdotting, then need to check whether it's
2718          * above the root of a filesystem, or above an
2719          * export point.
2720          */
2721         if (dotdot) {


2722                 ASSERT(cs->exi != NULL);
2723                 ASSERT3U(cs->exi->exi_zoneid, ==, curzone->zone_id);
2724                 /*
2725                  * If dotdotting at the root of a filesystem, then
2726                  * need to traverse back to the mounted-on filesystem
2727                  * and do the dotdot lookup there.
2728                  */
2729                 if ((cs->vp->v_flag & VROOT) || VN_IS_CURZONEROOT(cs->vp)) {
2730 
2731                         /*
2732                          * If at the system root, then can
2733                          * go up no further.
2734                          */
2735                         if (VN_CMP(cs->vp, ZONE_ROOTVP()))
2736                                 return (puterrno4(ENOENT));
2737 
2738                         /*
2739                          * Traverse back to the mounted-on filesystem
2740                          */
2741                         cs->vp = untraverse(cs->vp);
2742 
2743                         /*
2744                          * Set the different_export flag so we remember
2745                          * to pick up a new exportinfo entry for
2746                          * this new filesystem.
2747                          */
2748                         different_export = 1;
2749                 } else {
2750 
2751                         /*
2752                          * If dotdotting above an export point then set
2753                          * the different_export to get new export info.
2754                          */
2755                         different_export = nfs_exported(cs->exi, cs->vp);
2756                 }
2757         }
2758 
2759         error = VOP_LOOKUP(cs->vp, nm, &vp, NULL, 0, NULL, cs->cr,
2760             NULL, NULL, NULL);
2761         if (error)




 956         struct exportinfo *exi;
 957         fid_t fid;
 958         uint_t count, i;
 959         secinfo4 *resok_val;
 960         struct secinfo *secp;
 961         seconfig_t *si;
 962         bool_t did_traverse = FALSE;
 963         int dotdot, walk;
 964         nfs_export_t *ne = nfs_get_export();
 965 
 966         dvp = cs->vp;
 967         exi = cs->exi;
 968         ASSERT(exi != NULL);
 969         dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
 970 
 971         /*
 972          * If dotdotting, then need to check whether it's above the
 973          * root of a filesystem, or above an export point.
 974          */
 975         if (dotdot) {
 976                 vnode_t *zone_rootvp = ne->exi_root->exi_vp;
 977 
 978                 ASSERT3U(exi->exi_zoneid, ==, ne->exi_root->exi_zoneid);
 979                 /*
 980                  * If dotdotting at the root of a filesystem, then
 981                  * need to traverse back to the mounted-on filesystem
 982                  * and do the dotdot lookup there.
 983                  */
 984                 if ((dvp->v_flag & VROOT) || VN_CMP(dvp, zone_rootvp)) {
 985 
 986                         /*
 987                          * If at the system root, then can
 988                          * go up no further.
 989                          */
 990                         if (VN_CMP(dvp, zone_rootvp))
 991                                 return (puterrno4(ENOENT));
 992 
 993                         /*
 994                          * Traverse back to the mounted-on filesystem
 995                          */
 996                         dvp = untraverse(dvp, zone_rootvp);
 997 
 998                         /*
 999                          * Set the different_export flag so we remember
1000                          * to pick up a new exportinfo entry for
1001                          * this new filesystem.
1002                          */
1003                         different_export = 1;
1004                 } else {
1005 
1006                         /*
1007                          * If dotdotting above an export point then set
1008                          * the different_export to get new export info.
1009                          */
1010                         different_export = nfs_exported(exi, dvp);
1011                 }
1012         }
1013 
1014         /*
1015          * Get the vnode for the component "nm".
1016          */


2704         fid_t fid;
2705         int attrdir, dotdot, walk;
2706         bool_t is_newvp = FALSE;
2707 
2708         if (cs->vp->v_flag & V_XATTRDIR) {
2709                 attrdir = 1;
2710                 ASSERT(get_fh4_flag(&cs->fh, FH4_ATTRDIR));
2711         } else {
2712                 attrdir = 0;
2713                 ASSERT(! get_fh4_flag(&cs->fh, FH4_ATTRDIR));
2714         }
2715 
2716         dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
2717 
2718         /*
2719          * If dotdotting, then need to check whether it's
2720          * above the root of a filesystem, or above an
2721          * export point.
2722          */
2723         if (dotdot) {
2724                 vnode_t *zone_rootvp;
2725 
2726                 ASSERT(cs->exi != NULL);
2727                 zone_rootvp = cs->exi->exi_ne->exi_root->exi_vp;
2728                 /*
2729                  * If dotdotting at the root of a filesystem, then
2730                  * need to traverse back to the mounted-on filesystem
2731                  * and do the dotdot lookup there.
2732                  */
2733                 if ((cs->vp->v_flag & VROOT) || VN_CMP(cs->vp, zone_rootvp)) {
2734 
2735                         /*
2736                          * If at the system root, then can
2737                          * go up no further.
2738                          */
2739                         if (VN_CMP(cs->vp, zone_rootvp))
2740                                 return (puterrno4(ENOENT));
2741 
2742                         /*
2743                          * Traverse back to the mounted-on filesystem
2744                          */
2745                         cs->vp = untraverse(cs->vp, zone_rootvp);
2746 
2747                         /*
2748                          * Set the different_export flag so we remember
2749                          * to pick up a new exportinfo entry for
2750                          * this new filesystem.
2751                          */
2752                         different_export = 1;
2753                 } else {
2754 
2755                         /*
2756                          * If dotdotting above an export point then set
2757                          * the different_export to get new export info.
2758                          */
2759                         different_export = nfs_exported(cs->exi, cs->vp);
2760                 }
2761         }
2762 
2763         error = VOP_LOOKUP(cs->vp, nm, &vp, NULL, 0, NULL, cs->cr,
2764             NULL, NULL, NULL);
2765         if (error)