I could be misunderstanding the bug, of course.
I thought the bug was a missing check for the COW flag, but looking at it again it seems it was missing both setting and checking the flag.
I could be misunderstanding the bug, of course.