From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [PATCH] namespace.c: fix bind mount from foreign namespace Date: Tue, 17 May 2005 02:28:54 +0100 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 Cc: linuxram@us.ibm.com, viro@parcelfarce.linux.theplanet.co.uk, akpm@osdl.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: 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 To: Miklos Szeredi Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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