Patch 1 was sent on October 2 as "ext2fs: Delegate metadata sync to WAL
and fix shutdown hang" and is unchanged.  It is resent here because
patch 2 builds on it: patch 1 makes diskfs_set_hypermetadata () open a
journal transaction, and patch 2 uses that transaction to journal the
superblock write.  Patch 2 does not apply cleanly, build or work without it.

Patch 2 changes how the rest of ext2fs talks to the journal.  Until now
the journal was told about a block only after the fact that the block had
been modified.  Now every metadata edit is announced before it happens
(journal_get_write_access ()) and closed when it is done
(journal_mark_dirty ()), as in ext4's jbd2.  Every edit runs inside the
calling thread's transaction handle, which journal_thread_transaction ()
returns.

dir.c is not converted yet; directory blocks reach disk outside the
journal, as they did before this series.  ext2fs edits them through the
directory's file-pager mapping rather than the disk cache the journal
copies from, so journaling them needs new journal entry points that
take the block image from the caller's mapping and intercept pager
writes of the block until commit.  That will come as a separate patch,
which is in the works.

Milos Nikic (2):
  ext2fs: Delegate metadata sync to WAL and fix shutdown hang.
  ext2fs: Make journal pre-notify.

 ext2fs/balloc.c   |  10 +++-
 ext2fs/ext2fs.h   |  72 ++++++++++++++++---------
 ext2fs/getblk.c   |   8 +++
 ext2fs/hyper.c    |  32 ++++++++---
 ext2fs/ialloc.c   |  11 +++-
 ext2fs/inode.c    |  20 +++++--
 ext2fs/journal.c  | 133 ++++++++++++++++++++++++++++++++++++----------
 ext2fs/journal.h  |   2 +-
 ext2fs/orphan.c   |  66 ++++++++++-------------
 ext2fs/truncate.c |   7 +++
 ext2fs/xattr.c    |   9 ++++
 11 files changed, 265 insertions(+), 105 deletions(-)

-- 
2.56.0


Reply via email to