Fix an error that I made with an optimization. In the case

of softupdates, we need to do vtruncbuf the old way.  Luoqi
caught, found the bug and submitted this fix.
Submitted by:	Luoqi Chen <luoqi@chen.ml.org>
This commit is contained in:
John Dyson 1998-04-30 05:28:53 +00:00
parent 5679c69d0f
commit 83ad4e3dbc

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
* $Id: ffs_inode.c,v 1.39 1998/03/26 20:53:49 phk Exp $
* $Id: ffs_inode.c,v 1.40 1998/03/30 09:55:55 phk Exp $
*/
#include "opt_quota.h"
@ -212,7 +212,7 @@ ffs_truncate(vp, length, flags, cred, p)
(void) chkdq(oip, -oip->i_blocks, NOCRED, 0);
#endif
softdep_setup_freeblocks(oip, length);
(void) vtruncbuf(ovp, cred, p, length, fs->fs_bsize);
vinvalbuf(ovp, V_SAVE | V_SAVEMETA, cred, p, 0, 0);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
return (ffs_update(ovp, &tv, &tv, 0));
}