Be more strict when selecting between snapshot/regular mount.
authorkib <kib@FreeBSD.org>
Mon, 19 Sep 2016 15:58:33 +0000 (15:58 +0000)
committerkib <kib@FreeBSD.org>
Mon, 19 Sep 2016 15:58:33 +0000 (15:58 +0000)
commit800b88629ef59580dc464c62742abd34f1928b43
tree4803c237d33a5fe020dab717f179ea85dee4ba72
parent575f611223b38e5435dc196c66b07ef03ceb58c0
Be more strict when selecting between snapshot/regular mount.

Reclaimed vnode type is VBAD, so succesful comparision like
devvp->v_type != VREG does not imply that the devvp references
snapshot, it might be due to a reclaimed vnode.  Explicitely check the
vnode type.

In the the most important case of ffs_blkfree(), the devfs vnode is
locked and its type is stable.  In other cases, if the vnode is
reclaimed right after the check, hopefully the buffer methods return
right error codes.

Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
sys/ufs/ffs/ffs_alloc.c
sys/ufs/ufs/ufs_gjournal.c