Compare commits

..

2 Commits

Author SHA1 Message Date
Auke Kok
9ab925b903 Clear ref_blkno output when block is already dirty
block_dirty_ref() skipped setting *ref_blkno when the block was
already dirty, leaving the caller with a stale value passed by
reference.

dirty_alloc_blocks() calls it twice but when the referenced block
is already dirty, it will receive the uninitialized stack value back,
and then adding it freed list with list_block_add() later.

Set it to 0 on the already-dirty fast path so callers do not try to
free a random block.

Signed-off-by: Auke Kok <auke.kok@versity.com>
2026-05-12 15:10:47 -07:00
Zach Brown
fece0a9372 Merge pull request #310 from versity/zab/v1.31
v1.31 Release
2026-05-06 10:37:07 -07:00

View File

@@ -846,6 +846,8 @@ int scoutfs_block_dirty_ref(struct super_block *sb, struct scoutfs_alloc *alloc,
bp = BLOCK_PRIVATE(bl);
if (block_is_dirty(bp)) {
if (ref_blkno)
*ref_blkno = 0;
ret = 0;
goto out;
}