diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2019-02-17 22:17:29 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2019-02-17 22:17:29 +0000 |
commit | 1940b4c4b0ca57afc7481e253a0db3ab28f400c4 (patch) | |
tree | 2a1ab4a8d9c03ed7213097c751dd9be930feec1f /sys/kern/vfs_subr.c | |
parent | d175c749a6e191f19af3f89d60ecfa13edb39e02 (diff) |
if a write fails, we mark the buffer invalid and throw it away. this can
lead to lost errors, where a later fsync will return success. to fix this,
set a flag on the vnode indicating a past error has occurred, and return
an error for future fsync calls.
ok bluhm deraadt visa
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a15481c73f9..ed5bbd1be61 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.285 2019/01/21 18:09:21 anton Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.286 2019/02/17 22:17:28 tedu Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -712,6 +712,7 @@ vputonfreelist(struct vnode *vp) #endif vp->v_bioflag |= VBIOONFREELIST; + vp->v_bioflag &= ~VBIOERROR; if (vp->v_holdcnt > 0) lst = &vnode_hold_list; |