Skip to content

fs/vfs: pass readonly to foreach_inode() in sync() - #22046

Merged
GUIDINGLI merged 1 commit into
apache:masterfrom
jingfei195887:fs/sync-foreach-inode-readonly
Nov 19, 2026
Merged

GUIDINGLI merged 1 commit into
apache:masterfrom
jingfei195887:fs/sync-foreach-inode-readonly

Conversation

@jingfei195887

Copy link
Copy Markdown
Contributor

Summary

Fix the master build break in fs/vfs/fs_sync.c:

vfs/fs_sync.c:124:3: error: too few arguments to function 'foreach_inode'

#21999 (72ba9b9) moved sync() into fs/vfs/fs_sync.c and added a foreach_inode() call there, while #22013 (6be5713) added a readonly argument to foreach_inode(). Each PR built on its own; together they do not.

Pass readonly=true: the syncfs walk only visits mountpoint inodes, so it keeps the inode read lock it took before the signature change.

Impact

Build fix only, no behavior change. Every configuration with mountpoints enabled currently fails to build on master.

Testing

Host: Linux x86_64, gcc 13.1.0, base 7b4e437 (upstream master).

  • master: sim:nsh fails with the error above.
  • this PR: sim:nsh (+ CONFIG_FS_HOSTFS, CONFIG_FS_TMPFS) builds with make and CMake, no warnings in the changed file; ostest exits with status 0.
  • tools/checkpatch.sh passes.

foreach_inode() gained a readonly argument while sync() was being
moved to fs_sync.c, and the two changes were merged independently,
so sync() still calls it with two arguments and the build fails.

Pass true: the syncfs walk only visits inodes and needs the read
lock, as it took before.

Signed-off-by: jingfei <[email protected]>
@github-actions github-actions Bot added Area: File System File System issues Size: XS The size of the change in this PR is very small labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

esp32-devkitc

  • ROM: .flash.text +296 B (+0.2%, 133,256 B / 4,194,272 B, total: 3% used)
  • irom0_0_seg: .flash.text +296 B (+0.3%, 98,936 B / 3,342,304 B, total: 3% used)

hifive1-revb

  • flash: .text +208 B (+0.2%, 87,168 B / 4,194,304 B, total: 2% used)

qemu-armv8a

  • Code: .rodata +16 B, .text.blocks_entry +8 B, .text.foreach_inode +32 B, .text.foreach_inodelevel +8 B, .text.foreach_mountpoint +16 B, .text.mount_entry +8 B, .text.mount_read +4 B, .text.mountpoint_filter -72 B, .text.nx_umount2 +20 B, .text.sync +4 B, .text.usage_entry +8 B (+0.1%, 372,512 B)

qemu-intel64

  • Code: .text +452 B (+0.0%, 8,701,637 B)

rx65n-rsk2mb

  • ROM: .text +176 B (+0.2%, 92,284 B / 2,097,152 B, total: 4% used)

s698pm-dkit

  • Code: .text +784 B (+0.2%, 407,328 B)

stm32-nucleo-f103rb

  • flash: .text +20 B (+0.1%, 35,484 B / 131,072 B, total: 27% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@GUIDINGLI
GUIDINGLI merged commit 46aaa10 into apache:master Nov 19, 2026
52 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: File System File System issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants