mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
If a buffer flush fails when trying to reclaim a vnode, it is too
late to save the vnode, so just toss any remaining unwritten buffers rather than leaving them lying around to make trouble in the future.
This commit is contained in:
parent
4572bcfe05
commit
3764219663
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62549
@ -1660,14 +1660,20 @@ vclean(vp, flags, p)
|
||||
|
||||
/*
|
||||
* Clean out any buffers associated with the vnode.
|
||||
* If the flush fails, just toss the buffers.
|
||||
*/
|
||||
vinvalbuf(vp, V_SAVE, NOCRED, p, 0, 0);
|
||||
if (flags & DOCLOSE) {
|
||||
if (vinvalbuf(vp, V_SAVE, NOCRED, p, 0, 0) != 0)
|
||||
vinvalbuf(vp, 0, NOCRED, p, 0, 0);
|
||||
}
|
||||
|
||||
if ((obj = vp->v_object) != NULL) {
|
||||
if (obj->ref_count == 0) {
|
||||
/*
|
||||
* vclean() may be called twice. The first time removes the
|
||||
* primary reference to the object, the second time goes
|
||||
* one further and is a special-case to terminate the object.
|
||||
* vclean() may be called twice. The first time
|
||||
* removes the primary reference to the object,
|
||||
* the second time goes one further and is a
|
||||
* special-case to terminate the object.
|
||||
*/
|
||||
vm_object_terminate(obj);
|
||||
} else {
|
||||
|
@ -1660,14 +1660,20 @@ vclean(vp, flags, p)
|
||||
|
||||
/*
|
||||
* Clean out any buffers associated with the vnode.
|
||||
* If the flush fails, just toss the buffers.
|
||||
*/
|
||||
vinvalbuf(vp, V_SAVE, NOCRED, p, 0, 0);
|
||||
if (flags & DOCLOSE) {
|
||||
if (vinvalbuf(vp, V_SAVE, NOCRED, p, 0, 0) != 0)
|
||||
vinvalbuf(vp, 0, NOCRED, p, 0, 0);
|
||||
}
|
||||
|
||||
if ((obj = vp->v_object) != NULL) {
|
||||
if (obj->ref_count == 0) {
|
||||
/*
|
||||
* vclean() may be called twice. The first time removes the
|
||||
* primary reference to the object, the second time goes
|
||||
* one further and is a special-case to terminate the object.
|
||||
* vclean() may be called twice. The first time
|
||||
* removes the primary reference to the object,
|
||||
* the second time goes one further and is a
|
||||
* special-case to terminate the object.
|
||||
*/
|
||||
vm_object_terminate(obj);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user