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: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH 0/7] e2fsck: fast commit recovery path e2fsck changes
Date: Thu, 19 Mar 2020 16:34:26 -0700	[thread overview]
Message-ID: <20200319233433.117144-1-harshadshirwadkar@gmail.com> (raw)

This patch series adds e2fsck recovery path changes for fast commits.
Fast commit blocks are laid out in the reserved journal area. Each
block in fast commit region, corresponds to one inode. It contains
a header, a copy of the inode and any of the following tags or no
tags at all.

* EXT4_FC_TAG_ADD_DENTRY: add dentry to a directory
* EXT4_FC_TAG_DEL_DENTRY: remove dentry from a directory
* EXT4_FC_TAG_CREAT_DENTRY: new inode with corresponding dentry
* EXT4_FC_TAG_ADD_RANGE: add extent to inode
* EXT4_FC_TAG_DEL_RANGE: remove logical range from inode

High level new journal replay looks like this.

- For all fast commit blocks, invoke j_fc_replay() handler to handle
  blocks in SCAN phase.
  - In this phase, ext4 replay handler verifies that fast commit
    header is not malformed. If there's an error, it stops replay
    by marking error in replay state.
- Replay phase
  - In replay phase, for every fast commit block, fast commit tags
    are handled in following order.
    - Directory entry updates (Add / Remove / Create)
    - Data updates for inode in question.

Verified that all the tests pass:
367 tests succeeded     0 tests failed

New fast commit recovery test:
j_recover_fast_commit: : ok

Github: https://github.com/harshadjs/e2fsprogs/tree/fast-commit-submit

Harshad Shirwadkar(8):
 ext2fs: add fast_commit test
 e2fsck/jbd2: fast commit recovery changes
 e2fsck: main replay handler
 e2fsck/jbd2: add fast commit feature in jbd2
 ext2fs: make ext2fs_calculate_summary_stats() visible
 e2fsck: allow rewriting extents of a file
 e2fsck: make recovery.c identical with kernel
 e2fsck: fast commit recovery path e2fsck changes

 e2fsck/e2fsck.h                      |  26 ++
 e2fsck/extents.c                     | 160 +++++++-----
 e2fsck/jfs_user.h                    |   9 +
 e2fsck/journal.c                     | 489 ++++++++++++++++++++++++++++++++++-
 e2fsck/recovery.c                    | 113 +++++---
 lib/ext2fs/ext2_fs.h                 |  46 ++++
 lib/ext2fs/ext2fs.h                  |   1 +
 lib/ext2fs/initialize.c              |  58 +++++
 lib/ext2fs/jfs_compat.h              |   9 +
 lib/ext2fs/kernel-jbd.h              |   7 +-
 misc/tune2fs.c                       |  57 ----
 resize/resize2fs.c                   |   6 +-
 tests/j_recover_fast_commit/commands |   5 +
 tests/j_recover_fast_commit/expect   |  23 ++
 tests/j_recover_fast_commit/image.gz | Bin 0 -> 87787 bytes
 tests/j_recover_fast_commit/name     |   1 +
 tests/j_recover_fast_commit/script   |  25 ++
 17 files changed, 875 insertions(+), 160 deletions(-)

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
-- 
2.25.1.696.g5e7596f4ac-goog


             reply	other threads:[~2020-03-19 23:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 23:34 Harshad Shirwadkar [this message]
2020-03-19 23:34 ` [PATCH 1/7] e2fsck: make recovery.c identical with kernel Harshad Shirwadkar
2020-03-19 23:34 ` [PATCH 2/7] e2fsck: allow rewriting extents of a file Harshad Shirwadkar
2020-03-19 23:34 ` [PATCH 3/7] ext2fs: make ext2fs_calculate_summary_stats() visible Harshad Shirwadkar
2020-03-19 23:34 ` [PATCH 4/7] e2fsck/jbd2: add fast commit feature in jbd2 Harshad Shirwadkar
2020-03-19 23:34 ` [PATCH 5/7] e2fsck/jbd2: fast commit recovery changes Harshad Shirwadkar
2020-03-19 23:34 ` [PATCH 6/7] e2fsck: main fast commit replay handler Harshad Shirwadkar

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=20200319233433.117144-1-harshadshirwadkar@gmail.com \
    --to=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    /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).