Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern in vtruncbuf(), use a "synchronous freeing" flush t...
details: https://anonhg.NetBSD.org/src/rev/fca2a03a989a
branches: trunk
changeset: 501830:fca2a03a989a
user: chs <chs%NetBSD.org@localhost>
date: Mon Jan 08 07:05:47 2001 +0000
description:
in vtruncbuf(), use a "synchronous freeing" flush to prevent a race
between write i/os in a disk-based filesystem vs. the disk block being
freed by a truncation, allocated to a new file, and written again with
different data. if the disk driver reorders the requests and does
the second i/o first, the old data will clobber the new, corrupting
the new file.
diffstat:
sys/kern/vfs_subr.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r c779948f4a67 -r fca2a03a989a sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c Mon Jan 08 06:57:21 2001 +0000
+++ b/sys/kern/vfs_subr.c Mon Jan 08 07:05:47 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.143 2000/12/31 03:13:51 sommerfeld Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.144 2001/01/08 07:05:47 chs Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -748,7 +748,7 @@
simple_lock(&uobj->vmobjlock);
rv = (uobj->pgops->pgo_flush)(uobj,
round_page(lbn << vp->v_mount->mnt_fs_bshift),
- vp->v_uvm.u_size, PGO_FREE);
+ vp->v_uvm.u_size, PGO_FREE|PGO_SYNCIO);
simple_unlock(&uobj->vmobjlock);
if (!rv) {
splx(s);
Home |
Main Index |
Thread Index |
Old Index