Skip to content

Commit a44ad68

Browse files
harshadjstytso
authored andcommitted
ext4: describe fast_commit feature flags
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> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20201106035911.1942128-2-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 7067b26 commit a44ad68

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎Documentation/filesystems/ext4/journal.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ which is 1024 bytes long:
256256
- s\_padding2
257257
-
258258
* - 0x54
259+
- \_\_be32
260+
- s\_num\_fc\_blocks
261+
- Number of fast commit blocks in the journal.
262+
* - 0x58
259263
- \_\_u32
260264
- s\_padding[42]
261265
-
@@ -310,6 +314,8 @@ The journal incompat features are any combination of the following:
310314
- This journal uses v3 of the checksum on-disk format. This is the same as
311315
v2, but the journal block tag size is fixed regardless of the size of
312316
block numbers. (JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3)
317+
* - 0x20
318+
- Journal has fast commit blocks. (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT)
313319

314320
.. _jbd2_checksum_type:
315321

‎Documentation/filesystems/ext4/super.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,13 @@ following:
596596
- Sparse Super Block, v2. If this flag is set, the SB field s\_backup\_bgs
597597
points to the two block groups that contain backup superblocks
598598
(COMPAT\_SPARSE\_SUPER2).
599+
* - 0x400
600+
- Fast commits supported. Although fast commits blocks are
601+
backward incompatible, fast commit blocks are not always
602+
present in the journal. If fast commit blocks are present in
603+
the journal, JBD2 incompat feature
604+
(JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT) gets
605+
set (COMPAT\_FAST\_COMMIT).
599606

600607
.. _super_incompat:
601608

‎fs/ext4/ext4.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,13 @@ static inline bool ext4_verity_in_progress(struct inode *inode)
18631863
#define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010
18641864
#define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020
18651865
#define EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200
1866+
/*
1867+
* The reason why "FAST_COMMIT" is a compat feature is that, FS becomes
1868+
* incompatible only if fast commit blocks are present in the FS. Since we
1869+
* clear the journal (and thus the fast commit blocks), we don't mark FS as
1870+
* incompatible. We also have a JBD2 incompat feature, which gets set when
1871+
* there are fast commit blocks present in the journal.
1872+
*/
18661873
#define EXT4_FEATURE_COMPAT_FAST_COMMIT 0x0400
18671874
#define EXT4_FEATURE_COMPAT_STABLE_INODES 0x0800
18681875

0 commit comments

Comments
 (0)