Skip to content

feat(fs): add Linux-style errseq writeback reporting#1935

Open
fslongjin wants to merge 2 commits into
masterfrom
codex/errseq-writeback-reporting
Open

feat(fs): add Linux-style errseq writeback reporting#1935
fslongjin wants to merge 2 commits into
masterfrom
codex/errseq-writeback-reporting

Conversation

@fslongjin
Copy link
Copy Markdown
Member

Summary

Implements Linux-style errseq_t writeback error reporting for DragonOS page cache and sync paths.

  • Add a reusable atomic ErrSeq primitive matching Linux's sequence/error/seen-bit model.
  • Replace ad-hoc SpinLock<seq,error> writeback error state in PageCache and superblock state.
  • Track page-cache and superblock errseq cursors per open file description, protected by a file-local mutex.
  • Wire errseq consumption into fsync, fdatasync, msync(MS_SYNC), sync_file_range, and syncfs paths.
  • Add /sys/kernel/debug/errseq/selftest plus a dunitest wrapper.
  • Add errseq-设计.md with the Linux/DragonOS architecture analysis and review notes.

Fixes #1909.

Validation

Host-side:

  • make fmt
  • make kernel
  • make -C user/apps/tests/dunitest build-suites

DragonOS guest via make run-nographic after refreshing the disk image:

  • ./errseq_selftest_test - 2/2 passed
  • ./fdatasync_test - 7/7 passed
  • ./sync_file_range_test - 4/4 passed
  • ./syncfs_semantics_test - 8/8 passed
  • ./mlock_semantics_test - 10 passed, 1 skipped (MlockAll.FutureAppliesToBrkGrowth, environment cannot grow brk by one page without mlockall)

Signed-off-by: longjin <longjin@dragonos.org>
@github-actions github-actions Bot added the enhancement New feature or request label May 27, 2026
@fslongjin
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: longjin <longjin@dragonos.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(fs): Implement Linux-style errseq for page-cache writeback error reporting

1 participant