From owner-freebsd-fs@FreeBSD.ORG Sun Feb 17 05:55:39 2013 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A43FC29 for ; Sun, 17 Feb 2013 05:55:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id A7216AA0 for ; Sun, 17 Feb 2013 05:55:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1H5tSKK017200; Sun, 17 Feb 2013 07:55:28 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1H5tSKK017200 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1H5tSGT017199; Sun, 17 Feb 2013 07:55:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 17 Feb 2013 07:55:28 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: cleaning files beyond EOF Message-ID: <20130217055528.GB2522@kib.kiev.ua> References: <20130217113031.N9271@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lnVtgFsQ/+aGFUA8" Content-Disposition: inline In-Reply-To: <20130217113031.N9271@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2013 05:55:39 -0000 --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--