[PATCH v3 2/2] bfs: ensure buffer is marked uptodate before marking it dirty