Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2019 22:42:33 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345037 - head/sys/kern
Message-ID:  <201903112242.x2BMgXDm076316@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Mon Mar 11 22:42:33 2019
New Revision: 345037
URL: https://svnweb.freebsd.org/changeset/base/345037

Log:
  Update the main loop in the flushbuflist() routine to properly select
  buffers for flushing when requested to flush both normal and extended
  attributes buffers.
  
  Sponsored by: Netflix

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Mon Mar 11 22:39:06 2019	(r345036)
+++ head/sys/kern/vfs_subr.c	Mon Mar 11 22:42:33 2019	(r345037)
@@ -1756,8 +1756,16 @@ flushbuflist(struct bufv *bufv, int flags, struct bufo
 
 	retval = 0;
 	TAILQ_FOREACH_SAFE(bp, &bufv->bv_hd, b_bobufs, nbp) {
-		if (((flags & V_NORMAL) && (bp->b_xflags & BX_ALTDATA)) ||
-		    ((flags & V_ALT) && (bp->b_xflags & BX_ALTDATA) == 0)) {
+		/*
+		 * If we are flushing both V_NORMAL and V_ALT buffers then
+		 * do not skip any buffers. If we are flushing only V_NORMAL
+		 * buffers then skip buffers marked as BX_ALTDATA. If we are
+		 * flushing only V_ALT buffers then skip buffers not marked
+		 * as BX_ALTDATA.
+		 */
+		if (((flags & (V_NORMAL | V_ALT)) != (V_NORMAL | V_ALT)) &&
+		   (((flags & V_NORMAL) && (bp->b_xflags & BX_ALTDATA) != 0) ||
+		    ((flags & V_ALT) && (bp->b_xflags & BX_ALTDATA) == 0))) {
 			continue;
 		}
 		if (nbp != NULL) {



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