In ibrk and segattach there are two different expressions which check for expanding or newly created segments overlapping an existing segment. Neither version was general enough to catch all possible cases. This patch also includes a minimal correction for a bug reported in 9fans by cinap_lenrek on 2014-06-08 (Re: duppage) which can lead to resource starvation & deadlock: duppage() causes the freelist to be shuffled differently. without stuffing cached pages at the freelist tail, the tail accumulates a uncached "stopper" page which breaks the invariant of imagereclaim which just scans from the tail backwards as long as the pages are cached. imagereclaim does not move the pages to the head after uncaching them! so by default imagereclaim prevents the cached pages before the ones it reclaimed from being reclaimed ever.