{
  "slug": "ubi-atomic-leb-change",
  "term": "Atomic LEB change (UBI)",
  "aliases": [
    "UBI atomic logical eraseblock change",
    "UBI_IOCEBCH"
  ],
  "definition": "An atomic LEB change replaces one UBI logical eraseblock as a failure-atomic unit while retaining its logical number.",
  "note": "The Linux v6.16 kernel API is ubi_leb_change; its supplied length must fit the usable LEB and satisfy minimum-I/O alignment. This is a dynamic-volume operation, not a transaction across several LEBs or files. [ubi-api]\n\nFor userspace, UBI_IOCEBCH starts a request followed by writes of the declared byte count. This differs from UBI_IOCVOLUP's whole-volume update. Name the actual interface when documenting a recovery guarantee. [ubi-ioctl]\n\nCompletion of logical replacement is distinct from physical removal of obsolete copies. UBI unmap schedules erasure; the old mapping may return after an unclean reboot before that erasure. An erase call waits for the associated physical erasure. [ubi-api]\n\nUse this primitive only within a protocol that also defines publication, error handling and recovery. This is an engineering inference from its one-LEB scope, not evidence that a complete firmware update or secure deletion has been tested.",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "related": [
    "ubi",
    "ubifs",
    "nand-erase-block"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-21",
  "citations": [
    {
      "id": "ubi-api",
      "title": "Linux v6.16, ubi_leb_change, ubi_leb_unmap and ubi_leb_erase",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.16/drivers/mtd/ubi/kapi.c",
      "accessed": "2026-10-21"
    },
    {
      "id": "ubi-ioctl",
      "title": "Linux v6.16, UBI userspace interface and ioctl contracts",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.16/include/uapi/mtd/ubi-user.h",
      "accessed": "2026-10-21"
    }
  ],
  "provenance": [
    "Source review pinned to Linux v6.16. No raw-flash, power-cut or sanitization experiment was performed."
  ]
}
