Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 14:54:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7PLsOVT028582 for ; Mon, 25 Aug 2008 14:54:25 -0700 X-ASG-Debug-ID: 1219701346-7cde033f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D0BC9FBA7D6; Mon, 25 Aug 2008 14:55:46 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id HmsbWnHvut0fDura; Mon, 25 Aug 2008 14:55:46 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m7PLtWIF028617 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 25 Aug 2008 23:55:33 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7PLtWVD028615; Mon, 25 Aug 2008 23:55:32 +0200 Date: Mon, 25 Aug 2008 23:55:32 +0200 From: Christoph Hellwig To: Peter Zijlstra Cc: Dave Chinner , Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@lst.de X-ASG-Orig-Subj: Re: [2.6.27-rc4] XFS i_lock vs i_iolock... Subject: Re: [2.6.27-rc4] XFS i_lock vs i_iolock... Message-ID: <20080825215532.GB28188@lst.de> References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> <48B21507.9050708@sgi.com> <20080825035542.GR5706@disturbed> <1219647573.20732.28.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1219647573.20732.28.camel@twins> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1219701347 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3709 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8087/Mon Aug 25 11:40:37 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17712 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 08:59:33AM +0200, Peter Zijlstra wrote: > How can you take two locks in one go? It seems to me you always need to > take them one after another, and as soon as you do that, you have > ordering constraints. Yes, you would. Except that in all other places we only have a single iolock involved, so the ordering of the second iolock and second ilock don't matter. Because of that I think declaring that xfs_lock_two_inodes can just lock on lock type at a time might be the better solution.