At the early posts, I posited that only a few states were fully safe.
Technically, a couple more exist (single-initiator, read-only).
Here’s a full table of the states, and quick notes about why they are safe or not safe.
PLEASE ASK FOR DETAILS IF YOU BELIEVE A STATE MARKED UNSAFE IS ACTUALLY SAFE.
I will then provide more specific timelines of which initiator does what actions. This, however, takes significant work to write (and triple-check), so I would prefer to do it only if necessary.
Host | Firmware | Safe? | Problems |
---|---|---|---|
None |
None |
Safe | Useful for intermediate states |
R/O |
None |
Safe | |
None |
R/O |
Safe | |
R/O |
R/O |
Safe | Both firmware and host can read, cache the data, but neither one changes the data |
R/W |
None |
Safe | Single-initiator |
None |
R/W |
Safe | single-initiator |
R/W |
R/W |
Not safe | e.g., host reads/caches the FAT; firmware allocates space; host later allocates that same space for a different file; writes to one file now forever corrupt the other file |
R/W |
R/O |
Not safe | e.g., host caches some writes for performance, and/or has updated the FAT without updating the directory entry (or vice versa … the changes are not transactional). Result is that firmware reads and/or writes corrupt data. |
R/O |
R/W |
Not safe | e.g., host caches most data; firmware later makes changes; host does not see changes made by firmware; host reads and/or writes corrupted data |