From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCSO5-0007ji-0C for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:08:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCSNy-0001ZF-SC for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:08:20 -0400 Received: from verein.lst.de ([213.95.11.211]:57284 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCSNy-0001Yx-Li for qemu-devel@nongnu.org; Tue, 27 Mar 2012 05:08:14 -0400 Date: Tue, 27 Mar 2012 11:08:13 +0200 From: Christoph Hellwig Message-ID: <20120327090813.GA24820@lst.de> References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-7-git-send-email-pbonzini@redhat.com> <4F5A31B2.3050701@redhat.com> <4F5A46A1.4000508@redhat.com> <1331402560.8577.46.camel@watermelon.coderich.net> <20120324152721.GA13014@lst.de> <1332790847.3486.26.camel@watermelon.coderich.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1332790847.3486.26.camel@watermelon.coderich.net> Subject: Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Laager Cc: Christoph Hellwig , qemu-devel@nongnu.org On Mon, Mar 26, 2012 at 02:40:47PM -0500, Richard Laager wrote: > On Sat, 2012-03-24 at 16:27 +0100, Christoph Hellwig wrote: > > > has_discard = !fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, > > > > There is no point in using FALLOC_FL_KEEP_SIZE together with > > FALLOC_FL_PUNCH_HOLE. > > It's *required*. From the man page [0], "The FALLOC_FL_PUNCH_HOLE flag > must be ORed with FALLOC_FL_KEEP_SIZE in mode;" > > [0] http://man7.org/linux/man-pages/man2/fallocate.2.html You're right - we check that it is set in common code before entering the filesystem. It's utterly pointless, but too late to change now - I should have reviewed the patch to add it better.