This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hurd".

The branch, master has been updated
       via  cb8bb9fbab7eadfb56a6ad268cb84e3a97ee6732 (commit)
       via  cbb7243b340d9a26527590c17367d44a9a80b4f7 (commit)
       via  45edb64016b4a148b5a36a9bc9ea2de8e6c8dc4f (commit)
       via  b70a717d849eb97d4191e477b29792dd1ea97473 (commit)
      from  13c0e770375d0e0eff3f073f2474df6dfbfeef20 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cb8bb9fbab7eadfb56a6ad268cb84e3a97ee6732
Author: Milos Nikic <[email protected]>
Date:   Tue Oct 20 20:30:18 2026 -0700

    ext2fs: Check the journal's features, and declare revoke records
    
    The journal writes revoke records, but never set
    JBD2_FEATURE_INCOMPAT_REVOKE in the journal superblock.  That flag is
    incompatible on purpose: a journal implementation that does not know
    revoke records must refuse to replay the log rather than replay it
    wrongly.  A journal made by mke2fs has it, one made otherwise may not.
    ext4 sets it when it loads a journal.  Set it too when the journal
    starts, and flush it before the first commit.
    
    The journal also writes 32-bit block tags without checksums, but never
    looked at the journal superblock's features.  A journal with 64-bit
    tags or checksums, which recent mke2fs versions make by default, got
    records that e2fsck misreads.  journal_check, which replaces
    journal_log_is_empty, now also reports such a journal: any compat,
    ro_compat or incompat feature other than revoke, or a V1 superblock,
    which has no feature fields.  A log that is not empty still keeps the
    filesystem read-only, whatever its features, as only e2fsck can replay
    it.  With an empty log, the filesystem is used without a journal, with
    a warning, as ext2fs did before it had one, rather than kept
    read-only: a root filesystem made that way must still boot.
    Message-ID: <[email protected]>

commit cbb7243b340d9a26527590c17367d44a9a80b4f7
Author: Milos Nikic <[email protected]>
Date:   Tue Oct 20 20:30:17 2026 -0700

    ext2fs: Free the journal when it stops
    
    Since the journal stops when the filesystem goes read-only and starts
    again when it becomes writable, every such cycle left the old journal
    behind: its buffer and intercept pools, its maps and buffers, and a
    reference on the journal inode.  kjournald's thread
    exited but was never joined, so its stack and thread state stayed too,
    and its thread id was a single static, overwritten by the next
    journal.
    
    Once journal_quiesce_checkpoints has emptied the log,
    diskfs_journal_shutdown now frees all of it: it wakes and joins
    kjournald, frees the empty running transaction that a commit keeps
    open, the map of logged blocks, the pools, the superblock, descriptor
    and commit buffers and the journal's block map, and releases the
    journal inode.  When quiescing fails, the journal is kept with its
    transactions, as before.
    
    The journal_t itself, with its lock and condition variables, is kept.
    A pager thread may have read ext2_journal just before it was cleared,
    and still take the lock.  With no transaction left it finds nothing to
    do, and what is freed is only reached through a transaction or by the
    commit, checkpoint and superblock code, which no longer runs.  Each
    cycle thus costs a few hundred bytes instead of the pools.
    
    Tested with read-only and writable cycles of a mounted filesystem
    (fsysopts --update --readonly, then --update --writable), each after a
    burst of writes, with a loop reading files on the same filesystem
    throughout, so that pager threads entered the journal during every
    switch.  Without this change the translator's virtual size grew by about
    10 MB per cycle (636M, 646M, 657M, 667M, 677M), with the intercept pool
    then at 2048 chunks; with it, it stayed flat (637M to 642M over 14
    cycles, the growth coming from the node cache during the first rounds),
    and the thread count stayed constant.
    Message-ID: <[email protected]>

