zfs_rezget: drop cached pages before doing anything else
authoravg <avg@FreeBSD.org>
Wed, 31 Jan 2018 14:44:51 +0000 (14:44 +0000)
committeravg <avg@FreeBSD.org>
Wed, 31 Jan 2018 14:44:51 +0000 (14:44 +0000)
commit22ad2342b113bce4bf6c458e4f68e8e390490213
tree382aa6b0d5c4c768d8602df9155c1f1347490158
parent01b52fdebba8cfd06d2b39bbb5f22f151534e0fe
zfs_rezget: drop cached pages before doing anything else

We did that in the case of success to prevent the use of stale cached
data, but it makes even less sense to keep the cached data when we fail.

Ideally, we should call vgone() on the vnode in the case of zfs_rezget
failure, but the current lock order prevents us from doing that.

The change also rearranges the order of unlinked check and the size
change check.

While there, add missing SET_ERROR in one of the error paths.

MFC after: 2 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c