Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:33:57 -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.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7QJXmGg007383 for ; Tue, 26 Aug 2008 12:33:48 -0700 X-ASG-Debug-ID: 1219779311-3325000b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B763D3D1031; Tue, 26 Aug 2008 12:35:11 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id mAQpB8qHTPUa3iOn; Tue, 26 Aug 2008 12:35:11 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY4Jo-00050B-Tt; Tue, 26 Aug 2008 19:35:08 +0000 Date: Tue, 26 Aug 2008 15:35:08 -0400 From: Christoph Hellwig To: Christoph Hellwig , Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com 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: <20080826193508.GA17542@infradead.org> References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> <48B21507.9050708@sgi.com> <20080825035542.GR5706@disturbed> <1219647573.20732.28.camel@twins> <20080825215532.GB28188@lst.de> <20080826024547.GX5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080826024547.GX5706@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1219779311 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.3798 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8093/Tue Aug 26 09:01:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17732 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Aug 26, 2008 at 12:45:47PM +1000, Dave Chinner wrote: > XFS: prevent lockdep false positives when locking two inodes > > If we call xfs_lock_two_inodes() to grab both the iolock and > the ilock, then drop the ilocks on both inodes, then grab > them again (as xfs_swap_extents() does) then lockdep will > report a locking order problem. This is a false positive. > > To avoid this, disallow xfs_lock_two_inodes() fom locking both > inode locks at once - force calers to make two separate calls. > This means that nested dropping and regaining of the ilocks > will retain the same lockdep subclass and so lockdep will > not see anything wrong with this code. Looks good. We probably don't need the #ifdef DEBUG as ASSERT is debug-only anyway.