rename-exchange · shipping

RENAME_EXCHANGE

RENAME_EXCHANGE is a Linux renameat2 flag that atomically swaps two existing pathname bindings.

Related Observatory article: RENAME_EXCHANGE on hesela.com

Both names must exist; this flag cannot be combined with RENAME_NOREPLACE. [1]

Hesela observed swapped inode identities at the names while existing descriptors still read their original payloads. The experiment was sequential: it does not prove concurrent atomicity or crash durability, and two reader lookups do not become a snapshot. [2]

Relations

related
atomic-rename, rename-noreplace, open-file-description, directory-fsync

Citations

  1. Linux man-pages: rename(2), renameat2 flags (accessed 2026-10-17)
  2. Hesela: exchange observation and limitations (accessed 2026-10-17)

JSON: /data/terms/rename-exchange.json