From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:42886 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935AbeEPQT6 (ORCPT ); Wed, 16 May 2018 12:19:58 -0400 Received: by mail-pf0-f195.google.com with SMTP id p14-v6so602470pfh.9 for ; Wed, 16 May 2018 09:19:58 -0700 (PDT) Date: Wed, 16 May 2018 09:19:55 -0700 From: Omar Sandoval To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara , Aleksei Besogonov Subject: Re: [PATCH] iomap: don't allow holes in swapfiles Message-ID: <20180516161955.GA14174@vader> References: <20180516155000.GC23858@magnolia> <20180516155146.GA8294@infradead.org> <20180516155638.GD23858@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180516155638.GD23858@magnolia> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 16, 2018 at 08:56:38AM -0700, Darrick J. Wong wrote: > On Wed, May 16, 2018 at 08:51:46AM -0700, Christoph Hellwig wrote: > > On Wed, May 16, 2018 at 08:50:00AM -0700, Darrick J. Wong wrote: > > > > Hey, Darrick, I noticed this while writing up a generic xfstest to test > > > > that the Btrfs swap support patches don't allow a swapfile with holes. > > > > It'd be nice if we were all consistent :) This is based on > > > > xfs-linux/for-next. Feel free to fold it in to your patch or apply it > > > > separately as you see fit. Thanks! > > > > > > I sent a testcase of my own ("generic: test swapfile creation, > > > activation, and deactivation") a while back; would you mind sending out > > > yours so we can combine them into a single testcase? Sure thing, I have a small pile of tests. I'm still working on some Btrfs-specific ones, but I can send out the generic ones and we can figure out how to merge them. > > Wasn't the desire to support holes the rationale for the Aleksei > > version of the iomap swapfile patch? > > Ah, so it was. FWIW I'm not sure why you'd /want/ a holey swapfile? >>From reading the old thread, it looks like Aleksei just wanted fallocated swap files to work: "I've traced the problem to bmap(), used in generic_swapfile_activate call, which returns 0 for blocks inside holes created by fallocate". Are holes in that sense are different from actual holes in the iomap sense?