Disk I/O in modern Linux systems is heavily buffered. That's usually a good thing but can lead to data loss if sync is not called after critical operations — then a power cut can make the supposedly "successfully written" data disappear.
As T4975 shows, the consequences can be catastrophic — if a commit that involves login settings changes is followed by a power cut, the user may not be able to login again at all.
We need to ensure to flush buffers after a commit completes.