Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp380163pxj; Fri, 7 May 2021 10:34:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYXKsHhYlFchfGg0igPzW1t7cw9Ug23I0AB+nspJ5n44MB7GwahAp4ufOu6RG8So8MVoEE X-Received: by 2002:a63:2c81:: with SMTP id s123mr11034007pgs.168.1620408895779; Fri, 07 May 2021 10:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620408895; cv=none; d=google.com; s=arc-20160816; b=m/ofkTqder0oZGygAid2H+vCyQfxBNzLROL11hODber6D0Zbc0Zv7YMN/lZ1r+WmHk bht3GWOP5X7VX9j7+nHRYHqd4ZkKOilyRscUGxbgYl+wdsdZjzo5iKkSX7awrDUcPN70 LEl1sDX2XcJh5R8bNzzMb+VGi3lcpRQsT+el11F2ROk9535Y7yYBb9olc4i9Kd62aP6o NLwWCacaoeiucTdHWOocN7Zj3SjOvbE6wbZGfvwwGqnUAAweAq88XW9svMicSF8k328/ FLVPb1TEE8WVYz/bO6YJG29TsKdaWrzsSlHAnRpkVLdVycEl9w3gJ4AEam7KZ7NeRPrK fuRg== 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=EK8C3eLLCqVzkewkDe363DVBUf8lJyQzx2wasTTuUsA=; b=NxHtxcvS4uwhiSiC44MhKZMWPWOTdPBjUbLMlfdeDDd1mrTOfG7r4H9I0Y/5VN08Hd JPMWlLpbeq4za5+9uf0+ZVGRAgmTasbcDoBxMFvidG/mWCGzQHP4APsnRW3fWoRg/zJo bI3jQFEM9k9H/jYQNy0hQOAa8lG4l51syIRq6XPGRIAkwYFUv+XdeUH85oLDKNmhtfo5 AZyFZlj6hiXV/CQ9ftbpuJd7Hdd8pNZmdShR3FbpOT1Az/KyUCXTP5yWcdk0GC9LATN2 kH7gncFLjfmm0N9UTHdQhVGVzsucR9RWxydZCtFCBfT5Q/Afka5IzlzSTYoXduLrqYSx 7skg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p+KXtU+d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nu9si6778218pjb.111.2021.05.07.10.34.42; Fri, 07 May 2021 10:34:55 -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=pass header.i=@gmail.com header.s=20161025 header.b=p+KXtU+d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238084AbhEGQXi (ORCPT + 99 others); Fri, 7 May 2021 12:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236633AbhEGQXh (ORCPT ); Fri, 7 May 2021 12:23:37 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEF8FC061574 for ; Fri, 7 May 2021 09:22:37 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id n15so6273172edw.8 for ; Fri, 07 May 2021 09:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EK8C3eLLCqVzkewkDe363DVBUf8lJyQzx2wasTTuUsA=; b=p+KXtU+d3ZwvZqRkFzth7VcgK5pvfNqrgm7OO37c6y/PEeDiVkKxsozWetL9BIypFh +IhVXEIKd+2u24i0wrUJceSe5viSbkLVaANlBYRAA4y/vpVkNIpECgQwB87nOPnVPfS2 NVhJziW+pVWdMJPVn2VKF0qVtxHm+4yKVgOaEnYtqI6ociyOjDpAIAS4Uk8N+TAjfwuk nQYs6u8CEOB4qChniuteDHUwG8B9fnXHITQJs/db3HJvoPkzxt14dJil32toMzRywXHP Wv1UB9xizZ7C30M/Cr09owEUo+spKT7+4l6YlXe0QR0Cn0zP7oUV5/AleEvT014YLJgG IuHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EK8C3eLLCqVzkewkDe363DVBUf8lJyQzx2wasTTuUsA=; b=NHRFuaW9UHnNQUjkzIA25ci+jj09opFcsx51Fc18K5oEGGaOYyFaDvDJLeLDw2cQZX h/i7AH+ANFQavvq98QLkndsL8o6hzPDZDbmCXgwX6bgGd/yLLzxC+IOB/Z5gkGr5E8/m 0LvhXupT9M1gAkwjfUmF2+4CvvGQb3WMFCYYKAYOJYCtW//0xS374IsVHGHy/VuoaqFj TjWlSzsDKLk8IzWq6h84DmfqWeBrWDHl5mlYVX4YPVfVeSaSoXvN/EdNYxaYuptJqiby b87q/ORujF/Q+a0gc95fhQaizFROh3mMEXNBWfikekFd4A+n9Rp8HCldrpx9nspvcVFU yPSw== X-Gm-Message-State: AOAM533PAnx/FiL4ZXlhjmY9Mqk3u0QqIBbPdk8AfI+kHSwQ7aAccxzY uw0XFuzOx0YyEYgDWR7wiqVdTTl1INN3b5xAdo8= X-Received: by 2002:a05:6402:2d6:: with SMTP id b22mr12483931edx.274.1620404556411; Fri, 07 May 2021 09:22:36 -0700 (PDT) MIME-Version: 1.0 References: <20210504163550.1486337-1-leah.rumancik@gmail.com> <20210504163550.1486337-2-leah.rumancik@gmail.com> <20210505212711.GA8532@magnolia> <20210505220844.GD8532@magnolia> <20210506155853.GF8532@magnolia> In-Reply-To: From: harshad shirwadkar Date: Fri, 7 May 2021 09:22:24 -0700 Message-ID: Subject: Re: [PATCH v3 2/3] ext4: add ioctl EXT4_IOC_CHECKPOINT To: Leah Rumancik Cc: "Darrick J. Wong" , Ext4 Developers List , "Theodore Y. Ts'o" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > > > > > + err = jbd2_journal_flush(EXT4_SB(sb)->s_journal, > > > > > > Huh. So we don't flush the filesystem at all, just the journal? I > > > don't see anything in the documentation saying that syncfs() is a > > > prerequisite. > > This is just for the journal, good point, I'll update the documentation. It just occurred to me this morning that we need to ensure that a *full* commit happens before IOC_CHECKPOINT and not a *fast* commit. Fast commits cannot be checkpointed, they rely on full commits for checkpoint operation. So, if a syncfs call results in a fast commit, the following sequence of events will happen: * Ext4 writes fast commit information in fast commit area * When user calls EXT4_IOC_CHECKPOINT, the checkpoint operation would result in checkpointing everything in the main journal, except things written in fast commit area * During the discard phase of EXT4_IOC_CHECKPOINT, fast commit area will be discarded and thus we'll lose the log updates present in the fast commit area However, this isn't a problem today. Syncfs doesn't result in a fast commit but results in a full commit. But, that can change at some point in the future. So, unless we can either come up with syncfs() variant that can induce a full commit (which would be a little ugly - I don't think the user needs to know what kind of journal commit file system is doing) or add checkpointing support in fast commits, we should just do a full commit from the IOCTL code. - Harshad