From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED777C55191 for ; Fri, 24 Apr 2020 10:11:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFCB0208E4 for ; Fri, 24 Apr 2020 10:11:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="jVQVA2Uy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbgDXKLy (ORCPT ); Fri, 24 Apr 2020 06:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726867AbgDXKLy (ORCPT ); Fri, 24 Apr 2020 06:11:54 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37205C09B045; Fri, 24 Apr 2020 03:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=63eqvaxZAp7OS4S7rYpQU2Q5xJodUR5sgvC2fkZKUPw=; b=jVQVA2UyJk8C0S+mxfYgnhUGoI l5oJ0Eir3oGqzub+/rqK5r5BmgcZSlZnO3YFL1KAJIqFbBb8eNzU+skwZ1v1aIDwrLCLlAjyc7tgE DEepLbdKtdxJVJL1ayv4aJd5Vwfqx9H+ca4DkZUKwQwtD0BuPvMqKtPdDP60GaqRFbSSFktpuqHSu kQ4YdC/+6nJU/pzP6GSbWv77l9zcy9JBBYRB6tC5E+YwGAYw/7PIk8zQyJ07dzC2aMQMEQYJfnt9S JTktIxKD+Z6LatnwXG7FOCUMWRmGbzm6REB1MHlgew3Woa9m3fKxTiYhMoZEQf+5XmIv+8GlmAtAV YIhZwZ8A==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRvJJ-0004JM-BE; Fri, 24 Apr 2020 10:11:53 +0000 Date: Fri, 24 Apr 2020 03:11:53 -0700 From: Christoph Hellwig To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, jack@suse.cz, tytso@mit.edu, adilger@dilger.ca, darrick.wong@oracle.com, hch@infradead.org, Alexander Viro , Dan Carpenter , "Aneesh Kumar K . V" , Murphy Zhou , Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: Re: [PATCH 0/5] ext4/overlayfs: fiemap related fixes Message-ID: <20200424101153.GC456@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org I think the right fix is to move fiemap_check_ranges into all the ->fiemap instances (we only have a few actual implementation minus the wrappers around iomap/generic). Then add a version if iomap_fiemap that can pass in maxbytes explicitly for ext4, similar to what we've done with various other generic helpers. The idea of validating input against file systems specific paramaters before we call into the fs is just bound to cause problems.