linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, jack@suse.cz,
	Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH 01/10] ext4: describe fast_commit feature flags
Date: Sat, 31 Oct 2020 13:05:09 -0700	[thread overview]
Message-ID: <20201031200518.4178786-2-harshadshirwadkar@gmail.com> (raw)
In-Reply-To: <20201031200518.4178786-1-harshadshirwadkar@gmail.com>

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 <jack@suse.cz>
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 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


  reply	other threads:[~2020-10-31 20:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 20:05 [PATCH 00/10] Ext4 fast commit fixes Harshad Shirwadkar
2020-10-31 20:05 ` Harshad Shirwadkar [this message]
2020-11-03 10:33   ` [PATCH 01/10] ext4: describe fast_commit feature flags Jan Kara
2020-10-31 20:05 ` [PATCH 02/10] ext4: mark fc ineligible if inode gets evictied due to mem pressure Harshad Shirwadkar
2020-11-03 14:13   ` Jan Kara
2020-11-03 18:33     ` harshad shirwadkar
2020-11-04  9:52       ` Jan Kara
2020-10-31 20:05 ` [PATCH 03/10] ext4: pass handle to ext4_fc_track_* functions Harshad Shirwadkar
2020-11-03 14:46   ` Jan Kara
2020-11-05  1:53     ` harshad shirwadkar
2020-10-31 20:05 ` [PATCH 04/10] ext4: clean up the JBD2 API that initializes fast commits Harshad Shirwadkar
2020-11-03 16:29   ` Jan Kara
2020-11-04 19:52     ` harshad shirwadkar
2020-11-05 10:30       ` Jan Kara
2020-11-05 12:44         ` Jan Kara
     [not found]           ` <CAE1WUT6oxiKtrdF6vzLv5vYFxPjefRhzDE2xfQGF6CqQQdPv1Q@mail.gmail.com>
2020-11-06  3:02             ` harshad shirwadkar
2020-10-31 20:05 ` [PATCH 05/10] jbd2: fix fast commit journalling APIs Harshad Shirwadkar
2020-11-03 16:38   ` Jan Kara
2020-11-04 21:25     ` harshad shirwadkar
2020-10-31 20:05 ` [PATCH 06/10] ext4: dedpulicate the code to wait on inode that's being committed Harshad Shirwadkar
2020-11-03 16:42   ` Jan Kara
2020-11-04 21:35     ` harshad shirwadkar
2020-10-31 20:05 ` [PATCH 07/10] ext4: misc fast commit fixes Harshad Shirwadkar
2020-11-03 16:52   ` Jan Kara
2020-11-06  3:07     ` harshad shirwadkar
2020-10-31 20:05 ` [PATCH 08/10] ext4: fix inode dirty check in case of fast commits Harshad Shirwadkar
2020-11-01  7:09   ` Andrea Righi
2020-11-03 16:58   ` Jan Kara
2020-10-31 20:05 ` [PATCH 09/10] ext4: disable fast commit with data journalling Harshad Shirwadkar
2020-11-03 17:01   ` Jan Kara
2020-10-31 20:05 ` [PATCH 10/10] ext4: issue fsdev cache flush before starting fast commit Harshad Shirwadkar
2020-11-03 17:02   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201031200518.4178786-2-harshadshirwadkar@gmail.com \
    --to=harshadshirwadkar@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).