mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
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
This commit is contained in:
parent
09ac4e68f3
commit
bafa6cfc93
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248815
@ -1345,6 +1345,10 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
|
|||||||
vfs_mark_atime(vp, cred);
|
vfs_mark_atime(vp, cred);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (error != 0 && *writecounted) {
|
||||||
|
*writecounted = FALSE;
|
||||||
|
vnode_pager_update_writecount(obj, objsize, 0);
|
||||||
|
}
|
||||||
vput(vp);
|
vput(vp);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user