Skip to content

afpd: harden build_fce_packet() remaining accounting#3153

Merged
andylemin merged 1 commit into
mainfrom
rdmark-fce-fixes
Jul 7, 2026
Merged

afpd: harden build_fce_packet() remaining accounting#3153
andylemin merged 1 commit into
mainfrom
rdmark-fce-fixes

Conversation

@rdmark

@rdmark rdmark commented Jul 6, 2026

Copy link
Copy Markdown
Member

build_fce_packet() had imperfect remaining accounting: after writing 16-bit length fields for username/path/source path, it advances p and datalen but does not subtract those length-field bytes from remaining

also fixes a straggler FCE packet version 1 marshalling bug, a leftover from the fix for SourceForge Bug No.603

@rdmark
rdmark requested a review from andylemin as a code owner July 6, 2026 13:04
@augmentcode

augmentcode Bot commented Jul 6, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes incorrect buffer-remaining accounting in build_fce_packet() so the 16-bit length fields are included when decrementing remaining space.

Changes:

  • Subtracts sizeof(uint16) + payload length for username/path/source-path fields to prevent under-accounting
  • Passes obj->fce_version (instead of the compile-time constant) to the notify script to keep version marshalling consistent for v1/v2

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

build_fce_packet() had imperfect remaining accounting: after
writing 16-bit length fields for username/path/source path,
it advances p and datalen but does not subtract those length-field
bytes from remaining

also fixes a straggler FCE packet version 1 marshalling bug,
a leftover from the fix for SourceForge Bug no.603
@rdmark
rdmark force-pushed the rdmark-fce-fixes branch from 6799d00 to 1cb628d Compare July 6, 2026 13:10
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

📊 Performance Dashboard

Commit: 1cb628d39622c15dc7d23b54632ba414a7d18528

🔥 Spectest (AFP 3.4) - FlameGraph

Netatalk Code-time: 3.6% · Runtime: 68s · Stacks: 1895

🔥 Click the preview to open the interactive flamegraph (zoom + search).

Flamegraph preview

🔝 Top 10 leaf functions
Function Samples
do_syscall_64 395810065
x64_sys_call 248070375
_raw_spin_unlock_irqrestore 217199395
finish_task_switch.isra.0 192943625
__cp_end 98125615
srso_alias_safe_ret 79382520
afpd 68357170
find_get_block_common 38588725
__pi_memset 30870980
kmem_cache_alloc_noprof 27563375

📈 Speedtest (AFP 3.4) - PerfGraph

Speedtest throughput

🔝 Peak throughput per operation
Operation Peak mean (MB/s)
Read 6327
Write 1568
Copy 2393
ServerCopy 3254

⏱️ Lantest (AFP 3.4) - LatencyGraph

Lantest latency

Avg total runtime: 4342 ms · Avg time per AFP op: 0.084 ms

🐢 All operations (avg runtime, in test order)
Test Avg (ms)
Writing one large file 37
Reading one large file 16
Creating 2000 files 701
Writing 1024 bytes to 2000 files 372
Lock then unlock 2000 open forks 153
Stat, open, read 512 bytes, close 2000 files 773
Enumerate dir with 2000 files 5
Deleting 2000 files 629
Byte-range lock/unlock 2000 ranges in one fork 157
Create directory tree with 1000 dirs 396
Directory cache hits (20 dirs x 100 files) 92
Mixed cache operations (create/stat/enum/delete) on 1000 files 646
Deep path traversal (20 levels x 100 walks) 99
Cache validation (2000 files x 3 lookups) 266

@andylemin
andylemin merged commit 4ba63b3 into main Jul 7, 2026
65 of 66 checks passed
@rdmark
rdmark deleted the rdmark-fce-fixes branch July 7, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants