I think that this is solved if we always atomically update the size of the file first as mentioned before.