Filesystems · Cluster
Filesystem Fundamentals
Inodes, directories, and the POSIX interface.
- 01 What an Inode Stores, and Why It Stores No Name The inode is the object a filesystem calls a file: its fields, what it deliberately omits, how stat exposes it, and why a full inode table can refuse a write on a filesystem with free space.
- 02 Directory Entries as a Name-to-Inode Map A directory is a file whose records map names to inode numbers, with a fixed record shape, a reserved pair of names, and a deletion policy that leaves gaps behind.
- 03 Open File Descriptions and the Offsets They Share Three separate kernel objects stand behind a file descriptor, and knowing which one carries the offset explains dup, fork, append mode, and why two opens of one file disagree about position.
- 04 Rename Atomicity and the Replacement of a Directory Entry How rename changes two directory entries without a window of invisibility, which cross-filesystem cases the guarantee excludes, and why the call is the primitive behind atomic file updates.
- 05 Sparse Files and the Gap Between Length and Allocation A file can report a length of terabytes while occupying a few blocks, and the interface keeps the two numbers separate; seeks into the gap, hole punching, and the copy that silently fills it.
- 06 Path Resolution Component by Component The walk behind every open: how a pathname is split, when symlinks are expanded, how mount points and dot-dot interrupt the tree, and where the interface allows a race.
- 07 Reading a Directory as a Stream: readdir and Its Weak Guarantees Directory listing is a cursor over mutable records, not a snapshot; what the offset cookie means, which entries can be missed or repeated, and why sorting requires reading everything first.
- 08 Permission Checks at Open and the Bits That Change Meaning The mode word is consulted once, at open, against the whole path; umask, the sticky bit, setgid inheritance, and default ACLs each bend the rule in a way that surprises the caller.
- 09 Unlink While Open and the Life of an Orphaned Inode Removing the last name does not free a file that is still open; how the link count and the description reference interact, and why deleted files keep consuming disk.
- 10 fsync, fdatasync, and What Survives a Power Loss The durability calls promise different things about data and metadata, and a file entry needs a second call on its directory; where the guarantees stop on each filesystem.