Hello,

This series presents fixes and improvements for the journal.
Under load its intercept pool fills and pager writes bypass the journal
("Intercept Pool Full! Bypassing WAL"), and a crash can leave a filesystem
in a state with a corrupted orphan list after a halt right after a large
upgrade.

- Patch 1 lets libpager's write callbacks know whether the kernel keeps
  the pages, which the journal needs.
- Patch 2 fixes the journal handles of the libdiskfs RPCs: deadlocks,
  handles held across data copies, commit errors that were lost, and
  ENOSPC on a full disk while freed blocks wait for a commit.
- Patch 3 keeps the orphan list right for files without links.
- Patch 4 replaces the intercept pool with the transactions' own shadow
  copies, and fixes the journal's crash consistency: ordering of the log
  and of home writes, recovery of the orphan list, error handling, and
  concurrency.  With a journal, ext2fs no longer syncs the pagers
  itself, and leaves durability to the journal.

Tested for several days with a translator in a kill -9 crash loop,
running rm -rf and tar -xf of a large archive, with e2fsck after every
crash: it was clean every time.  Also large apt upgrades followed by an
immediate halt.

Thanks,
Milos


Milos Nikic (4):
  libpager: Tell the write callbacks whether the kernel keeps the pages
  libdiskfs: Fix the journal handles of RPCs
  libdiskfs: Keep the orphan list right for files without links
  ext2fs: Replace the journal's intercept pool, and fix its crash
    consistency

 ext2fs/balloc.c            |   11 +
 ext2fs/ext2fs.c            |    4 +-
 ext2fs/ext2fs.h            |   29 +-
 ext2fs/getblk.c            |   12 +-
 ext2fs/hyper.c             |   30 +-
 ext2fs/ialloc.c            |   21 +-
 ext2fs/inode.c             |   22 +-
 ext2fs/journal.c           | 1741 ++++++++++++++++++++++++------------
 ext2fs/journal.h           |   26 +-
 ext2fs/orphan.c            |   10 +
 ext2fs/pager.c             |  107 ++-
 ext2fs/truncate.c          |   25 +-
 libdiskfs/dir-link.c       |   26 +-
 libdiskfs/dir-lookup.c     |   46 +-
 libdiskfs/dir-mkdir.c      |   19 +-
 libdiskfs/dir-readdir.c    |   10 +-
 libdiskfs/dir-rename.c     |   26 +-
 libdiskfs/dir-renamed.c    |    6 +-
 libdiskfs/diskfs.h         |   17 +-
 libdiskfs/file-get-trans.c |    8 +-
 libdiskfs/file-set-trans.c |   39 +-
 libdiskfs/file-sync.c      |   10 +-
 libdiskfs/fsys-getroot.c   |   14 +
 libdiskfs/init-startup.c   |    6 +
 libdiskfs/io-get-conch.c   |    7 +
 libdiskfs/io-modes-off.c   |    7 +
 libdiskfs/io-modes-on.c    |    7 +
 libdiskfs/io-modes-set.c   |    7 +
 libdiskfs/io-read.c        |   17 +-
 libdiskfs/io-readable.c    |    6 +
 libdiskfs/io-rel-conch.c   |    7 +
 libdiskfs/io-seek.c        |    6 +
 libdiskfs/io-write.c       |   19 +
 libdiskfs/journal.c        |   18 +-
 libdiskfs/node-create.c    |    6 +
 libdiskfs/priv.h           |   15 +
 libpager/data-return.c     |   11 +
 libpager/pager.h           |    7 +
 38 files changed, 1698 insertions(+), 707 deletions(-)

-- 
2.56.0


Reply via email to