From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.9]:57710 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079AbcCEU6g (ORCPT ); Sat, 5 Mar 2016 15:58:36 -0500 Date: Sat, 5 Mar 2016 12:58:34 -0800 From: Christoph Hellwig To: Linus Torvalds Cc: "Darrick J. Wong" , Jens Axboe , Christoph Hellwig , Theodore Ts'o , "Martin K. Petersen" , Linux API , Dave Chinner , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton , Andrew Morton Subject: Re: [PATCH 3/3] block: implement (some of) fallocate for block devices Message-ID: <20160305205833.GB4834@infradead.org> References: <20160305005556.29738.66782.stgit@birch.djwong.org> <20160305005617.29738.85316.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Mar 04, 2016 at 07:13:25PM -0800, Linus Torvalds wrote: > > + /* We can't change the bdev size from here */ > > + if (!(mode & FALLOC_FL_KEEP_SIZE)) > > + return -EOPNOTSUPP; > > Oh, and this I think is wrong. > > The thing is, FALLOC_FL_KEEP_SIZE is only supposed to matter if the > region is outside the existing length. For allocations... > So if y ou punch a hole in the middle of a file, you don't need > FALLOC_FL_KEEP_SIZE. For FALLOC_FL_PUNCH_HOLE we always require FALLOC_FL_KEEP_SIZE so far, and I'd rather not change things for block devices just because we can.