If less than a full block is being written the previous contents of the buffer must be read so that the appropriate part can be preserved, otherwise just get any available buffer;
There is no “write ahead” facility, but there is a “delayed write” for buffers whose final characters have not been changed;
If the file offset now points beyond the recorded end of file character, the file has obviously grown bigger!
Why is it necessary/desirable to set the “IUPD” flag again? (See line 6285.)