From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id o523W6g7044637 for ; Tue, 1 Jun 2010 22:32:06 -0500 Message-ID: <4C05D145.6080602@sandeen.net> Date: Tue, 01 Jun 2010 22:34:29 -0500 From: Eric Sandeen MIME-Version: 1.0 Subject: Re: [xfs-masters] [PATCH 11/17] fs/xfs/quota: Add missing mutex_unlock References: In-Reply-To: List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Julia Lawall Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Elder Julia Lawall wrote: > From: Julia Lawall > > Add a mutex_unlock missing on the error path. The use of this lock is > balanced elsewhere in the file. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > expression E1; > @@ > > * mutex_lock(E1,...); > <+... when != E1 > if (...) { > ... when != E1 > * return ...; > } > ...+> > * mutex_unlock(E1,...); > // > > Signed-off-by: Julia Lawall > > --- > The use of ENOMEM rather than -ENOMEM is also a bit odd. All the xfs core code uses positive errors, it's an irix holdover. As things bubble up to the vfs interface, signs get switched. Yeah, it's a bit odd, but nobody dares change it ;) Maybe semantic patching could fix it ;) -Eric _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs