Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbcCCSJ2 (ORCPT ); Thu, 3 Mar 2016 13:09:28 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:49715 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754099AbcCCSJ0 (ORCPT ); Thu, 3 Mar 2016 13:09:26 -0500 Date: Thu, 3 Mar 2016 10:09:24 -0800 From: Christoph Hellwig To: "Martin K. Petersen" Cc: Linus Torvalds , "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Andrew Morton , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks Message-ID: <20160303180924.GA4116@infradead.org> References: <20160302040932.16685.62789.stgit@birch.djwong.org> <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 977 Lines: 23 On Thu, Mar 03, 2016 at 01:01:11PM -0500, Martin K. Petersen wrote: > That's not entirely true. Writing the blocks may cause them to be > allocated on the storage device (depending on which flags we feed it in > WRITE SAME). > > The filesystems people were wanted the following semantics: > > - deallocate, don't care about contents for future reads (discard) > - deallocate, guarantee zeroes on future reads (zeroout) > - (re)allocate, guarantee zeroes on future reads (zeroout) > > Maybe we just need a better naming scheme... In filesystem terms we have two and three: - FALLOC_FL_PUNCH_HOLE assures zeroes are returned, but space is deallocated as much as possible - FALLOC_FL_ZERO_RANGE assures zeroes are returned, AND blocks are actually allocated Returning stale blocks in a file system is a nasty security risk, so we don't do that, and so shouldn't storage that offers any kind of multi tenancy, and if it's just VMs using multiple partitions on it.