zero the pages for newly allocated clusters in deextend() after we
notify UVM of the file's new size rather than in extendfile(). fixes PR 11852.
This commit is contained in:
parent
fe278fa440
commit
5c68a1518a
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msdosfs_denode.c,v 1.47 2000/11/27 08:39:46 chs Exp $ */
|
||||
/* $NetBSD: msdosfs_denode.c,v 1.48 2001/01/01 00:25:41 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
@ -490,7 +490,7 @@ deextend(dep, length, cred)
|
||||
struct ucred *cred;
|
||||
{
|
||||
struct msdosfsmount *pmp = dep->de_pmp;
|
||||
u_long count;
|
||||
u_long count, osize;
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -523,8 +523,12 @@ deextend(dep, length, cred)
|
||||
}
|
||||
}
|
||||
|
||||
osize = dep->de_FileSize;
|
||||
dep->de_FileSize = length;
|
||||
uvm_vnp_setsize(DETOV(dep), (voff_t)dep->de_FileSize);
|
||||
dep->de_flag |= DE_UPDATE|DE_MODIFIED;
|
||||
uvm_vnp_zerorange(DETOV(dep), (off_t)osize,
|
||||
(size_t)(dep->de_FileSize - osize));
|
||||
return (deupdat(dep, 1));
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.35 2000/12/04 11:54:39 fvdl Exp $ */
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.36 2001/01/01 00:25:41 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
@ -1070,12 +1070,5 @@ extendfile(dep, count, bpp, ncp, flags)
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & DE_CLEAR) && !(dep->de_Attributes & ATTR_DIRECTORY)) {
|
||||
int cnshift = pmp->pm_cnshift;
|
||||
|
||||
uvm_vnp_zerorange(DETOV(dep), frcn << cnshift,
|
||||
origcount << cnshift);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user