Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2013 07:55:28 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        fs@freebsd.org
Subject:   Re: cleaning files beyond EOF
Message-ID:  <20130217055528.GB2522@kib.kiev.ua>
In-Reply-To: <20130217113031.N9271@besplex.bde.org>
References:  <20130217113031.N9271@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--lnVtgFsQ/+aGFUA8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Feb 17, 2013 at 11:33:58AM +1100, Bruce Evans wrote:
> I have a (possibly damaged) ffs data block with nonzero data beyond
> EOF.  Is anything responsible for clearing this data when the file
> is mmapped()?
>=20
> At least old versions of gcc mmap() the file and have a bug checking
> for EOF.  They read the garbage beyond the end and get confused.

Does the 'damaged' status of the data block mean that it contain the
garbage after EOF on disk ?

UFS uses a small wrapper around vnode_generic_getpages() as the
VOP_GETPAGES(), the wrapping code can be ignored for the current
purpose.

vnode_generic_getpages() iterates over the the pages after the bstrategy()
and marks the part of the page after EOF valid and zeroes it, using
vm_page_set_valid_range().

--lnVtgFsQ/+aGFUA8
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJRIHDQAAoJEJDCuSvBvK1BVvIQAII9S5yh7gY5/sDH53QfKv7T
6r1ekPRmUgcSMGcFMwH6N88uVOckdXFcROIJKmgKDvjQzzdvif3SPzBFwShm55rg
zsqs5IuEi+xJtn2N6TQOdgTiV+//GLonIKXMjrQluF0qm9+BhP9bUmSrkIzHGV5P
Lf20n3EMok3hF03cxdJrDI0jHJ+wUpZTee1SELq/fcMHK04R0BCtsVgulHwRnrr9
N+fdhpB5Eh85LH5OEALgiF2x5deK/khhauPyFRymg+s2N57w7EsxxQHAyYnuz/KN
sDY0FOlvNLqwzBGtomrJnRWY+d6RQiKlcxvWkBUP9leOFnuGnRVc1MjYHhNP/Htz
GzAeQKLLuDIroSZy5IbcGrLzc2XQIKix1ILPtfffV/2Vn/bQCXHC1EGqPfQl2UqK
8K90QjVR0z7mBvbaiW8QgoN/2Dy0UvqYwOTBrAzAET6tRmH/nOuCAqhzsBAvssY1
tjRS5nqeF3S/AbalZtDNM7TmNZOlWTlLYUrvDuct/C68CkWGejYYFGMoGOuL2/vC
hGb5pSH9IDNG5NP3mtoXylukmplgUnhPOiXyxLLGAoFnVTL5nGJaxlUwu8XElOxq
+3xNgLt2mkR4er8mx9WaB3moistCIU1LEI4M/kQEOQLQfTWxdc7hC2P8hvm6IN0V
TCvwmJrtvt+it4vdaTpg
=lL16
-----END PGP SIGNATURE-----

--lnVtgFsQ/+aGFUA8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130217055528.GB2522>