Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5655382rwl; Thu, 29 Dec 2022 00:19:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXudqOmjxXmYWt1pTSwmKsaymSLLsRnq0jbr4fp0vV6Kdqi5FKA2DYwBwJDvXvE9A4kRP0lt X-Received: by 2002:aa7:c30b:0:b0:46b:c11:c8d2 with SMTP id l11-20020aa7c30b000000b0046b0c11c8d2mr23717841edq.40.1672301948787; Thu, 29 Dec 2022 00:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672301948; cv=none; d=google.com; s=arc-20160816; b=d7RwcFUl/mj0xxR1TqQ4Nsanb+7kwUWObYRqigBkr14DyDP4aVJPOJNJgi2LSTuJ3S Tqmp0ul0pH8h/1xlC0m7ijuy1lB/HBdwuSCeMDwe7IRvUrObac7vLJZsfq4HtJnj5aTJ 0k7C8KCmKMsZzg+rUDZp0vt/CnRa+zkct7oZUCRbZcVTmbZJ4ZrcZxiqj2wHqWE2wjsf 2ac02wMznBhgrmqPK9mPzFI+FwIP1PgBhJHYJckGehjGfzUJzjAmBWU3QUg0OqQTTbyV FbrJiBlQLBh+45t3rVjeihwaYPbiQZhnV/gFqZJoe1v51XUXrAoZN0/H6o1QBDG+VR71 zHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Wf4Oclx/s2DatfZfaRbzTJQI1IZBAeRXW5JK4LTSla4=; b=AOVHJmoH7S225Upqs9m+MlQCIavCztyTIF16L2a5n6O7ezLyoQOl80E6m/9s3eaV7b wJmnb6wRYGD7jaGDvWTmZBlM0ZgaxySMgUGGrY0rSspcc7TC3NL/LFWb+JHEKjr2Bo/j NaniaDsRB1bYDkVqzqzGYuatEjWRPBlrYmhFCD3FKaS8ShPpeLdN8ISoV1utsp3tSovo 0d7oZNlOSHrjpWq6qnBc0aSep0SkXJNTrxCd+1Vx3mvuX/2DzbBkQ0AGtaFrxYvGa00l vycnK1/3UXapCaP8UIDi65rAeeluziFtNrkKnkQk3mYsfGpdlKUlFmXqfBASH7ALReIM fKIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NU2n1cZS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a0564021f0e00b00484a8ab76d1si8907309edb.251.2022.12.29.00.18.44; Thu, 29 Dec 2022 00:19:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NU2n1cZS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233214AbiL2IQb (ORCPT + 99 others); Thu, 29 Dec 2022 03:16:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbiL2IPw (ORCPT ); Thu, 29 Dec 2022 03:15:52 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9674913DCF for ; Thu, 29 Dec 2022 00:14:37 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id x22so43400148ejs.11 for ; Thu, 29 Dec 2022 00:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Wf4Oclx/s2DatfZfaRbzTJQI1IZBAeRXW5JK4LTSla4=; b=NU2n1cZSHmMnwavRmjaGTIOlZm9KKoVlTctPjkyNTmZUljpRpEn9h6P8v4Hs9lilpI mkCIQ2k2l/xfRvQXQ69rAtGkTcoyANDRbInSespNg/TQMBEiJJphNIESLhmtweJP/7+h Wp7m19/xGESByGcjrF6tidvzavgdhhzaF0/Yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wf4Oclx/s2DatfZfaRbzTJQI1IZBAeRXW5JK4LTSla4=; b=u1PIm49MenL8X97mAVWNyDyedU2GY/xejiypU+y0lRulFNWTXO0hW62AhB/mxxtIT1 ZpD2XUR+9FFGJk5PVg1eGZuuhEDV+JJWGA74h4OxFJLBQvTNMAUk+KmC1nQtl44110L2 RaXeiqOhbXFNGPu5lINE/eJhS6nuvsedUDBzdC21yDFdwidwJLQ6BfMd4fDRwhiefgeM /v/cpe4t6a9gTAeNklORZyhKSYxiPGfKF1EOEV1WDupOfV+WOkJk4EEXoCjv+1IcqIaf 7JW4BmdUzA9OmsLvth9aX2nUbtrOnEIn0xg12N0m5RMppdaHiALIIg8Ve6resSnYZ9Xz Y5Hg== X-Gm-Message-State: AFqh2kqiux6jRzT9qXHD6F5VgtM5LSNaOV9I/hf8EkrzhayWYPxJDkg7 u5EMtKbndN2QFSZdp8JPNvRlnN3ozk6X1DtYl5lBOA== X-Received: by 2002:a17:907:c013:b0:7c0:eb3c:1037 with SMTP id ss19-20020a170907c01300b007c0eb3c1037mr2068068ejc.663.1672301676050; Thu, 29 Dec 2022 00:14:36 -0800 (PST) MIME-Version: 1.0 References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-5-sarthakkukreti@google.com> In-Reply-To: From: Sarthak Kukreti Date: Thu, 29 Dec 2022 00:14:25 -0800 Message-ID: Subject: Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION To: Christoph Hellwig Cc: dm-devel@redhat.com, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Jens Axboe , "Michael S . Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Alasdair Kergon , Mike Snitzer , "Theodore Ts'o" , Andreas Dilger , Bart Van Assche , Daniil Lunev , Evan Green , Gwendal Grignou Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Sep 23, 2022 at 1:45 AM Christoph Hellwig wrote: > > On Tue, Sep 20, 2022 at 10:54:32PM -0700, Sarthak Kukreti wrote: > > [ mmc0blkp1 | ext4(1) | sparse file | loop | dm-thinp | dm-thin | ext4(2) ] > > > > would be predicated on the guarantees of fallocate() per allocation > > layer; if ext4(1) was replaced by a filesystem that did not support > > fallocate(), then there would be no guarantee that a write to a file > > on ext4(2) succeeds. > > a write or any unlimited number of writes? (Apologies for the super late reply!) In this case, even a write won't be guaranteed if we run out of space on the lower filesystem. Looking at the fallocate() man page, I think the key part lies in the following phrase (emphasis mine): ``` After a successful call, subsequent writes into the range specified by offset and len are guaranteed not to fail _because of lack of disk space_ ``` So, it's not a blanket guarantee that all writes will always succeed, but that any writes into that range will not fail due to lack of disk space. As you mentioned, writes may happen out-of-place in one or more layer. But the fallocate(FALLOC_FL_PROVISION) ensures that each layer will preserve space for writes into that range to not fail with ENOSPC (so eg. ext4 and dm-thinp will set aside enough extents to fulfil that promise later on for all writes). Best Sarthak