diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 8452cc0f3a2f..bce9231da92a 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -496,6 +496,7 @@ writev(p, uap) } #endif cnt = auio.uio_resid; + bwillwrite(); if ((error = fo_write(fp, &auio, fp->f_cred, 0, p))) { if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 785219c8aded..4830120c6213 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -495,6 +495,9 @@ WRITE(ap) if (ioflag & IO_SYNC) { (void)bwrite(bp); + } else if (vm_page_count_severe() || buf_dirty_count_severe()) { + bp->b_flags |= B_CLUSTEROK; + bawrite(bp); } else if (xfersize + blkoffset == fs->fs_bsize) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; @@ -502,9 +505,6 @@ WRITE(ap) } else { bawrite(bp); } - } else if (vm_page_count_severe() || buf_dirty_count_severe()) { - bp->b_flags |= B_CLUSTEROK; - bawrite(bp); } else { bp->b_flags |= B_CLUSTEROK; bdwrite(bp);