Properly test for vmio buffer in bnoreuselist().

The presence of allocated v_object does not imply that the buffer is
necessary VMIO kind.  Buffer might has been allocated before the
object created, then the buffer is malloced.  Although we try to avoid
such situation, it seems to be still legitimate.

Reported and tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Konstantin Belousov 2018-12-23 18:52:02 +00:00
parent 09ed804717
commit 6c59824b31

View File

@ -1840,7 +1840,7 @@ bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn)
* reused. Dirty buffers will have the hint applied once
* they've been written.
*/
if (bp->b_vp->v_object != NULL)
if ((bp->b_flags & B_VMIO) != 0)
bp->b_flags |= B_NOREUSE;
brelse(bp);
BO_RLOCK(bo);