Thread (10 messages) 10 messages, 5 authors, 2015-09-23

Re: [PATCH v2] netpoll: Close race condition between poll_one_napi and napi_disable

flat view

From: David Miller <davem@davemloft.net>
Date: 2015-09-23 18:03:11

From: Neil Horman <redacted>
Date: Tue, 22 Sep 2015 16:01:36 -0400
quoted hunk ↗ jump to hunk
-	set_bit(NAPI_STATE_NPSVC, &napi->state);
+	/*
+	 * If we set this bit but see that it has already been set,
+	 * that indicates that napi has been disabled and we need
+	 * to abort this operation
+ 	 */
+
+	if(test_and_set_bit(NAPI_STATE_NPSVC, &napi->state))
+		goto out;
 
Networking comments should be styled:

	/* Like
	 * this.
	 */

Also you need a space after the "if" and before the openning parenthesis.

And like Stephen I think the empty line between the comment and the
if() statement is superfluous and eats up precious vertical space on
the screen :-)

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help