From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757580Ab0FBDed (ORCPT ); Tue, 1 Jun 2010 23:34:33 -0400 Received: from 64-131-60-146.usfamily.net ([64.131.60.146]:56998 "EHLO mail.sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755467Ab0FBDec (ORCPT ); Tue, 1 Jun 2010 23:34:32 -0400 Message-ID: <4C05D145.6080602@sandeen.net> Date: Tue, 01 Jun 2010 22:34:29 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Julia Lawall CC: Alex Elder , xfs-masters@oss.sgi.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [xfs-masters] [PATCH 11/17] fs/xfs/quota: Add missing mutex_unlock References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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