diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-01-20 20:11:31 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-01-20 20:11:31 +0000 |
commit | 85ccf361d4569bd19b06620fcc62285b90afcb15 (patch) | |
tree | 65500e997dea6742d461d9cef7651417c4657805 /sys | |
parent | 20ccaa1777fd33e25f5f9239c685123fc3ea838e (diff) | |
download | FreeBSD-src-85ccf361d4569bd19b06620fcc62285b90afcb15.zip FreeBSD-src-85ccf361d4569bd19b06620fcc62285b90afcb15.tar.gz |
Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
When using cp to copy a file under the following circumstanes:
- original file in on an NFS filesystem
- destination file is on the same NFS filesystem
- the file is less than 8Mbytes in size
- the file is larger than 65536 bytes in size
the cp process can get frozen in device-wait and never wake up (cp uses
mmap() in this case).
A small change to allocbuf() fixes this.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_bio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 8867fbe..8ecc229 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.20 1995/01/11 01:53:18 davidg Exp $ + * $Id: vfs_bio.c,v 1.21 1995/01/15 09:35:58 davidg Exp $ */ /* @@ -1159,10 +1159,12 @@ allocbuf(struct buf * bp, int size, int vmio) bufferdestroyed = 1; } s = splbio(); - if (m) { + if (m && (m->flags & PG_BUSY)) { m->flags |= PG_WANTED; tsleep(m, PRIBIO, "pgtblk", 0); - } + } else + if (m->valid == 0) + vm_page_free(m); splx(s); if (bufferdestroyed) return 0; |