Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2016 09:52:19 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r310578 - stable/11/sys/kern
Message-ID:  <201612260952.uBQ9qJcC025009@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Dec 26 09:52:19 2016
New Revision: 310578
URL: https://svnweb.freebsd.org/changeset/base/310578

Log:
  MFC r310302:
  Do not clear KN_INFLUX when not owning influx state.
  
  PR:	214923

Modified:
  stable/11/sys/kern/kern_event.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_event.c
==============================================================================
--- stable/11/sys/kern/kern_event.c	Mon Dec 26 09:46:55 2016	(r310577)
+++ stable/11/sys/kern/kern_event.c	Mon Dec 26 09:52:19 2016	(r310578)
@@ -2006,6 +2006,7 @@ knote(struct knlist *list, long hint, in
 	struct kqueue *kq;
 	struct knote *kn, *tkn;
 	int error;
+	bool own_influx;
 
 	if (list == NULL)
 		return;
@@ -2036,11 +2037,14 @@ knote(struct knlist *list, long hint, in
 			 */
 			KQ_UNLOCK(kq);
 		} else if ((lockflags & KNF_NOKQLOCK) != 0) {
-			kn->kn_status |= KN_INFLUX;
+			own_influx = (kn->kn_status & KN_INFLUX) == 0;
+			if (own_influx)
+				kn->kn_status |= KN_INFLUX;
 			KQ_UNLOCK(kq);
 			error = kn->kn_fop->f_event(kn, hint);
 			KQ_LOCK(kq);
-			kn->kn_status &= ~KN_INFLUX;
+			if (own_influx)
+				kn->kn_status &= ~KN_INFLUX;
 			if (error)
 				KNOTE_ACTIVATE(kn, 1);
 			KQ_UNLOCK_FLUX(kq);



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