Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2244149pxx; Sat, 31 Oct 2020 13:06:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz439X+5xQ0oMGzNeMlSjYAUFx+KjHlaxi1gqsMpD718COuBSczk0yHObFSwu68B0glnpp X-Received: by 2002:aa7:da16:: with SMTP id r22mr9073518eds.68.1604174788986; Sat, 31 Oct 2020 13:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604174788; cv=none; d=google.com; s=arc-20160816; b=JUuP5HfX6kXVhQorfY+BdQcVAhG+TuZS0Qtwm7imaInGyqOS9hSJgL5XMqtQ8Kn9sl dkXqXUjlajDh4nHx6/+r8gtxIyWpkPKOgedJav0ieERQhW6ZUXGTQuh0I2abw/DcEyfK cNNaQLcr6PEu+72mhj85lre2jiFw+OvAXXTFFn9FIkJXnSt/qZxwBhMJbB71Wq8BUeip kMyFYG7fM/HA3HpIM9HM4TJ+gqAj1p1qLqQJif9/t+CbUZi8HL39xTrNEwyDahGbEzxa bjFHNEd7uG0Z3RvF5p95l4AVJyBb2KeApbNiCMfqKL6FVUip/7uJznZafGYJlwWKf+G6 WplQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o5bljzUCNVJH27l4iRKZz07B9nzI0+7vnypubYcKy/Y=; b=TvmodPF5ZpD0S0Q2+/BY+Rk1XF5k6V8I+pcwHRMefALkAjyWcrfJSP4MaAcYvop4NX gImspPBR+GBRpHWdwD/IwKjJ1S9melSpNW2MFw/a4XhqBT+p7cQUwxQc4X1edk4nvKn0 rvzB9QCEseA5GvrNHnh4Y/KhyeudgIhoH649MdFxo04KN3DdzrEo0QA8xIsIrN4tzvJm 20GQ/NT9y7QRsPI3NI51hhHumYiOt/nCxtq99jxJS8sRk/nadTFC1gIkrR1/4TGyzNl1 Rd1YxykGothJF6ZajgxQ3tURTiGtP+6prhtV/0y3T/465pBHc+JLmtjlQqMkVNxvMTZ5 fwPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H4wnGBRY; 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 bq7si6887334ejb.212.2020.10.31.13.05.53; Sat, 31 Oct 2020 13:06:28 -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=H4wnGBRY; 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 S1728551AbgJaUFl (ORCPT + 99 others); Sat, 31 Oct 2020 16:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728549AbgJaUFl (ORCPT ); Sat, 31 Oct 2020 16:05:41 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4265AC0617A6 for ; Sat, 31 Oct 2020 13:05:41 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id g19so685376pji.0 for ; Sat, 31 Oct 2020 13:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o5bljzUCNVJH27l4iRKZz07B9nzI0+7vnypubYcKy/Y=; b=H4wnGBRYxXAA4vlsScB67tJ0OpUgLzi7ezHfQGU7O7ziIpR5An4KIT1oP0McOzfZuP h8f+O84B0oQm8ri1t/ToYfeTWM+Zz0jXTS/HVO8WjjQQ4eH9+nZDizNMOP0B5OYLIoIv uVluOxvL+5+obZBINglFUztaWAyVJBfQIINrhgqzjskWh8+5S3KYm3+DPJpt5ZCTnQLc S90bb6XvHYzGGkUEYYDI6Am6uzbUFzHPNq+nb4psBIULHnq4DPA+2NxrDvPIUErxRrUl dzVrCKjyYnrwmNS45TLHztPos6cnLh2Lt3XvnzM9jFP80UCrQHRXEqzvI1bKcoUxGLMf e1eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o5bljzUCNVJH27l4iRKZz07B9nzI0+7vnypubYcKy/Y=; b=BKf0EJyzLyxEVPWw1ZjznS85LMurphCU/kz+D/sDOE84yKqgdFIimWB7TgEJBWmN3g UjWjrLHza5SX+V8dwXDyrDOnIMIcqReI3ZrH1iDln7F+QZfgBMlMr/amRNEbNK7+c32N hVc60Rk9RXbNIAMORePiiEQgr+PQVB+X1bPhmyZkEjIUtLllaA5YTc2Apbpo3vN2SN9W W6y72OIxRLBp9lnXzSDUvSdXP9mUuHJVTWhsA/eaiaz6x2jp5E8yMgI05cp1kn5NqrwA VYTLuPMK7Sa+2LSBXFV01kDeAlC8EOfKf7X5T5r6UEePTaVztEV0liEdzw1z+wGmJW0g V1uA== X-Gm-Message-State: AOAM5307FzwUm+dYlzmsgRv3kUUyiLMCIEDcDmpaPE+hB+F59ItDKZP9 y9jzGWt5PgrqGIIgqhkYP1IsV6fhebo= X-Received: by 2002:a17:90a:6901:: with SMTP id r1mr10006176pjj.178.1604174740380; Sat, 31 Oct 2020 13:05:40 -0700 (PDT) Received: from harshads-520.kir.corp.google.com ([2620:15c:17:10:a6ae:11ff:fe11:86a2]) by smtp.googlemail.com with ESMTPSA id t15sm17177102pjq.3.2020.10.31.13.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Oct 2020 13:05:39 -0700 (PDT) From: Harshad Shirwadkar To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, jack@suse.cz, Harshad Shirwadkar Subject: [PATCH 01/10] ext4: describe fast_commit feature flags Date: Sat, 31 Oct 2020 13:05:09 -0700 Message-Id: <20201031200518.4178786-2-harshadshirwadkar@gmail.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog In-Reply-To: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Fast commit feature has flags in the file system as well in JBD2. The meaning of fast commit feature flags can get confusing. Update docs and code to add more documentation about it. Suggested-by: Jan Kara Signed-off-by: Harshad Shirwadkar --- Documentation/filesystems/ext4/journal.rst | 6 ++++++ Documentation/filesystems/ext4/super.rst | 7 +++++++ fs/ext4/ext4.h | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/Documentation/filesystems/ext4/journal.rst b/Documentation/filesystems/ext4/journal.rst index 805a1e9ea3a5..849d5b119eb8 100644 --- a/Documentation/filesystems/ext4/journal.rst +++ b/Documentation/filesystems/ext4/journal.rst @@ -256,6 +256,10 @@ which is 1024 bytes long: - s\_padding2 - * - 0x54 + - \_\_be32 + - s\_num\_fc\_blocks + - Number of fast commit blocks in the journal. + * - 0x58 - \_\_u32 - s\_padding[42] - @@ -310,6 +314,8 @@ The journal incompat features are any combination of the following: - This journal uses v3 of the checksum on-disk format. This is the same as v2, but the journal block tag size is fixed regardless of the size of block numbers. (JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3) + * - 0x20 + - Journal has fast commit blocks. (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT) .. _jbd2_checksum_type: diff --git a/Documentation/filesystems/ext4/super.rst b/Documentation/filesystems/ext4/super.rst index 93e55d7c1d40..2eb1ab20498d 100644 --- a/Documentation/filesystems/ext4/super.rst +++ b/Documentation/filesystems/ext4/super.rst @@ -596,6 +596,13 @@ following: - Sparse Super Block, v2. If this flag is set, the SB field s\_backup\_bgs points to the two block groups that contain backup superblocks (COMPAT\_SPARSE\_SUPER2). + * - 0x400 + - Fast commits supported. Although fast commits blocks are + backward incompatible, fast commit blocks are not always + present in the journal. If fast commit blocks are present in + the journal, JBD2 incompat feature + (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT) gets + set (COMPAT\_FAST\_COMMIT). .. _super_incompat: diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 2337e443fa30..12673f9ec880 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1875,6 +1875,13 @@ static inline bool ext4_verity_in_progress(struct inode *inode) #define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010 #define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020 #define EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200 +/* + * The reason why "FAST_COMMIT" is a compat feature is that, FS becomes + * incompatible only if fast commit blocks are present in the FS. Since we + * clear the journal (and thus the fast commit blocks), we don't mark FS as + * incompatible. We also have a JBD2 incompat feature, which gets set when + * there are fast commit blocks present in the journal. + */ #define EXT4_FEATURE_COMPAT_FAST_COMMIT 0x0400 #define EXT4_FEATURE_COMPAT_STABLE_INODES 0x0800 -- 2.29.1.341.ge80a0c044ae-goog