diff options
author | kib <kib@FreeBSD.org> | 2009-09-09 10:51:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-09-09 10:51:50 +0000 |
commit | 3119d26c952b144660c1507510826da62234c628 (patch) | |
tree | 9f34a8c807425a0e1982df1313140797bdfd70ec /sys/kern/vfs_subr.c | |
parent | 92c0e3160b71624802e910d64bea5e2fab069a2a (diff) | |
download | FreeBSD-src-3119d26c952b144660c1507510826da62234c628.zip FreeBSD-src-3119d26c952b144660c1507510826da62234c628.tar.gz |
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
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3beb881..f3ec565 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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); } |