From a966070d38f5b9765605c5a51501ac9586cf99a5 Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 5 Dec 2006 23:07:42 +0000 Subject: [PATCH] adjust file size in write only if file grows. but since this change is in the "never use ubc" branch, I don't think it matters except for cosmetics. --- sys/fs/puffs/puffs_vnops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/fs/puffs/puffs_vnops.c b/sys/fs/puffs/puffs_vnops.c index fbaabe84b726..88996258e8e3 100644 --- a/sys/fs/puffs/puffs_vnops.c +++ b/sys/fs/puffs/puffs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vnops.c,v 1.19 2006/12/05 23:03:28 pooka Exp $ */ +/* $NetBSD: puffs_vnops.c,v 1.20 2006/12/05 23:07:42 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.19 2006/12/05 23:03:28 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.20 2006/12/05 23:07:42 pooka Exp $"); #include #include @@ -1513,7 +1513,8 @@ puffs_write(void *v) } /* adjust file size */ - uvm_vnp_setsize(vp, uio->uio_offset); + if (vp->v_size < uio->uio_offset) + uvm_vnp_setsize(vp, uio->uio_offset); /* didn't move everything? bad userspace. bail */ if (write_argp->pvnr_resid != 0) {