diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index ab76649d6002..10be138cf274 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_serv.c,v 1.62 2001/11/10 10:59:09 lukem Exp $ */ +/* $NetBSD: nfs_serv.c,v 1.63 2002/09/26 20:38:04 bouyer Exp $ */ /* * Copyright (c) 1989, 1993 @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.62 2001/11/10 10:59:09 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.63 2002/09/26 20:38:04 bouyer Exp $"); #include #include @@ -3010,7 +3010,10 @@ nfsrv_commit(nfsd, slp, procp, mrq) return (0); } for_ret = VOP_GETATTR(vp, &bfor, cred, procp); - error = VOP_FSYNC(vp, cred, FSYNC_WAIT, off, off + cnt, procp); + if (cnt > 0) + error = VOP_FSYNC(vp, cred, FSYNC_WAIT, off, off + cnt, procp); + else + error = VOP_FSYNC(vp, cred, FSYNC_WAIT, off, vp->v_size, procp); aft_ret = VOP_GETATTR(vp, &aft, cred, procp); vput(vp); nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);