Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3288450pxb; Tue, 12 Jan 2021 10:45:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeFQNWFCde910Iki7NQq8yeOxboOLW2CjfB5MtzjoTezYDmXjyFGl7pBPmyBZINpfBI6My X-Received: by 2002:aa7:c9cf:: with SMTP id i15mr404141edt.296.1610477145110; Tue, 12 Jan 2021 10:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610477145; cv=none; d=google.com; s=arc-20160816; b=J4SAKEh6ONQNFJiL3CvHh06M83LD2lOivKGDXEOrvcXlHL1P3W5G9yO8DNHXkrMluw yrbV2tWXg0qe296ts7rMqkYiht8OBUEkZQV+N9CLISLZSZHmVhNHW0/Cj7XPy7UDivMH kN28LIZCnqcdFWvQCb2uLufSjNh9y5Ns8mKP4JdzhBJpXi+MebLwCT4uSFfcdREgN3b/ 3gHpOEATGbSi0/BNsI5nshUtd5oldkgnBhFgU+Binmv1Jqo/D3XqP6t/r3UN/Y4TYp3E ee6XBufKrCynPQfDPP8SY8cH79QnvXPr+U7NznrIGqUsZJbfTaBnZRhuC3DuvxXDN56f 5FTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ouV8q9+PTUftcxRx8suqz3Pt46rr9u55Qwc5eoB9EWs=; b=0ot07qrCEWsOjq+OzwyUlZgBqa5A2+MTtRTMhCutHKKymGCCGvkmqcT65BlJPmqVDU OTZCrrHBX8oOKbWBktjAl5R5kzCwvJCU3xh9jN+F9I1zsfQn4qMxWlutU3GhoJBjDDzh NB32fd8EDre/V3RMp1xz+BlGg1ZZOXrOCpgX/GpWV1q5/WDcb/mcPklYVQUOW89Yt1l3 P+Iu3A85HxUEvPjZqyYO6LL59kbBcpaAXYZS2kBFCPXBd3zDssZR1eI8/yake3v9cP77 ufgDP3PKWJ2GPecaXnqpeExR4Gd1fSSeyUKkDr3PnG/F0CwxuamaHzuYnyzvM19dIZzs qrfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=a9dsEmwc; 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 r6si1469333ejb.640.2021.01.12.10.45.21; Tue, 12 Jan 2021 10:45:45 -0800 (PST) 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=pass header.i=@infradead.org header.s=casper.20170209 header.b=a9dsEmwc; 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 S2392160AbhALSof (ORCPT + 99 others); Tue, 12 Jan 2021 13:44:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728814AbhALSoe (ORCPT ); Tue, 12 Jan 2021 13:44:34 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EFA3C061575; Tue, 12 Jan 2021 10:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=ouV8q9+PTUftcxRx8suqz3Pt46rr9u55Qwc5eoB9EWs=; b=a9dsEmwcFBYk5KRd9MJAYDC+L7 kBhJ/E8w/SrixuwI3x8Q6AzWMA97H4rS7B7Vx5Bqv+RdBP5W5BB+2w2Ti0pVGVeARU2HoOK9o8HtL rPOnLEMTPIa+mvC0l0dzhX0JO9V6uhFsb9zSLwUH2An7Gi4rAcfzVwLADxbbVEszGkO+INTmu4EWU /n/gRDU3VhIks8huG8Ji5mzSdu2a7ln2WZhw5J3voZWL/clq01ND2FaXGnedzQf+tj3HbYsfqvP5z 6sXxTQXAgTe9nTEu9j4StkGpFZAThX496OlhESHYBwPKg1btB99j/GWBRlweul51W8nNYd2NYfGtg NkKi5Lnw==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1kzOdn-005CNS-OA; Tue, 12 Jan 2021 18:43:44 +0000 Date: Tue, 12 Jan 2021 18:43:39 +0000 From: Christoph Hellwig To: Andreas Dilger Cc: Christoph Hellwig , Avi Kivity , Andres Freund , "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten extents? Message-ID: <20210112184339.GA1238746@infradead.org> References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> <20210104181958.GE6908@magnolia> <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> <20210112181600.GA1228497@infradead.org> 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 casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jan 12, 2021 at 11:39:58AM -0700, Andreas Dilger wrote: > > XFS already has a XFS_IOC_ALLOCSP64 that is defined to actually > > allocate written extents. It does not currently use > > blkdev_issue_zeroout, but could be changed pretty trivially to do so. > > > >> But note it will need to be plumbed down to md and dm to be generally > >> useful. > > > > DM and MD already support mddev_check_write_zeroes, at least for the > > usual targets. > > Similarly, ext4 also has EXT4_GET_BLOCKS_CREATE_ZERO that can allocate zero > filled extents rather than unwritten extents (without clobbering existing > data like FALLOC_FL_ZERO_RANGE does), and just needs a flag from fallocate() > to trigger it. This is plumbed down to blkdev_issue_zeroout() as well. XFS_IOC_ALLOCSP64 actually is an ioctl that has been around since 1995 on IRIX (as an fcntl).