Ignore doomed vnodes in tmpfs_update_mtime().

Otherwise we might dereference NULL vp->v_data after
VP_TO_TMPFS_NODE().

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2019-04-12 17:11:50 +00:00
parent 91ff2d4883
commit 28ce2bc1b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346157

View File

@ -173,7 +173,7 @@ tmpfs_update_mtime(struct mount *mp, bool lazy)
* metadata changes now.
*/
if (!lazy || (obj->flags & OBJ_TMPFS_DIRTY) != 0) {
if (vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK,
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK,
curthread) != 0)
continue;
tmpfs_check_mtime(vp);