Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp443588ybz; Fri, 24 Apr 2020 03:12:48 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8LlxiHCNIKhfL2vE1U7HI54/TfV7qxGiqKW9HTZwUZpkZWoYss6p61bZ5MQt9ji0ccbYm X-Received: by 2002:a17:907:41b6:: with SMTP id na6mr6284154ejb.119.1587723168506; Fri, 24 Apr 2020 03:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587723168; cv=none; d=google.com; s=arc-20160816; b=Nyd5aHQKRKypYPatu4ngYxuy3ke2LpGH5/h4dLoJx2/fbSypht2o//L/G2xtVGKZU/ fSCiuIuYktKTh2gP245hGqNpker8Gj9MZRDddrnsX8d9nGBY4Tzo9sFtWZ9ouupiOs1t WH9CRHS4+ewW3R+1mmZBt4yB6Mtr9xT5Svvs8LwDhHO1XdrHEhoBptKUJfPoDB/E/qEb IokmA34F38uCq/gbb7zWUGeN+ooG8LiRdPtrUDw+xe6rCR/a94S8sirpc59zBHPVO5zI nENVFz8oscWV50Y+mxFMCd5jwrE/aErFRhgZy4Wa0VX3r3w/14ROu2rrG+hpgr+Qulrx ggLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=63eqvaxZAp7OS4S7rYpQU2Q5xJodUR5sgvC2fkZKUPw=; b=HpEoFMCtcgTYn2lxngapcJsObh7aBj8dhucPKzXSA6e7IzgBdZ+J2NVRyIl0Ds5V2z qE18T3fRlZOXODndHeDBI4NtCxJAxp9/hSepYT3fFfJHGTeYlcPoiqenFfhGrvm7SLvW zLPHv3mSNS2Gx7wg6Nrui5Mb+MIB28Rz4Ak+5oTV39CxZTaOQ9mSB7lA0tTNbca3eCNm kZvmlZw+kQxvtJBcGtgFIcFH7SMRAqkGHUasTicHI5QVNbrRUQKIF3HeIX3c7Ppvr6zw 5xiBI6+NT1C8Wo9TyP7ghS3zdSPfI21gUMiP/MX0S9Hr6oSmR3WNOBRptBrOfXiwjNEC 2Sdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jVQVA2Uy; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si2876559ejb.508.2020.04.24.03.12.24; Fri, 24 Apr 2020 03:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jVQVA2Uy; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726866AbgDXKLy (ORCPT + 99 others); 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.