Racing The File System
summary
Filesystems change underfoot; the talk shows concrete race failures (split reads, TOCTOU, directory-delete races) and practical fixes: use directory-handle operations (openat/unlinkat style), prefer FD-based sibling ops, and use atomic replace-via-rename. Boost.AFIO introduced as a portable library implementing these idioms. Windows supports atomic rename since Vista (use SetFileInformationByHandle with REPLACE_IF_EXISTS); Linux/Windows support empty-string FD-to-path tricks. Benchmarks: lock-file perf: ~2.5K Win, 4K Linux, 10K FreeBSD and the AFIO-backed transactional key/value prototype works in tests.
AI-written summary · about
chapters (15)
- 0:00Intro
- 3:02What is a race: Classic example
- 4:05Concurrent i/o
- 8:54Deleting a directory tree on Windows
- 15:18Why do filing system races matter?
- 16:40Security: Time Of Check To Time Of Use (TOCTTOU)
- 21:52Relative paths
- 23:11Avoid paths altogether
- 25:40Inode checking
- 33:20Atomic renaming
- 37:30Locking
- 40:28Design pattern 5a: Lock files
- 45:18Design pattern 5b: Byte range locks
- 51:02Design pattern 5c: atomic append + extent deallocation
- 51:55Design pattern 5d: Ordering guarantees
related talks
18mOxbow: A Coordinated Architecture for Multi-Component File Systems
05mLightning Talk: To Flush or Not to Flush? - That Is the Question
43mNVM Software Interfaces New Direction
34mWhat UNIX Cost Us
51mWhat went wrong with AIO
42mAdventures in Efficiency and Performance
01h 07mVerifying a concurrent file system with sequential reasoning
01h 04mWe Live in Interesting Times