commit 45edb64016b4a148b5a36a9bc9ea2de8e6c8dc4f
Author: Milos Nikic <[email protected]>
Date:   Tue Oct 20 20:30:16 2026 -0700

    ext2fs: Run the journal only while the filesystem is writable
    
    ext2fs does not replay a journal; e2fsck does.  But ext2fs loaded the
    journal superblock at mount, read-only or not, and kept that state.
    The root filesystem is mounted read-only, e2fsck then replays the
    journal and resets its superblock, and the remount read-write kept
    writing at the old log head with the old sequence numbers.  After the
    next crash e2fsck finds the log out of sequence at its tail and stops,
    so every transaction since that boot was lost.  And a filesystem
    mounted writable with a log that was never replayed had that log
    overwritten.
    
    Start the journal only when the filesystem is writable: at a writable
    mount, or in diskfs_readonly_changed when it becomes writable, from the
    journal superblock as it is on disk then.  When it becomes read-only,
    shut the journal down like a clean unmount does, as ext4 does on a
    read-only remount: the log is checkpointed and emptied and the
    needs_recovery flag cleared, while the store is still writable.  The
    root filesystem's remount read-only at shutdown thus leaves it clean.
    
    While the journal is not running, look at its log at mount and on each
    remount (diskfs_reload_global_state, which "fsysopts --update" reaches
    while the filesystem is read-only).  If the log holds transactions that
    were never replayed, keep the filesystem hard read-only, with a
    warning, so that switching it to writable fails with EROFS until e2fsck
    has replayed the log and a remount finds it empty.  A writable mount of
    such a filesystem comes up read-only.  On a normal boot the root is
    read-only until checkroot.sh has run fsck and remounted it, so nothing
    changes there; in the install case, where runsystem makes the root
    writable before fsck, it drops to single user when the log is not
    empty.
    Message-ID: <[email protected]>

commit b70a717d849eb97d4191e477b29792dd1ea97473
Author: Milos Nikic <[email protected]>
Date:   Tue Oct 20 20:30:15 2026 -0700

    ext2fs: Keep the needs_recovery flag on disk while the journal has data
    
    e2fsck replays the journal only when the superblock's needs_recovery
    flag is set, and ext2fs does not replay it itself.  The flag was set
    in diskfs_set_hypermetadata the first time the filesystem was dirtied,
    which happens lazily, and the superblock then went through the
    journal.  So kjournald could commit transactions while the superblock
    on disk still said that nothing needed recovery, until block 0 was
    checkpointed or written by the pager.  A crash in that window left
    e2fsck with "needs_recovery flag is clear, but journal has data": with
    -y it replays anyway, but in preen mode PR_0_JOURNAL_RUN is not
    PR_PREEN_OK and the boot stops for a manual fsck.  On clean shutdown,
    the flag was cleared before the journal had been checkpointed and
    emptied, and also on a goaway that then failed with EBUSY, leaving the
    filesystem mounted and journaled with the flag clear.
    
    Follow ext4: the flag is on disk whenever the log may hold
    transactions, and is cleared only once the log on disk is empty.
    ext2_set_needs_recovery sets it when the journal starts on a writable
    filesystem and when such a filesystem becomes writable, before
    anything is journaled.  It reads the superblock from disk, sets only
    the flag there, writes it back and flushes, outside the journal; the
    rest of the in-memory superblock may hold changes that are not
    committed yet.  diskfs_journal_shutdown clears the flag the same way
    with ext2_clear_needs_recovery, after quiescing has emptied the log and
    the journal superblock is flushed, and leaves it set when quiescing
    failed.  diskfs_set_hypermetadata no longer touches it.
    Message-ID: <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ext2fs/ext2fs.c      | 106 +++++++++++++++++++++++++++++----
 ext2fs/ext2fs.h      |  14 +++++
 ext2fs/hyper.c       | 119 +++++++++++++++++++++++++++++++++----
 ext2fs/jbd2_format.h |  15 +++++
 ext2fs/journal.c     | 163 +++++++++++++++++++++++++++++++++++++++++++++++----
 ext2fs/journal.h     |  15 +++++
 6 files changed, 398 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Hurd

Reply via email to