Auke Kok c042bf68a7 Fix incomplete freed list head recovery in dirty_alloc_blocks
dirty_alloc_blocks saves the freed list state before modifying it so
it can roll back on error.  But it only saved the block_ref (blkno
+ seq), not the full alloc_list_head which also includes first_nr,
total_nr, and flags.

When the freed list's head block is nearly full, dirty_alloc_blocks
forces allocation of a new empty head block. It zeros alloc->freed.ref
and sets alloc->freed.first_nr = 0.  dirty_list_block then sees the
empty ref, allocates a fresh block, and updates alloc->freed.ref to
point at it. first_nr = 0 correctly describes that new empty block. All
good so far.

If the subsequent avail dirty_list_block fails, the error path restores
alloc->freed.ref to orig_freed but leaves alloc->freed.first_nr at 0.
The original head block still holds its N entries on disk, but the
in-memory head now claims first_nr = 0 -- the recovery should have
rewound first_nr back to N along with the ref, but had no saved copy
to rewind from.

On the next dirty_alloc_blocks call the threshold check sees first_nr =
0! (full empty space) and skips the new-block path.  dirty_list_block
CoWs the existing head block and list_block_add writes new entries
past the N already-present blknos while incrementing first_nr from 0.
The head's first_nr drifts permanently below the block's actual nr.
This leads to the alloc list head/block mismatch BUG_ON at alloc.c:375
and downstream extent overlap errors that permanently stall the server.

Fix by saving and restoring the full scoutfs_alloc_list_head struct
instead of just the scoutfs_block_ref. Exposed by stress testing.

Signed-off-by: Auke Kok <auke.kok@versity.com>
2026-05-21 14:02:27 -07:00
2020-12-07 09:47:12 -08:00
2020-12-07 10:39:20 -08:00
2021-11-05 11:16:57 -07:00
2026-05-05 14:29:18 -07:00

Introduction

scoutfs is a clustered in-kernel Linux filesystem designed to support large archival systems. It features additional interfaces and metadata so that archive agents can perform their maintenance workflows without walking all the files in the namespace. Its cluster support lets deployments add nodes to satisfy archival tier bandwidth targets.

The design goal is to reach file populations in the trillions, with the archival bandwidth to match, while remaining operational and responsive.

Highlights of the design and implementation include:

  • Fully consistent POSIX semantics between nodes
  • Atomic transactions to maintain consistent persistent structures
  • Integrated archival metadata replaces syncing to external databases
  • Dynamic seperation of resources lets nodes write in parallel
  • 64bit throughout; no limits on file or directory sizes or counts
  • Open GPLv2 implementation

Community Mailing List

Please join us on the open scoutfs-devel@scoutfs.org mailing list hosted on Google Groups

S
Description
No description provided
Readme 6.6 MiB
Languages
C 86.3%
Shell 10%
Roff 2.5%
TeX 0.8%
Makefile 0.4%