Print this page
Hyperaggressive asserts pt 2/N
Be far more judicious in the use of curzone-using macros.
*** 951,961 ****
static nfsstat4
do_rfs4_op_secinfo(struct compound_state *cs, char *nm, SECINFO4res *resp)
{
int error, different_export = 0;
vnode_t *dvp, *vp;
! struct exportinfo *exi = NULL;
fid_t fid;
uint_t count, i;
secinfo4 *resok_val;
struct secinfo *secp;
seconfig_t *si;
--- 951,961 ----
static nfsstat4
do_rfs4_op_secinfo(struct compound_state *cs, char *nm, SECINFO4res *resp)
{
int error, different_export = 0;
vnode_t *dvp, *vp;
! struct exportinfo *exi;
fid_t fid;
uint_t count, i;
secinfo4 *resok_val;
struct secinfo *secp;
seconfig_t *si;
*** 962,985 ****
bool_t did_traverse = FALSE;
int dotdot, walk;
nfs_export_t *ne = nfs_get_export();
dvp = cs->vp;
dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
/*
* If dotdotting, then need to check whether it's above the
* root of a filesystem, or above an export point.
*/
if (dotdot) {
!
/*
* If dotdotting at the root of a filesystem, then
* need to traverse back to the mounted-on filesystem
* and do the dotdot lookup there.
*/
! if ((cs->vp->v_flag & VROOT) || VN_IS_CURZONEROOT(cs->vp)) {
/*
* If at the system root, then can
* go up no further.
*/
--- 962,987 ----
bool_t did_traverse = FALSE;
int dotdot, walk;
nfs_export_t *ne = nfs_get_export();
dvp = cs->vp;
+ exi = cs->exi;
+ ASSERT(exi != NULL);
dotdot = (nm[0] == '.' && nm[1] == '.' && nm[2] == '\0');
/*
* If dotdotting, then need to check whether it's above the
* root of a filesystem, or above an export point.
*/
if (dotdot) {
! ASSERT3U(exi->exi_zoneid, ==, curzone->zone_id);
/*
* If dotdotting at the root of a filesystem, then
* need to traverse back to the mounted-on filesystem
* and do the dotdot lookup there.
*/
! if ((dvp->v_flag & VROOT) || VN_IS_CURZONEROOT(dvp)) {
/*
* If at the system root, then can
* go up no further.
*/
*** 987,997 ****
return (puterrno4(ENOENT));
/*
* Traverse back to the mounted-on filesystem
*/
! dvp = untraverse(cs->vp);
/*
* Set the different_export flag so we remember
* to pick up a new exportinfo entry for
* this new filesystem.
--- 989,999 ----
return (puterrno4(ENOENT));
/*
* Traverse back to the mounted-on filesystem
*/
! dvp = untraverse(dvp);
/*
* Set the different_export flag so we remember
* to pick up a new exportinfo entry for
* this new filesystem.
*** 1001,1011 ****
/*
* If dotdotting above an export point then set
* the different_export to get new export info.
*/
! different_export = nfs_exported(cs->exi, cs->vp);
}
}
/*
* Get the vnode for the component "nm".
--- 1003,1013 ----
/*
* If dotdotting above an export point then set
* the different_export to get new export info.
*/
! different_export = nfs_exported(exi, dvp);
}
}
/*
* Get the vnode for the component "nm".
*** 1020,1032 ****
* used in the request is valid but not an explicitly shared flavor,
* or the access bit indicates that this is a limited access,
* check whether this vnode is visible.
*/
if (!different_export &&
! (PSEUDO(cs->exi) || ! is_exported_sec(cs->nfsflavor, cs->exi) ||
cs->access & CS_ACCESS_LIMITED)) {
! if (! nfs_visible(cs->exi, vp, &different_export)) {
VN_RELE(vp);
return (puterrno4(ENOENT));
}
}
--- 1022,1034 ----
* used in the request is valid but not an explicitly shared flavor,
* or the access bit indicates that this is a limited access,
* check whether this vnode is visible.
*/
if (!different_export &&
! (PSEUDO(exi) || !is_exported_sec(cs->nfsflavor, exi) ||
cs->access & CS_ACCESS_LIMITED)) {
! if (! nfs_visible(exi, vp, &different_export)) {
VN_RELE(vp);
return (puterrno4(ENOENT));
}
}
*** 1064,1073 ****
--- 1066,1076 ----
if (error) {
VN_RELE(vp);
return (puterrno4(error));
}
+ /* We'll need to reassign "exi". */
if (dotdot)
exi = nfs_vptoexi(NULL, vp, cs->cr, &walk, NULL, TRUE);
else
exi = checkexport4(&vp->v_vfsp->vfs_fsid, &fid, vp);
*** 1084,1095 ****
} else {
VN_RELE(vp);
return (puterrno4(EACCES));
}
}
- } else {
- exi = cs->exi;
}
ASSERT(exi != NULL);
/*
--- 1087,1096 ----
*** 2716,2726 ****
* If dotdotting, then need to check whether it's
* above the root of a filesystem, or above an
* export point.
*/
if (dotdot) {
!
/*
* If dotdotting at the root of a filesystem, then
* need to traverse back to the mounted-on filesystem
* and do the dotdot lookup there.
*/
--- 2717,2728 ----
* If dotdotting, then need to check whether it's
* above the root of a filesystem, or above an
* export point.
*/
if (dotdot) {
! ASSERT(cs->exi != NULL);
! ASSERT3U(cs->exi->exi_zoneid, ==, curzone->zone_id);
/*
* If dotdotting at the root of a filesystem, then
* need to traverse back to the mounted-on filesystem
* and do the dotdot lookup there.
*/