From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:35524 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbeEPQ0Q (ORCPT ); Wed, 16 May 2018 12:26:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id i5-v6so727815plt.2 for ; Wed, 16 May 2018 09:26:16 -0700 (PDT) Date: Wed, 16 May 2018 09:26:14 -0700 From: Omar Sandoval To: Christoph Hellwig Cc: "Darrick J . Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara Subject: Re: [PATCH] iomap: don't allow holes in swapfiles Message-ID: <20180516162614.GB14174@vader> References: <20180516162329.GA21071@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180516162329.GA21071@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 16, 2018 at 09:23:29AM -0700, Christoph Hellwig wrote: > > > > - /* Skip holes. */ > > + /* No holes. */ > > if (iomap->type == IOMAP_HOLE) > > - goto out; > > + goto err; > > If we end up not allowing holes this check can just be removed > entirely. We already check for the allow types below. I have to > admit I would move that type check above the bdev check, though. True, although I wonder if we should be logging more specific error messages instead of a generic "not a valid swap file" message. At least for my Btrfs patches, that's what I do. I'll send a v2 with a second patch doing that.