From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Laager Subject: fallocate(FALLOC_FL_PUNCH_HOLE) Date: Sat, 10 Mar 2012 14:07:05 -0600 Message-ID: <1331410025.8577.68.camel@watermelon.coderich.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-u1fGP18KTvInylIDwdxB" To: linux-fsdevel@vger.kernel.org Return-path: Received: from spam1.wiktel.com ([69.89.207.151]:41653 "EHLO spam1.wiktel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987Ab2CJUHH (ORCPT ); Sat, 10 Mar 2012 15:07:07 -0500 Received: from [10.10.10.30] (vpn.wiktel.com [69.89.205.192]) (authenticated bits=0) by spam1.wiktel.com (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id q2AK75fa032368 for ; Sat, 10 Mar 2012 14:07:05 -0600 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --=-u1fGP18KTvInylIDwdxB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've been working on a discard patch for QEMU. I have a couple of questions about the semantics of fallocate()'s FALLOC_FL_PUNCH_HOLE that are not addressed in the latest man-pages.git. 1. Upon successful return, are the results guaranteed to be on stable storage? 1. If not, is fdatasync() sufficient, or is fsync() required? 2. Does O_DSYNC on open() change any of this? 3. Does O_DIRECT on open() change any of this? 2. If I punch a hole in a previously preallocated range, is this... A. required to undo the preallocation? B. permitted, but not required, to undo the preallocation? C. forbidden from undoing the preallocation? If the answer to #2 is not C, it would appear there's no atomic way to indicate that I'm done with certain data* but I want the filesystem to continue to guarantee space for me. Is this correct? * so the filesystem can send a TRIM/UNMAP to an underlying SSD. Thanks, Richard --=-u1fGP18KTvInylIDwdxB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk9btGMACgkQbfU6uV4fG87COgCfYVneBKN7n3Hz4D3Th/sqgM0i yAQAnihFnDuuPwJD0ijsGeUBXCpScM5t =VCe0 -----END PGP SIGNATURE----- --=-u1fGP18KTvInylIDwdxB--