From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757217AbZEUWWs (ORCPT ); Thu, 21 May 2009 18:22:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755509AbZEUWWj (ORCPT ); Thu, 21 May 2009 18:22:39 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:42391 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755264AbZEUWWi (ORCPT ); Thu, 21 May 2009 18:22:38 -0400 Date: Thu, 21 May 2009 15:22:36 -0700 (PDT) Message-Id: <20090521.152236.101174595.davem@davemloft.net> To: jpirko@redhat.com Cc: menage@google.com, lizf@cn.fujitsu.com, akpm@linux-foundation.org, tgraf@suug.ch, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] cls_cgroup: read classid atomically in classifier From: David Miller In-Reply-To: <20090521194447.GA3388@psychotron.englab.brq.redhat.com> References: <20090521183100.12678.28835.stgit@menage.mtv.corp.google.com> <20090521194447.GA3388@psychotron.englab.brq.redhat.com> X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Pirko Date: Thu, 21 May 2009 21:44:48 +0200 > Thu, May 21, 2009 at 08:31:26PM CEST, menage@google.com wrote: >>cls_cgroup: read classid atomically in classifier >> >>Avoid reading the unsynchronized value cs->classid multiple times, >>since it could change concurrently from non-zero to zero; this would >>result in the classifier returning a positive result with a bogus >>(zero) classid. >> >>Signed-off-by: Paul Menage >>Reviewed-by: Li Zefan >> >>--- >> >>Resending to cc netdev@vger.kernel.org as requested by DaveM >> >> net/sched/cls_cgroup.c | 22 +++++++++++----------- >> 1 files changed, 11 insertions(+), 11 deletions(-) >> >>diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c >>index 1ab4542..4ece6e0 100644 >>--- a/net/sched/cls_cgroup.c >>+++ b/net/sched/cls_cgroup.c >>@@ -98,8 +98,7 @@ static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp, >> struct tcf_result *res) >> { >> struct cls_cgroup_head *head = tp->root; >>- struct cgroup_cls_state *cs; >>- int ret = 0; >>+ u32 classid; > ^^^^^^^^ How about using TAB instead? Agreed, please use proper formatting.