Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261914AbVEQB3I (ORCPT ); Mon, 16 May 2005 21:29:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261902AbVEQB3I (ORCPT ); Mon, 16 May 2005 21:29:08 -0400 Received: from mail.shareable.org ([81.29.64.88]:33751 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S261631AbVEQB3B (ORCPT ); Mon, 16 May 2005 21:29:01 -0400 Date: Tue, 17 May 2005 02:28:54 +0100 From: Jamie Lokier To: Miklos Szeredi Cc: linuxram@us.ibm.com, viro@parcelfarce.linux.theplanet.co.uk, akpm@osdl.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] namespace.c: fix bind mount from foreign namespace Message-ID: <20050517012854.GC32226@mail.shareable.org> References: <1116005355.6248.372.camel@localhost> <1116012287.6248.410.camel@localhost> <1116013840.6248.429.camel@localhost> <1116256279.4154.41.camel@localhost> <20050516111408.GA21145@mail.shareable.org> <1116301843.4154.88.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 734 Lines: 28 Miklos Szeredi wrote: > + if (ns1 < ns2) { > + down_write(&ns1->sem); > + down_write(&ns2->sem); > + } else { > + down_write(&ns2->sem); > + down_write(&ns1->sem); > + } That's a bit smaller (source and compiled) as: if (ns2 < ns1) down_write(&ns2->sem); down_write(&ns1->sem); if (ns2 > ns1) down_write(&ns2->sem); (And you'll notice that does the right thing if ns2==ns1 too, in case that gives you any ideas.) Otherwise, the patch looks convincing to me. -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/