summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_mmap.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-03-28 06:39:27 +0000
committerkib <kib@FreeBSD.org>2013-03-28 06:39:27 +0000
commit7b210bf144ce08f72d6f2ea941e99224a429f7e6 (patch)
tree1123040519467d7a18f383bba5f3ab5dc6ed1b5d /sys/vm/vm_mmap.c
parenta1961a79d2a0d90362da7c7240193a27a55de138 (diff)
downloadFreeBSD-src-7b210bf144ce08f72d6f2ea941e99224a429f7e6.zip
FreeBSD-src-7b210bf144ce08f72d6f2ea941e99224a429f7e6.tar.gz
Release the v_writecount reference on the vnode in case of error,
before the vnode is vput() in vm_mmap_vnode(). Error return means that there is no use reference on the vnode from the vm object reference, and failing to restore v_writecount breaks the invariant that v_writecount is less or equal to the usecount. The situation observed when nfs client returns ESTALE for VOP_GETATTR() after the open. In collaboration with: pho MFC after: 1 week
Diffstat (limited to 'sys/vm/vm_mmap.c')
-rw-r--r--sys/vm/vm_mmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 248d9e8..c17e9ce 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1345,6 +1345,10 @@ mark_atime:
vfs_mark_atime(vp, cred);
done:
+ if (error != 0 && *writecounted) {
+ *writecounted = FALSE;
+ vnode_pager_update_writecount(obj, objsize, 0);
+ }
vput(vp);
return (error);
}
OpenPOWER on IntegriCloud