zfs_rezget: z_vnode can not be NULL if zp is valid

MFC after:	3 weeks
This commit is contained in:
Andriy Gapon 2016-04-16 07:41:56 +00:00
parent c2d36fc5cd
commit e01dd79f9a

View File

@ -1341,7 +1341,7 @@ zfs_rezget(znode_t *zp)
* recycled when the last vnode reference is dropped.
*/
vp = ZTOV(zp);
if (vp != NULL && vp->v_type != IFTOVT((mode_t)zp->z_mode)) {
if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) {
zfs_znode_dmu_fini(zp);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
return (EIO);
@ -1349,11 +1349,9 @@ zfs_rezget(znode_t *zp)
zp->z_unlinked = (zp->z_links == 0);
zp->z_blksz = doi.doi_data_block_size;
if (vp != NULL) {
vn_pages_remove(vp, 0, 0);
if (zp->z_size != size)
vnode_pager_setsize(vp, zp->z_size);
}
vn_pages_remove(vp, 0, 0);
if (zp->z_size != size)
vnode_pager_setsize(vp, zp->z_size);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);