In allocbuf() newbsize is rounded up to nearest page size.
The only place where B_MALLOC is set is in vfs_nonvmio_extend(), only if newbsize is <= PAGE_SIZE / 2. But since allocbuf() rounds up to nearest page size, code which sets B_MALLOC is never run.
Since it's still desirable to have malloc bufs, this fix modifies allocbuf() to check if the buffer would be a malloc buf prior to rounding up to PAGE_SIZE, and only does so if the buffer would not be a malloc buf.