In vfs_mark_atime(9), be resistent against reclaimed vnodes.

Assert that neccessary locks are taken, since vop might not be called.

Tested by:	pho
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2009-09-09 10:51:50 +00:00
parent aa3e6183ce
commit 427992ecdb

View File

@ -4269,8 +4269,12 @@ vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off)
void
vfs_mark_atime(struct vnode *vp, struct ucred *cred)
{
struct mount *mp;
if ((vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0)
mp = vp->v_mount;
VFS_ASSERT_GIANT(mp);
ASSERT_VOP_LOCKED(vp, "vfs_mark_atime");
if (mp != NULL && (mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0)
(void)VOP_MARKATIME(vp);
}