vnode: v_path reading should be protected by v_lock
The vnode's v_path is stable only in a case the v_lock is held. The nice example of that is in the vn_copypath() function implementation. Unfortunately, some v_path readers does not hold the v_lock when they work with v_path, so they are in danger that the v_path might get freed and/or replaced under their hands.
181 vpathlen = vp->v_path ? strlen(vp->v_path) : 0; 182 kex->ex_pathlen = vpathlen + strlen(PSEUDOFS_SUFFIX); 183 kex->ex_path = kmem_alloc(kex->ex_pathlen + 1, KM_SLEEP); 184 185 if (vpathlen) 186 (void) strcpy(kex->ex_path, vp->v_path);
236 237 zcmn_err(GLOBAL_ZONEID, 238 CE_WARN, "%s: File system full, " 239 "swap space limit exceeded", 240 vfs->vfs_vnodecovered->v_path);