Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2018 18:52:02 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342380 - head/sys/kern
Message-ID:  <201812231852.wBNIq2Mk090860@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Dec 23 18:52:02 2018
New Revision: 342380
URL: https://svnweb.freebsd.org/changeset/base/342380

Log:
  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

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Sun Dec 23 18:15:48 2018	(r342379)
+++ head/sys/kern/vfs_subr.c	Sun Dec 23 18:52:02 2018	(r342380)
@@ -1840,7 +1840,7 @@ again:
 		 * 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812231852.wBNIq2Mk090860>