-
Notifications
You must be signed in to change notification settings - Fork 29
Fix littlefs dir lseek to keep file->pos in user-space offset #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
dfs_lfs.c(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
dfs_lfs.c (1)
lfs.c (1)
lfs_dir_seek(6385-6398)
🪛 GitHub Actions: test
dfs_lfs.c
[error] 1-1: Compilation failed: fatal error: rtdevice.h: No such file or directory (included by dfs_lfs.c)
- Convert seek offset to littlefs entry index (skip dot entries) and back to user byte offset after lfs_dir_seek - Align telldir/seekdir with getdents behavior
|
Tip For best results, initiate chat on the files or code changes. @wdfk-prog Hello! How can I help you with this PR? Would you like me to:
Please let me know what you need, and I'll be happy to assist! |
[
为什么提交这份PR (why to submit this PR)
Fix littlefs dir lseek to keep file->pos in user-space offset
#29
你的解决方案是什么 (what is your solution)
Adjust directory lseek to skip the first two dot entries by converting the byte offset into a dirent index and adding 2 before calling
lfs_dir_seek.请提供验证的bsp和config (provide the config and bsp)
BSP: N/A (logic-only change, no board-specific validation yet)
.config: N/A
action: N/A
测试代码
msh />lfs_seekdir_bug seekdir fixture already exists: /flash/seekdir_bug readdir1=a, telldir_after1=2 (expect 0), readdir2=b, telldir_after2=262 (expect 260), after_seek=b, errno=0 FAIL: mismatchmsh />lfs_seekdir_bug seekdir fixture already exists: /flash/seekdir_bug readdir1=a, telldir_after1=0 (expect 0), readdir2=b, telldir_after2=260 (expect 260), after_seek=b, errno=0 PASS: seekdir/telldir 一致]
当前拉取/合并请求的状态 Intent for your PR
代码质量 Code Quality:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned upSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.