From owner-xfs@oss.sgi.com Fri Aug 1 00:29:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 00:29:34 -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,J_CHICKENPOX_72 autolearn=no 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 m717TP56015704 for ; Fri, 1 Aug 2008 00:29:25 -0700 X-ASG-Debug-ID: 1217575837-16fe03ce0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 79D85EEAF81 for ; Fri, 1 Aug 2008 00:30:37 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id FgzSmxucNgrc8tx0 for ; Fri, 01 Aug 2008 00:30:37 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALlWkkh5LDlw/2dsb2JhbACLIKVP X-IronPort-AV: E=Sophos;i="4.31,291,1215354600"; d="scan'208";a="162074320" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 01 Aug 2008 17:00:34 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KOp5t-0006ji-HJ; Fri, 01 Aug 2008 17:30:33 +1000 Date: Fri, 1 Aug 2008 17:30:33 +1000 From: Dave Chinner To: Jasper Bryant-Greene Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, hch@lst.de X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Message-ID: <20080801073033.GF6201@disturbed> Mail-Followup-To: Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, hch@lst.de References: <1217553598.3860.16.camel@luna.unix.geek.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1217553598.3860.16.camel@luna.unix.geek.nz> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217575838 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.1425 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17291 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs [cc'd xfs@oss.sgi.com] On Fri, Aug 01, 2008 at 01:19:58PM +1200, Jasper Bryant-Greene wrote: > I mount a bunch of XFS filesystems with "noikeep,attr2,noatime", and a > couple also with "ro". > > Sometimes I want to remount one of the "ro" ones "rw", to make changes. > This doesn't work anymore in 2.6.27-rc1-next-20080730. The last kernel I > tried which it worked in was 2.6.26 release. > > luna ~ # mount -o remount,rw /usr > mount: /usr not mounted already, or bad option > > luna ~ # dmesg | tail -n 1 > [18702.291344] XFS: mount option "noikeep" not supported for remount > > Is this intended behaviour? Side effect of this commit: http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=0327f9d799ebb96f67c80dd732b1fdb09527365e Christoph? FWIW, noikeep is the default, so you don't need to specify it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 01:11:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 01:11:38 -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=-1.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m718BYBO019934 for ; Fri, 1 Aug 2008 01:11:34 -0700 X-ASG-Debug-ID: 1217578366-0e6d00de0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C260E1967F12 for ; Fri, 1 Aug 2008 01:12:46 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id 8LxbVS60esK6GoHG for ; Fri, 01 Aug 2008 01:12:46 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id D87A06E22A; Fri, 1 Aug 2008 04:12:45 -0400 (EDT) Date: Fri, 1 Aug 2008 04:12:45 -0400 (EDT) From: Justin Piszcz To: Matt Garman cc: David Greaves , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! In-Reply-To: <20080801034150.GA32026@sewage.raw-sewage.fake> Message-ID: References: <4872A2F4.2010604@dgreaves.com> <20080801034150.GA32026@sewage.raw-sewage.fake> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1217578367 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.1428 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17292 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Thu, 31 Jul 2008, Matt Garman wrote: > On Tue, Jul 08, 2008 at 04:39:34AM -0400, Justin Piszcz wrote: >> On Tue, 8 Jul 2008, Justin Piszcz wrote: >>> On Tue, 8 Jul 2008, David Greaves wrote: >>>> Justin Piszcz wrote: >>>>> Each PCI-e x1 card has 1 veliciraptor on it now. >>>>> Got an x4 card wit 4 sata ports: >>>> Useful - which card? >>> >>> StarTech 4 Port PCI Express x4 SATA II Card Model PEXSATA24E >>> >>> >> Chipset: Marvell 88SX7042 >> SATA Connectivity: Use four internal ports at the same time or two internal >> and two external ports >> >> Which is fully supported in the latest kernels (didn't try an old kernel): >> >> linux-2.6.25.10/drivers/ata/sata_mv.c >> >> /* Marvell 7042 support */ >> { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 }, > > How have that card and the array attached to it been doing since you > originally posted this? No problems to report yet, working well, I wish I had multiple x4 or x16 slots and use those instead of x1 cards (the mobo would need to support the I/O as well).. > > Doesn't that HighPoint 23xx card also use the Marvell 88SX7042 chip? I read remeber 'locked' 64kb read problem but not any corruption issue. > I remember seeing the threads about the HighPoint card silently > corrupting data by silently writing over parts of the disk(s) with Also I MD5SUM -c (verify) 100-150GiB of data daily or so to make sure it is OK, so far, no problems. > its own info. I'm guessing that's not a "feature" of the Marvell > chip, but still... admittedly irrational fear here :) Have not seen it yet. > > It would be nice if that Supermicro 8-port SATA card (AOC-SAT2-MV8) > was available in PCIe... I wonder if it's possible to just graft > multiple SiI 3132 controllers (2 SATA each) on a single PCIe card? Yes, I asked Supermicro about it and they never mailed me back about a PCIe version.. That's a good question, I suppose if it was easy it would have already been done? Justin. From owner-xfs@oss.sgi.com Fri Aug 1 05:31:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 05:32:11 -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 m71CVik8013327 for ; Fri, 1 Aug 2008 05:31:44 -0700 X-ASG-Debug-ID: 1217593976-7dab00b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF7C434EA5E for ; Fri, 1 Aug 2008 05:32:56 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ZGkFRW4HSHMJf3oq for ; Fri, 01 Aug 2008 05:32:56 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAAmdkkh5LDlw/2dsb2JhbACLIKYk X-IronPort-AV: E=Sophos;i="4.31,293,1215354600"; d="scan'208";a="162219518" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 01 Aug 2008 22:02:54 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KOtoT-0004qh-3S; Fri, 01 Aug 2008 22:32:53 +1000 Date: Fri, 1 Aug 2008 22:32:53 +1000 From: Dave Chinner To: Timothy Shimmin Cc: "Linda A. Walsh" , xfs-oss X-ASG-Orig-Subj: Re: Question about extended attributes... Subject: Re: Question about extended attributes... Message-ID: <20080801123253.GG6201@disturbed> Mail-Followup-To: Timothy Shimmin , "Linda A. Walsh" , xfs-oss References: <48925495.7040804@tlinx.org> <4892B361.9030900@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4892B361.9030900@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217593977 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.1444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17293 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 04:55:29PM +1000, Timothy Shimmin wrote: > Hi Linda, > > Linda A. Walsh wrote: > > my man page says extended xfs attributes can have 256-byte names > > with up to 64K of data. > > > > Is there a limit on the number of extended attributes max data size or > > name size? > > > > I.e. could I have 1000 attributes with 64K of data each? > > > Yep. > > > Is there a strong reason why the file and data sizes were limited to > > 256/64K? .... > I'm not sure why 64K was chosen for a value size limit. Because changes to EAs are journalled. Hence there must be a bound size limit because log space is limited. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 12:01:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:01:35 -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 (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 m71J1TRn016095 for ; Fri, 1 Aug 2008 12:01:31 -0700 X-ASG-Debug-ID: 1217617361-6f9802950000-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 568E5EECD81; Fri, 1 Aug 2008 12:02:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 2iJ922mYLnWryOEb; Fri, 01 Aug 2008 12:02:41 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KOztg-0002UY-FB; Fri, 01 Aug 2008 19:02:40 +0000 Date: Fri, 1 Aug 2008 15:02:40 -0400 From: Christoph Hellwig To: Lachlan McIlroy , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27 Subject: Re: [GIT PULL] XFS update for 2.6.27 Message-ID: <20080801190240.GA23604@infradead.org> References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> <20080731034952.GC13395@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080731034952.GC13395@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: 1217617363 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.1468 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17294 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 Thu, Jul 31, 2008 at 01:49:52PM +1000, Dave Chinner wrote: > author of that patch. I don't know why there's duplicates of it > in the tree - the only thing I can see is that the committer's > email address is not stable. There is a growing number of > duplicate commits like this in the XFS tree..... Yes, I pointed this out before. But at this point I'd rather have the XFS changes in .27 and not completely miss the window even if that means some patches are not correctly atributed to me. From owner-xfs@oss.sgi.com Fri Aug 1 12:21:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:21:35 -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 (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 m71JLXsL022388 for ; Fri, 1 Aug 2008 12:21:33 -0700 X-ASG-Debug-ID: 1217618566-184601f80000-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 0A890EECFA5; Fri, 1 Aug 2008 12:22:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id oDawIsWtqxBJF8Yk; Fri, 01 Aug 2008 12:22:46 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KP0D7-0007pX-Tg; Fri, 01 Aug 2008 19:22:45 +0000 Date: Fri, 1 Aug 2008 15:22:45 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW] Cleanup more dir v1 macros and stuff Subject: Re: [REVIEW] Cleanup more dir v1 macros and stuff Message-ID: <20080801192245.GA26807@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1217618567 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.1472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17295 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, Jul 29, 2008 at 11:29:36AM +1000, Barry Naujok wrote: > Well, it seems I found a few remnants (cookie crumbs) of dirv1 stuff > in the kernel! This patch removes those remnants! Looks good. From owner-xfs@oss.sgi.com Fri Aug 1 12:30:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:30:37 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_72, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71JUV42023276 for ; Fri, 1 Aug 2008 12:30:34 -0700 X-ASG-Debug-ID: 1217619103-5b8a01b40000-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 0F44419693FD for ; Fri, 1 Aug 2008 12:31:43 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jHIXvIJMLnwE85BA for ; Fri, 01 Aug 2008 12:31:43 -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 m71JVYIF001202 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:31:34 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JVXYn001200; Fri, 1 Aug 2008 21:31:33 +0200 Date: Fri, 1 Aug 2008 21:31:33 +0200 From: Christoph Hellwig To: Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Message-ID: <20080801193133.GA838@lst.de> References: <1217553598.3860.16.camel@luna.unix.geek.nz> <20080801073033.GF6201@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801073033.GF6201@disturbed> 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: 1217619105 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.1473 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17296 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 Fri, Aug 01, 2008 at 05:30:33PM +1000, Dave Chinner wrote: > On Fri, Aug 01, 2008 at 01:19:58PM +1200, Jasper Bryant-Greene wrote: > > I mount a bunch of XFS filesystems with "noikeep,attr2,noatime", and a > > couple also with "ro". > > > > Sometimes I want to remount one of the "ro" ones "rw", to make changes. > > This doesn't work anymore in 2.6.27-rc1-next-20080730. The last kernel I > > tried which it worked in was 2.6.26 release. > > > > luna ~ # mount -o remount,rw /usr > > mount: /usr not mounted already, or bad option > > > > luna ~ # dmesg | tail -n 1 > > [18702.291344] XFS: mount option "noikeep" not supported for remount > > > > Is this intended behaviour? > > Side effect of this commit: > > http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=0327f9d799ebb96f67c80dd732b1fdb09527365e > > Christoph? I'ts most likely a fallout, but I wonder why. To get this behaviour moutn would have to add all the options it finds in /proc/self/mounts to the command line. Added the util-linux-ng list to shed some light on this, but I suspect I'll have to change xfs_fs_remount to check if the option passed in is identical to the one we already have and only reject it when it changes due to this mount(1) dumbness. From owner-xfs@oss.sgi.com Fri Aug 1 12:33:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:33:06 -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 (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 m71JX4eW023720 for ; Fri, 1 Aug 2008 12:33:04 -0700 X-ASG-Debug-ID: 1217619256-35d602cf0000-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 DA78779F8F1 for ; Fri, 1 Aug 2008 12:34:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 5SzCTZFbpCnClorY for ; Fri, 01 Aug 2008 12:34:16 -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 m71JYIIF001361 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:34:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JYIN9001359; Fri, 1 Aug 2008 21:34:18 +0200 Date: Fri, 1 Aug 2008 21:34:18 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/21] btree cleanups and unification Subject: Re: [PATCH 00/21] btree cleanups and unification Message-ID: <20080801193418.GA1263@lst.de> References: <20080729193000.GA19104@lst.de> <20080730005338.GG13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730005338.GG13395@disturbed> 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: 1217619257 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.1472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17297 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 Wed, Jul 30, 2008 at 10:53:39AM +1000, Dave Chinner wrote: > On Tue, Jul 29, 2008 at 09:30:00PM +0200, Christoph Hellwig wrote: > > This is the full btree unficiation based on Dave's initial patches plus > > various cleanups. This second versions post now contains the complete > > btree refactoring, and passes XFSQA. > > Cool. Are the first few patches unchanged from the ones I reviewed > earlier? As mentioned below only the trace and readahead patches changed a little bit. From owner-xfs@oss.sgi.com Fri Aug 1 12:33:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:34:04 -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.2 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 m71JXnU9023922 for ; Fri, 1 Aug 2008 12:33:59 -0700 X-ASG-Debug-ID: 1217619302-35b5029f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 102A379F655 for ; Fri, 1 Aug 2008 12:35:02 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id MSZf9a3CUzBCftQU for ; Fri, 01 Aug 2008 12:35:02 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 3CD61AC6275; Fri, 1 Aug 2008 14:35:01 -0500 (CDT) Message-ID: <48936564.706@sandeen.net> Date: Fri, 01 Aug 2008 14:35:00 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: Barry Naujok , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW] Cleanup more dir v1 macros and stuff Subject: Re: [REVIEW] Cleanup more dir v1 macros and stuff References: <20080801192245.GA26807@infradead.org> In-Reply-To: <20080801192245.GA26807@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1217619303 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.1472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17298 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Tue, Jul 29, 2008 at 11:29:36AM +1000, Barry Naujok wrote: >> Well, it seems I found a few remnants (cookie crumbs) of dirv1 stuff >> in the kernel! This patch removes those remnants! > > > Looks good. > > is the 0x7fffffff stuff in xfs_file.c also a dir v1 remnant? cvs history seems to indicate so.... -Eric From owner-xfs@oss.sgi.com Fri Aug 1 12:35:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:35:12 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71JZA4p024489 for ; Fri, 1 Aug 2008 12:35:10 -0700 X-ASG-Debug-ID: 1217619382-435602f80000-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 3B64C1969487 for ; Fri, 1 Aug 2008 12:36:23 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 1BydtQl8xroo0TOQ for ; Fri, 01 Aug 2008 12:36:23 -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 m71JaPIF001471 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:36:25 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JaPaP001469; Fri, 1 Aug 2008 21:36:25 +0200 Date: Fri, 1 Aug 2008 21:36:25 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 08/21] make btree tracing generic Subject: Re: [PATCH 08/21] make btree tracing generic Message-ID: <20080801193625.GB1263@lst.de> References: <20080729193044.GI19104@lst.de> <20080730013920.GI13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730013920.GI13395@disturbed> 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: 1217619384 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1473 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17299 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 Wed, Jul 30, 2008 at 11:39:20AM +1000, Dave Chinner wrote: > > + void (*trace_enter)(struct xfs_btree_cur *, const char *, > > + char *, int, int, __psunsigned_t, > > + __psunsigned_t, __psunsigned_t, > > + __psunsigned_t, __psunsigned_t, > > + __psunsigned_t, __psunsigned_t, > > + __psunsigned_t, __psunsigned_t, > > + __psunsigned_t, __psunsigned_t); > > Would it be better to use a 'trace args' structure here rather > than passing a heap of parameters? memset(args, 0,...) rather than > passing a whole heap of zeros in most cases seems like a better > approach to me, esp. as they all get cast to (void *) anyway.... Well, we need to case to void * somewhere, and going from struct to arguments list isn't helpful either. Changing the whole ktrace thing to an args strucutr and/or varags would be nice, but is not in scope for this patchset.. > > +static void > > +xfsidb_btree_trace_record( > > shouldn't these all use "xfsidbg" prefixes? Probably. From owner-xfs@oss.sgi.com Fri Aug 1 12:38:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:38:49 -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 (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 m71JckLP024998 for ; Fri, 1 Aug 2008 12:38:46 -0700 X-ASG-Debug-ID: 1217619598-351602cd0000-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 1390179F96A for ; Fri, 1 Aug 2008 12:39:58 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Zr3kXKc4lVE7HkcM for ; Fri, 01 Aug 2008 12:39:58 -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 m71Je0IF001662 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:40:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71Je0kl001660; Fri, 1 Aug 2008 21:40:00 +0200 Date: Fri, 1 Aug 2008 21:40:00 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 09/21] implement generic xfs_btree_increment Subject: Re: [PATCH 09/21] implement generic xfs_btree_increment Message-ID: <20080801194000.GC1263@lst.de> References: <20080729193053.GJ19104@lst.de> <20080730020645.GJ13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730020645.GJ13395@disturbed> 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: 1217619600 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17300 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 Wed, Jul 30, 2008 at 12:06:45PM +1000, Dave Chinner wrote: > > +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); > > I think for these interfaces it woul dbe better to include > variable names in the prototypes. i.e.: > > int xfs_btree_increment(struct xfs_btree_cur *cur, int level, int *stat); Well, all this and much more is documented at the implementation site, so I'd avoid this churn. If there are strong feelings for it I can change the prototypes. > Can kill the else there: > > if (cur->bc_flags & XFS_BTREE_LONG_PTRS) > return be64_to_cpu(ptr->l) == NULLFSBLOCK; > return be32_to_cpu(ptr->s) == NULLAGBLOCK; Normally I'd agree with you, but for the short/long pointer case the if else make the symmetry of the code clear and thus is IMHO better readable. > > + ptr->s = block->bb_u.s.bb_rightsib; > > + else > > + ptr->s = block->bb_u.s.bb_leftsib; > > + } > > +} > > Should we use trinary notation for this? i.e: I find the if else much easier to read. > Hmmm - if xfs_btree_check_block() returns an error, we won't release > the buffer in the error handling path. While this may not be a > problem right now (as the only error is EFSCORRUPTED) we want to be > able to recover from errors here in the future so we should really > exit cleanly form this function.... Fixed. > Would it be better here to explicitly test this rather than assert? > ie.: > > if (lev == cur->bc_nlevels) { > if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) > goto out0; > ASSERT(0); > error = EFSCORRUPTED; > goto error0; > } > > So that we get an explicit error reported in the production systems > rather than carrying on and dying a horrible death somewhere else.... Yes, this is much better. But we're getting on a slipperly slope here to introduce too many improvements. For the initial patches I'd like to stay as close as possible to the old btree implementations. Anyway, this change is trivial enough and I've added it. From owner-xfs@oss.sgi.com Fri Aug 1 12:39:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:39:06 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71Jd4IY025126 for ; Fri, 1 Aug 2008 12:39:04 -0700 X-ASG-Debug-ID: 1217619616-56c701d70000-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 564701969148 for ; Fri, 1 Aug 2008 12:40:17 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ZfNPWglSUvzbnPnl for ; Fri, 01 Aug 2008 12:40:17 -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 m71JeJIF001690 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:40:19 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JeJBL001688; Fri, 1 Aug 2008 21:40:19 +0200 Date: Fri, 1 Aug 2008 21:40:19 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 10/21] implement generic xfs_btree_decrement Subject: Re: [PATCH 10/21] implement generic xfs_btree_decrement Message-ID: <20080801194019.GD1263@lst.de> References: <20080729193058.GK19104@lst.de> <20080730020919.GK13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730020919.GK13395@disturbed> 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: 1217619618 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1473 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17301 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 Wed, Jul 30, 2008 at 12:09:19PM +1000, Dave Chinner wrote: > On Tue, Jul 29, 2008 at 09:30:58PM +0200, Christoph Hellwig wrote: > > From: Dave Chinner > > > > [hch: split out from bigger patch and minor adaptions] > > > > Signed-off-by: Christoph Hellwig > .... > > + /* > > + * If we went off the root then we are seriously confused. > > + * or the root of the tree is in an inode. > > + */ > > + if (lev == cur->bc_nlevels) { > > + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); > > + goto out0; > > + } > > Same question as for the increment case. Ok, changed. From owner-xfs@oss.sgi.com Fri Aug 1 12:42:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:42:28 -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 m71JgN2D025847 for ; Fri, 1 Aug 2008 12:42:25 -0700 X-ASG-Debug-ID: 1217619815-033902d30000-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 76B7EEECE54 for ; Fri, 1 Aug 2008 12:43:36 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jyQHmKs3e9O8FkXt for ; Fri, 01 Aug 2008 12:43:36 -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 m71JhaIF001834 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:43:36 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71Jha3U001831; Fri, 1 Aug 2008 21:43:36 +0200 Date: Fri, 1 Aug 2008 21:43:36 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 11/21] implement generic xfs_btree_lookup Subject: Re: [PATCH 11/21] implement generic xfs_btree_lookup Message-ID: <20080801194336.GE1263@lst.de> References: <20080729193104.GL19104@lst.de> <20080730045937.GL13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730045937.GL13395@disturbed> 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: 1217619817 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17302 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 Wed, Jul 30, 2008 at 02:59:37PM +1000, Dave Chinner wrote: > > + if (level == 0) { > > + union xfs_btree_rec *krp; > > + > > + krp = cur->bc_ops->rec_addr(cur, keyno, block); > > + cur->bc_ops->init_key_from_rec(cur, kp, krp); > > + return kp; > > I think the record pointer variable "krp" is confusing with "kp", the key > pointer. It's a record pointer; 'rp' it should be. Ok, fixed. > Can you make the {} consistent here ant move the comment for the > else? i.e. Yeah, done. > > + /* Return if we succeeded or not. */ > > + if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) > > + *stat = 0; > > + else > > + *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); > > Can probably kill all the extra () in that. I've turned this into an if else if else with the superflous braces removed. > > --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:51:41.000000000 +0200 > > @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf > > */ > > > > /* > > + * Lookup the record equal to [bno, len] in the btree given by cur. > > + */ > > +STATIC int /* error */ > > +xfs_alloc_lookup_eq( > > Should these be xfs_allocbt_lookup_*() to be consistent > with all the other allocbt functions (and inobt_lookup/bmbt_lookup)? Currently only the btree_ops methods are named allocbt. Comments on that scheme would be appreciated. From owner-xfs@oss.sgi.com Fri Aug 1 12:43:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:43:42 -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 m71Jhdh8026218 for ; Fri, 1 Aug 2008 12:43:39 -0700 X-ASG-Debug-ID: 1217619890-034b02cc0000-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 3D7BEEECE8D for ; Fri, 1 Aug 2008 12:44:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id kn13qPxLKWg7KvlN for ; Fri, 01 Aug 2008 12:44:51 -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 m71JirIF001895 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:44:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71Jirfa001893; Fri, 1 Aug 2008 21:44:53 +0200 Date: Fri, 1 Aug 2008 21:44:52 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 12/21] implement generic xfs_btree_updkey Subject: Re: [PATCH 12/21] implement generic xfs_btree_updkey Message-ID: <20080801194452.GF1263@lst.de> References: <20080729193110.GM19104@lst.de> <20080730050936.GM13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730050936.GM13395@disturbed> 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: 1217619893 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17303 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 Wed, Jul 30, 2008 at 03:09:36PM +1000, Dave Chinner wrote: > > + int ptr; > > +#ifdef DEBUG > > + int error; > > +#endif > > This can be scoped inside the for loop. Done. > And even then I think we might not need an error variable - it can > only return EFSCORRUPTED, so: > > #ifdef DEBUG > if (xfs_btree_check_block(cur, block, level, bp)) { > XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); > return EFSCORRUPTED; > } > #endif > > Would remove the need for the error variable. I'm not a big fan of losing detailed error information. Depending on how the bigger btree blocks work out we might return other errors here in the near future. From owner-xfs@oss.sgi.com Fri Aug 1 12:45:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:45:13 -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 m71JjAMj026682 for ; Fri, 1 Aug 2008 12:45:10 -0700 X-ASG-Debug-ID: 1217619982-034002e60000-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 2D79DEECEAF for ; Fri, 1 Aug 2008 12:46:22 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id HeRMpGKsBZpdtR9O for ; Fri, 01 Aug 2008 12:46:22 -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 m71JkOIF001957 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:46:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JkO7E001955; Fri, 1 Aug 2008 21:46:24 +0200 Date: Fri, 1 Aug 2008 21:46:24 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 13/21] implement generic xfs_btree_update Subject: Re: [PATCH 13/21] implement generic xfs_btree_update Message-ID: <20080801194624.GG1263@lst.de> References: <20080729193116.GN19104@lst.de> <20080730052959.GN13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730052959.GN13395@disturbed> 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: 1217619984 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17304 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 Wed, Jul 30, 2008 at 03:29:59PM +1000, Dave Chinner wrote: > Oh, it's be moved inside the update code itself. So, why always call > the update function and then check the ptr? Why not the way it was > originally done? Because all three callers do different checks, and I could not proof that they are either identical or hamrless for the other cases. We can clean this mess up later in small standalone patches. > > + /* updated last record information */ > > + void (*update_lastrec)(struct xfs_btree_cur *, > > + struct xfs_btree_block *, > > + union xfs_btree_rec *, int, int); > > Can you add the variable names to the prototype parameters? Done. From owner-xfs@oss.sgi.com Fri Aug 1 12:45:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:45:37 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71JjY4x026877 for ; Fri, 1 Aug 2008 12:45:34 -0700 X-ASG-Debug-ID: 1217620006-5b8a020e0000-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 B011C19694BD for ; Fri, 1 Aug 2008 12:46:46 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id UqLSddrE3S7uYl8U for ; Fri, 01 Aug 2008 12:46: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 m71JkmIF001985 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:46:48 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71Jkm4a001983; Fri, 1 Aug 2008 21:46:48 +0200 Date: Fri, 1 Aug 2008 21:46:48 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 14/21] add get_maxrecs btree operation Subject: Re: [PATCH 14/21] add get_maxrecs btree operation Message-ID: <20080801194648.GH1263@lst.de> References: <20080729193121.GO19104@lst.de> <20080730053455.GO13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730053455.GO13395@disturbed> 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: 1217620007 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.1473 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17305 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 Wed, Jul 30, 2008 at 03:34:55PM +1000, Dave Chinner wrote: > On Tue, Jul 29, 2008 at 09:31:21PM +0200, Christoph Hellwig wrote: > > Factor xfs_btree_maxrecs into a per-btree operation. > > > > > > Signed-off-by: Christoph Hellwig > > ->get_maxrecs was extracted out of my original patchset, right? > > I didn't apply it to removing xfs_btree_maxrecs(), though. Good > idea. Looks fine to me. Yeah, should have added a comment that this has been taken from the big patch. From owner-xfs@oss.sgi.com Fri Aug 1 12:48:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:48:01 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71JlxZH027520 for ; Fri, 1 Aug 2008 12:48:00 -0700 X-ASG-Debug-ID: 1217620151-5b9201fa0000-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 35F471623F45 for ; Fri, 1 Aug 2008 12:49:12 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id A2VJIBGzgXV6IG3Q for ; Fri, 01 Aug 2008 12:49:12 -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 m71JnEIF002080 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:49:14 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JnEt0002078; Fri, 1 Aug 2008 21:49:14 +0200 Date: Fri, 1 Aug 2008 21:49:14 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 15/21] implement generic xfs_btree_rshift Subject: Re: [PATCH 15/21] implement generic xfs_btree_rshift Message-ID: <20080801194914.GI1263@lst.de> References: <20080729193125.GP19104@lst.de> <20080730060808.GP13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730060808.GP13395@disturbed> 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: 1217620153 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1473 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17306 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 > > +{ > > + ASSERT(from >= 0 && from <= 1000); > > + ASSERT(to >= 0 && to <= 1000); > > + ASSERT(numptrs >= 0); > > Those numbers are not safe. I plucked them out of thin air to verify > validity on 4k block size filesystem which had (IIRC) a max of about > 500 ptrs to a block. It was throwaway debug code to find a problem. > Larger block sizes can well exceed 1000. So realistically, the only > valid assert there is this one: > > ASSERT(numptrs >= 0); Yeah, I've actually managed to trigger it now. The >=0 checks for from and to still make sense, although they might be overkill. > How about: > > union xfs_btree_ptr *pp; > xfs_caddr_t *block = XFS_BUF_TO_BLOCK(bp); > xfs_caddr_t start; /* first byte offset logged */ > xfs_caddr_t end; /* last byte offset logged */ > > pp = cur->bc_ops->ptr_addr(cur, 1, XFS_BUF_TO_BLOCK(bp)); > > if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { > __be64 *lpp = &pp->l; > > start = (xfs_caddr_t)&lpp[first - 1] - block; > end = ((xfs_caddr_t)&lpp[last] - 1) - block; > } else { > __be32 *spp = &pp->s; > > start = (xfs_caddr_t)&spp[first - 1] - block; > end = ((xfs_caddr_t)&spp[last] - 1) - block; > } > > xfs_trans_log_buf(cur->bc_tp, bp, (int)start, (int)end); > > That makes it much easier to read (to me, anyway). Yes, absolutely. And there's also another set of useless braces. I've also applied a similar cleanup to the log_keys and log_recs implementations. > > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > > + XFS_BTREE_TRACE_ARGBI(cur, bp, fields); > > + > > + if (bp) { > > + xfs_btree_offsets(fields, > > + (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? > > + loffsets : soffsets, > ^^ > Some stray whitespace there. Fixed. > > + XFS_BB_NUM_BITS, &first, &last); > > + xfs_trans_log_buf(cur->bc_tp, bp, first, last); > > + } else { > > + /* XXX(hch): maybe factor out into a method? */ > > + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, > > + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); > > I don't think it is necessary at this point. It's the only leakage of the detailed inode root implementation into the generic code, so I'm still wondering whether a method would be better. From owner-xfs@oss.sgi.com Fri Aug 1 12:51:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:51:37 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m71JpZmo028078 for ; Fri, 1 Aug 2008 12:51:36 -0700 X-ASG-Debug-ID: 1217620367-584301f00000-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 DC4321969680 for ; Fri, 1 Aug 2008 12:52:47 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 1CMxQ23uQF61qxEA for ; Fri, 01 Aug 2008 12:52:47 -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 m71JqnIF002292 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:52:50 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JqngI002290; Fri, 1 Aug 2008 21:52:49 +0200 Date: Fri, 1 Aug 2008 21:52:49 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 16/21] implement generic xfs_btree_lshift Subject: Re: [PATCH 16/21] implement generic xfs_btree_lshift Message-ID: <20080801195249.GJ1263@lst.de> References: <20080729193132.GQ19104@lst.de> <20080730062422.GQ13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730062422.GQ13395@disturbed> 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: 1217620368 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1475 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17307 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 > > +xfs_btree_copy_ptrs( > > + struct xfs_btree_cur *cur, > > + union xfs_btree_ptr *src_ptr, > > + union xfs_btree_ptr *dst_ptr, > > + int numptrs) > > +{ > > + ASSERT(numptrs > 0); > > + > > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) > > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be64)); > > + else > > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be32)); > > +} > > These should really use memmove, not memcpy. There is no guarantee > the source and destination do not overlap. > > At minimum, we need comments to say this must only be used to > copy between blocks, and xfs_btree_move_ptrs() must be used to > copy within a block. I note the original patchset of mine > commented on this distinction when defining the ->move_* and > ->copy_* operations. > > FWIW, that also helps explain why they have different interfaces... There were some comments in the pre-walkthru cleanup version but they were already lost in that patch. But yes, adding some comments makes sense. Or moving back to single one that unlike your very first version always passes src and dst pointers and always uses memmove. > This can be moved inside the branch it is used in. Done. > Move the XFS_BTREE_STATS_ADD() above the comment to match the rshift > code. Done. From owner-xfs@oss.sgi.com Fri Aug 1 12:53:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:53:58 -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 m71JrtNe028501 for ; Fri, 1 Aug 2008 12:53:55 -0700 X-ASG-Debug-ID: 1217620507-763103280000-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 BDFA0EED08C for ; Fri, 1 Aug 2008 12:55:07 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id LG5LbHyakmEweHdm for ; Fri, 01 Aug 2008 12:55:07 -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 m71Jt7IF002453 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:55:07 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71Jt7jP002451; Fri, 1 Aug 2008 21:55:07 +0200 Date: Fri, 1 Aug 2008 21:55:07 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 17/21] implement generic xfs_btree_split Subject: Re: [PATCH 17/21] implement generic xfs_btree_split Message-ID: <20080801195507.GK1263@lst.de> References: <20080729192113.493074843@verein.lst.de> <20080729193137.GR19104@lst.de> <20080730065349.GR13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730065349.GR13395@disturbed> 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: 1217620509 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17308 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 > This is where I begin to question this approach (i.e. using > helpers like this rather than specific ops like I did). It's > taken me 4 ??r 5 patches to put my finger on it. > > The intent of this factorisation is to make implementing new btree > structures easy, not making the current code better or more > managable. The first thing we need is is btrees with different > header blocks (self describing information, CRCs, etc). This above > function will suddenly have four combinations to deal with - long and > short, version 1 and version 2 header formats. The more we change, > the more this complicates these helpers. That is why I pushed > seemingly trivial stuff out to operations vectors - because of the > future flexibility it allowed in implementation of new btrees..... > > I don't see this a problem for this patch series, but I can see that > some of this work will end up being converted back to ops vectors > as soon as we start modifying between structures.... Maybe. But even when we convert it to ops vectors it should not be the btree implementation vector, but a btree_block_ops that's implemented once instead of duplicated for the alloc vs ialloc btree. And for now having all this in xfs_btree.c makes reading and working on the patch series easier, so.. > > + /* need to sort out how callers deal with failures first */ > > + ASSERT(!(flags & XFS_BUF_TRYLOCK)); > > + > > + d = xfs_btree_ptr_to_daddr(cur, ptr); > > + *bpp = xfs_trans_get_buf(cur->bc_tp, mp->m_ddev_targp, d, > > + mp->m_bsize, flags); > > + > > + ASSERT(*bpp); > > + ASSERT(!XFS_BUF_GETERROR(*bpp)); > > xfs_trans_get_buf() can return NULL, right? Only when XFS_BUF_TRYLOCK is set, which it never is for the btree code, and the assert above makes sure we catch any new caller early. > > + /* block allocation / freeing */ > > + int (*alloc_block)(struct xfs_btree_cur *cur, > > + union xfs_btree_ptr *sbno, > > + union xfs_btree_ptr *nbno, > > start_bno, new_bno. Done. From owner-xfs@oss.sgi.com Fri Aug 1 12:54:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 12:54:44 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_65 autolearn=no 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 m71JsgKN028830 for ; Fri, 1 Aug 2008 12:54:42 -0700 X-ASG-Debug-ID: 1217620554-6f97039f0000-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 27313EEC4A1 for ; Fri, 1 Aug 2008 12:55:54 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id urN8ecjl7BPmuyPE for ; Fri, 01 Aug 2008 12:55:54 -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 m71JtuIF002510 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 21:55:56 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71JtuW6002508; Fri, 1 Aug 2008 21:55:56 +0200 Date: Fri, 1 Aug 2008 21:55:56 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 21/21] clean up xfs_bmap_btree.c Subject: Re: [PATCH 21/21] clean up xfs_bmap_btree.c Message-ID: <20080801195556.GL1263@lst.de> References: <20080729193200.GV19104@lst.de> <20080730073245.GV13395@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080730073245.GV13395@disturbed> 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: 1217620556 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.1474 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17309 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 Wed, Jul 30, 2008 at 05:32:45PM +1000, Dave Chinner wrote: > > + ASSERT(nrecs == crecs); > > + kp = xfs_bmbt_key_addr(cur, 1, block); > > + ckp = xfs_bmbt_key_addr(cur, 1, cblock); > > + memcpy(kp, ckp, nrecs * sizeof(xfs_bmbt_key_t)); > > Should really be xfs_bmbt_copy_keys(), right? Yes, fixed. > > + memcpy(pp, cpp, nrecs * sizeof(xfs_bmbt_key_t)); > > xfs_bmbt_copy_recs()? Yes, fixed. From owner-xfs@oss.sgi.com Fri Aug 1 14:17:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 14:17:05 -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 m71LH2bR002221 for ; Fri, 1 Aug 2008 14:17:03 -0700 X-ASG-Debug-ID: 1217625484-3fa702930000-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 BEC82EEDE55 for ; Fri, 1 Aug 2008 14:18:14 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id NDHJcMaEBADVbetj for ; Fri, 01 Aug 2008 14:18:14 -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 m71LI7IF006672 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 1 Aug 2008 23:18:07 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m71LI6cK006670; Fri, 1 Aug 2008 23:18:06 +0200 Date: Fri, 1 Aug 2008 23:18:06 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] optimize xfs_ichgtime Subject: Re: [PATCH 2/3] optimize xfs_ichgtime Message-ID: <20080801211806.GA6529@lst.de> References: <20080726063335.GB22603@lst.de> <20080726091230.GS5947@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726091230.GS5947@disturbed> 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: 1217625495 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.1480 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17310 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 Sat, Jul 26, 2008 at 07:12:30PM +1000, Dave Chinner wrote: > On Sat, Jul 26, 2008 at 08:33:35AM +0200, Christoph Hellwig wrote: > > Port a little optmization from file_update_time to xfs_ichgtime, and > > only update the timestamp and mark the inode dirty if the timestamp > > actually changes in the timer tick resultion supported by the running > > kernel. > > Looks ok. Updated version that removes the I_NEW check (I could do this in patch 1, but doing it here causes less churn) Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-26 11:14:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-26 11:15:54.000000000 +0200 @@ -97,17 +97,23 @@ xfs_ichgtime( { struct inode *inode = VFS_I(ip); timespec_t tv; + int sync_it = 0; - nanotime(&tv); - if (flags & XFS_ICHGTIME_MOD) { + tv = current_fs_time(inode->i_sb); + + if ((flags & XFS_ICHGTIME_MOD) && + !timespec_equal(&inode->i_mtime, &tv)) { inode->i_mtime = tv; ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; + sync_it = 1; } - if (flags & XFS_ICHGTIME_CHG) { + if ((flags & XFS_ICHGTIME_CHG) && + !timespec_equal(&inode->i_ctime, &tv)) { inode->i_ctime = tv; ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; + sync_it = 1; } /* @@ -119,10 +125,11 @@ xfs_ichgtime( * ensure that the compiler does not reorder the update * of i_update_core above the timestamp updates above. */ - SYNCHRONIZE(); - ip->i_update_core = 1; - if (!(inode->i_state & I_NEW)) + if (sync_it) { + SYNCHRONIZE(); + ip->i_update_core = 1; mark_inode_dirty_sync(inode); + } } /* From owner-xfs@oss.sgi.com Fri Aug 1 17:33:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 17:34:29 -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 m720Xv7a019133 for ; Fri, 1 Aug 2008 17:33:57 -0700 X-ASG-Debug-ID: 1217637309-26d303aa0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 09D5B2FF491 for ; Fri, 1 Aug 2008 17:35:10 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id mrCcq1W0WvGEFFte for ; Fri, 01 Aug 2008 17:35:10 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAMlFk0h5LDlw/2dsb2JhbACLH6Rf X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162464048" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:05:08 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP55O-0005Th-RK; Sat, 02 Aug 2008 10:35:06 +1000 Date: Sat, 2 Aug 2008 10:35:06 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 09/21] implement generic xfs_btree_increment Subject: Re: [PATCH 09/21] implement generic xfs_btree_increment Message-ID: <20080802003506.GJ6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193053.GJ19104@lst.de> <20080730020645.GJ13395@disturbed> <20080801194000.GC1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801194000.GC1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217637311 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1492 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17311 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:40:00PM +0200, Christoph Hellwig wrote: > On Wed, Jul 30, 2008 at 12:06:45PM +1000, Dave Chinner wrote: > > > +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); > > > > I think for these interfaces it woul dbe better to include > > variable names in the prototypes. i.e.: > > > > int xfs_btree_increment(struct xfs_btree_cur *cur, int level, int *stat); > > Well, all this and much more is documented at the implementation site, > so I'd avoid this churn. If there are strong feelings for it I > can change the prototypes. Not a big deal, really. I was just looking at consistency with the other prototypes around this one.... > > Would it be better here to explicitly test this rather than assert? > > ie.: > > > > if (lev == cur->bc_nlevels) { > > if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) > > goto out0; > > ASSERT(0); > > error = EFSCORRUPTED; > > goto error0; > > } > > > > So that we get an explicit error reported in the production systems > > rather than carrying on and dying a horrible death somewhere else.... > > Yes, this is much better. But we're getting on a slipperly slope here > to introduce too many improvements. For the initial patches I'd like > to stay as close as possible to the old btree implementations. Sure, but this particular piece of code is different to wthe original btree anyway because it has to handle two different cases. better to get it right first time, IMO. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:12:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:12:53 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m721Cpum021806 for ; Fri, 1 Aug 2008 18:12:51 -0700 X-ASG-Debug-ID: 1217639642-37be01040000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C2466196B220 for ; Fri, 1 Aug 2008 18:14:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id CfDGaCG3TOEDPv5A for ; Fri, 01 Aug 2008 18:14:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFBQk0h5LDlw/2dsb2JhbACLH6RY X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162481693" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:44:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5h2-0006LB-NO; Sat, 02 Aug 2008 11:14:00 +1000 Date: Sat, 2 Aug 2008 11:14:00 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 11/21] implement generic xfs_btree_lookup Subject: Re: [PATCH 11/21] implement generic xfs_btree_lookup Message-ID: <20080802011400.GK6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193104.GL19104@lst.de> <20080730045937.GL13395@disturbed> <20080801194336.GE1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801194336.GE1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217639644 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1495 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17312 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:43:36PM +0200, Christoph Hellwig wrote: > On Wed, Jul 30, 2008 at 02:59:37PM +1000, Dave Chinner wrote: > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:51:41.000000000 +0200 > > > @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf > > > */ > > > > > > /* > > > + * Lookup the record equal to [bno, len] in the btree given by cur. > > > + */ > > > +STATIC int /* error */ > > > +xfs_alloc_lookup_eq( > > > > Should these be xfs_allocbt_lookup_*() to be consistent > > with all the other allocbt functions (and inobt_lookup/bmbt_lookup)? > > Currently only the btree_ops methods are named allocbt. Comments on > that scheme would be appreciated. I think I used 'abt' for it. Perhaps 'albt'? allocbt is probably ok, though, just longer. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:13:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:13:39 -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 (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 m721DVv5022110 for ; Fri, 1 Aug 2008 18:13:31 -0700 X-ASG-Debug-ID: 1217639684-6f1801a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 27DE6EF0C34 for ; Fri, 1 Aug 2008 18:14:44 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id PN8bTZHTJPa5s2Ya for ; Fri, 01 Aug 2008 18:14:44 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFBQk0h5LDlw/2dsb2JhbACLH6RY X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162482320" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:44:42 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5hi-0006MG-IA; Sat, 02 Aug 2008 11:14:42 +1000 Date: Sat, 2 Aug 2008 11:14:42 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 12/21] implement generic xfs_btree_updkey Subject: Re: [PATCH 12/21] implement generic xfs_btree_updkey Message-ID: <20080802011442.GL6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193110.GM19104@lst.de> <20080730050936.GM13395@disturbed> <20080801194452.GF1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801194452.GF1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217639685 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1496 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17313 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:44:52PM +0200, Christoph Hellwig wrote: > On Wed, Jul 30, 2008 at 03:09:36PM +1000, Dave Chinner wrote: > > And even then I think we might not need an error variable - it can > > only return EFSCORRUPTED, so: > > > > #ifdef DEBUG > > if (xfs_btree_check_block(cur, block, level, bp)) { > > XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); > > return EFSCORRUPTED; > > } > > #endif > > > > Would remove the need for the error variable. > > I'm not a big fan of losing detailed error information. Depending > on how the bigger btree blocks work out we might return other errors > here in the near future. Fair enough. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:14:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:14:17 -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 m721ECDk022516 for ; Fri, 1 Aug 2008 18:14:12 -0700 X-ASG-Debug-ID: 1217639724-6b9301920000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BB57F352C7A for ; Fri, 1 Aug 2008 18:15:25 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id F6hpy0xbA8HlFo7W for ; Fri, 01 Aug 2008 18:15:25 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFBQk0h5LDlw/2dsb2JhbACLH6RY X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162482876" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:45:24 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5iN-0006Ni-Ot; Sat, 02 Aug 2008 11:15:23 +1000 Date: Sat, 2 Aug 2008 11:15:23 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 13/21] implement generic xfs_btree_update Subject: Re: [PATCH 13/21] implement generic xfs_btree_update Message-ID: <20080802011523.GM6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193116.GN19104@lst.de> <20080730052959.GN13395@disturbed> <20080801194624.GG1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801194624.GG1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217639725 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1495 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17314 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:46:24PM +0200, Christoph Hellwig wrote: > On Wed, Jul 30, 2008 at 03:29:59PM +1000, Dave Chinner wrote: > > Oh, it's be moved inside the update code itself. So, why always call > > the update function and then check the ptr? Why not the way it was > > originally done? > > Because all three callers do different checks, and I could not proof > that they are either identical or hamrless for the other cases. > We can clean this mess up later in small standalone patches. Ok. Sounds like a good plan. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:19:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:19:34 -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 m721JVdF023234 for ; Fri, 1 Aug 2008 18:19:32 -0700 X-ASG-Debug-ID: 1217640044-6b9401bf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C81F6352B29 for ; Fri, 1 Aug 2008 18:20:45 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id GDD0G901SnYBkZkT for ; Fri, 01 Aug 2008 18:20:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFBQk0h5LDlw/2dsb2JhbACLH6RY X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162486324" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:50:43 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5nW-0006Ug-Sz; Sat, 02 Aug 2008 11:20:42 +1000 Date: Sat, 2 Aug 2008 11:20:42 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 15/21] implement generic xfs_btree_rshift Subject: Re: [PATCH 15/21] implement generic xfs_btree_rshift Message-ID: <20080802012042.GN6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193125.GP19104@lst.de> <20080730060808.GP13395@disturbed> <20080801194914.GI1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080801194914.GI1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217640045 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1496 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17315 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:49:14PM +0200, Christoph Hellwig wrote: > > > + XFS_BB_NUM_BITS, &first, &last); > > > + xfs_trans_log_buf(cur->bc_tp, bp, first, last); > > > + } else { > > > + /* XXX(hch): maybe factor out into a method? */ > > > + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, > > > + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); > > > > I don't think it is necessary at this point. > > It's the only leakage of the detailed inode root implementation into > the generic code, so I'm still wondering whether a method would be > better. Ah, right. yes, it probably would be cleaner to do it as a separate method, but Ç don't think it's that important right now. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:26:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:26:59 -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 (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 m721QrVa024081 for ; Fri, 1 Aug 2008 18:26:54 -0700 X-ASG-Debug-ID: 1217640485-6d1e02400000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BC3CFEF0C88 for ; Fri, 1 Aug 2008 18:28:06 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id WbR3G9u1mV6l9rsl for ; Fri, 01 Aug 2008 18:28:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEANhTk0h5LDlw/2dsb2JhbACLH6RN X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162489900" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 10:58:04 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5ud-0006dz-Qq; Sat, 02 Aug 2008 11:28:03 +1000 Date: Sat, 2 Aug 2008 11:28:03 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 16/21] implement generic xfs_btree_lshift Subject: Re: [PATCH 16/21] implement generic xfs_btree_lshift Message-ID: <20080802012803.GO6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193132.GQ19104@lst.de> <20080730062422.GQ13395@disturbed> <20080801195249.GJ1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801195249.GJ1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217640486 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1496 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17316 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:52:49PM +0200, Christoph Hellwig wrote: > > > +xfs_btree_copy_ptrs( > > > + struct xfs_btree_cur *cur, > > > + union xfs_btree_ptr *src_ptr, > > > + union xfs_btree_ptr *dst_ptr, > > > + int numptrs) > > > +{ > > > + ASSERT(numptrs > 0); > > > + > > > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) > > > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be64)); > > > + else > > > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be32)); > > > +} > > > > These should really use memmove, not memcpy. There is no guarantee > > the source and destination do not overlap. > > > > At minimum, we need comments to say this must only be used to > > copy between blocks, and xfs_btree_move_ptrs() must be used to > > copy within a block. I note the original patchset of mine > > commented on this distinction when defining the ->move_* and > > ->copy_* operations. > > > > FWIW, that also helps explain why they have different interfaces... > > There were some comments in the pre-walkthru cleanup version but they > were already lost in that patch. But yes, adding some comments makes > sense. Or moving back to single one that unlike your very first > version always passes src and dst pointers and always uses memmove. It might make sense to go back to a single implementation, though at the time I did it it made sense to split the move/copy operations because it made both cases simpler. Seeing as you've stuck more closely to the original structure of the code, the distinction is not as great as so it might be best to go back to a single memmove based interface. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 1 18:32:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 01 Aug 2008 18:32:33 -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 (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 m721WQEG024896 for ; Fri, 1 Aug 2008 18:32:26 -0700 X-ASG-Debug-ID: 1217640819-6d24021c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6B481EF0CAF for ; Fri, 1 Aug 2008 18:33:39 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id L2kMhz3OCbU2m57g for ; Fri, 01 Aug 2008 18:33:39 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEANhTk0h5LDlw/2dsb2JhbACLH6RN X-IronPort-AV: E=Sophos;i="4.31,296,1215354600"; d="scan'208";a="162492958" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Aug 2008 11:03:37 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KP5zR-0006l3-2s; Sat, 02 Aug 2008 11:33:01 +1000 Date: Sat, 2 Aug 2008 11:33:01 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 17/21] implement generic xfs_btree_split Subject: Re: [PATCH 17/21] implement generic xfs_btree_split Message-ID: <20080802013301.GP6201@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729192113.493074843@verein.lst.de> <20080729193137.GR19104@lst.de> <20080730065349.GR13395@disturbed> <20080801195507.GK1263@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080801195507.GK1263@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217640820 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1496 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17317 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:55:07PM +0200, Christoph Hellwig wrote: > > This is where I begin to question this approach (i.e. using > > helpers like this rather than specific ops like I did). It's > > taken me 4 ??r 5 patches to put my finger on it. > > > > The intent of this factorisation is to make implementing new btree > > structures easy, not making the current code better or more > > managable. The first thing we need is is btrees with different > > header blocks (self describing information, CRCs, etc). This above > > function will suddenly have four combinations to deal with - long and > > short, version 1 and version 2 header formats. The more we change, > > the more this complicates these helpers. That is why I pushed > > seemingly trivial stuff out to operations vectors - because of the > > future flexibility it allowed in implementation of new btrees..... > > > > I don't see this a problem for this patch series, but I can see that > > some of this work will end up being converted back to ops vectors > > as soon as we start modifying between structures.... > > Maybe. But even when we convert it to ops vectors it should not > be the btree implementation vector, but a btree_block_ops that's > implemented once instead of duplicated for the alloc vs ialloc > btree. Yes, that makes sense - I had sort of headed that way, but it was not fully though out... > And for now having all this in xfs_btree.c makes reading > and working on the patch series easier, so.. Fair enough - do the work when we implement a new btree ;) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sat Aug 2 03:08:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 03:08:41 -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=0.0 required=5.0 tests=BAYES_50 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 m72A8a1u009950 for ; Sat, 2 Aug 2008 03:08:37 -0700 X-ASG-Debug-ID: 1217671786-6b5501fd0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from kingbrown.geo.net.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B9BA5EF19A1 for ; Sat, 2 Aug 2008 03:09:47 -0700 (PDT) Received: from kingbrown.geo.net.au (kingbrown.geo.net.au [203.57.242.3]) by cuda.sgi.com with ESMTP id W1dvgyQC1AijZGo8 for ; Sat, 02 Aug 2008 03:09:47 -0700 (PDT) Received: from localhost (localhost.geo.net.au [127.0.0.1]) by kingbrown.geo.net.au (8.13.6/8.13.2) with ESMTP id m72A6hUu048060; Sat, 2 Aug 2008 18:06:44 +0800 (WST) Received: from 192.168.1.6 (192.168.1.6 [192.168.1.6]) by webmail.geo.net.au (Horde Framework) with HTTP; Sat, 02 Aug 2008 18:06:43 +0800 Message-ID: <20080802180643.48453xm7kcfogbeo@webmail.geo.net.au> Date: Sat, 02 Aug 2008 18:06:43 +0800 From: "Messaging center" Reply-To: surport.office@jmail.co.za To: undisclosed-recipients:; X-ASG-Orig-Subj: Upgrading Web Team Subject: Upgrading Web Team MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline User-Agent: Internet Messaging Program (IMP) H3 (4.2) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.92.1/7915/Sat Aug 2 11:45:09 2008 on kingbrown.geo.net.au X-Virus-Status: Clean X-Barracuda-Connect: kingbrown.geo.net.au[203.57.242.3] X-Barracuda-Start-Time: 1217671789 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5020 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 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.1531 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m72A8b1u009952 X-archive-position: 17318 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: surport@unsw.edu.au Precedence: bulk X-list: xfs Dear Account Owner, This message is from WEBMAIL E-mail messaging center to all our email account users. We are currently conducting a maintenance exercise which is for upgrading our database and e-mail account center. This exercise involves the deactivation of dormant /unused/invalid email accounts to make room for further upgrading. To confirm the validity of your email and to prevent your account from deactivation, you are advised to update it by proving us with the following information. CONFIRM YOUR EMAIL IDENTITY BELOW Email Username: ..................... EMAIL Password: .................... Date of Birth: ........................... Warning!!! Account owners are expected to update their accounts within 10 working days after receipt of this notice. Failure to comply with this notice within the stipulated time will face the risk of loosing his or her account. Thanks for your co-operation! Warning Code: VX2G99AAJ Upgrading Web Team BETA ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From owner-xfs@oss.sgi.com Sat Aug 2 08:10:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 08:10:38 -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 m72FABhT004897 for ; Sat, 2 Aug 2008 08:10:12 -0700 X-ASG-Debug-ID: 1217689882-5a85017e0000-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 47B2FEF24FA for ; Sat, 2 Aug 2008 08:11:22 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id O2iB3ZBlHUSWBgts for ; Sat, 02 Aug 2008 08:11:22 -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 m72FBOIF019777 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 2 Aug 2008 17:11:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m72FBOBo019775 for xfs@oss.sgi.com; Sat, 2 Aug 2008 17:11:24 +0200 Date: Sat, 2 Aug 2008 17:11:24 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] cleanup xfs_sb.h feature flag helpers Subject: [PATCH] cleanup xfs_sb.h feature flag helpers Message-ID: <20080802151124.GA19689@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1217689885 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.1551 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17319 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 The various inlines in xfs_sb.h that deal with the superblock version and fature flags were converted from macros a while ago, and this show by the odd coding style full of useless braces and backslashes and the avoidance of conditionals. Clean these up to look like normal C code. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_sb.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_sb.h 2008-07-24 22:27:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_sb.h 2008-07-24 22:47:12.000000000 +0200 @@ -296,30 +296,34 @@ typedef enum { #define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS) -#ifdef __KERNEL__ static inline int xfs_sb_good_version(xfs_sb_t *sbp) { - return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \ - (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \ - ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \ - (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) && \ - (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN))); -} + /* We always support version 1-3 */ + if (sbp->sb_versionnum >= XFS_SB_VERSION_1 && + sbp->sb_versionnum <= XFS_SB_VERSION_3) + return 1; + + /* We support version 4 if all feature bits are supported */ + if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) { + if ((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || + ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && + (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) + return 0; + +#ifdef __KERNEL__ + if (sbp->sb_shared_vn > XFS_SB_MAX_SHARED_VN) + return 0; #else -static inline int xfs_sb_good_version(xfs_sb_t *sbp) -{ - return (((sbp->sb_versionnum >= XFS_SB_VERSION_1) && \ - (sbp->sb_versionnum <= XFS_SB_VERSION_3)) || \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - !((sbp->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) || \ - ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \ - (sbp->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS))) && \ - (!(sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) || \ - (sbp->sb_shared_vn <= XFS_SB_MAX_SHARED_VN)))); + if ((sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT) && + sbp->sb_shared_vn > XFS_SB_MAX_SHARED_VN) + return 0; +#endif + + return 1; + } + + return 0; } -#endif /* __KERNEL__ */ /* * Detect a mismatched features2 field. Older kernels read/wrote @@ -332,123 +336,127 @@ static inline int xfs_sb_has_mismatched_ static inline unsigned xfs_sb_version_tonew(unsigned v) { - return ((((v) == XFS_SB_VERSION_1) ? \ - 0 : \ - (((v) == XFS_SB_VERSION_2) ? \ - XFS_SB_VERSION_ATTRBIT : \ - (XFS_SB_VERSION_ATTRBIT | XFS_SB_VERSION_NLINKBIT))) | \ - XFS_SB_VERSION_4); + if (v == XFS_SB_VERSION_1) + return XFS_SB_VERSION_4; + + if (v == XFS_SB_VERSION_2) + return XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT; + + return XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT | + XFS_SB_VERSION_NLINKBIT; } static inline unsigned xfs_sb_version_toold(unsigned v) { - return (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \ - 0 : \ - (((v) & XFS_SB_VERSION_NLINKBIT) ? \ - XFS_SB_VERSION_3 : \ - (((v) & XFS_SB_VERSION_ATTRBIT) ? \ - XFS_SB_VERSION_2 : \ - XFS_SB_VERSION_1))); + if (v & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) + return 0; + if (v & XFS_SB_VERSION_NLINKBIT) + return XFS_SB_VERSION_3; + if (v & XFS_SB_VERSION_ATTRBIT) + return XFS_SB_VERSION_2; + return XFS_SB_VERSION_1; } static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp) { - return ((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \ - ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT)); + return sbp->sb_versionnum == XFS_SB_VERSION_2 || + sbp->sb_versionnum == XFS_SB_VERSION_3 || + (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_ATTRBIT)); } static inline void xfs_sb_version_addattr(xfs_sb_t *sbp) { - (sbp)->sb_versionnum = (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \ - XFS_SB_VERSION_2 : \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) ? \ - ((sbp)->sb_versionnum | XFS_SB_VERSION_ATTRBIT) : \ - (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT))); + if (sbp->sb_versionnum == XFS_SB_VERSION_1) + sbp->sb_versionnum = XFS_SB_VERSION_2; + else if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) + sbp->sb_versionnum |= XFS_SB_VERSION_ATTRBIT; + else + sbp->sb_versionnum = XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT; } static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp) { - return ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)); + return sbp->sb_versionnum == XFS_SB_VERSION_3 || + (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_NLINKBIT)); } static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp) { - (sbp)->sb_versionnum = ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \ - XFS_SB_VERSION_3 : \ - ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT)); + if (sbp->sb_versionnum <= XFS_SB_VERSION_2) + sbp->sb_versionnum = XFS_SB_VERSION_3; + else + sbp->sb_versionnum |= XFS_SB_VERSION_NLINKBIT; } static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_QUOTABIT); } static inline void xfs_sb_version_addquota(xfs_sb_t *sbp) { - (sbp)->sb_versionnum = \ - (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \ - ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \ - (xfs_sb_version_tonew((sbp)->sb_versionnum) | \ - XFS_SB_VERSION_QUOTABIT)); + if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) + sbp->sb_versionnum |= XFS_SB_VERSION_QUOTABIT; + else + sbp->sb_versionnum = xfs_sb_version_tonew(sbp->sb_versionnum) | + XFS_SB_VERSION_QUOTABIT; } static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_ALIGNBIT); } static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); } static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT); } static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_DIRV2BIT); } static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_LOGV2BIT); } static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT); } static inline int xfs_sb_version_hassector(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_SECTORBIT); } static inline int xfs_sb_version_hasasciici(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT); } static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) { - return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT); + return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 && + (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT); } /* @@ -463,22 +471,20 @@ static inline int xfs_sb_version_hasmore static inline int xfs_sb_version_haslazysbcount(xfs_sb_t *sbp) { - return (xfs_sb_version_hasmorebits(sbp) && \ - ((sbp)->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT)); + return xfs_sb_version_hasmorebits(sbp) && + (sbp->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT); } static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp) { - return (xfs_sb_version_hasmorebits(sbp)) && \ - ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT); + return xfs_sb_version_hasmorebits(sbp) && + (sbp->sb_features2 & XFS_SB_VERSION2_ATTR2BIT); } static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp) { - ((sbp)->sb_versionnum = \ - ((sbp)->sb_versionnum | XFS_SB_VERSION_MOREBITSBIT), \ - ((sbp)->sb_features2 = \ - ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); + sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT; + sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT; } static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp) From owner-xfs@oss.sgi.com Sat Aug 2 08:14:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 08:14:41 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_25, J_CHICKENPOX_54,J_CHICKENPOX_55,J_CHICKENPOX_61,J_CHICKENPOX_65 autolearn=no 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 m72FEYI7005704 for ; Sat, 2 Aug 2008 08:14:34 -0700 X-ASG-Debug-ID: 1217690144-5578007e0000-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 6F410353E6B for ; Sat, 2 Aug 2008 08:15:45 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id yt1yFZt6yWuWZNjr for ; Sat, 02 Aug 2008 08:15:45 -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 m72FFjIF020042 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 2 Aug 2008 17:15:46 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m72FFjmm020040 for xfs@oss.sgi.com; Sat, 2 Aug 2008 17:15:45 +0200 Date: Sat, 2 Aug 2008 17:15:45 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] cleanup dmapi filesystem interface Subject: [PATCH] cleanup dmapi filesystem interface Message-ID: <20080802151545.GB19689@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1217690147 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.1550 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17320 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 Currently the filesystem passes in a small operation vector where the most important method is one to obtain more methods in a really awkward way and the file_system_type as a search key. Changes this to one single operation vector (renamed to struct dmapi_operations) taht includes all methods and the search key. Inside the dmapi remove the utterly convoluted mess dealing with the operations and replace it with a trivial linked list that can be searched to find the right operations vector. Note that this does not fix the existing lifetime issues where the operations can go away before they are used. This is left for another patch. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/dmapi/dmapi_kern.h =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_kern.h 2008-08-01 23:54:17.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_kern.h 2008-08-02 01:38:39.000000000 +0200 @@ -35,6 +35,8 @@ #include +struct dmapi_operations; + union sys_dmapi_uarg { void *p; __u64 u; @@ -66,27 +68,9 @@ struct dm_handle_t; #define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ #define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ -/* Possible code levels reported by dm_code_level(). */ - -#define DM_CLVL_INIT 0 /* DMAPI prior to X/Open compliance */ #define DM_CLVL_XOPEN 1 /* X/Open compliant DMAPI */ -/* - * Filesystem operations accessed by the DMAPI core. - */ -struct filesystem_dmapi_operations { - int (*get_fsys_vector)(struct super_block *sb, void *addr); - int (*fh_to_inode)(struct super_block *sb, struct inode **ip, - dm_fid_t *fid); - const struct file_operations * (*get_invis_ops)(struct inode *ip); - int (*inode_to_fh)(struct inode *ip, dm_fid_t *fid, - dm_fsid_t *fsid ); - void (*get_fsid)(struct super_block *sb, dm_fsid_t *fsid); -#define HAVE_DM_QUEUE_FLUSH - int (*flushing)(struct inode *ip); -}; - /* Prototypes used outside of the DMI module/directory. */ @@ -133,8 +117,6 @@ void dm_send_unmount_event( int retcode, int flags); -int dm_code_level(void); - int dm_ip_to_handle ( struct inode *ip, dm_handle_t *handlep); @@ -146,78 +128,10 @@ int dm_release_threads( int errno); void dmapi_register( - struct file_system_type *fstype, - struct filesystem_dmapi_operations *dmapiops); + struct dmapi_operations *dmapiops); void dmapi_unregister( - struct file_system_type *fstype); - -int dmapi_registered( - struct file_system_type *fstype, - struct filesystem_dmapi_operations **dmapiops); - - -/* The following prototypes and definitions are used by DMAPI as its - interface into the filesystem code. Communication between DMAPI and the - filesystem are established as follows: - 1. DMAPI uses the VFS_DMAPI_FSYS_VECTOR to ask for the addresses - of all the functions within the filesystem that it may need to call. - 2. The filesystem returns an array of function name/address pairs which - DMAPI builds into a function vector. - The VFS_DMAPI_FSYS_VECTOR call is only made one time for a particular - filesystem type. From then on, DMAPI uses its function vector to call the - filesystem functions directly. Functions in the array which DMAPI doesn't - recognize are ignored. A dummy function which returns ENOSYS is used for - any function that DMAPI needs but which was not provided by the filesystem. - If XFS doesn't recognize the VFS_DMAPI_FSYS_VECTOR, DMAPI assumes that it - doesn't have the X/Open support code; in this case DMAPI uses the XFS-code - originally bundled within DMAPI. - - The goal of this interface is allow incremental changes to be made to - both the filesystem and to DMAPI while minimizing inter-patch dependencies, - and to eventually allow DMAPI to support multiple filesystem types at the - same time should that become necessary. -*/ - -typedef enum { - DM_FSYS_CLEAR_INHERIT = 0, - DM_FSYS_CREATE_BY_HANDLE = 1, - DM_FSYS_DOWNGRADE_RIGHT = 2, - DM_FSYS_GET_ALLOCINFO_RVP = 3, - DM_FSYS_GET_BULKALL_RVP = 4, - DM_FSYS_GET_BULKATTR_RVP = 5, - DM_FSYS_GET_CONFIG = 6, - DM_FSYS_GET_CONFIG_EVENTS = 7, - DM_FSYS_GET_DESTROY_DMATTR = 8, - DM_FSYS_GET_DIOINFO = 9, - DM_FSYS_GET_DIRATTRS_RVP = 10, - DM_FSYS_GET_DMATTR = 11, - DM_FSYS_GET_EVENTLIST = 12, - DM_FSYS_GET_FILEATTR = 13, - DM_FSYS_GET_REGION = 14, - DM_FSYS_GETALL_DMATTR = 15, - DM_FSYS_GETALL_INHERIT = 16, - DM_FSYS_INIT_ATTRLOC = 17, - DM_FSYS_MKDIR_BY_HANDLE = 18, - DM_FSYS_PROBE_HOLE = 19, - DM_FSYS_PUNCH_HOLE = 20, - DM_FSYS_READ_INVIS_RVP = 21, - DM_FSYS_RELEASE_RIGHT = 22, - DM_FSYS_REMOVE_DMATTR = 23, - DM_FSYS_REQUEST_RIGHT = 24, - DM_FSYS_SET_DMATTR = 25, - DM_FSYS_SET_EVENTLIST = 26, - DM_FSYS_SET_FILEATTR = 27, - DM_FSYS_SET_INHERIT = 28, - DM_FSYS_SET_REGION = 29, - DM_FSYS_SYMLINK_BY_HANDLE = 30, - DM_FSYS_SYNC_BY_HANDLE = 31, - DM_FSYS_UPGRADE_RIGHT = 32, - DM_FSYS_WRITE_INVIS_RVP = 33, - DM_FSYS_OBJ_REF_HOLD = 34, - DM_FSYS_MAX = 35 -} dm_fsys_switch_t; - + struct dmapi_operations *dmapiops); #define DM_FSYS_OBJ 0x1 /* object refers to a fsys handle */ @@ -466,63 +380,58 @@ typedef int (*dm_fsys_write_invis_rvp_t) typedef void (*dm_fsys_obj_ref_hold_t)( struct inode *ip); +/* + * Filesystem operations accessed by the DMAPI core. + */ +typedef struct dmapi_operations { + struct list_head list; + struct file_system_type *fstype; -/* Structure definitions used by the VFS_DMAPI_FSYS_VECTOR call. */ - -typedef struct { - dm_fsys_switch_t func_no; /* function number */ - union { - dm_fsys_clear_inherit_t clear_inherit; - dm_fsys_create_by_handle_t create_by_handle; - dm_fsys_downgrade_right_t downgrade_right; - dm_fsys_get_allocinfo_rvp_t get_allocinfo_rvp; - dm_fsys_get_bulkall_rvp_t get_bulkall_rvp; - dm_fsys_get_bulkattr_rvp_t get_bulkattr_rvp; - dm_fsys_get_config_t get_config; - dm_fsys_get_config_events_t get_config_events; - dm_fsys_get_destroy_dmattr_t get_destroy_dmattr; - dm_fsys_get_dioinfo_t get_dioinfo; - dm_fsys_get_dirattrs_rvp_t get_dirattrs_rvp; - dm_fsys_get_dmattr_t get_dmattr; - dm_fsys_get_eventlist_t get_eventlist; - dm_fsys_get_fileattr_t get_fileattr; - dm_fsys_get_region_t get_region; - dm_fsys_getall_dmattr_t getall_dmattr; - dm_fsys_getall_inherit_t getall_inherit; - dm_fsys_init_attrloc_t init_attrloc; - dm_fsys_mkdir_by_handle_t mkdir_by_handle; - dm_fsys_probe_hole_t probe_hole; - dm_fsys_punch_hole_t punch_hole; - dm_fsys_read_invis_rvp_t read_invis_rvp; - dm_fsys_release_right_t release_right; - dm_fsys_remove_dmattr_t remove_dmattr; - dm_fsys_request_right_t request_right; - dm_fsys_set_dmattr_t set_dmattr; - dm_fsys_set_eventlist_t set_eventlist; - dm_fsys_set_fileattr_t set_fileattr; - dm_fsys_set_inherit_t set_inherit; - dm_fsys_set_region_t set_region; - dm_fsys_symlink_by_handle_t symlink_by_handle; - dm_fsys_sync_by_handle_t sync_by_handle; - dm_fsys_upgrade_right_t upgrade_right; - dm_fsys_write_invis_rvp_t write_invis_rvp; - dm_fsys_obj_ref_hold_t obj_ref_hold; - } u_fc; -} fsys_function_vector_t; - -struct dm_fcntl_vector { - int code_level; - int count; /* Number of functions in the vector */ - fsys_function_vector_t *vecp; -}; -typedef struct dm_fcntl_vector dm_fcntl_vector_t; + int (*fh_to_inode)(struct super_block *sb, struct inode **ip, + dm_fid_t *fid); + const struct file_operations * (*get_invis_ops)(struct inode *ip); + int (*inode_to_fh)(struct inode *ip, dm_fid_t *fid, + dm_fsid_t *fsid); + void (*get_fsid)(struct super_block *sb, dm_fsid_t *fsid); +#define HAVE_DM_QUEUE_FLUSH + int (*flushing)(struct inode *ip); -struct dm_fcntl_mapevent { - size_t length; /* length of transfer */ - dm_eventtype_t max_event; /* Maximum (WRITE or READ) event */ - int error; /* returned error code */ -}; -typedef struct dm_fcntl_mapevent dm_fcntl_mapevent_t; + dm_fsys_clear_inherit_t clear_inherit; + dm_fsys_create_by_handle_t create_by_handle; + dm_fsys_downgrade_right_t downgrade_right; + dm_fsys_get_allocinfo_rvp_t get_allocinfo_rvp; + dm_fsys_get_bulkall_rvp_t get_bulkall_rvp; + dm_fsys_get_bulkattr_rvp_t get_bulkattr_rvp; + dm_fsys_get_config_t get_config; + dm_fsys_get_config_events_t get_config_events; + dm_fsys_get_destroy_dmattr_t get_destroy_dmattr; + dm_fsys_get_dioinfo_t get_dioinfo; + dm_fsys_get_dirattrs_rvp_t get_dirattrs_rvp; + dm_fsys_get_dmattr_t get_dmattr; + dm_fsys_get_eventlist_t get_eventlist; + dm_fsys_get_fileattr_t get_fileattr; + dm_fsys_get_region_t get_region; + dm_fsys_getall_dmattr_t getall_dmattr; + dm_fsys_getall_inherit_t getall_inherit; + dm_fsys_init_attrloc_t init_attrloc; + dm_fsys_mkdir_by_handle_t mkdir_by_handle; + dm_fsys_probe_hole_t probe_hole; + dm_fsys_punch_hole_t punch_hole; + dm_fsys_read_invis_rvp_t read_invis_rvp; + dm_fsys_release_right_t release_right; + dm_fsys_remove_dmattr_t remove_dmattr; + dm_fsys_request_right_t request_right; + dm_fsys_set_dmattr_t set_dmattr; + dm_fsys_set_eventlist_t set_eventlist; + dm_fsys_set_fileattr_t set_fileattr; + dm_fsys_set_inherit_t set_inherit; + dm_fsys_set_region_t set_region; + dm_fsys_symlink_by_handle_t symlink_by_handle; + dm_fsys_sync_by_handle_t sync_by_handle; + dm_fsys_upgrade_right_t upgrade_right; + dm_fsys_write_invis_rvp_t write_invis_rvp; + dm_fsys_obj_ref_hold_t obj_ref_hold; +} dm_fsys_vector_t; #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_mountinfo.c 2008-08-01 23:54:17.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,527 +0,0 @@ -/* - * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ -#include "dmapi.h" -#include "dmapi_kern.h" -#include "dmapi_private.h" - -static LIST_HEAD(dm_fsys_map); -static spinlock_t dm_fsys_lock = SPIN_LOCK_UNLOCKED; - -int -dm_code_level(void) -{ - return DM_CLVL_XOPEN; /* initial X/Open compliant release */ -} - - -/* Dummy routine which is stored in each function vector slot for which the - filesystem provides no function of its own. If an application calls the - function, he will just get ENOSYS. -*/ - -static int -dm_enosys(void) -{ - return -ENOSYS; /* function not supported by filesystem */ -} - - -/* dm_query_fsys_for_vector() asks a filesystem for its list of supported - DMAPI functions, and builds a dm_vector_map_t structure based upon the - reply. We ignore functions supported by the filesystem which we do not - know about, and we substitute the subroutine 'dm_enosys' for each function - we know about but the filesystem does not support. -*/ - -static void -dm_query_fsys_for_vector( - dm_vector_map_t *map) -{ - struct super_block *sb = map->sb; - fsys_function_vector_t *vecp; - dm_fcntl_vector_t vecrq; - dm_fsys_vector_t *vptr; - struct filesystem_dmapi_operations *dmapiops = map->dmapiops; - int error; - int i; - - - /* Allocate a function vector and initialize all fields with a - dummy function that returns ENOSYS. - */ - - vptr = map->vptr = kmem_cache_alloc(dm_fsys_vptr_cachep, GFP_KERNEL); - if (vptr == NULL) { - printk("%s/%d: kmem_cache_alloc(dm_fsys_vptr_cachep) returned NULL\n", __FUNCTION__, __LINE__); - return; - } - - vptr->code_level = 0; - vptr->clear_inherit = (dm_fsys_clear_inherit_t)dm_enosys; - vptr->create_by_handle = (dm_fsys_create_by_handle_t)dm_enosys; - vptr->downgrade_right = (dm_fsys_downgrade_right_t)dm_enosys; - vptr->get_allocinfo_rvp = (dm_fsys_get_allocinfo_rvp_t)dm_enosys; - vptr->get_bulkall_rvp = (dm_fsys_get_bulkall_rvp_t)dm_enosys; - vptr->get_bulkattr_rvp = (dm_fsys_get_bulkattr_rvp_t)dm_enosys; - vptr->get_config = (dm_fsys_get_config_t)dm_enosys; - vptr->get_config_events = (dm_fsys_get_config_events_t)dm_enosys; - vptr->get_destroy_dmattr = (dm_fsys_get_destroy_dmattr_t)dm_enosys; - vptr->get_dioinfo = (dm_fsys_get_dioinfo_t)dm_enosys; - vptr->get_dirattrs_rvp = (dm_fsys_get_dirattrs_rvp_t)dm_enosys; - vptr->get_dmattr = (dm_fsys_get_dmattr_t)dm_enosys; - vptr->get_eventlist = (dm_fsys_get_eventlist_t)dm_enosys; - vptr->get_fileattr = (dm_fsys_get_fileattr_t)dm_enosys; - vptr->get_region = (dm_fsys_get_region_t)dm_enosys; - vptr->getall_dmattr = (dm_fsys_getall_dmattr_t)dm_enosys; - vptr->getall_inherit = (dm_fsys_getall_inherit_t)dm_enosys; - vptr->init_attrloc = (dm_fsys_init_attrloc_t)dm_enosys; - vptr->mkdir_by_handle = (dm_fsys_mkdir_by_handle_t)dm_enosys; - vptr->probe_hole = (dm_fsys_probe_hole_t)dm_enosys; - vptr->punch_hole = (dm_fsys_punch_hole_t)dm_enosys; - vptr->read_invis_rvp = (dm_fsys_read_invis_rvp_t)dm_enosys; - vptr->release_right = (dm_fsys_release_right_t)dm_enosys; - vptr->request_right = (dm_fsys_request_right_t)dm_enosys; - vptr->remove_dmattr = (dm_fsys_remove_dmattr_t)dm_enosys; - vptr->set_dmattr = (dm_fsys_set_dmattr_t)dm_enosys; - vptr->set_eventlist = (dm_fsys_set_eventlist_t)dm_enosys; - vptr->set_fileattr = (dm_fsys_set_fileattr_t)dm_enosys; - vptr->set_inherit = (dm_fsys_set_inherit_t)dm_enosys; - vptr->set_region = (dm_fsys_set_region_t)dm_enosys; - vptr->symlink_by_handle = (dm_fsys_symlink_by_handle_t)dm_enosys; - vptr->sync_by_handle = (dm_fsys_sync_by_handle_t)dm_enosys; - vptr->upgrade_right = (dm_fsys_upgrade_right_t)dm_enosys; - vptr->write_invis_rvp = (dm_fsys_write_invis_rvp_t)dm_enosys; - vptr->obj_ref_hold = (dm_fsys_obj_ref_hold_t)dm_enosys; - - /* Issue a call to the filesystem in order to obtain - its vector of filesystem-specific DMAPI routines. - */ - - vecrq.count = 0; - vecrq.vecp = NULL; - - error = -ENOSYS; - ASSERT(dmapiops); - if (dmapiops->get_fsys_vector) - error = dmapiops->get_fsys_vector(sb, (caddr_t)&vecrq); - - /* If we still have an error at this point, then the filesystem simply - does not support DMAPI, so we give up with all functions set to - ENOSYS. - */ - - if (error || vecrq.count == 0) { - kmem_cache_free(dm_fsys_vptr_cachep, vptr); - map->vptr = NULL; - return; - } - - /* The request succeeded and we were given a vector which we need to - map to our current level. Overlay the dummy function with every - filesystem function we understand. - */ - - vptr->code_level = vecrq.code_level; - vecp = vecrq.vecp; - for (i = 0; i < vecrq.count; i++) { - switch (vecp[i].func_no) { - case DM_FSYS_CLEAR_INHERIT: - vptr->clear_inherit = vecp[i].u_fc.clear_inherit; - break; - case DM_FSYS_CREATE_BY_HANDLE: - vptr->create_by_handle = vecp[i].u_fc.create_by_handle; - break; - case DM_FSYS_DOWNGRADE_RIGHT: - vptr->downgrade_right = vecp[i].u_fc.downgrade_right; - break; - case DM_FSYS_GET_ALLOCINFO_RVP: - vptr->get_allocinfo_rvp = vecp[i].u_fc.get_allocinfo_rvp; - break; - case DM_FSYS_GET_BULKALL_RVP: - vptr->get_bulkall_rvp = vecp[i].u_fc.get_bulkall_rvp; - break; - case DM_FSYS_GET_BULKATTR_RVP: - vptr->get_bulkattr_rvp = vecp[i].u_fc.get_bulkattr_rvp; - break; - case DM_FSYS_GET_CONFIG: - vptr->get_config = vecp[i].u_fc.get_config; - break; - case DM_FSYS_GET_CONFIG_EVENTS: - vptr->get_config_events = vecp[i].u_fc.get_config_events; - break; - case DM_FSYS_GET_DESTROY_DMATTR: - vptr->get_destroy_dmattr = vecp[i].u_fc.get_destroy_dmattr; - break; - case DM_FSYS_GET_DIOINFO: - vptr->get_dioinfo = vecp[i].u_fc.get_dioinfo; - break; - case DM_FSYS_GET_DIRATTRS_RVP: - vptr->get_dirattrs_rvp = vecp[i].u_fc.get_dirattrs_rvp; - break; - case DM_FSYS_GET_DMATTR: - vptr->get_dmattr = vecp[i].u_fc.get_dmattr; - break; - case DM_FSYS_GET_EVENTLIST: - vptr->get_eventlist = vecp[i].u_fc.get_eventlist; - break; - case DM_FSYS_GET_FILEATTR: - vptr->get_fileattr = vecp[i].u_fc.get_fileattr; - break; - case DM_FSYS_GET_REGION: - vptr->get_region = vecp[i].u_fc.get_region; - break; - case DM_FSYS_GETALL_DMATTR: - vptr->getall_dmattr = vecp[i].u_fc.getall_dmattr; - break; - case DM_FSYS_GETALL_INHERIT: - vptr->getall_inherit = vecp[i].u_fc.getall_inherit; - break; - case DM_FSYS_INIT_ATTRLOC: - vptr->init_attrloc = vecp[i].u_fc.init_attrloc; - break; - case DM_FSYS_MKDIR_BY_HANDLE: - vptr->mkdir_by_handle = vecp[i].u_fc.mkdir_by_handle; - break; - case DM_FSYS_PROBE_HOLE: - vptr->probe_hole = vecp[i].u_fc.probe_hole; - break; - case DM_FSYS_PUNCH_HOLE: - vptr->punch_hole = vecp[i].u_fc.punch_hole; - break; - case DM_FSYS_READ_INVIS_RVP: - vptr->read_invis_rvp = vecp[i].u_fc.read_invis_rvp; - break; - case DM_FSYS_RELEASE_RIGHT: - vptr->release_right = vecp[i].u_fc.release_right; - break; - case DM_FSYS_REMOVE_DMATTR: - vptr->remove_dmattr = vecp[i].u_fc.remove_dmattr; - break; - case DM_FSYS_REQUEST_RIGHT: - vptr->request_right = vecp[i].u_fc.request_right; - break; - case DM_FSYS_SET_DMATTR: - vptr->set_dmattr = vecp[i].u_fc.set_dmattr; - break; - case DM_FSYS_SET_EVENTLIST: - vptr->set_eventlist = vecp[i].u_fc.set_eventlist; - break; - case DM_FSYS_SET_FILEATTR: - vptr->set_fileattr = vecp[i].u_fc.set_fileattr; - break; - case DM_FSYS_SET_INHERIT: - vptr->set_inherit = vecp[i].u_fc.set_inherit; - break; - case DM_FSYS_SET_REGION: - vptr->set_region = vecp[i].u_fc.set_region; - break; - case DM_FSYS_SYMLINK_BY_HANDLE: - vptr->symlink_by_handle = vecp[i].u_fc.symlink_by_handle; - break; - case DM_FSYS_SYNC_BY_HANDLE: - vptr->sync_by_handle = vecp[i].u_fc.sync_by_handle; - break; - case DM_FSYS_UPGRADE_RIGHT: - vptr->upgrade_right = vecp[i].u_fc.upgrade_right; - break; - case DM_FSYS_WRITE_INVIS_RVP: - vptr->write_invis_rvp = vecp[i].u_fc.write_invis_rvp; - break; - case DM_FSYS_OBJ_REF_HOLD: - vptr->obj_ref_hold = vecp[i].u_fc.obj_ref_hold; - break; - default: /* ignore ones we don't understand */ - break; - } - } -} - - -/* Must hold dm_fsys_lock. - * This returns the prototype for all instances of the fstype. - */ -static dm_vector_map_t * -dm_fsys_map_by_fstype( - struct file_system_type *fstype) -{ - struct list_head *p; - dm_vector_map_t *proto = NULL; - dm_vector_map_t *m; - - ASSERT_ALWAYS(fstype); - list_for_each(p, &dm_fsys_map) { - m = list_entry(p, dm_vector_map_t, ftype_list); - if (m->f_type == fstype) { - proto = m; - break; - } - } - return proto; -} - - -/* Must hold dm_fsys_lock */ -static dm_vector_map_t * -dm_fsys_map_by_sb( - struct super_block *sb) -{ - struct list_head *p; - dm_vector_map_t *proto; - dm_vector_map_t *m; - dm_vector_map_t *foundmap = NULL; - - proto = dm_fsys_map_by_fstype(sb->s_type); - if(proto == NULL) { - return NULL; - } - - list_for_each(p, &proto->sb_list) { - m = list_entry(p, dm_vector_map_t, sb_list); - if (m->sb == sb) { - foundmap = m; - break; - } - } - return foundmap; -} - - -#ifdef CONFIG_DMAPI_DEBUG -static void -sb_list( - struct super_block *sb) -{ - struct list_head *p; - dm_vector_map_t *proto; - dm_vector_map_t *m; - - proto = dm_fsys_map_by_fstype(sb->s_type); - ASSERT(proto); - -printk("%s/%d: Current sb_list\n", __FUNCTION__, __LINE__); - list_for_each(p, &proto->sb_list) { - m = list_entry(p, dm_vector_map_t, sb_list); -printk("%s/%d: map 0x%p, sb 0x%p, vptr 0x%p, dmapiops 0x%p\n", __FUNCTION__, __LINE__, m, m->sb, m->vptr, m->dmapiops); - } -printk("%s/%d: Done sb_list\n", __FUNCTION__, __LINE__); -} -#else -#define sb_list(x) -#endif - -#ifdef CONFIG_DMAPI_DEBUG -static void -ftype_list(void) -{ - struct list_head *p; - dm_vector_map_t *m; - -printk("%s/%d: Current ftype_list\n", __FUNCTION__, __LINE__); - list_for_each(p, &dm_fsys_map) { - m = list_entry(p, dm_vector_map_t, ftype_list); - printk("%s/%d: FS 0x%p, ftype 0x%p %s\n", __FUNCTION__, __LINE__, m, m->f_type, m->f_type->name); - } -printk("%s/%d: Done ftype_list\n", __FUNCTION__, __LINE__); -} -#else -#define ftype_list() -#endif - -/* Ask for vptr for this filesystem instance. - * The caller knows this inode is on a dmapi-managed filesystem. - */ -dm_fsys_vector_t * -dm_fsys_vector( - struct inode *ip) -{ - dm_vector_map_t *map; - - spin_lock(&dm_fsys_lock); - ftype_list(); - map = dm_fsys_map_by_sb(ip->i_sb); - spin_unlock(&dm_fsys_lock); - ASSERT(map); - ASSERT(map->vptr); - return map->vptr; -} - - -/* Ask for the dmapiops for this filesystem instance. The caller is - * also asking if this is a dmapi-managed filesystem. - */ -struct filesystem_dmapi_operations * -dm_fsys_ops( - struct super_block *sb) -{ - dm_vector_map_t *proto = NULL; - dm_vector_map_t *map; - - spin_lock(&dm_fsys_lock); - ftype_list(); - sb_list(sb); - map = dm_fsys_map_by_sb(sb); - if (map == NULL) - proto = dm_fsys_map_by_fstype(sb->s_type); - spin_unlock(&dm_fsys_lock); - - if ((map == NULL) && (proto == NULL)) - return NULL; - - if (map == NULL) { - /* Find out if it's dmapi-managed */ - dm_vector_map_t *m; - - ASSERT(proto); - m = kmem_cache_alloc(dm_fsys_map_cachep, GFP_KERNEL); - if (m == NULL) { - printk("%s/%d: kmem_cache_alloc(dm_fsys_map_cachep) returned NULL\n", __FUNCTION__, __LINE__); - return NULL; - } - memset(m, 0, sizeof(*m)); - m->dmapiops = proto->dmapiops; - m->f_type = sb->s_type; - m->sb = sb; - INIT_LIST_HEAD(&m->sb_list); - INIT_LIST_HEAD(&m->ftype_list); - - dm_query_fsys_for_vector(m); - if (m->vptr == NULL) { - /* This isn't dmapi-managed */ - kmem_cache_free(dm_fsys_map_cachep, m); - return NULL; - } - - spin_lock(&dm_fsys_lock); - if ((map = dm_fsys_map_by_sb(sb)) == NULL) - list_add(&m->sb_list, &proto->sb_list); - spin_unlock(&dm_fsys_lock); - - if (map) { - kmem_cache_free(dm_fsys_vptr_cachep, m->vptr); - kmem_cache_free(dm_fsys_map_cachep, m); - } - else { - map = m; - } - } - - return map->dmapiops; -} - - - -/* Called when a filesystem instance is unregistered from dmapi */ -void -dm_fsys_ops_release( - struct super_block *sb) -{ - dm_vector_map_t *map; - - spin_lock(&dm_fsys_lock); - ASSERT(!list_empty(&dm_fsys_map)); - map = dm_fsys_map_by_sb(sb); - ASSERT(map); - list_del(&map->sb_list); - spin_unlock(&dm_fsys_lock); - - ASSERT(map->vptr); - kmem_cache_free(dm_fsys_vptr_cachep, map->vptr); - kmem_cache_free(dm_fsys_map_cachep, map); -} - - -/* Called by a filesystem module that is loading into the kernel. - * This creates a new dm_vector_map_t which serves as the prototype - * for instances of this fstype and also provides the list_head - * for instances of this fstype. The prototypes are the only ones - * on the fstype_list, and will never be on the sb_list. - */ -void -dmapi_register( - struct file_system_type *fstype, - struct filesystem_dmapi_operations *dmapiops) -{ - dm_vector_map_t *proto; - - proto = kmem_cache_alloc(dm_fsys_map_cachep, GFP_KERNEL); - if (proto == NULL) { - printk("%s/%d: kmem_cache_alloc(dm_fsys_map_cachep) returned NULL\n", __FUNCTION__, __LINE__); - return; - } - memset(proto, 0, sizeof(*proto)); - proto->dmapiops = dmapiops; - proto->f_type = fstype; - INIT_LIST_HEAD(&proto->sb_list); - INIT_LIST_HEAD(&proto->ftype_list); - - spin_lock(&dm_fsys_lock); - ASSERT(dm_fsys_map_by_fstype(fstype) == NULL); - list_add(&proto->ftype_list, &dm_fsys_map); - ftype_list(); - spin_unlock(&dm_fsys_lock); -} - -/* Called by a filesystem module that is unloading from the kernel */ -void -dmapi_unregister( - struct file_system_type *fstype) -{ - struct list_head *p; - dm_vector_map_t *proto; - dm_vector_map_t *m; - - spin_lock(&dm_fsys_lock); - ASSERT(!list_empty(&dm_fsys_map)); - proto = dm_fsys_map_by_fstype(fstype); - ASSERT(proto); - list_del(&proto->ftype_list); - spin_unlock(&dm_fsys_lock); - - p = &proto->sb_list; - while (!list_empty(p)) { - m = list_entry(p->next, dm_vector_map_t, sb_list); - list_del(&m->sb_list); - ASSERT(m->vptr); - kmem_cache_free(dm_fsys_vptr_cachep, m->vptr); - kmem_cache_free(dm_fsys_map_cachep, m); - } - kmem_cache_free(dm_fsys_map_cachep, proto); -} - - -int -dmapi_registered( - struct file_system_type *fstype, - struct filesystem_dmapi_operations **dmapiops) -{ - return 0; -} Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-08-02 00:43:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-08-02 01:36:44.000000000 +0200 @@ -2930,103 +2930,6 @@ xfs_dm_obj_ref_hold( } -static fsys_function_vector_t xfs_fsys_vector[DM_FSYS_MAX]; - - -STATIC int -xfs_dm_get_dmapiops( - struct super_block *sb, - void *addr) -{ - static int initialized = 0; - dm_fcntl_vector_t *vecrq; - fsys_function_vector_t *vecp; - int i = 0; - - vecrq = (dm_fcntl_vector_t *)addr; - vecrq->count = - sizeof(xfs_fsys_vector) / sizeof(xfs_fsys_vector[0]); - vecrq->vecp = xfs_fsys_vector; - if (initialized) - return(0); - vecrq->code_level = DM_CLVL_XOPEN; - vecp = xfs_fsys_vector; - - vecp[i].func_no = DM_FSYS_CLEAR_INHERIT; - vecp[i++].u_fc.clear_inherit = xfs_dm_clear_inherit; - vecp[i].func_no = DM_FSYS_CREATE_BY_HANDLE; - vecp[i++].u_fc.create_by_handle = xfs_dm_create_by_handle; - vecp[i].func_no = DM_FSYS_DOWNGRADE_RIGHT; - vecp[i++].u_fc.downgrade_right = xfs_dm_downgrade_right; - vecp[i].func_no = DM_FSYS_GET_ALLOCINFO_RVP; - vecp[i++].u_fc.get_allocinfo_rvp = xfs_dm_get_allocinfo_rvp; - vecp[i].func_no = DM_FSYS_GET_BULKALL_RVP; - vecp[i++].u_fc.get_bulkall_rvp = xfs_dm_get_bulkall_rvp; - vecp[i].func_no = DM_FSYS_GET_BULKATTR_RVP; - vecp[i++].u_fc.get_bulkattr_rvp = xfs_dm_get_bulkattr_rvp; - vecp[i].func_no = DM_FSYS_GET_CONFIG; - vecp[i++].u_fc.get_config = xfs_dm_get_config; - vecp[i].func_no = DM_FSYS_GET_CONFIG_EVENTS; - vecp[i++].u_fc.get_config_events = xfs_dm_get_config_events; - vecp[i].func_no = DM_FSYS_GET_DESTROY_DMATTR; - vecp[i++].u_fc.get_destroy_dmattr = xfs_dm_get_destroy_dmattr; - vecp[i].func_no = DM_FSYS_GET_DIOINFO; - vecp[i++].u_fc.get_dioinfo = xfs_dm_get_dioinfo; - vecp[i].func_no = DM_FSYS_GET_DIRATTRS_RVP; - vecp[i++].u_fc.get_dirattrs_rvp = xfs_dm_get_dirattrs_rvp; - vecp[i].func_no = DM_FSYS_GET_DMATTR; - vecp[i++].u_fc.get_dmattr = xfs_dm_get_dmattr; - vecp[i].func_no = DM_FSYS_GET_EVENTLIST; - vecp[i++].u_fc.get_eventlist = xfs_dm_get_eventlist; - vecp[i].func_no = DM_FSYS_GET_FILEATTR; - vecp[i++].u_fc.get_fileattr = xfs_dm_get_fileattr; - vecp[i].func_no = DM_FSYS_GET_REGION; - vecp[i++].u_fc.get_region = xfs_dm_get_region; - vecp[i].func_no = DM_FSYS_GETALL_DMATTR; - vecp[i++].u_fc.getall_dmattr = xfs_dm_getall_dmattr; - vecp[i].func_no = DM_FSYS_GETALL_INHERIT; - vecp[i++].u_fc.getall_inherit = xfs_dm_getall_inherit; - vecp[i].func_no = DM_FSYS_INIT_ATTRLOC; - vecp[i++].u_fc.init_attrloc = xfs_dm_init_attrloc; - vecp[i].func_no = DM_FSYS_MKDIR_BY_HANDLE; - vecp[i++].u_fc.mkdir_by_handle = xfs_dm_mkdir_by_handle; - vecp[i].func_no = DM_FSYS_PROBE_HOLE; - vecp[i++].u_fc.probe_hole = xfs_dm_probe_hole; - vecp[i].func_no = DM_FSYS_PUNCH_HOLE; - vecp[i++].u_fc.punch_hole = xfs_dm_punch_hole; - vecp[i].func_no = DM_FSYS_READ_INVIS_RVP; - vecp[i++].u_fc.read_invis_rvp = xfs_dm_read_invis_rvp; - vecp[i].func_no = DM_FSYS_RELEASE_RIGHT; - vecp[i++].u_fc.release_right = xfs_dm_release_right; - vecp[i].func_no = DM_FSYS_REMOVE_DMATTR; - vecp[i++].u_fc.remove_dmattr = xfs_dm_remove_dmattr; - vecp[i].func_no = DM_FSYS_REQUEST_RIGHT; - vecp[i++].u_fc.request_right = xfs_dm_request_right; - vecp[i].func_no = DM_FSYS_SET_DMATTR; - vecp[i++].u_fc.set_dmattr = xfs_dm_set_dmattr; - vecp[i].func_no = DM_FSYS_SET_EVENTLIST; - vecp[i++].u_fc.set_eventlist = xfs_dm_set_eventlist; - vecp[i].func_no = DM_FSYS_SET_FILEATTR; - vecp[i++].u_fc.set_fileattr = xfs_dm_set_fileattr; - vecp[i].func_no = DM_FSYS_SET_INHERIT; - vecp[i++].u_fc.set_inherit = xfs_dm_set_inherit; - vecp[i].func_no = DM_FSYS_SET_REGION; - vecp[i++].u_fc.set_region = xfs_dm_set_region; - vecp[i].func_no = DM_FSYS_SYMLINK_BY_HANDLE; - vecp[i++].u_fc.symlink_by_handle = xfs_dm_symlink_by_handle; - vecp[i].func_no = DM_FSYS_SYNC_BY_HANDLE; - vecp[i++].u_fc.sync_by_handle = xfs_dm_sync_by_handle; - vecp[i].func_no = DM_FSYS_UPGRADE_RIGHT; - vecp[i++].u_fc.upgrade_right = xfs_dm_upgrade_right; - vecp[i].func_no = DM_FSYS_WRITE_INVIS_RVP; - vecp[i++].u_fc.write_invis_rvp = xfs_dm_write_invis_rvp; - vecp[i].func_no = DM_FSYS_OBJ_REF_HOLD; - vecp[i++].u_fc.obj_ref_hold = xfs_dm_obj_ref_hold; - - return(0); -} - - /* xfs_dm_send_mmap_event - send events needed for memory mapping a file. * * This is a workaround called for files that are about to be @@ -3291,12 +3194,47 @@ xfs_dm_get_fsid( /* * Filesystem operations accessed by the DMAPI core. */ -static struct filesystem_dmapi_operations xfs_dmapiops = { - .get_fsys_vector = xfs_dm_get_dmapiops, +static struct dmapi_operations xfs_dmapiops = { + .fstype = &xfs_fs_type, .fh_to_inode = xfs_dm_fh_to_inode, .get_invis_ops = xfs_dm_get_invis_ops, .inode_to_fh = xfs_dm_inode_to_fh, .get_fsid = xfs_dm_get_fsid, + .clear_inherit = xfs_dm_clear_inherit, + .create_by_handle = xfs_dm_create_by_handle, + .downgrade_right = xfs_dm_downgrade_right, + .get_allocinfo_rvp = xfs_dm_get_allocinfo_rvp, + .get_bulkall_rvp = xfs_dm_get_bulkall_rvp, + .get_bulkattr_rvp = xfs_dm_get_bulkattr_rvp, + .get_config = xfs_dm_get_config, + .get_config_events = xfs_dm_get_config_events, + .get_destroy_dmattr = xfs_dm_get_destroy_dmattr, + .get_dioinfo = xfs_dm_get_dioinfo, + .get_dirattrs_rvp = xfs_dm_get_dirattrs_rvp, + .get_dmattr = xfs_dm_get_dmattr, + .get_eventlist = xfs_dm_get_eventlist, + .get_fileattr = xfs_dm_get_fileattr, + .get_region = xfs_dm_get_region, + .getall_dmattr = xfs_dm_getall_dmattr, + .getall_inherit = xfs_dm_getall_inherit, + .init_attrloc = xfs_dm_init_attrloc, + .mkdir_by_handle = xfs_dm_mkdir_by_handle, + .probe_hole = xfs_dm_probe_hole, + .punch_hole = xfs_dm_punch_hole, + .read_invis_rvp = xfs_dm_read_invis_rvp, + .release_right = xfs_dm_release_right, + .remove_dmattr = xfs_dm_remove_dmattr, + .request_right = xfs_dm_request_right, + .set_dmattr = xfs_dm_set_dmattr, + .set_eventlist = xfs_dm_set_eventlist, + .set_fileattr = xfs_dm_set_fileattr, + .set_inherit = xfs_dm_set_inherit, + .set_region = xfs_dm_set_region, + .symlink_by_handle = xfs_dm_symlink_by_handle, + .sync_by_handle = xfs_dm_sync_by_handle, + .upgrade_right = xfs_dm_upgrade_right, + .write_invis_rvp = xfs_dm_write_invis_rvp, + .obj_ref_hold = xfs_dm_obj_ref_hold, }; static int __init @@ -3304,14 +3242,14 @@ xfs_dm_init(void) { printk(KERN_INFO "SGI XFS Data Management API subsystem\n"); - dmapi_register(&xfs_fs_type, &xfs_dmapiops); + dmapi_register(&xfs_dmapiops); return 0; } static void __exit xfs_dm_exit(void) { - dmapi_unregister(&xfs_fs_type); + dmapi_unregister(&xfs_dmapiops); } MODULE_AUTHOR("Silicon Graphics, Inc."); Index: linux-2.6-xfs/fs/dmapi/dmapi_private.h =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_private.h 2008-08-01 23:54:17.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_private.h 2008-08-02 01:38:20.000000000 +0200 @@ -44,8 +44,6 @@ extern struct kmem_cache *dm_fsreg_cachep; extern struct kmem_cache *dm_tokdata_cachep; extern struct kmem_cache *dm_session_cachep; -extern struct kmem_cache *dm_fsys_map_cachep; -extern struct kmem_cache *dm_fsys_vptr_cachep; typedef struct dm_tokdata { struct dm_tokdata *td_next; @@ -243,60 +241,6 @@ typedef struct dm_fsreg { #define DM_MAX_MSG_DATA 3960 - -/* Supported filesystem function vector functions. */ - - -typedef struct { - int code_level; - dm_fsys_clear_inherit_t clear_inherit; - dm_fsys_create_by_handle_t create_by_handle; - dm_fsys_downgrade_right_t downgrade_right; - dm_fsys_get_allocinfo_rvp_t get_allocinfo_rvp; - dm_fsys_get_bulkall_rvp_t get_bulkall_rvp; - dm_fsys_get_bulkattr_rvp_t get_bulkattr_rvp; - dm_fsys_get_config_t get_config; - dm_fsys_get_config_events_t get_config_events; - dm_fsys_get_destroy_dmattr_t get_destroy_dmattr; - dm_fsys_get_dioinfo_t get_dioinfo; - dm_fsys_get_dirattrs_rvp_t get_dirattrs_rvp; - dm_fsys_get_dmattr_t get_dmattr; - dm_fsys_get_eventlist_t get_eventlist; - dm_fsys_get_fileattr_t get_fileattr; - dm_fsys_get_region_t get_region; - dm_fsys_getall_dmattr_t getall_dmattr; - dm_fsys_getall_inherit_t getall_inherit; - dm_fsys_init_attrloc_t init_attrloc; - dm_fsys_mkdir_by_handle_t mkdir_by_handle; - dm_fsys_probe_hole_t probe_hole; - dm_fsys_punch_hole_t punch_hole; - dm_fsys_read_invis_rvp_t read_invis_rvp; - dm_fsys_release_right_t release_right; - dm_fsys_remove_dmattr_t remove_dmattr; - dm_fsys_request_right_t request_right; - dm_fsys_set_dmattr_t set_dmattr; - dm_fsys_set_eventlist_t set_eventlist; - dm_fsys_set_fileattr_t set_fileattr; - dm_fsys_set_inherit_t set_inherit; - dm_fsys_set_region_t set_region; - dm_fsys_symlink_by_handle_t symlink_by_handle; - dm_fsys_sync_by_handle_t sync_by_handle; - dm_fsys_upgrade_right_t upgrade_right; - dm_fsys_write_invis_rvp_t write_invis_rvp; - dm_fsys_obj_ref_hold_t obj_ref_hold; -} dm_fsys_vector_t; - - -typedef struct { - struct list_head ftype_list; /* list of fstypes */ - struct list_head sb_list; /* list of sb's per fstype */ - struct file_system_type *f_type; - struct filesystem_dmapi_operations *dmapiops; - dm_fsys_vector_t *vptr; - struct super_block *sb; -} dm_vector_map_t; - - extern dm_session_t *dm_sessions; /* head of session list */ extern dm_fsreg_t *dm_registers; extern lock_t dm_reg_lock; /* lock for registration list */ @@ -462,12 +406,9 @@ void dm_remove_fsys_entry( dm_fsys_vector_t *dm_fsys_vector( struct inode *ip); -struct filesystem_dmapi_operations *dm_fsys_ops( +struct dmapi_operations *dm_fsys_ops( struct super_block *sb); -void dm_fsys_ops_release( - struct super_block *sb); - int dm_waitfor_disp_session( struct super_block *sb, dm_tokevent_t *tevp, Index: linux-2.6-xfs/fs/dmapi/dmapi_sysent.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_sysent.c 2008-08-01 23:54:17.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_sysent.c 2008-08-02 01:42:42.000000000 +0200 @@ -54,8 +54,56 @@ struct kmem_cache *dm_fsreg_cachep = NULL; struct kmem_cache *dm_tokdata_cachep = NULL; struct kmem_cache *dm_session_cachep = NULL; -struct kmem_cache *dm_fsys_map_cachep = NULL; -struct kmem_cache *dm_fsys_vptr_cachep = NULL; + + +static LIST_HEAD(dm_fsys_map); +static DEFINE_SPINLOCK(dm_fsys_lock); + + +/* + * Ask for the dmapiops for this filesystem instance. The caller is + * also asking if this is a dmapi-managed filesystem. + */ +struct dmapi_operations *dm_fsys_ops(struct super_block *sb) +{ + struct dmapi_operations *ops; + + spin_lock(&dm_fsys_lock); + list_for_each_entry(ops, &dm_fsys_map, list) { + if (ops->fstype == sb->s_type) { + spin_unlock(&dm_fsys_lock); + return ops; + } + } + spin_unlock(&dm_fsys_lock); + return NULL; +} + +struct dmapi_operations *dm_fsys_vector(struct inode *inode) +{ + return dm_fsys_ops(inode->i_sb); +} + +/* + * Called by a filesystem module that is loading into the kernel + * to register it's dmapi operation vector. + */ +void dmapi_register(struct dmapi_operations *dmapiops) +{ + spin_lock(&dm_fsys_lock); + list_add_tail(&dmapiops->list, &dm_fsys_map); + spin_unlock(&dm_fsys_lock); +} + +/* + * Called by a filesystem module that is unloading from the kernel. + */ +void dmapi_unregister(struct dmapi_operations *dmapiops) +{ + spin_lock(&dm_fsys_lock); + list_del(&dmapiops->list); + spin_unlock(&dm_fsys_lock); +} static int dmapi_ioctl(struct inode *inode, struct file *file, unsigned int cmd, @@ -741,28 +789,15 @@ int __init dmapi_init(void) if (dm_session_cachep == NULL) goto out_free_fsreg_cachep; - dm_fsys_map_cachep = kmem_cache_create("dm_fsys_map", - sizeof(dm_vector_map_t), 0, 0, NULL); - if (dm_fsys_map_cachep == NULL) - goto out_free_session_cachep; - dm_fsys_vptr_cachep = kmem_cache_create("dm_fsys_vptr", - sizeof(dm_fsys_vector_t), 0, 0, NULL); - if (dm_fsys_vptr_cachep == NULL) - goto out_free_fsys_map_cachep; - ret = misc_register(&dmapi_dev); if (ret) { printk(KERN_ERR "dmapi_init: misc_register returned %d\n", ret); - goto out_free_fsys_vptr_cachep; + goto out_free_session_cachep; } dmapi_init_procfs(dmapi_dev.minor); return 0; - out_free_fsys_vptr_cachep: - kmem_cache_destroy(dm_fsys_vptr_cachep); - out_free_fsys_map_cachep: - kmem_cache_destroy(dm_fsys_map_cachep); out_free_session_cachep: kmem_cache_destroy(dm_session_cachep); out_free_fsreg_cachep: @@ -781,8 +816,6 @@ void __exit dmapi_uninit(void) kmem_cache_destroy(dm_tokdata_cachep); kmem_cache_destroy(dm_fsreg_cachep); kmem_cache_destroy(dm_session_cachep); - kmem_cache_destroy(dm_fsys_map_cachep); - kmem_cache_destroy(dm_fsys_vptr_cachep); } #endif @@ -801,5 +834,4 @@ EXPORT_SYMBOL(dm_send_destroy_event); EXPORT_SYMBOL(dm_ip_to_handle); EXPORT_SYMBOL(dmapi_register); EXPORT_SYMBOL(dmapi_unregister); -EXPORT_SYMBOL(dmapi_registered); EXPORT_SYMBOL(dm_release_threads); Index: linux-2.6-xfs/fs/dmapi/dmapi_register.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_register.c 2008-08-02 01:35:34.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_register.c 2008-08-02 01:38:00.000000000 +0200 @@ -206,7 +206,7 @@ dm_add_fsys_entry( void *msg; unsigned long lc; /* lock cookie */ dm_fsid_t fsid; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dops = dm_fsys_ops(sb); ASSERT(dops); @@ -297,7 +297,7 @@ dm_change_fsys_entry( int seq_error; unsigned long lc; /* lock cookie */ dm_fsid_t fsid; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; /* Find the filesystem referenced by the sb's fsid_t. This should always succeed. @@ -393,7 +393,7 @@ dm_remove_fsys_entry( dm_fsreg_t **fsrpp; dm_fsreg_t *fsrp; unsigned long lc; /* lock cookie */ - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dm_fsid_t fsid; dops = dm_fsys_ops(sb); @@ -464,7 +464,6 @@ dm_remove_fsys_entry( remove_proc_entry(buf, NULL); } #endif - dm_fsys_ops_release(sb); sv_destroy(&fsrp->fr_dispq); sv_destroy(&fsrp->fr_queue); spinlock_destroy(&fsrp->fr_lock); @@ -506,7 +505,7 @@ dm_handle_to_ip( struct super_block *sb; struct inode *ip; int filetype; - struct filesystem_dmapi_operations *dmapiops; + struct dmapi_operations *dmapiops; if ((fsrp = dm_find_fsreg_and_lock(&handlep->ha_fsid, &lc)) == NULL) return NULL; @@ -591,7 +590,7 @@ dm_ip_to_handle( dm_fid_t fid; dm_fsid_t fsid; int hsize; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dops = dm_fsys_ops(ip->i_sb); ASSERT(dops); @@ -683,7 +682,7 @@ dm_waitfor_disp( dm_session_t *s; dm_fsreg_t *fsrp; dm_fsid_t fsid; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dops = dm_fsys_ops(sb); ASSERT(dops); @@ -864,7 +863,7 @@ dm_path_to_hdl( struct inode *inode; size_t len; char *name; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; /* XXX get things straightened out so getname() works here? */ if (!(len = strnlen_user(path, PATH_MAX))) @@ -940,7 +939,7 @@ dm_path_to_fshdl( struct inode *inode; size_t len; char *name; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; /* XXX get things straightened out so getname() works here? */ if(!(len = strnlen_user(path, PATH_MAX))) @@ -1577,7 +1576,7 @@ dm_open_by_handle_rvp( } if (td_type == DM_TDT_REG) { - struct filesystem_dmapi_operations *dmapiops; + struct dmapi_operations *dmapiops; dmapiops = dm_fsys_ops(inodep->i_sb); if (dmapiops && dmapiops->get_invis_ops) { /* invisible operation should not change atime */ Index: linux-2.6-xfs/fs/dmapi/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/Makefile 2008-08-02 01:42:50.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/Makefile 2008-08-02 01:42:56.000000000 +0200 @@ -46,7 +46,6 @@ dmapi-y += dmapi_sysent.o \ dmapi_handle.o \ dmapi_hole.o \ dmapi_io.o \ - dmapi_mountinfo.o \ dmapi_region.o \ dmapi_register.o \ dmapi_right.o \ Index: linux-2.6-xfs/fs/dmapi/dmapi_event.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_event.c 2008-08-02 01:37:00.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_event.c 2008-08-02 01:37:14.000000000 +0200 @@ -199,7 +199,7 @@ dm_sb_data( dm_right_t right) { dm_tokdata_t *tdp; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dm_fsid_t fsid; dops = dm_fsys_ops(sb); Index: linux-2.6-xfs/fs/dmapi/dmapi_session.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_session.c 2008-08-02 01:37:19.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_session.c 2008-08-02 01:37:29.000000000 +0200 @@ -1381,7 +1381,7 @@ dm_enqueue( return tevp->te_reply; } else { - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; dm_tokdata_t *tdp; int errno = 0; @@ -1767,7 +1767,7 @@ dm_release_threads( int i; int found_events = 0; dm_fsid_t fsid; - struct filesystem_dmapi_operations *dops; + struct dmapi_operations *dops; ASSERT(sb); dops = dm_fsys_ops(sb); From owner-xfs@oss.sgi.com Sat Aug 2 08:30:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 08:30:22 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m72FUK3R011567 for ; Sat, 2 Aug 2008 08:30:21 -0700 X-ASG-Debug-ID: 1217691093-233f01690000-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 BBD8C1972F01 for ; Sat, 2 Aug 2008 08:31:33 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Tp0wGIyr9dOUxEEY for ; Sat, 02 Aug 2008 08:31:33 -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 m72FVZIF020876 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 2 Aug 2008 17:31:35 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m72FVZRu020874; Sat, 2 Aug 2008 17:31:35 +0200 Date: Sat, 2 Aug 2008 17:31:35 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 15/21] implement generic xfs_btree_rshift Subject: Re: [PATCH 15/21] implement generic xfs_btree_rshift Message-ID: <20080802153135.GD19689@lst.de> References: <20080729193125.GP19104@lst.de> <20080730060808.GP13395@disturbed> <20080801194914.GI1263@lst.de> <20080802012042.GN6201@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080802012042.GN6201@disturbed> 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: 1217691094 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1552 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17321 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 Sat, Aug 02, 2008 at 11:20:42AM +1000, Dave Chinner wrote: > > It's the only leakage of the detailed inode root implementation into > > the generic code, so I'm still wondering whether a method would be > > better. > > Ah, right. yes, it probably would be cleaner to do it as a > separate method, but ?? don't think it's that important right now. That's why I left the XXX in, this is something to get right eventually, just not now :) From owner-xfs@oss.sgi.com Sat Aug 2 08:33:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 08:33:51 -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 (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 m72FXnjW012065 for ; Sat, 2 Aug 2008 08:33:49 -0700 X-ASG-Debug-ID: 1217691301-525e01790000-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 85B68353CDF for ; Sat, 2 Aug 2008 08:35:02 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id V4VEmyKZfFRJKZ8j for ; Sat, 02 Aug 2008 08:35:02 -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 m72FZ3IF021004 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 2 Aug 2008 17:35:04 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m72FZ31Y021002 for xfs@oss.sgi.com; Sat, 2 Aug 2008 17:35:03 +0200 Date: Sat, 2 Aug 2008 17:35:03 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 16/21] implement generic xfs_btree_lshift Subject: Re: [PATCH 16/21] implement generic xfs_btree_lshift Message-ID: <20080802153503.GE19689@lst.de> References: <20080729193132.GQ19104@lst.de> <20080730062422.GQ13395@disturbed> <20080801195249.GJ1263@lst.de> <20080802012803.GO6201@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080802012803.GO6201@disturbed> 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: 1217691303 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1551 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17322 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 Sat, Aug 02, 2008 at 11:28:03AM +1000, Dave Chinner wrote: > It might make sense to go back to a single implementation, > though at the time I did it it made sense to split the move/copy > operations because it made both cases simpler. Seeing as you've > stuck more closely to the original structure of the code, the > distinction is not as great as so it might be best to go back to a > single memmove based interface. Btw, one other idea I still have in my mind is to add rec_len and key_len methods to the core btree code, that way quite a few methods (ptr_addr, key_addr, rec_addr, set_key, move_keys, move_recs, copy_keys, copy_recs, log_keys, and log_recs) could be implemented in common code, leaving the actual btree implementations really small. From owner-xfs@oss.sgi.com Sat Aug 2 08:40:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 08:40:07 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m72Fe4Ge012848 for ; Sat, 2 Aug 2008 08:40:05 -0700 X-ASG-Debug-ID: 1217691676-233f02120000-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 C77301973016 for ; Sat, 2 Aug 2008 08:41:17 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id kK7alXz41Ee9w5tj for ; Sat, 02 Aug 2008 08:41:17 -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 m72FfJIF021247 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 2 Aug 2008 17:41:19 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m72FfJa5021245 for xfs@oss.sgi.com; Sat, 2 Aug 2008 17:41:19 +0200 Date: Sat, 2 Aug 2008 17:41:19 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] kill xfs_buf_iostart Subject: [PATCH] kill xfs_buf_iostart Message-ID: <20080802154119.GA21145@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1217691677 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.1552 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17323 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 xfs_buf_iostart is a "shared" helper for xfs_buf_read_flags, xfs_bawrite, and xfs_bdwrite - except that there isn't much shared code but rather special cases for each caller. So remove this function and move the functionality to the caller. xfs_bawrite and xfs_bdwrite are now big enough to be moved out of line and the xfs_buf_read_flags is moved into a new helper called _xfs_buf_read. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2008-05-15 14:15:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c 2008-05-15 14:38:41.000000000 +0200 @@ -630,6 +630,29 @@ xfs_buf_get_flags( return NULL; } +STATIC int +_xfs_buf_read( + xfs_buf_t *bp, + xfs_buf_flags_t flags) +{ + int status; + + XB_TRACE(bp, "_xfs_buf_read", (unsigned long)flags); + + ASSERT(!(flags & (XBF_DELWRI|XBF_WRITE))); + ASSERT(bp->b_bn != XFS_BUF_DADDR_NULL); + + bp->b_flags &= ~(XBF_WRITE | XBF_ASYNC | XBF_DELWRI | \ + XBF_READ_AHEAD | _XBF_RUN_QUEUES); + bp->b_flags |= flags & (XBF_READ | XBF_ASYNC | \ + XBF_READ_AHEAD | _XBF_RUN_QUEUES); + + status = xfs_buf_iorequest(bp); + if (!status && !(flags & XBF_ASYNC)) + status = xfs_buf_iowait(bp); + return status; +} + xfs_buf_t * xfs_buf_read_flags( xfs_buftarg_t *target, @@ -646,7 +669,7 @@ xfs_buf_read_flags( if (!XFS_BUF_ISDONE(bp)) { XB_TRACE(bp, "read", (unsigned long)flags); XFS_STATS_INC(xb_get_read); - xfs_buf_iostart(bp, flags); + _xfs_buf_read(bp, flags); } else if (flags & XBF_ASYNC) { XB_TRACE(bp, "read_async", (unsigned long)flags); /* @@ -1052,50 +1075,39 @@ xfs_buf_ioerror( XB_TRACE(bp, "ioerror", (unsigned long)error); } -/* - * Initiate I/O on a buffer, based on the flags supplied. - * The b_iodone routine in the buffer supplied will only be called - * when all of the subsidiary I/O requests, if any, have been completed. - */ int -xfs_buf_iostart( - xfs_buf_t *bp, - xfs_buf_flags_t flags) +xfs_bawrite( + void *mp, + struct xfs_buf *bp) { - int status = 0; + XB_TRACE(bp, "bawrite", 0); - XB_TRACE(bp, "iostart", (unsigned long)flags); + ASSERT(bp->b_bn != XFS_BUF_DADDR_NULL); - if (flags & XBF_DELWRI) { - bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC); - bp->b_flags |= flags & (XBF_DELWRI | XBF_ASYNC); - xfs_buf_delwri_queue(bp, 1); - return 0; - } + xfs_buf_delwri_dequeue(bp); - bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_ASYNC | XBF_DELWRI | \ - XBF_READ_AHEAD | _XBF_RUN_QUEUES); - bp->b_flags |= flags & (XBF_READ | XBF_WRITE | XBF_ASYNC | \ - XBF_READ_AHEAD | _XBF_RUN_QUEUES); + bp->b_flags &= ~(XBF_READ | XBF_DELWRI | XBF_READ_AHEAD); + bp->b_flags |= (XBF_WRITE | XBF_ASYNC | _XBF_RUN_QUEUES); + + bp->b_fspriv3 = mp; + bp->b_strat = xfs_bdstrat_cb; + return xfs_bdstrat_cb(bp); +} - BUG_ON(bp->b_bn == XFS_BUF_DADDR_NULL); +void +xfs_bdwrite( + void *mp, + struct xfs_buf *bp) +{ + XB_TRACE(bp, "bdwrite", 0); - /* For writes allow an alternate strategy routine to precede - * the actual I/O request (which may not be issued at all in - * a shutdown situation, for example). - */ - status = (flags & XBF_WRITE) ? - xfs_buf_iostrategy(bp) : xfs_buf_iorequest(bp); + bp->b_strat = xfs_bdstrat_cb; + bp->b_fspriv3 = mp; - /* Wait for I/O if we are not an async request. - * Note: async I/O request completion will release the buffer, - * and that can already be done by this point. So using the - * buffer pointer from here on, after async I/O, is invalid. - */ - if (!status && !(flags & XBF_ASYNC)) - status = xfs_buf_iowait(bp); + bp->b_flags &= ~XBF_READ; + bp->b_flags |= (XBF_DELWRI | XBF_ASYNC); - return status; + xfs_buf_delwri_queue(bp, 1); } STATIC_INLINE void Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2008-05-15 14:15:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.h 2008-05-15 14:24:26.000000000 +0200 @@ -206,9 +206,10 @@ extern void xfs_buf_lock(xfs_buf_t *); extern void xfs_buf_unlock(xfs_buf_t *); /* Buffer Read and Write Routines */ +extern int xfs_bawrite(void *mp, xfs_buf_t *bp); +extern void xfs_bdwrite(void *mp, xfs_buf_t *bp); extern void xfs_buf_ioend(xfs_buf_t *, int); extern void xfs_buf_ioerror(xfs_buf_t *, int); -extern int xfs_buf_iostart(xfs_buf_t *, xfs_buf_flags_t); extern int xfs_buf_iorequest(xfs_buf_t *); extern int xfs_buf_iowait(xfs_buf_t *); extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, xfs_caddr_t, @@ -358,14 +359,6 @@ extern void xfs_buf_trace(xfs_buf_t *, c #define XFS_BUF_TARGET(bp) ((bp)->b_target) #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) -static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) -{ - bp->b_fspriv3 = mp; - bp->b_strat = xfs_bdstrat_cb; - xfs_buf_delwri_dequeue(bp); - return xfs_buf_iostart(bp, XBF_WRITE | XBF_ASYNC | _XBF_RUN_QUEUES); -} - static inline void xfs_buf_relse(xfs_buf_t *bp) { if (!bp->b_relse) @@ -406,17 +399,6 @@ static inline int XFS_bwrite(xfs_buf_t * return error; } -/* - * No error can be returned from xfs_buf_iostart for delwri - * buffers as they are queued and no I/O is issued. - */ -static inline void xfs_bdwrite(void *mp, xfs_buf_t *bp) -{ - bp->b_strat = xfs_bdstrat_cb; - bp->b_fspriv3 = mp; - (void)xfs_buf_iostart(bp, XBF_DELWRI | XBF_ASYNC); -} - #define XFS_bdstrat(bp) xfs_buf_iorequest(bp) #define xfs_iowait(bp) xfs_buf_iowait(bp) Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-15 14:25:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-15 14:25:12.000000000 +0200 @@ -160,7 +160,8 @@ EXPORT_SYMBOL(xfs_file_operations); EXPORT_SYMBOL(xfs_invis_file_operations); EXPORT_SYMBOL(xfs_buf_delwri_dequeue); EXPORT_SYMBOL(_xfs_buf_find); -EXPORT_SYMBOL(xfs_buf_iostart); +EXPORT_SYMBOL(xfs_bawrite); +EXPORT_SYMBOL(xfs_bdwrite); EXPORT_SYMBOL(xfs_buf_ispin); #ifdef DEBUG EXPORT_SYMBOL(xfs_buf_lock_value); From owner-xfs@oss.sgi.com Sat Aug 2 17:05:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 02 Aug 2008 17:05:22 -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=3.3 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_31,J_CHICKENPOX_43,J_CHICKENPOX_54 autolearn=no 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 m7305Jul024022 for ; Sat, 2 Aug 2008 17:05:19 -0700 X-ASG-Debug-ID: 1217721993-2cb202910000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail-gx0-f28.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AF00B352A36 for ; Sat, 2 Aug 2008 17:06:33 -0700 (PDT) Received: from mail-gx0-f28.google.com (mail-gx0-f28.google.com [209.85.217.28]) by cuda.sgi.com with ESMTP id XXegqgGI7fKjp7rn for ; Sat, 02 Aug 2008 17:06:33 -0700 (PDT) Received: by gxk9 with SMTP id 9so2308511gxk.20 for ; Sat, 02 Aug 2008 17:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=pA6a9ncZ9Pv3gGd5XwwzKP5fQ7Sh7+rmbxNShGcBouA=; b=afzs2AqurVAmV+SOgYGaYkR8ofXa9whQpR0JNPR1n6jeHC/m8AI8LEqcq0o33Ot4gc bUIg0VsQeLHI6a3UkBNEHVSNgOuaY9z3ECyRalXZp8NM3sCwyudwzAcNpQnqolyLOzCf orosRA3V3mVHKuSOVtmevUe/iZrda63+Gfyyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=OEk74C+Y3jsWKkNO1LPjSeVoLiHaxwjVMgsojC0tUEfSoUFXMAL2/+IcMjoS6kI2WX 2BNbaZGkJMksDmyoIyG1SWc9NpBeeXb4dDUSBox3KGTbKmWxO0K3m2NlB6hN6AM0WoA+ /eSUPHJZuMIgRW6mrgN9vSxp2H6gLdO3mTDZY= Received: by 10.151.108.3 with SMTP id k3mr5747152ybm.226.1217721989355; Sat, 02 Aug 2008 17:06:29 -0700 (PDT) Received: by 10.151.107.3 with HTTP; Sat, 2 Aug 2008 17:06:29 -0700 (PDT) Message-ID: Date: Sun, 3 Aug 2008 00:06:29 +0000 From: "paulina godwill" To: paulina04godwill@yahoo.com X-ASG-Orig-Subj: HI Subject: HI MIME-Version: 1.0 X-Barracuda-Connect: mail-gx0-f28.google.com[209.85.217.28] X-Barracuda-Start-Time: 1217721993 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5054 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1586 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 556 X-archive-position: 17324 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: paulina.godwill@gmail.com Precedence: bulk X-list: xfs Hello My name is miss Paulina godwill i saw your profile today and became intrested in you,i will also like to know you the more,and i want you to send a mail to my email address so i can give you my picture for you to know whom l am.Here is my email address(paulina04godwill@yahoo.com ).I believe we can move from here.I am waiting for your mail to my email address above.miss paulina.(Remeber the distance or colour does not matter but love matters alot in life) Please rpely me with my email address here [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Sun Aug 3 18:33:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:33:27 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no 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 m741X9eZ032035 for ; Sun, 3 Aug 2008 18:33:10 -0700 X-ASG-Debug-ID: 1217813660-40db01c40000-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 48D5EEF6A71 for ; Sun, 3 Aug 2008 18:34:21 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id UcDt2BhN1uWeeoO6 for ; Sun, 03 Aug 2008 18:34:21 -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 m741YMIF009137 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:34:22 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741YMY7009135 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:34:22 +0200 Date: Mon, 4 Aug 2008 03:34:22 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 13/26] implement generic xfs_btree_updkey Subject: [PATCH 13/26] implement generic xfs_btree_updkey Message-ID: <20080804013422.GN8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-updkey 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: 1217813663 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17338 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 From: Dave Chinner Note that there are many > 80 char lines introduced due to the xfs_btree_key casts. But the places where this happens is throw-away code once the whole btree code gets merged into a common implementation. The same is true for the temporary xfs_alloc_log_keys define to the new name. All old users will be gone after a few patches. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 13:46:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 23:11:28.000000000 +0200 @@ -1371,3 +1371,50 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Update keys at all levels from here to the root along the cursor's path. + */ +int +xfs_btree_updkey( + struct xfs_btree_cur *cur, + union xfs_btree_key *keyp, + int level) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + union xfs_btree_key *kp; + int ptr; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGIK(cur, level, keyp); + + ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || level >= 1); + + /* + * Go up the tree from this level toward the root. + * At each level, update the key value to the value input. + * Stop when we reach a level where the cursor isn't pointing + * at the first entry in the block. + */ + for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { +#ifdef DEBUG + int error; +#endif + block = xfs_btree_get_block(cur, level, &bp); +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } +#endif + ptr = cur->bc_ptrs[level]; + kp = cur->bc_ops->key_addr(cur, ptr, block); + cur->bc_ops->copy_keys(cur, keyp, kp, 1); + cur->bc_ops->log_keys(cur, bp, ptr, ptr); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 13:46:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 23:11:28.000000000 +0200 @@ -205,6 +205,16 @@ struct xfs_btree_ops { __int64_t (*key_diff)(struct xfs_btree_cur *cur, union xfs_btree_key *key); + /* copy bits of btree blocks between blocks */ + void (*copy_keys)(struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, int numkeys); + + /* log changes to btree structures */ + void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); + + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -523,6 +533,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); +int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 13:46:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 23:11:50.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -44,7 +45,9 @@ */ STATIC void xfs_alloc_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_alloc_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_keys(c, b, i, j) \ + xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); @@ -52,7 +55,6 @@ STATIC int xfs_alloc_newroot(xfs_btree_c STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_alloc_updkey(xfs_btree_cur_t *, xfs_alloc_key_t *, int); /* * Internal functions. @@ -265,7 +267,7 @@ xfs_alloc_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_alloc_updkey(cur, lkp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)lkp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -798,7 +800,7 @@ xfs_alloc_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_alloc_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Look to see if the longest extent in the allocation group @@ -859,28 +861,6 @@ xfs_alloc_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_alloc_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_alloc_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -1068,7 +1048,7 @@ xfs_alloc_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_alloc_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1354,7 +1334,7 @@ xfs_alloc_rshift( i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_alloc_updkey(tcur, rkp, level + 1))) + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); *stat = 1; @@ -1520,45 +1500,6 @@ xfs_alloc_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_alloc_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_alloc_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer for block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_alloc_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_alloc_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1765,7 +1706,7 @@ xfs_alloc_update( key.ar_startblock = cpu_to_be32(bno); key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_alloc_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1853,6 +1794,44 @@ xfs_allocbt_key_diff( return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; } +STATIC void +xfs_allocbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_allocbt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int first, /* index of first key to log */ + int last) /* index of last key to log */ +{ + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_alloc_key_t *kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); + char *baddr = (char *)block; + int start; /* first byte offset logged */ + int end; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + start = (char *)&kp[first - 1] - baddr; + end = (char *)&kp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -1928,6 +1907,8 @@ static const struct xfs_btree_ops xfs_al .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, + .copy_keys = xfs_allocbt_copy_keys, + .log_keys = xfs_allocbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 13:46:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 23:11:59.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -48,7 +49,6 @@ STATIC int xfs_inobt_newroot(xfs_btree_c STATIC int xfs_inobt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_inobt_updkey(xfs_btree_cur_t *, xfs_inobt_key_t *, int); /* * Single level of the xfs_inobt_delete record deletion routine. @@ -214,7 +214,7 @@ xfs_inobt_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_inobt_updkey(cur, kp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -723,7 +723,7 @@ xfs_inobt_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_inobt_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Return the new block number, if any. @@ -763,28 +763,6 @@ xfs_inobt_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_inobt_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_inobt_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -960,7 +938,7 @@ xfs_inobt_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_inobt_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1238,7 +1216,7 @@ xfs_inobt_rshift( return error; xfs_btree_lastrec(tcur, level); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; } @@ -1407,45 +1385,6 @@ xfs_inobt_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_inobt_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_inobt_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_buf_t *bp; /* buffer for block */ - xfs_inobt_block_t *block; /* btree block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_inobt_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_INOBT_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_inobt_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1637,7 +1576,7 @@ xfs_inobt_update( xfs_inobt_key_t key; /* key containing [ino] */ key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_inobt_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1711,6 +1650,43 @@ xfs_inobt_key_diff( cur->bc_rec.i.ir_startino; } +STATIC void +xfs_inobt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_inobt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int first, /* index of first key to log */ + int last) /* index of last key to log */ +{ + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_inobt_key_t *kp = XFS_INOBT_KEY_ADDR(block, 1, cur); + char *baddr = (char *)block; + int start; /* first byte offset logged */ + int end; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + start = (char *)&kp[first - 1] - baddr; + end = (char *)&kp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1786,6 +1762,8 @@ static const struct xfs_btree_ops xfs_in .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, + .copy_keys = xfs_inobt_copy_keys, + .log_keys = xfs_inobt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 13:46:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 23:12:14.000000000 +0200 @@ -56,7 +56,6 @@ STATIC int xfs_bmbt_lshift(xfs_btree_cur STATIC int xfs_bmbt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); #undef EXIT @@ -211,7 +210,7 @@ xfs_bmbt_delrec( *stat = 1; return 0; } - if (ptr == 1 && (error = xfs_bmbt_updkey(cur, kp, level + 1))) { + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -635,7 +634,7 @@ xfs_bmbt_insrec( kp + ptr); } #endif - if (optr == 1 && (error = xfs_bmbt_updkey(cur, &key, level + 1))) { + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -741,42 +740,6 @@ xfs_bmbt_killroot( } /* - * Log key values from the btree block. - */ -STATIC void -xfs_bmbt_log_keys( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int kfirst, - int klast) -{ - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, kfirst, klast); - tp = cur->bc_tp; - if (bp) { - xfs_bmbt_block_t *block; - int first; - xfs_bmbt_key_t *kp; - int last; - - block = XFS_BUF_TO_BMBT_BLOCK(bp); - kp = XFS_BMAP_KEY_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - } else { - xfs_inode_t *ip; - - ip = cur->bc_private.b.ip; - xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Log pointer values from the btree block. */ STATIC void @@ -935,7 +898,7 @@ xfs_bmbt_lshift( key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); rkp = &key; } - if ((error = xfs_bmbt_updkey(cur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1067,7 +1030,7 @@ xfs_bmbt_rshift( goto error1; } XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_updkey(tcur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1276,44 +1239,6 @@ xfs_bmbt_split( return 0; } - -/* - * Update keys for the record. - */ -STATIC int -xfs_bmbt_updkey( - xfs_btree_cur_t *cur, - xfs_bmbt_key_t *keyp, /* on-disk format */ - int level) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; -#ifdef DEBUG - int error; -#endif - xfs_bmbt_key_t *kp; - int ptr; - - ASSERT(level >= 1); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIK(cur, level, keyp); - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_BMAP_KEY_IADDR(block, ptr, cur); - *kp = *keyp; - xfs_bmbt_log_keys(cur, bp, ptr, ptr); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - /* * Convert on-disk form of btree root to in-memory form. */ @@ -2039,7 +1964,7 @@ xfs_bmbt_update( return 0; } key.br_startoff = cpu_to_be64(off); - if ((error = xfs_bmbt_updkey(cur, &key, 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -2157,6 +2082,48 @@ xfs_bmbt_key_diff( cur->bc_rec.b.br_startoff; } +STATIC void +xfs_bmbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); +} + +/* + * Log key values from the btree block. + */ +STATIC void +xfs_bmbt_log_keys( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int first, + int last) +{ + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + if (bp) { + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_bmbt_key_t *kp = XFS_BMAP_KEY_DADDR(block, 1, cur); + char *baddr = (char *)block; + int start; + int end; + + start = (char *)&kp[first - 1] - baddr; + end = (char *)&kp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + } else { + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2252,6 +2219,8 @@ static const struct xfs_btree_ops xfs_bm .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, + .copy_keys = xfs_bmbt_copy_keys, + .log_keys = xfs_bmbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, -- From owner-xfs@oss.sgi.com Sun Aug 3 18:33:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:33:19 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741X3nS031933 for ; Sun, 3 Aug 2008 18:33:03 -0700 X-ASG-Debug-ID: 1217813654-16b402d80000-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 0FD7A197643B for ; Sun, 3 Aug 2008 18:34:14 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id VxoVVPMGVwgDETFi for ; Sun, 03 Aug 2008 18:34:14 -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 m741YFIF009118 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:34:16 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741YF0W009116 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:34:15 +0200 Date: Mon, 4 Aug 2008 03:34:15 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 12/26] implement generic xfs_btree_lookup Subject: [PATCH 12/26] implement generic xfs_btree_lookup Message-ID: <20080804013415.GM8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-lookup 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: 1217813656 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17337 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 From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 02:53:26.000000000 +0200 @@ -1151,3 +1151,224 @@ error0: return error; } + +STATIC int +xfs_btree_lookup_get_block( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level in the btree */ + union xfs_btree_ptr *pp, /* ptr to btree block */ + struct xfs_btree_block **blkp) /* return btree block */ +{ + struct xfs_buf *bp; /* buffer pointer for btree block */ + int error = 0; + + /* special case the root block if in an inode */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *blkp = cur->bc_ops->get_root_from_inode(cur); + return 0; + } + + /* + * If the old buffer at this level for the disk address we are + * looking for re-use it. + * + * Otherwise throw it away and get a new one. + */ + bp = cur->bc_bufs[level]; + if (bp && XFS_BUF_ADDR(bp) == xfs_btree_ptr_to_daddr(cur, pp)) { + *blkp = XFS_BUF_TO_BLOCK(bp); + return 0; + } + + error = xfs_btree_read_buf_block(cur, pp, level, 0, blkp, &bp); + if (error) + return error; + + xfs_btree_setbuf(cur, level, bp); + return 0; +} + +/* + * Get current search key. For level 0 we don't actually have a key + * structure so we make one up from the record. For all other levels + * we just return the right key. + */ +STATIC union xfs_btree_key * +xfs_lookup_get_search_key( + struct xfs_btree_cur *cur, + int level, + int keyno, + struct xfs_btree_block *block, + union xfs_btree_key *kp) +{ + if (level == 0) { + union xfs_btree_rec *rp; + + rp = cur->bc_ops->rec_addr(cur, keyno, block); + cur->bc_ops->init_key_from_rec(cur, kp, rp); + return kp; + } + + return cur->bc_ops->key_addr(cur, keyno, block); +} + +/* + * Lookup the record. The cursor is made to point to it, based on dir. + * Return 0 if can't find any such record, 1 for success. + */ +int /* error */ +xfs_btree_lookup( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_lookup_t dir, /* <=, ==, or >= */ + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; /* current btree block */ + __int64_t diff; /* difference for the current key */ + int error; /* error return value */ + int keyno; /* current key number */ + int level; /* level in the btree */ + union xfs_btree_ptr *pp; /* ptr to btree block */ + union xfs_btree_ptr ptr; /* ptr to btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, dir); + + XFS_BTREE_STATS_INC(cur, lookup); + + block = NULL; + keyno = 0; + + /* initialise start pointer from cursor */ + cur->bc_ops->init_ptr_from_cur(cur, &ptr); + pp = &ptr; + + /* + * Iterate over each level in the btree, starting at the root. + * For each level above the leaves, find the key we need, based + * on the lookup record, then follow the corresponding block + * pointer down to the next level. + */ + for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { + /* Get the block we need to do the lookup on. */ + error = xfs_btree_lookup_get_block(cur, level, pp, &block); + if (error) + goto error0; + + if (diff == 0) { + /* + * If we already had a key match at a higher level, we + * know we need to use the first entry in this block. + */ + keyno = 1; + } else { + /* Otherwise search this block. Do a binary search. */ + + int high; /* high entry number */ + int low; /* low entry number */ + + /* Set low and high entry numbers, 1-based. */ + low = 1; + high = xfs_btree_get_numrecs(block); + if (!high) { + /* Block is empty, must be an empty leaf. */ + ASSERT(level == 0 && cur->bc_nlevels == 1); + + cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + /* Binary search the block. */ + while (low <= high) { + union xfs_btree_key key; + union xfs_btree_key *kp; + + XFS_BTREE_STATS_INC(cur, compare); + + /* keyno is average of low and high. */ + keyno = (low + high) >> 1; + + /* Get current search key */ + kp = xfs_lookup_get_search_key(cur, level, + keyno, block, &key); + + /* + * Compute difference to get next direction: + * - less than, move right + * - greater than, move left + * - equal, we're done + */ + diff = cur->bc_ops->key_diff(cur, kp); + if (diff < 0) + low = keyno + 1; + else if (diff > 0) + high = keyno - 1; + else + break; + } + } + + /* + * If there are more levels, set up for the next level + * by getting the block number and filling in the cursor. + */ + if (level > 0) { + /* + * If we moved left, need the previous key number, + * unless there isn't one. + */ + if (diff > 0 && --keyno < 1) + keyno = 1; + pp = cur->bc_ops->ptr_addr(cur, keyno, block); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, pp, 0, level); + if (error) + goto error0; +#endif + cur->bc_ptrs[level] = keyno; + } + } + + /* Done with the search. See if we need to adjust the results. */ + if (dir != XFS_LOOKUP_LE && diff < 0) { + keyno++; + /* + * If ge search and we went off the end of the block, but it's + * not the last block, we're in the wrong block. + */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (dir == XFS_LOOKUP_GE && + keyno > xfs_btree_get_numrecs(block) && + !xfs_btree_ptr_is_null(cur, &ptr)) { + int i; + + cur->bc_ptrs[0] = keyno; + error = xfs_btree_increment(cur, 0, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_RETURN(i == 1); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + } + } else if (dir == XFS_LOOKUP_LE && diff > 0) + keyno--; + cur->bc_ptrs[0] = keyno; + + /* Return if we succeeded or not. */ + if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) + *stat = 0; + else if (dir != XFS_LOOKUP_EQ || diff == 0) + *stat = 1; + else + *stat = 0; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 02:53:26.000000000 +0200 @@ -194,6 +194,21 @@ struct xfs_btree_ops { /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); + union xfs_btree_key *(*key_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + union xfs_btree_rec *(*rec_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + + /* init values of btree structures */ + void (*init_key_from_rec)(struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec); + void (*init_ptr_from_cur)(struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr); + + /* difference between key value and cursor value */ + __int64_t (*key_diff)(struct xfs_btree_cur *cur, + union xfs_btree_key *key); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -512,6 +527,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); +int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 02:54:04.000000000 +0200 @@ -938,223 +938,6 @@ xfs_alloc_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_alloc_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_alloc_block_t *block=NULL; /* current btree block */ - int diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - XFS_STATS_INC(xs_abt_lookup); - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - - { - xfs_agf_t *agf; /* a.g. freespace header */ - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - agno = be32_to_cpu(agf->agf_seqno); - agbno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, agno, - agbno, 0, &bp, XFS_ALLOC_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_alloc_key_t *kkbase=NULL;/* base of keys in block */ - xfs_alloc_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_ALLOC_KEY_ADDR(block, 1, cur); - else - krbase = XFS_ALLOC_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_extlen_t blockcount; /* key value */ - xfs_agblock_t startblock; /* key value */ - - XFS_STATS_INC(xs_abt_compare); - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startblock & blockcount. - */ - if (level > 0) { - xfs_alloc_key_t *kkp; - - kkp = kkbase + keyno - 1; - startblock = be32_to_cpu(kkp->ar_startblock); - blockcount = be32_to_cpu(kkp->ar_blockcount); - } else { - xfs_alloc_rec_t *krp; - - krp = krbase + keyno - 1; - startblock = be32_to_cpu(krp->ar_startblock); - blockcount = be32_to_cpu(krp->ar_blockcount); - } - /* - * Compute difference to get next direction. - */ - if (cur->bc_btnum == XFS_BTNUM_BNO) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - else if (!(diff = (int)blockcount - - (int)cur->bc_rec.a.ar_blockcount)) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - XFS_WANT_CORRUPTED_RETURN(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1919,53 +1702,6 @@ xfs_alloc_insert( } /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ @@ -2044,6 +1780,31 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC void +xfs_allocbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + ASSERT(rec->alloc.ar_startblock != 0); + + key->alloc.ar_startblock = rec->alloc.ar_startblock; + key->alloc.ar_blockcount = rec->alloc.ar_blockcount; +} + +STATIC void +xfs_allocbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); + ASSERT(agf->agf_roots[cur->bc_btnum] != 0); + + ptr->s = agf->agf_roots[cur->bc_btnum]; +} + STATIC union xfs_btree_ptr * xfs_allocbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2053,6 +1814,45 @@ xfs_allocbt_ptr_addr( return (union xfs_btree_ptr *)XFS_ALLOC_PTR_ADDR(block, index, cur); } +STATIC union xfs_btree_key * +xfs_allocbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *)XFS_ALLOC_KEY_ADDR(block, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_allocbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *)XFS_ALLOC_REC_ADDR(block, index, cur); +} + +STATIC __int64_t +xfs_allocbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; + xfs_alloc_key_t *kp = &key->alloc; + __int64_t diff; + + if (cur->bc_btnum == XFS_BTNUM_BNO) { + return (__int64_t)be32_to_cpu(kp->ar_startblock) - + rec->ar_startblock; + } + + diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount; + if (diff) + return diff; + + return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2122,7 +1922,12 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .init_key_from_rec = xfs_allocbt_init_key_from_rec, + .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, + .key_addr = xfs_allocbt_key_addr, + .rec_addr = xfs_allocbt_rec_addr, + .key_diff = xfs_allocbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 02:54:40.000000000 +0200 @@ -829,212 +829,6 @@ xfs_inobt_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_inobt_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_inobt_block_t *block=NULL; /* current btree block */ - __int64_t diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - { - xfs_agi_t *agi; /* a.g. inode header */ - - agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); - agno = be32_to_cpu(agi->agi_seqno); - agbno = be32_to_cpu(agi->agi_root); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - agno, agbno, 0, &bp, XFS_INO_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_INOBT_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_inobt_key_t *kkbase=NULL;/* base of keys in block */ - xfs_inobt_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_INOBT_KEY_ADDR(block, 1, cur); - else - krbase = XFS_INOBT_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_agino_t startino; /* key value */ - - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startino. - */ - if (level > 0) { - xfs_inobt_key_t *kkp; - - kkp = kkbase + keyno - 1; - startino = be32_to_cpu(kkp->ir_startino); - } else { - xfs_inobt_rec_t *krp; - - krp = krbase + keyno - 1; - startino = be32_to_cpu(krp->ir_startino); - } - /* - * Compute difference to get next direction. - */ - diff = (__int64_t) - startino - cur->bc_rec.i.ir_startino; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - ASSERT(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1798,59 +1592,6 @@ xfs_inobt_insert( } /* - * Lookup the record equal to ino in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. @@ -1910,6 +1651,30 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC void +xfs_inobt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->inobt.ir_startino = rec->inobt.ir_startino; +} + +/* + * intial value of ptr for lookup + */ +STATIC void +xfs_inobt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno)); + + ptr->s = agi->agi_root; +} + STATIC union xfs_btree_ptr * xfs_inobt_ptr_addr( struct xfs_btree_cur *cur, @@ -1919,6 +1684,33 @@ xfs_inobt_ptr_addr( return (union xfs_btree_ptr *)XFS_INOBT_PTR_ADDR(block, index, cur); } +STATIC union xfs_btree_key * +xfs_inobt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *)XFS_INOBT_KEY_ADDR(block, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_inobt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *)XFS_INOBT_REC_ADDR(block, index, cur); +} + +STATIC __int64_t +xfs_inobt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be32_to_cpu(key->inobt.ir_startino) - + cur->bc_rec.i.ir_startino; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1988,7 +1780,12 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .init_key_from_rec = xfs_inobt_init_key_from_rec, + .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, .ptr_addr = xfs_inobt_ptr_addr, + .key_addr = xfs_inobt_key_addr, + .rec_addr = xfs_inobt_rec_addr, + .key_diff = xfs_inobt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 02:55:15.000000000 +0200 @@ -813,146 +813,6 @@ xfs_bmbt_log_ptrs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - */ -STATIC int /* error */ -xfs_bmbt_lookup( - xfs_btree_cur_t *cur, - xfs_lookup_t dir, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block=NULL; - xfs_buf_t *bp; - xfs_daddr_t d; - xfs_sfiloff_t diff; - int error; /* error return value */ - xfs_fsblock_t fsbno=0; - int high; - int i; - int keyno=0; - xfs_bmbt_key_t *kkbase=NULL; - xfs_bmbt_key_t *kkp; - xfs_bmbt_rec_t *krbase=NULL; - xfs_bmbt_rec_t *krp; - int level; - int low; - xfs_mount_t *mp; - xfs_bmbt_ptr_t *pp; - xfs_bmbt_irec_t *rp; - xfs_fileoff_t startoff; - xfs_trans_t *tp; - - XFS_STATS_INC(xs_bmbt_lookup); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, (int)dir); - tp = cur->bc_tp; - mp = cur->bc_mp; - rp = &cur->bc_rec.b; - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - if (level < cur->bc_nlevels - 1) { - d = XFS_FSB_TO_DADDR(mp, fsbno); - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, - 0, &bp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - xfs_btree_setbuf(cur, level, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, - level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } else - block = XFS_BUF_TO_BMBT_BLOCK(bp); - } else - block = xfs_bmbt_get_block(cur, level, &bp); - if (diff == 0) - keyno = 1; - else { - if (level > 0) - kkbase = XFS_BMAP_KEY_IADDR(block, 1, cur); - else - krbase = XFS_BMAP_REC_IADDR(block, 1, cur); - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - ASSERT(level == 0); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - while (low <= high) { - XFS_STATS_INC(xs_bmbt_compare); - keyno = (low + high) >> 1; - if (level > 0) { - kkp = kkbase + keyno - 1; - startoff = be64_to_cpu(kkp->br_startoff); - } else { - krp = krbase + keyno - 1; - startoff = xfs_bmbt_disk_get_startoff(krp); - } - diff = (xfs_sfiloff_t) - (startoff - rp->br_startoff); - if (diff < 0) - low = keyno + 1; - else if (diff > 0) - high = keyno - 1; - else - break; - } - } - if (level > 0) { - if (diff > 0 && --keyno < 1) - keyno = 1; - pp = XFS_BMAP_PTR_IADDR(block, keyno, cur); - fsbno = be64_to_cpu(*pp); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, fsbno, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - cur->bc_ptrs[level] = keyno; - } - } - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && - be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_WANT_CORRUPTED_RETURN(i == 1); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - } else { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - } - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1809,34 +1669,6 @@ xfs_bmbt_log_recs( XFS_BMBT_TRACE_CURSOR(cur, EXIT); } -int /* error */ -xfs_bmbt_lookup_eq( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -int /* error */ -xfs_bmbt_lookup_ge( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_GE, stat); -} - /* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. @@ -2271,6 +2103,24 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC void +xfs_bmbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->bmbt.br_startoff = + cpu_to_be64(xfs_bmbt_disk_get_startoff(&rec->bmbt)); +} + +STATIC void +xfs_bmbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + ptr->l = 0; +} + STATIC union xfs_btree_ptr * xfs_bmbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2281,6 +2131,33 @@ xfs_bmbt_ptr_addr( XFS_BMAP_PTR_IADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_bmbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *)XFS_BMAP_KEY_IADDR(block, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_bmbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *)XFS_BMAP_REC_IADDR(block, index, cur); +} + +STATIC __int64_t +xfs_bmbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) - + cur->bc_rec.b.br_startoff; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2370,7 +2247,12 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .init_key_from_rec = xfs_bmbt_init_key_from_rec, + .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .ptr_addr = xfs_bmbt_ptr_addr, + .key_addr = xfs_bmbt_key_addr, + .rec_addr = xfs_bmbt_rec_addr, + .key_diff = xfs_bmbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-02 02:53:26.000000000 +0200 @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf */ /* + * Lookup the record equal to [bno, len] in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + + +/* * Compute aligned version of the found extent. * Takes alignment and min length into account. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-02 02:53:26.000000000 +0200 @@ -114,26 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -extern int xfs_alloc_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_ge(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-02 02:53:26.000000000 +0200 @@ -402,6 +402,35 @@ xfs_bmap_disk_count_leaves( * Bmap internal routines. */ +STATIC int /* error */ +xfs_bmbt_lookup_eq( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +STATIC int /* error */ +xfs_bmbt_lookup_ge( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + + /* * Called from xfs_bmap_add_attrfork to handle btree format files. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-02 02:53:26.000000000 +0200 @@ -119,6 +119,59 @@ xfs_ialloc_cluster_alignment( } /* + * Lookup the record equal to ino in the btree given by cur. + */ +STATIC int /* error */ +xfs_inobt_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.h 2008-08-02 02:49:48.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.h 2008-08-02 02:53:26.000000000 +0200 @@ -154,6 +154,21 @@ xfs_ialloc_pagi_init( struct xfs_trans *tp, /* transaction pointer */ xfs_agnumber_t agno); /* allocation group number */ +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + + #endif /* __KERNEL__ */ #endif /* __XFS_IALLOC_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-02 02:53:26.000000000 +0200 @@ -136,26 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to ino in the btree given by cur. - */ -extern int xfs_inobt_lookup_eq(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-02 02:53:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-02 02:53:26.000000000 +0200 @@ -254,10 +254,6 @@ extern int xfs_bmbt_insert(struct xfs_bt extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); -extern int xfs_bmbt_lookup_eq(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); -extern int xfs_bmbt_lookup_ge(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); /* * Give the bmap btree a new root block. Copy the old broot contents -- From owner-xfs@oss.sgi.com Sun Aug 3 18:30:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:18 -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 (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 m741UjIx030300 for ; Sun, 3 Aug 2008 18:30:47 -0700 X-ASG-Debug-ID: 1217813518-7399019f0000-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 0E8AA3566AA for ; Sun, 3 Aug 2008 18:31:58 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ey3983KkYRQG0zxE for ; Sun, 03 Aug 2008 18:31:58 -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 m741VwIF008856 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:31:58 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741Vwm9008854 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:31:58 +0200 Date: Mon, 4 Aug 2008 03:31:58 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 00/26] generic btree implementation, version 3 Subject: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080804013158.GA8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1217813520 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17325 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 Firstly all but one of Dave's review comments are addressed. There is also a new first patch to clean up the defintion of struct xfs_btree_block which I would consider an ASAP merge candidate. But there are also some bigger changes. For reimplemented the newroot and killroot methods. In both cases one method was used for block rooted and inode rooted btree but doing something quite different. This patchset gets rid of these two method completely and implements both cases in xfs_btree.c. For new_root that was as easy as just calling xfs_btree_new_root directly for the !XFS_BTREE_ROOT_IN_INODE and moving xfs_bmbt_newroot into the common code and calling it for the other case. The XFS_BTREE_ROOT_IN_INODE case for kill_root was similarly easily solved by just moving the code around and making it block/rec/key/ptr size agnostic, but the !XFS_BTREE_ROOT_IN_INODE needed a little care. The alloc and inobt trees were in fact using the almost exact sequence built from ->set_root and ->free_block but the odd way to pass the block to be freed made this non-obvious. By changing the calling convention to the normal one this one could be unified. I've left in some nasty asserts to ensure the assumptions about these blocks wasn't wrong. The other big news is the last patch in the series, which adds rec_len and key_len members to the btree_ops structure and uses this to make the ptr_addr, key_addr, rec_addr, set_key, set_rec, move_keys, move_recs, copy_keys, copy_recsm log_keys and log_recs methods generic. This patch by itselfs saves a few hundred lines of code and more than two kilobytes in the binary image. With this eventual worse generated code that needs to multiply by variables instead of constants should easily be offset by the reduced instruction cache footprint. The patch is so far not really comments and more a proof of concept - if everyone agrees with this approach the changes will be merged into the earlier patches. Now even with this move the set_*, move_* and copy_* interfaces are left as-is. All the old discussion still applies except that things might be a little more clear now that there's just one implementation each and everything is contained in one file. I think keeping the copy_* interfaces is a good idea, they are now basically just typed memcpy wrappers - although we should switch the order of the src and dst arguments to be the same as memcpy. The set_* interfaces can probably go away - over copy_ they just add the index based addressing which most callers don't use anyway. I'm not sure what to do with move_* - these are the most ugly helpers, so maybe we should just make them memmove wrappers in the style of copy_ and leave all addressing to the callers. With all these changes the stats for this series are now: 37 files changed, 6309 insertions(+), 7873 deletions(-) text data bss dec hex filename 631577 4227 3092 638896 9bfb0 fs/xfs/xfs.ko.base 614298 4435 3124 621857 97d21 fs/xfs/xfs.ko.btree -- From owner-xfs@oss.sgi.com Sun Aug 3 18:32:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:32:48 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_65 autolearn=no 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 m741WdiT031460 for ; Sun, 3 Aug 2008 18:32:39 -0700 X-ASG-Debug-ID: 1217813630-2dae03580000-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 1EFB7EF6A60 for ; Sun, 3 Aug 2008 18:33:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id IQ7XvVvg40BTKJXf for ; Sun, 03 Aug 2008 18:33:51 -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 m741XpIF009081 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:33:52 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741XpUa009079 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:33:51 +0200 Date: Mon, 4 Aug 2008 03:33:51 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 11/26] implement generic xfs_btree_decrement Subject: [PATCH 11/26] implement generic xfs_btree_decrement Message-ID: <20080804013351.GL8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-decrement 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: 1217813633 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17336 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 From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-01 18:15:06.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-01 18:16:29.000000000 +0200 @@ -1052,3 +1052,102 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Decrement cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_decrement( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + xfs_buf_t *bp; + int error; /* error return value */ + int lev; + union xfs_btree_ptr ptr; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the left at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + /* We're done if we remain in the block after the decrement. */ + if (--cur->bc_ptrs[level] > 0) + goto out1; + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* Fail if we just went off the left edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, decrement); + + /* + * March up the tree decrementing pointers. + * Stop when we don't go off the left edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + if (--cur->bc_ptrs[lev] > 0) + break; + /* Read-ahead the left block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + } + + /* + * If we went off the root then we are seriously confused. + * or the root of the tree is in an inode. + */ + if (lev == cur->bc_nlevels) { + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) + goto out0; + ASSERT(0); + error = EFSCORRUPTED; + goto error0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = xfs_btree_get_numrecs(block); + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-01 18:16:14.000000000 +0200 @@ -961,7 +961,7 @@ xfs_alloc_ag_vextent_near( args->minlen, <bnoa, <lena); if (ltlena >= args->minlen) break; - if ((error = xfs_alloc_decrement(bno_cur_lt, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur_lt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_lt, @@ -1162,7 +1162,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the left end. */ - if ((error = xfs_alloc_decrement( + if ((error = xfs_btree_decrement( bno_cur_lt, 0, &i))) goto error0; if (!i) { @@ -1321,7 +1321,7 @@ xfs_alloc_ag_vextent_size( bestflen = flen; bestfbno = fbno; for (;;) { - if ((error = xfs_alloc_decrement(cnt_cur, 0, &i))) + if ((error = xfs_btree_decrement(cnt_cur, 0, &i))) goto error0; if (i == 0) break; @@ -1416,7 +1416,7 @@ xfs_alloc_ag_vextent_small( xfs_extlen_t flen; int i; - if ((error = xfs_alloc_decrement(ccur, 0, &i))) + if ((error = xfs_btree_decrement(ccur, 0, &i))) goto error0; if (i) { if ((error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i))) @@ -1607,7 +1607,7 @@ xfs_free_ag_extent( /* * Move the by-block cursor back to the left neighbor. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); #ifdef DEBUG @@ -1653,7 +1653,7 @@ xfs_free_ag_extent( * Back up the by-block cursor to the left neighbor, and * update its length. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); nbno = ltbno; Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-01 18:16:14.000000000 +0200 @@ -256,7 +256,7 @@ xfs_alloc_delrec( xfs_btree_setbuf(cur, level, NULL); cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_alloc_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -272,7 +272,7 @@ xfs_alloc_delrec( * the minimum, we're done. */ if (numrecs >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -336,7 +336,7 @@ xfs_alloc_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_alloc_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -352,7 +352,7 @@ xfs_alloc_delrec( if (lbno != NULLAGBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -368,7 +368,7 @@ xfs_alloc_delrec( */ i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); xfs_btree_firstrec(tcur, level); @@ -468,7 +468,7 @@ xfs_alloc_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1780,90 +1780,6 @@ xfs_alloc_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer pointer for block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1889,7 +1805,7 @@ xfs_alloc_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_alloc_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-01 18:16:14.000000000 +0200 @@ -95,12 +95,6 @@ typedef struct xfs_btree_sblock xfs_allo XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-01 18:16:14.000000000 +0200 @@ -820,7 +820,7 @@ xfs_bmap_add_extent_delay_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1381,13 +1381,13 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1430,7 +1430,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1473,7 +1473,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, new->br_startoff, @@ -1556,7 +1556,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; if (xfs_bmbt_update(cur, LEFT.br_startoff, LEFT.br_startblock, @@ -2108,7 +2108,7 @@ xfs_bmap_add_extent_hole_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, left.br_startoff, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-01 18:16:14.000000000 +0200 @@ -203,7 +203,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -216,7 +216,7 @@ xfs_bmbt_delrec( goto error0; } if (numrecs >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -237,7 +237,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -282,7 +282,7 @@ xfs_bmbt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); tcur = NULL; if (level > 0) { - if ((error = xfs_bmbt_decrement(cur, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); @@ -298,7 +298,7 @@ xfs_bmbt_delrec( if (lbno != NULLFSBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -311,7 +311,7 @@ xfs_bmbt_delrec( /* * decrement to last in block */ - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -383,7 +383,7 @@ xfs_bmbt_delrec( } lrecs = be16_to_cpu(left->bb_numrecs); } else { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -1487,80 +1487,6 @@ xfs_bmdr_to_bmbt( } /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_decrement( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - - if (--cur->bc_ptrs[level] > 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. */ int /* error */ @@ -1582,7 +1508,7 @@ xfs_bmbt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_bmbt_decrement(cur, level, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-01 18:16:14.000000000 +0200 @@ -237,7 +237,6 @@ typedef struct xfs_btree_lblock xfs_bmbt * Prototypes for xfs_bmap.c to call. */ extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); -extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-01 18:16:14.000000000 +0200 @@ -739,7 +739,7 @@ nextag: /* * Search left with tcur, back up 1 record. */ - if ((error = xfs_inobt_decrement(tcur, 0, &i))) + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; if (!doneleft) { @@ -815,7 +815,7 @@ nextag: * further left. */ if (useleft) { - if ((error = xfs_inobt_decrement(tcur, 0, + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-01 18:16:14.000000000 +0200 @@ -205,7 +205,7 @@ xfs_inobt_delrec( cur->bc_bufs[level] = NULL; cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -222,7 +222,7 @@ xfs_inobt_delrec( */ if (numrecs >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -286,7 +286,7 @@ xfs_inobt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_inobt_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -301,7 +301,7 @@ xfs_inobt_delrec( rrecs = be16_to_cpu(right->bb_numrecs); if (lbno != NULLAGBLOCK) { xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; } } @@ -315,7 +315,7 @@ xfs_inobt_delrec( * previous block. */ xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; xfs_btree_firstrec(tcur, level); /* @@ -414,7 +414,7 @@ xfs_inobt_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_inobt_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1656,90 +1656,6 @@ xfs_inobt_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - int error; - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1765,7 +1681,7 @@ xfs_inobt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_inobt_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-01 18:16:14.000000000 +0200 @@ -117,12 +117,6 @@ typedef struct xfs_btree_sblock xfs_inob i, XFS_INOBT_BLOCK_MAXRECS(1, cur))) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-01 18:10:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-01 18:16:14.000000000 +0200 @@ -511,6 +511,7 @@ xfs_btree_setbuf( */ int xfs_btree_increment(struct xfs_btree_cur *, int, int *); +int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); /* -- From owner-xfs@oss.sgi.com Sun Aug 3 18:32:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:32:31 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741WLBb031172 for ; Sun, 3 Aug 2008 18:32:21 -0700 X-ASG-Debug-ID: 1217813612-16a602eb0000-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 129BA197642B for ; Sun, 3 Aug 2008 18:33:33 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id anQwla8VGpIOuv5F for ; Sun, 03 Aug 2008 18:33:33 -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 m741XYIF009045 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:33:34 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741XYsr009043 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:33:34 +0200 Date: Mon, 4 Aug 2008 03:33:34 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 09/26] make btree tracing generic Subject: [PATCH 09/26] make btree tracing generic Message-ID: <20080804013334.GJ8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-trace 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: 1217813614 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: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17334 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 make the existing bmap btree tracing generic so that it applies to all btree types. Some fragments lifted from a patch by Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 16:23:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 16:52:06.000000000 +0200 @@ -190,6 +190,25 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + + /* btree tracing */ +#ifdef XFS_BTREE_TRACE + void (*trace_enter)(struct xfs_btree_cur *, const char *, + char *, int, int, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t); + void (*trace_cursor)(struct xfs_btree_cur *, __uint32_t *, + __uint64_t *, __uint64_t *); + void (*trace_key)(struct xfs_btree_cur *, + union xfs_btree_key *, __uint64_t *, + __uint64_t *); + void (*trace_record)(struct xfs_btree_cur *, + union xfs_btree_rec *, __uint64_t *, + __uint64_t *, __uint64_t *); +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.c 2008-07-29 16:59:40.000000000 +0200 @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_types.h" +#include "xfs_inum.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_btree_trace.h" + +STATIC void +xfs_btree_trace_ptr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr ptr, + __psunsigned_t *high, + __psunsigned_t *low) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __u64 val = be64_to_cpu(ptr.l); + *high = val >> 32; + *low = (int)val; + } else { + *high = 0; + *low = be32_to_cpu(ptr.s); + } +} + +/* + * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. + */ +void +xfs_btree_trace_argbi( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBI, + line, (__psunsigned_t)b, i, 0, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for a buffer & 2 integer args. + */ +void +xfs_btree_trace_argbii( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i0, + int i1, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBII, + line, (__psunsigned_t)b, i0, i1, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for 3 block-length args + * and an integer arg. + */ +void +xfs_btree_trace_argfffi( + const char *func, + struct xfs_btree_cur *cur, + xfs_dfiloff_t o, + xfs_dfsbno_t b, + xfs_dfilblks_t i, + int j, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGFFFI, line, + o >> 32, (int)o, b >> 32, (int)b, + i >> 32, (int)i, (int)j, 0, + 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for one integer arg. + */ +void +xfs_btree_trace_argi( + const char *func, + struct xfs_btree_cur *cur, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGI, + line, i, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, key. + */ +void +xfs_btree_trace_argipk( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_ptr ptr, + union xfs_btree_key *key, + int line) +{ + __psunsigned_t high, low; + __uint64_t l0, l1; + + xfs_btree_trace_ptr(cur, ptr, &high, &low); + cur->bc_ops->trace_key(cur, key, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIPK, + line, i, high, low, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, rec. + */ +void +xfs_btree_trace_argipr( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_ptr ptr, + union xfs_btree_rec *rec, + int line) +{ + __psunsigned_t high, low; + __uint64_t l0, l1, l2; + + xfs_btree_trace_ptr(cur, ptr, &high, &low); + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIPR, + line, i, + high, low, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, key. + */ +void +xfs_btree_trace_argik( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_key *key, + int line) +{ + __uint64_t l0, l1; + + cur->bc_ops->trace_key(cur, key, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIK, + line, i, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for record. + */ +void +xfs_btree_trace_argr( + const char *func, + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + int line) +{ + __uint64_t l0, l1, l2; + + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGR, + line, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for the cursor/operation. + */ +void +xfs_btree_trace_cursor( + const char *func, + struct xfs_btree_cur *cur, + int type, + int line) +{ + __uint32_t s0; + __uint64_t l0, l1; + char *s; + + switch (type) { + case XBT_ARGS: + s = "args"; + break; + case XBT_ENTRY: + s = "entry"; + break; + case XBT_ERROR: + s = "error"; + break; + case XBT_EXIT: + s = "exit"; + break; + default: + s = "unknown"; + break; + } + + cur->bc_ops->trace_cursor(cur, &s0, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, s, XFS_BTREE_KTRACE_CUR, line, + s0, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + (__psunsigned_t)cur->bc_bufs[0], + (__psunsigned_t)cur->bc_bufs[1], + (__psunsigned_t)cur->bc_bufs[2], + (__psunsigned_t)cur->bc_bufs[3], + (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], + (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); +} Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-07-29 16:23:24.000000000 +0200 @@ -81,7 +81,8 @@ xfs-y += xfs_alloc.o \ xfs_dmops.o \ xfs_qmops.o -xfs-$(CONFIG_XFS_TRACE) += xfs_dir2_trace.o +xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ + xfs_dir2_trace.o # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ Index: linux-2.6-xfs/fs/xfs/xfs.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs.h 2008-07-29 16:23:24.000000000 +0200 @@ -30,7 +30,7 @@ #define XFS_ATTR_TRACE 1 #define XFS_BLI_TRACE 1 #define XFS_BMAP_TRACE 1 -#define XFS_BMBT_TRACE 1 +#define XFS_BTREE_TRACE 1 #define XFS_DIR2_TRACE 1 #define XFS_DQUOT_TRACE 1 #define XFS_ILOCK_TRACE 1 Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:57:57.000000000 +0200 @@ -37,16 +37,13 @@ #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_itable.h" #include "xfs_bmap.h" #include "xfs_error.h" #include "xfs_quota.h" -#if defined(XFS_BMBT_TRACE) -ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for internal btree functions. */ @@ -61,245 +58,33 @@ STATIC int xfs_bmbt_split(xfs_btree_cur_ __uint64_t *, xfs_btree_cur_t **, int *); STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); - -#if defined(XFS_BMBT_TRACE) - -static char ARGS[] = "args"; -static char ENTRY[] = "entry"; -static char ERROR[] = "error"; #undef EXIT -static char EXIT[] = "exit"; -/* - * Add a trace buffer entry for the arguments given to the routine, - * generic form. - */ -STATIC void -xfs_bmbt_trace_enter( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int type, - int line, - __psunsigned_t a0, - __psunsigned_t a1, - __psunsigned_t a2, - __psunsigned_t a3, - __psunsigned_t a4, - __psunsigned_t a5, - __psunsigned_t a6, - __psunsigned_t a7, - __psunsigned_t a8, - __psunsigned_t a9, - __psunsigned_t a10) -{ - xfs_inode_t *ip; - int whichfork; - - ip = cur->bc_private.b.ip; - whichfork = cur->bc_private.b.whichfork; - ktrace_enter(xfs_bmbt_trace_buf, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); - ASSERT(ip->i_btrace); - ktrace_enter(ip->i_btrace, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); -} -/* - * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. - */ -STATIC void -xfs_bmbt_trace_argbi( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBI, line, - (__psunsigned_t)b, i, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for a buffer & 2 integer args. - */ -STATIC void -xfs_bmbt_trace_argbii( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i0, - int i1, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBII, line, - (__psunsigned_t)b, i0, i1, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for 3 block-length args - * and an integer arg. - */ -STATIC void -xfs_bmbt_trace_argfffi( - const char *func, - xfs_btree_cur_t *cur, - xfs_dfiloff_t o, - xfs_dfsbno_t b, - xfs_dfilblks_t i, - int j, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGFFFI, line, - o >> 32, (int)o, b >> 32, (int)b, - i >> 32, (int)i, (int)j, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for one integer arg. - */ -STATIC void -xfs_bmbt_trace_argi( - const char *func, - xfs_btree_cur_t *cur, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGI, line, - i, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, key. - */ -STATIC void -xfs_bmbt_trace_argifk( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_dfiloff_t o, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, (xfs_dfsbno_t)f >> 32, (int)f, o >> 32, - (int)o, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, rec. - */ -STATIC void -xfs_bmbt_trace_argifr( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_bmbt_rec_t *r, - int line) -{ - xfs_dfsbno_t b; - xfs_dfilblks_t c; - xfs_dfsbno_t d; - xfs_dfiloff_t o; - xfs_bmbt_irec_t s; - - d = (xfs_dfsbno_t)f; - xfs_bmbt_disk_get_all(r, &s); - o = (xfs_dfiloff_t)s.br_startoff; - b = (xfs_dfsbno_t)s.br_startblock; - c = s.br_blockcount; - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFR, line, - i, d >> 32, (int)d, o >> 32, - (int)o, b >> 32, (int)b, c >> 32, - (int)c, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, key. - */ -STATIC void -xfs_bmbt_trace_argik( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_bmbt_key_t *k, - int line) -{ - xfs_dfiloff_t o; - - o = be64_to_cpu(k->br_startoff); - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, o >> 32, (int)o, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for the cursor/operation. - */ -STATIC void -xfs_bmbt_trace_cursor( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int line) -{ - xfs_bmbt_rec_host_t r; - - xfs_bmbt_set_all(&r, &cur->bc_rec.b); - xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line, - (cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) | - cur->bc_private.b.allocated, - r.l0 >> 32, (int)r.l0, - r.l1 >> 32, (int)r.l1, - (unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1], - (unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3], - (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], - (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); -} - -#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ - xfs_bmbt_trace_argbi(__func__, c, b, i, __LINE__) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ - xfs_bmbt_trace_argbii(__func__, c, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ - xfs_bmbt_trace_argfffi(__func__, c, o, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGI(c,i) \ - xfs_bmbt_trace_argi(__func__, c, i, __LINE__) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ - xfs_bmbt_trace_argifk(__func__, c, i, f, s, __LINE__) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ - xfs_bmbt_trace_argifr(__func__, c, i, f, r, __LINE__) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ - xfs_bmbt_trace_argik(__func__, c, i, k, __LINE__) -#define XFS_BMBT_TRACE_CURSOR(c,s) \ - xfs_bmbt_trace_cursor(__func__, c, s, __LINE__) -#else -#define XFS_BMBT_TRACE_ARGBI(c,b,i) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) -#define XFS_BMBT_TRACE_ARGI(c,i) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) -#define XFS_BMBT_TRACE_CURSOR(c,s) -#endif /* XFS_BMBT_TRACE */ +#define ENTRY XBT_ENTRY +#define ERROR XBT_ERROR +#define EXIT XBT_EXIT + +/* + * Keep the XFS_BMBT_TRACE_ names around for now until all code using them + * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names. + */ +#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ + XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ + XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ + XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BMBT_TRACE_ARGI(c,i) \ + XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ + XFS_BTREE_TRACE_ARGIPK(c,i,(union xfs_btree_ptr)f,s) +#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ + XFS_BTREE_TRACE_ARGIPR(c,i, \ + (union xfs_btree_ptr)f, (union xfs_btree_rec *)r) +#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ + XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k) +#define XFS_BMBT_TRACE_CURSOR(c,s) \ + XFS_BTREE_TRACE_CURSOR(c,s) /* @@ -1485,7 +1270,8 @@ xfs_bmbt_split( xfs_bmbt_rec_t *rrp; /* right record pointer */ XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIFK(cur, level, *bnop, *startoff); + // disable until merged into common code +// XFS_BMBT_TRACE_ARGIFK(cur, level, *bnop, *startoff); args.tp = cur->bc_tp; args.mp = cur->bc_mp; lbp = cur->bc_bufs[level]; @@ -2639,9 +2425,102 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_bmbt_trace_buf; + +STATIC void +xfs_bmbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + struct xfs_inode *ip = cur->bc_private.b.ip; + int whichfork = cur->bc_private.b.whichfork; + + ktrace_enter(xfs_bmbt_trace_buf, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); + ktrace_enter(ip->i_btrace, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_bmbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + struct xfs_bmbt_rec_host r; + + xfs_bmbt_set_all(&r, &cur->bc_rec.b); + + *s0 = (cur->bc_nlevels << 24) | + (cur->bc_private.b.flags << 16) | + cur->bc_private.b.allocated; + *l0 = r.l0; + *l1 = r.l1; +} + +STATIC void +xfs_bmbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be64_to_cpu(key->bmbt.br_startoff); + *l1 = 0; +} + +STATIC void +xfs_bmbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + struct xfs_bmbt_irec irec; + + xfs_bmbt_disk_get_all(&rec->bmbt, &irec); + *l0 = irec.br_startoff; + *l1 = irec.br_startblock; + *l2 = irec.br_blockcount; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_bmbt_trace_enter, + .trace_cursor = xfs_bmbt_trace_cursor, + .trace_key = xfs_bmbt_trace_key, + .trace_record = xfs_bmbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 16:23:24.000000000 +0200 @@ -39,6 +39,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -97,7 +98,9 @@ EXPORT_SYMBOL(xfs_alloc_trace_buf); #ifdef XFS_BMAP_TRACE EXPORT_SYMBOL(xfs_bmap_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE +EXPORT_SYMBOL(xfs_allocbt_trace_buf); +EXPORT_SYMBOL(xfs_inobt_trace_buf); EXPORT_SYMBOL(xfs_bmbt_trace_buf); #endif #ifdef XFS_ATTR_TRACE Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 16:23:24.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -1744,10 +1745,18 @@ xfs_alloc_trace_bufs(void) if (!xfs_bmap_trace_buf) goto out_free_alloc_trace; #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE + xfs_allocbt_trace_buf = ktrace_alloc(XFS_ALLOCBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_allocbt_trace_buf) + goto out_free_bmap_trace; + + xfs_inobt_trace_buf = ktrace_alloc(XFS_INOBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_inobt_trace_buf) + goto out_free_allocbt_trace; + xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL); if (!xfs_bmbt_trace_buf) - goto out_free_bmap_trace; + goto out_free_inobt_trace; #endif #ifdef XFS_ATTR_TRACE xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL); @@ -1769,8 +1778,12 @@ xfs_alloc_trace_bufs(void) ktrace_free(xfs_attr_trace_buf); out_free_bmbt_trace: #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + out_free_inobt_trace: + ktrace_free(xfs_inobt_trace_buf); + out_free_allocbt_trace: + ktrace_free(xfs_allocbt_trace_buf); out_free_bmap_trace: #endif #ifdef XFS_BMAP_TRACE @@ -1793,8 +1806,10 @@ xfs_free_trace_bufs(void) #ifdef XFS_ATTR_TRACE ktrace_free(xfs_attr_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + ktrace_free(xfs_inobt_trace_buf); + ktrace_free(xfs_allocbt_trace_buf); #endif #ifdef XFS_BMAP_TRACE ktrace_free(xfs_bmap_trace_buf); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:52:06.000000000 +0200 @@ -233,24 +233,6 @@ typedef struct xfs_btree_lblock xfs_bmbt #ifdef __KERNEL__ -#if defined(XFS_BMBT_TRACE) -/* - * Trace buffer entry types. - */ -#define XFS_BMBT_KTRACE_ARGBI 1 -#define XFS_BMBT_KTRACE_ARGBII 2 -#define XFS_BMBT_KTRACE_ARGFFFI 3 -#define XFS_BMBT_KTRACE_ARGI 4 -#define XFS_BMBT_KTRACE_ARGIFK 5 -#define XFS_BMBT_KTRACE_ARGIFR 6 -#define XFS_BMBT_KTRACE_ARGIK 7 -#define XFS_BMBT_KTRACE_CUR 8 - -#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ -#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ -extern ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for xfs_bmap.c to call. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-29 16:23:24.000000000 +0200 @@ -41,6 +41,7 @@ #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" @@ -841,7 +842,7 @@ xfs_iread( #ifdef XFS_BMAP_TRACE ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_RW_TRACE @@ -2600,7 +2601,7 @@ xfs_idestroy( #ifdef XFS_BMAP_TRACE ktrace_free(ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-29 16:23:24.000000000 +0200 @@ -251,7 +251,7 @@ typedef struct xfs_inode { #ifdef XFS_BMAP_TRACE struct ktrace *i_xtrace; /* inode extent list trace */ #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE struct ktrace *i_btrace; /* inode bmap btree trace */ #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-29 16:59:55.000000000 +0200 @@ -45,6 +45,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" @@ -88,7 +89,7 @@ static void xfsidbg_xattrtrace(int); static void xfsidbg_xblitrace(xfs_buf_log_item_t *); #endif #ifdef XFS_BMAP_TRACE -static void xfsidbg_xbmatrace(int); +static void xfsidbg_xbtatrace(int, struct ktrace *, int); static void xfsidbg_xbmitrace(xfs_inode_t *); static void xfsidbg_xbmstrace(xfs_inode_t *); static void xfsidbg_xbxatrace(int); @@ -133,7 +134,7 @@ static void xfsidbg_xattrleaf(xfs_attr_l static void xfsidbg_xattrsf(xfs_attr_shortform_t *); static void xfsidbg_xbirec(xfs_bmbt_irec_t *r); static void xfsidbg_xbmalla(xfs_bmalloca_t *); -static void xfsidbg_xbrec(xfs_bmbt_rec_host_t *); +static void xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *); static void xfsidbg_xbroot(xfs_inode_t *); static void xfsidbg_xbroota(xfs_inode_t *); static void xfsidbg_xbtcur(xfs_btree_cur_t *); @@ -198,9 +199,6 @@ static int xfs_attr_trace_entry(ktrace_e #ifdef XFS_BMAP_TRACE static int xfs_bmap_trace_entry(ktrace_entry_t *ktep); #endif -#ifdef XFS_BMAP_TRACE -static int xfs_bmbt_trace_entry(ktrace_entry_t *ktep); -#endif #ifdef XFS_DIR2_TRACE static int xfs_dir2_trace_entry(ktrace_entry_t *ktep); #endif @@ -421,10 +419,52 @@ static int kdbm_xfs_xbmatrace( if (diag) return diag; - xfsidbg_xbmatrace((int) addr); + xfsidbg_xbtatrace(XFS_BTNUM_BMAP, xfs_bmbt_trace_buf, (int)addr); return 0; } +static int kdbm_xfs_xbtaatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + /* also contains XFS_BTNUM_CNT */ + xfsidbg_xbtatrace(XFS_BTNUM_BNO, xfs_allocbt_trace_buf, (int)addr); + return 0; +} + +static int kdbm_xfs_xbtiatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + xfsidbg_xbtatrace(XFS_BTNUM_INO, xfs_inobt_trace_buf, (int)addr); + return 0; +} + + static int kdbm_xfs_xbmitrace( int argc, const char **argv) @@ -902,7 +942,7 @@ static int kdbm_xfs_xbrec( if (diag) return diag; - xfsidbg_xbrec((xfs_bmbt_rec_host_t *) addr); + xfsidbg_xbmbtrec((xfs_bmbt_rec_host_t *) addr); return 0; } @@ -2273,6 +2313,10 @@ static struct xif xfsidbg_funcs[] = { "Dump XFS bmap btree per-inode trace" }, { "xbmstrc", kdbm_xfs_xbmstrace, "", "Dump XFS bmap btree inode trace" }, + { "xbtaatrc", kdbm_xfs_xbtaatrace, "", + "Dump XFS alloc btree count trace" }, + { "xbtiatrc", kdbm_xfs_xbtiatrace, "", + "Dump XFS inobt btree count trace" }, #endif { "xbrec", kdbm_xfs_xbrec, "", "Dump XFS bmap record"}, @@ -2706,16 +2750,115 @@ xfs_bmap_trace_entry(ktrace_entry_t *kte return 1; } +static void +xfsidb_btree_trace_record( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4, + unsigned long l5) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_irec s; + + s.br_startoff = ((xfs_dfiloff_t)l0 << 32) | (xfs_dfiloff_t)l1; + s.br_startblock = ((xfs_dfsbno_t)l2 << 32) | (xfs_dfsbno_t)l3; + s.br_blockcount = ((xfs_dfilblks_t)l4 << 32) | (xfs_dfilblks_t)l5; + + xfsidbg_xbirec(&s); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock = %d, blockcount = %d\n", + (unsigned int)l0, (unsigned int)l2); + break; + case XFS_BTNUM_INO: + qprintf(" startino = %d, freecount = %d, free = %lld\n", + (unsigned int)l0, (unsigned int)l2, + ((xfs_inofree_t)l4 << 32) | (xfs_inofree_t)l5); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_key( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + qprintf(" startoff 0x%x%08x\n", (unsigned int)l0, (unsigned int)l1); + break; + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" startino %d\n", (unsigned int)l0); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_cursor( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_rec_host r; + + qprintf(" nlevels %ld flags %ld allocated %ld ", + (l0 >> 24) & 0xff, (l0 >> 16) & 0xff, l0 & 0xffff); + + r.l0 = (unsigned long long)l1 << 32 | l2; + r.l1 = (unsigned long long)l3 << 32 | l4; + + xfsidbg_xbmbtrec(&r); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" agno %d startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l1, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" agno %d startino %d free %lld\n", + (unsigned int)l0, (unsigned int)l1, + ((xfs_inofree_t)l3 << 32) | (xfs_inofree_t)l4); + break; + default: + break; + } +} + /* * Print xfs bmap btree trace buffer entry. */ static int -xfs_bmbt_trace_entry( - ktrace_entry_t *ktep) +xfs_btree_trace_entry( + int btnum, + ktrace_entry_t *ktep) { int line; - xfs_bmbt_rec_host_t r; - xfs_bmbt_irec_t s; int type; int whichfork; @@ -2732,18 +2875,18 @@ xfs_bmbt_trace_entry( "da"[whichfork], (xfs_btree_cur_t *)ktep->val[4]); switch (type) { - case XFS_BMBT_KTRACE_ARGBI: + case XFS_BTREE_KTRACE_ARGBI: qprintf(" buf 0x%p i %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6]); break; - case XFS_BMBT_KTRACE_ARGBII: + case XFS_BTREE_KTRACE_ARGBII: qprintf(" buf 0x%p i0 %ld i1 %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6], (long)ktep->val[7]); break; - case XFS_BMBT_KTRACE_ARGFFFI: + case XFS_BTREE_KTRACE_ARGFFFI: qprintf(" o 0x%x%08x b 0x%x%08x i 0x%x%08x j %ld\n", (unsigned int)(long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2753,11 +2896,11 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[10], (long)ktep->val[11]); break; - case XFS_BMBT_KTRACE_ARGI: + case XFS_BTREE_KTRACE_ARGI: qprintf(" i 0x%lx\n", (long)ktep->val[5]); break; - case XFS_BMBT_KTRACE_ARGIFK: + case XFS_BTREE_KTRACE_ARGIPK: qprintf(" i 0x%lx f 0x%x%08x o 0x%x%08x\n", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2765,39 +2908,45 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[8], (unsigned int)(long)ktep->val[9]); break; - case XFS_BMBT_KTRACE_ARGIFR: + case XFS_BTREE_KTRACE_ARGIPR: qprintf(" i 0x%lx f 0x%x%08x ", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], (unsigned int)(long)ktep->val[7]); - s.br_startoff = (xfs_fileoff_t) - (((xfs_dfiloff_t)(unsigned long)ktep->val[8] << 32) | - (xfs_dfiloff_t)(unsigned long)ktep->val[9]); - s.br_startblock = (xfs_fsblock_t) - (((xfs_dfsbno_t)(unsigned long)ktep->val[10] << 32) | - (xfs_dfsbno_t)(unsigned long)ktep->val[11]); - s.br_blockcount = (xfs_filblks_t) - (((xfs_dfilblks_t)(unsigned long)ktep->val[12] << 32) | - (xfs_dfilblks_t)(unsigned long)ktep->val[13]); - xfsidbg_xbirec(&s); - break; - case XFS_BMBT_KTRACE_ARGIK: - qprintf(" i 0x%lx o 0x%x%08x\n", - (long)ktep->val[5], - (unsigned int)(long)ktep->val[6], - (unsigned int)(long)ktep->val[7]); - break; - case XFS_BMBT_KTRACE_CUR: - qprintf(" nlevels %ld flags %ld allocated %ld ", - ((long)ktep->val[5] >> 24) & 0xff, - ((long)ktep->val[5] >> 16) & 0xff, - (long)ktep->val[5] & 0xffff); - r.l0 = (unsigned long long)(unsigned long)ktep->val[6] << 32 | - (unsigned long)ktep->val[7]; - r.l1 = (unsigned long long)(unsigned long)ktep->val[8] << 32 | - (unsigned long)ktep->val[9]; + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10], + (unsigned long)ktep->val[11], + (unsigned long)ktep->val[12], + (unsigned long)ktep->val[13]); + break; + case XFS_BTREE_KTRACE_ARGIK: + qprintf(" i 0x%lx\n", (long)ktep->val[5]); + xfsidb_btree_trace_key(btnum, + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); + break; + case XFS_BTREE_KTRACE_ARGR: + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10]); + break; + case XFS_BTREE_KTRACE_CUR: + + xfsidb_btree_trace_cursor(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); - xfsidbg_xbrec(&r); qprintf(" bufs 0x%p 0x%p 0x%p 0x%p ", (xfs_buf_t *)ktep->val[10], (xfs_buf_t *)ktep->val[11], @@ -4383,21 +4532,21 @@ xfsidbg_xbmalla(xfs_bmalloca_t *a) #ifdef XFS_BMAP_TRACE /* - * Print out the last "count" entries in the bmap btree trace buffer. + * Print out the last "count" entries in a btree trace buffer. * The "a" is for "all" inodes. */ static void -xfsidbg_xbmatrace(int count) +xfsidbg_xbtatrace(int btnum, struct ktrace *trace_buf, int count) { ktrace_entry_t *ktep; ktrace_snap_t kts; int nentries; int skip_entries; - if (xfs_bmbt_trace_buf == NULL) { + if (trace_buf == NULL) { qprintf("The xfs bmap btree trace buffer is not initialized\n"); return; } - nentries = ktrace_nentries(xfs_bmbt_trace_buf); + nentries = ktrace_nentries(trace_buf); if (count == -1) { count = nentries; } @@ -4406,23 +4555,23 @@ xfsidbg_xbmatrace(int count) return; } - ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_first(trace_buf, &kts); if (count != nentries) { /* * Skip the total minus the number to look at minus one * for the entry returned by ktrace_first(). */ skip_entries = nentries - count - 1; - ktep = ktrace_skip(xfs_bmbt_trace_buf, skip_entries, &kts); + ktep = ktrace_skip(trace_buf, skip_entries, &kts); if (ktep == NULL) { qprintf("Skipped them all\n"); return; } } while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(btnum, ktep)) qprintf("\n"); - ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_next(trace_buf, &kts); } } @@ -4442,7 +4591,7 @@ xfsidbg_xbmitrace(xfs_inode_t *ip) ktep = ktrace_first(ip->i_btrace, &kts); while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); ktep = ktrace_next(ip->i_btrace, &kts); } @@ -4465,7 +4614,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); while (ktep != NULL) { if ((xfs_inode_t *)(ktep->val[2]) == ip) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); } ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); @@ -4477,7 +4626,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) * Print xfs bmap record */ static void -xfsidbg_xbrec(xfs_bmbt_rec_host_t *r) +xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *r) { xfs_bmbt_irec_t irec; @@ -6398,7 +6547,7 @@ xfsidbg_xnode(xfs_inode_t *ip) #ifdef XFS_BMAP_TRACE qprintf(" bmap_trace 0x%p\n", ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE qprintf(" bmbt trace 0x%p\n", ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.h 2008-07-29 16:53:44.000000000 +0200 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_BTREE_TRACE_H__ +#define __XFS_BTREE_TRACE_H__ + +struct xfs_btree_cur; +struct xfs_buf; + + +/* + * Trace hooks. + * i,j = integer (32 bit) + * b = btree block buffer (xfs_buf_t) + * p = btree ptr + * r = btree record + * k = btree key + */ + +#ifdef XFS_BTREE_TRACE + +/* + * Trace buffer entry types. + */ +#define XFS_BTREE_KTRACE_ARGBI 1 +#define XFS_BTREE_KTRACE_ARGBII 2 +#define XFS_BTREE_KTRACE_ARGFFFI 3 +#define XFS_BTREE_KTRACE_ARGI 4 +#define XFS_BTREE_KTRACE_ARGIPK 5 +#define XFS_BTREE_KTRACE_ARGIPR 6 +#define XFS_BTREE_KTRACE_ARGIK 7 +#define XFS_BTREE_KTRACE_ARGR 8 +#define XFS_BTREE_KTRACE_CUR 9 + +/* + * Sub-types for cursor traces. + */ +#define XBT_ARGS 0 +#define XBT_ENTRY 1 +#define XBT_ERROR 2 +#define XBT_EXIT 3 + +void xfs_btree_trace_argbi(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int); +void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int, int); +void xfs_btree_trace_argfffi(const char *, struct xfs_btree_cur *, + xfs_dfiloff_t, xfs_dfsbno_t, xfs_dfilblks_t, int, int); +void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int); +void xfs_btree_trace_argipk(const char *, struct xfs_btree_cur *, int, + union xfs_btree_ptr, union xfs_btree_key *, int); +void xfs_btree_trace_argipr(const char *, struct xfs_btree_cur *, int, + union xfs_btree_ptr, union xfs_btree_rec *, int); +void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int, + union xfs_btree_key *, int); +void xfs_btree_trace_argr(const char *, struct xfs_btree_cur *, + union xfs_btree_rec *, int); +void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int); + + +#define XFS_ALLOCBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_allocbt_trace_buf; + +#define XFS_INOBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_inobt_trace_buf; + +#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ +#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ +extern ktrace_t *xfs_bmbt_trace_buf; + + +#define XFS_BTREE_TRACE_ARGBI(c,b,i) \ + xfs_btree_trace_argbi(__func__, c, b, i, __LINE__) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) \ + xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) \ + xfs_btree_trace_argfffi(__func__, c, o, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGI(c,i) \ + xfs_btree_trace_argi(__func__, c, i, __LINE__) +#define XFS_BTREE_TRACE_ARGIPK(c,i,p,k) \ + xfs_btree_trace_argipk(__func__, c, i, p, k, __LINE__) +#define XFS_BTREE_TRACE_ARGIPR(c,i,p,r) \ + xfs_btree_trace_argipr(__func__, c, i, p, r, __LINE__) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) \ + xfs_btree_trace_argik(__func__, c, i, k, __LINE__) +#define XFS_BTREE_TRACE_ARGR(c,r) \ + xfs_btree_trace_argr(__func__, c, r, __LINE__) +#define XFS_BTREE_TRACE_CURSOR(c,t) \ + xfs_btree_trace_cursor(__func__, c, t, __LINE__) +#else +#define XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BTREE_TRACE_ARGIPK(c,i,p,s) +#define XFS_BTREE_TRACE_ARGIPR(c,i,p,r) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) +#define XFS_BTREE_TRACE_ARGR(c,r) +#define XFS_BTREE_TRACE_CURSOR(c,t) +#endif /* XFS_BTREE_TRACE */ + +#endif /* __XFS_BTREE_TRACE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:52:06.000000000 +0200 @@ -2219,8 +2219,82 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_allocbt_trace_buf; + +STATIC void +xfs_allocbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_allocbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.a.ar_startblock; + *l1 = cur->bc_rec.a.ar_blockcount; +} + +STATIC void +xfs_allocbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->alloc.ar_startblock); + *l1 = be32_to_cpu(key->alloc.ar_blockcount); +} + +STATIC void +xfs_allocbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->alloc.ar_startblock); + *l1 = be32_to_cpu(rec->alloc.ar_blockcount); + *l2 = 0; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_allocbt_trace_enter, + .trace_cursor = xfs_allocbt_trace_cursor, + .trace_key = xfs_allocbt_trace_key, + .trace_record = xfs_allocbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:52:06.000000000 +0200 @@ -2085,8 +2085,82 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_inobt_trace_buf; + +STATIC void +xfs_inobt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_inobt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.i.ir_startino; + *l1 = cur->bc_rec.i.ir_free; +} + +STATIC void +xfs_inobt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->inobt.ir_startino); + *l1 = 0; +} + +STATIC void +xfs_inobt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->inobt.ir_startino); + *l1 = be32_to_cpu(rec->inobt.ir_freecount); + *l2 = be64_to_cpu(rec->inobt.ir_free); +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_inobt_trace_enter, + .trace_cursor = xfs_inobt_trace_cursor, + .trace_key = xfs_inobt_trace_key, + .trace_record = xfs_inobt_trace_record, +#endif }; /* -- From owner-xfs@oss.sgi.com Sun Aug 3 18:31:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:55 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no 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 m741Vr1N030687 for ; Sun, 3 Aug 2008 18:31:53 -0700 X-ASG-Debug-ID: 1217813585-73a201b00000-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 E1F203566B9 for ; Sun, 3 Aug 2008 18:33:06 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id IjxGNwkmMV5Y74BJ for ; Sun, 03 Aug 2008 18:33:06 -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 m741X6IF008953 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:33:06 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741X6c4008951 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:33:06 +0200 Date: Mon, 4 Aug 2008 03:33:06 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 06/26] refactor xfs_btree_readahead Subject: [PATCH 06/26] refactor xfs_btree_readahead Message-ID: <20080804013306.GG8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-readahead-refactor 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: 1217813587 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.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17331 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 From: Dave Chinner Refactor xfs_btree_readahead to make it more readable: (a) remove the inline xfs_btree_readahead wrapper and move all checks out of line into the main routine. (b) factor out helpers for short/long form btrees (c) move check for root in inodes from the callers into xfs_btree_readahead [hch: split out from a big patch and minor cleanups] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 02:11:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 03:03:28.000000000 +0200 @@ -709,66 +709,84 @@ xfs_btree_reada_bufs( xfs_baread(mp->m_ddev_targp, d, mp->m_bsize * count); } +STATIC int +xfs_btree_readahead_lblock( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_block *block) +{ + int rval = 0; + xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); + xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, right, 1); + rval++; + } + + return rval; +} + +STATIC int +xfs_btree_readahead_sblock( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_block *block) +{ + int rval = 0; + xfs_agblock_t left = be32_to_cpu(block->bb_u.s.bb_leftsib); + xfs_agblock_t right = be32_to_cpu(block->bb_u.s.bb_rightsib); + + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + right, 1); + rval++; + } + + return rval; +} + /* * Read-ahead btree blocks, at the given level. * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ +xfs_btree_readahead( + struct xfs_btree_cur *cur, /* btree cursor */ int lev, /* level in btree */ int lr) /* left/right bits */ { - xfs_alloc_block_t *a; - xfs_bmbt_block_t *b; - xfs_inobt_block_t *i; - int rval = 0; + struct xfs_btree_block *block; + + /* + * No readahead needed if we are at the root level and the + * btree root is stored in the inode. + */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (lev == cur->bc_nlevels - 1)) + return 0; + + if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) + return 0; - ASSERT(cur->bc_bufs[lev] != NULL); cur->bc_ra[lev] |= lr; - switch (cur->bc_btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - a = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(a->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(a->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_BMAP: - b = XFS_BUF_TO_BMBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be64_to_cpu(b->bb_leftsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be64_to_cpu(b->bb_rightsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_INO: - i = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(i->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(i->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_rightsib), 1); - rval++; - } - break; - default: - ASSERT(0); - } - return rval; + block = XFS_BUF_TO_BLOCK(cur->bc_bufs[lev]); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return xfs_btree_readahead_lblock(cur, lr, block); + return xfs_btree_readahead_sblock(cur, lr, block); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 02:11:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 03:00:21.000000000 +0200 @@ -429,23 +429,10 @@ xfs_btree_reada_bufs( * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int /* readahead block count */ -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ - int lev, /* level in btree */ - int lr); /* left/right bits */ - -static inline int /* readahead block count */ xfs_btree_readahead( xfs_btree_cur_t *cur, /* btree cursor */ int lev, /* level in btree */ - int lr) /* left/right bits */ -{ - if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) - return 0; - - return xfs_btree_readahead_core(cur, lev, lr); -} - + int lr); /* left/right bits */ /* * Set the buffer for level "lev" in the cursor to bp, releasing Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 02:11:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 03:00:18.000000000 +0200 @@ -1721,8 +1721,9 @@ xfs_bmbt_decrement( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + if (--cur->bc_ptrs[level] > 0) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); *stat = 1; @@ -1743,8 +1744,7 @@ xfs_bmbt_decrement( for (lev = level + 1; lev < cur->bc_nlevels; lev++) { if (--cur->bc_ptrs[lev] > 0) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); @@ -1995,8 +1995,8 @@ xfs_bmbt_increment( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); block = xfs_bmbt_get_block(cur, level, &bp); #ifdef DEBUG if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { @@ -2024,8 +2024,7 @@ xfs_bmbt_increment( #endif if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); -- From owner-xfs@oss.sgi.com Sun Aug 3 18:31:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:19 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no 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 m741VCrJ030341 for ; Sun, 3 Aug 2008 18:31:12 -0700 X-ASG-Debug-ID: 1217813543-739601ce0000-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 4409D3566AC for ; Sun, 3 Aug 2008 18:32:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 9Y6DgqHx3WB2TX45 for ; Sun, 03 Aug 2008 18:32:24 -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 m741WPIF008896 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:32:25 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741WPaN008894 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:32:25 +0200 Date: Mon, 4 Aug 2008 03:32:25 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 02/26] split up xfs_btree_init_cursor Subject: [PATCH 02/26] split up xfs_btree_init_cursor Message-ID: <20080804013225.GC8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-split-init-cursor 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: 1217813546 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.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17327 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 xfs_btree_init_cursor contains close to little shared code for the different btrees and will get even more non-common code in the future. Split it up into one routine per btree type. Because xfs_btree_dup_cursor needs to call the init routine for a generic btree cursor add a new btree operation vector that contains a dup_cursor method that initializes a new cursor based on an existing one. The btree operations vector is based on an idea and code from Dave Chinner and will be used for more operations later on. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:01:06.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:01:46.000000000 +0200 @@ -131,6 +131,11 @@ extern const __uint32_t xfs_magics[]; #define XFS_BTREE_MAXLEVELS 8 /* max of all btrees */ +struct xfs_btree_ops { + /* cursor operations */ + struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); +}; + /* * Btree cursor structure. * This collects all information needed by the btree code in one place. @@ -139,6 +144,7 @@ typedef struct xfs_btree_cur { struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ + const struct xfs_btree_ops *bc_ops; union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -308,20 +314,6 @@ xfs_btree_get_bufs( uint lock); /* lock flags for get_buf */ /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - struct xfs_mount *mp, /* file system mount point */ - struct xfs_trans *tp, /* transaction pointer */ - struct xfs_buf *agbp, /* (A only) buffer for agf structure */ - xfs_agnumber_t agno, /* (A only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - struct xfs_inode *ip, /* (B only) inode owning the btree */ - int whichfork); /* (B only) data/attr fork */ - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 04:01:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 04:01:46.000000000 +0200 @@ -387,16 +387,17 @@ xfs_btree_dup_cursor( tp = cur->bc_tp; mp = cur->bc_mp; + /* * Allocate a new cursor like the old one. */ - new = xfs_btree_init_cursor(mp, tp, cur->bc_private.a.agbp, - cur->bc_private.a.agno, cur->bc_btnum, cur->bc_private.b.ip, - cur->bc_private.b.whichfork); + new = cur->bc_ops->dup_cursor(cur); + /* * Copy the record currently in the cursor. */ new->bc_rec = cur->bc_rec; + /* * For each level current, re-get the buffer and copy the ptr value. */ @@ -416,15 +417,6 @@ xfs_btree_dup_cursor( } else new->bc_bufs[i] = NULL; } - /* - * For bmap btrees, copy the firstblock, flist, and flags values, - * since init cursor doesn't get them. - */ - if (new->bc_btnum == XFS_BTNUM_BMAP) { - new->bc_private.b.firstblock = cur->bc_private.b.firstblock; - new->bc_private.b.flist = cur->bc_private.b.flist; - new->bc_private.b.flags = cur->bc_private.b.flags; - } *ncur = new; return 0; } @@ -505,97 +497,6 @@ xfs_btree_get_bufs( } /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B) or inodes (I). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - xfs_mount_t *mp, /* file system mount point */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *agbp, /* (A only) buffer for agf structure */ - /* (I only) buffer for agi structure */ - xfs_agnumber_t agno, /* (AI only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - xfs_inode_t *ip, /* (B only) inode owning the btree */ - int whichfork) /* (B only) data or attr fork */ -{ - xfs_agf_t *agf; /* (A) allocation group freespace */ - xfs_agi_t *agi; /* (I) allocation group inodespace */ - xfs_btree_cur_t *cur; /* return value */ - xfs_ifork_t *ifp; /* (I) inode fork pointer */ - int nlevels=0; /* number of levels in the btree */ - - ASSERT(xfs_btree_cur_zone != NULL); - /* - * Allocate a new cursor. - */ - cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); - /* - * Deduce the number of btree levels from the arguments. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - agf = XFS_BUF_TO_AGF(agbp); - nlevels = be32_to_cpu(agf->agf_levels[btnum]); - break; - case XFS_BTNUM_BMAP: - ifp = XFS_IFORK_PTR(ip, whichfork); - nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; - break; - case XFS_BTNUM_INO: - agi = XFS_BUF_TO_AGI(agbp); - nlevels = be32_to_cpu(agi->agi_level); - break; - default: - ASSERT(0); - } - /* - * Fill in the common fields. - */ - cur->bc_tp = tp; - cur->bc_mp = mp; - cur->bc_nlevels = nlevels; - cur->bc_btnum = btnum; - cur->bc_blocklog = mp->m_sb.sb_blocklog; - /* - * Fill in private fields. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - /* - * Allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_INO: - /* - * Inode allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_BMAP: - /* - * Bmap btree fields. - */ - cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); - cur->bc_private.b.ip = ip; - cur->bc_private.b.firstblock = NULLFSBLOCK; - cur->bc_private.b.flist = NULL; - cur->bc_private.b.allocated = 0; - cur->bc_private.b.flags = 0; - cur->bc_private.b.whichfork = whichfork; - break; - default: - ASSERT(0); - } - return cur; -} - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:01:46.000000000 +0200 @@ -2608,3 +2608,62 @@ xfs_check_nostate_extents( } return 0; } + + +STATIC struct xfs_btree_cur * +xfs_bmbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_btree_cur *new; + + new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.b.ip, cur->bc_private.b.whichfork); + + /* + * Copy the firstblock, flist, and flags values, + * since init cursor doesn't get them. + */ + new->bc_private.b.firstblock = cur->bc_private.b.firstblock; + new->bc_private.b.flist = cur->bc_private.b.flist; + new->bc_private.b.flags = cur->bc_private.b.flags; + + return new; +} + +static const struct xfs_btree_ops xfs_bmbt_ops = { + .dup_cursor = xfs_bmbt_dup_cursor, +}; + +/* + * Allocate a new bmap btree cursor. + */ +struct xfs_btree_cur * /* new bmap btree cursor */ +xfs_bmbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_inode *ip, /* inode owning the btree */ + int whichfork) /* data or attr fork */ +{ + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; + cur->bc_btnum = XFS_BTNUM_BMAP; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_bmbt_ops; + + cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); + cur->bc_private.b.ip = ip; + cur->bc_private.b.firstblock = NULLFSBLOCK; + cur->bc_private.b.flist = NULL; + cur->bc_private.b.allocated = 0; + cur->bc_private.b.flags = 0; + cur->bc_private.b.whichfork = whichfork; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 04:01:46.000000000 +0200 @@ -2076,3 +2076,44 @@ xfs_inobt_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_inobt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno); +} + +static const struct xfs_btree_ops xfs_inobt_ops = { + .dup_cursor = xfs_inobt_dup_cursor, +}; + +/* + * Allocate a new inode btree cursor. + */ +struct xfs_btree_cur * /* new inode btree cursor */ +xfs_inobt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agi structure */ + xfs_agnumber_t agno) /* allocation group number */ +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agi->agi_level); + cur->bc_btnum = XFS_BTNUM_INO; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_inobt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-02 04:00:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-02 04:01:46.000000000 +0200 @@ -640,8 +640,8 @@ xfs_alloc_ag_vextent_exact( /* * Allocate/initialize a cursor for the by-number freespace btree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup bno and minlen in the btree (minlen is irrelevant, really). * Look for the closest free block <= bno, it must contain bno @@ -696,8 +696,8 @@ xfs_alloc_ag_vextent_exact( * We are allocating agbno for rlen [agbno .. end] * Allocate/initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ASSERT(args->agbno + args->len <= be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length)); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, @@ -759,8 +759,8 @@ xfs_alloc_ag_vextent_near( /* * Get a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ltlen = 0; bno_cur_lt = bno_cur_gt = NULL; /* @@ -886,8 +886,8 @@ xfs_alloc_ag_vextent_near( /* * Set up a cursor for the by-bno tree. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, - args->agbp, args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, + args->agbp, args->agno, XFS_BTNUM_BNO); /* * Fix up the btree entries. */ @@ -914,8 +914,8 @@ xfs_alloc_ag_vextent_near( /* * Allocate and initialize the cursor for the leftward search. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup <= bno to find the leftward search's starting point. */ @@ -1267,8 +1267,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); bno_cur = NULL; /* * Look for an entry >= maxlen+alignment-1 blocks. @@ -1372,8 +1372,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-block tree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, rbno, rlen, XFSA_FIXUP_CNT_OK))) goto error0; @@ -1515,8 +1515,7 @@ xfs_free_ag_extent( /* * Allocate and initialize a cursor for the by-block btree. */ - bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, NULL, - 0); + bno_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO); cnt_cur = NULL; /* * Look for a neighboring block on the left (lower block numbers) @@ -1575,8 +1574,7 @@ xfs_free_ag_extent( /* * Now allocate and initialize a cursor for the by-size tree. */ - cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, NULL, - 0); + cnt_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT); /* * Have both left and right contiguous neighbors. * Merge all three into a single free block. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 04:01:46.000000000 +0200 @@ -2209,3 +2209,48 @@ xfs_alloc_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + +static const struct xfs_btree_ops xfs_allocbt_ops = { + .dup_cursor = xfs_allocbt_dup_cursor, +}; + +/* + * Allocate a new allocation btree cursor. + */ +struct xfs_btree_cur * /* new alloc btree cursor */ +xfs_allocbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agf structure */ + xfs_agnumber_t agno, /* allocation group number */ + xfs_btnum_t btnum) /* btree identifier */ +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + struct xfs_btree_cur *cur; + + ASSERT(btnum == XFS_BTNUM_BNO || btnum == XFS_BTNUM_CNT); + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agf->agf_levels[btnum]); + cur->bc_btnum = btnum; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_allocbt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-02 04:01:46.000000000 +0200 @@ -152,4 +152,9 @@ extern int xfs_alloc_lookup_le(struct xf extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len); + +extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, + xfs_agnumber_t, xfs_btnum_t); + #endif /* __XFS_ALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-02 04:01:46.000000000 +0200 @@ -422,8 +422,7 @@ xfs_bmap_add_attrfork_btree( if (ip->i_df.if_broot_bytes <= XFS_IFORK_DSIZE(ip)) *flags |= XFS_ILOG_DBROOT; else { - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - XFS_DATA_FORK); + cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); cur->bc_private.b.flist = flist; cur->bc_private.b.firstblock = *firstblock; if ((error = xfs_bmbt_lookup_ge(cur, 0, 0, 0, &stat))) @@ -3441,8 +3440,7 @@ xfs_bmap_extents_to_btree( * Need a cursor. Can't allocate until bb_level is filled in. */ mp = ip->i_mount; - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0; @@ -5029,8 +5027,7 @@ xfs_bmapi( if (abno == NULLFSBLOCK) break; if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; @@ -5147,9 +5144,8 @@ xfs_bmapi( */ ASSERT(mval->br_blockcount <= len); if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, - ip, whichfork); + cur = xfs_bmbt_init_cursor(mp, + tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; @@ -5440,8 +5436,7 @@ xfs_bunmapi( logflags = 0; if (ifp->if_flags & XFS_IFBROOT) { ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = 0; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-02 04:01:46.000000000 +0200 @@ -24,6 +24,7 @@ struct xfs_btree_cur; struct xfs_btree_lblock; struct xfs_mount; struct xfs_inode; +struct xfs_trans; /* * Bmap root header, on-disk form only. @@ -300,6 +301,9 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_bl extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); +extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_inode *, int); + #endif /* __KERNEL__ */ #endif /* __XFS_BMAP_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-02 04:00:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-02 04:01:46.000000000 +0200 @@ -335,8 +335,7 @@ xfs_ialloc_ag_alloc( /* * Insert records describing the new inode chunk into the btree. */ - cur = xfs_btree_init_cursor(args.mp, tp, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(args.mp, tp, agbp, agno); for (thisino = newino; thisino < newino + newlen; thisino += XFS_INODES_PER_CHUNK) { @@ -676,8 +675,7 @@ nextag: */ agno = tagno; *IO_agbp = NULL; - cur = xfs_btree_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno), - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno)); /* * If pagino is 0 (this is the root inode allocation) use newino. * This must work because we've just allocated some. @@ -1022,8 +1020,7 @@ xfs_difree( /* * Initialize the cursor. */ - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); #ifdef DEBUG if (cur->bc_nlevels == 1) { int freecount = 0; @@ -1259,8 +1256,7 @@ xfs_dilocate( #endif /* DEBUG */ return error; } - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) { #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-02 04:01:46.000000000 +0200 @@ -175,4 +175,8 @@ extern int xfs_inobt_lookup_le(struct xf extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, __int32_t fcnt, xfs_inofree_t free); + +extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); + #endif /* __XFS_IALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-08-02 03:59:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-08-02 04:01:46.000000000 +0200 @@ -416,8 +416,7 @@ xfs_bulkstat( /* * Allocate and initialize a btree cursor for ialloc btree. */ - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); irbp = irbuf; irbufend = irbuf + nirbuf; end_of_ag = 0; @@ -842,8 +841,7 @@ xfs_inumbers( agino = 0; continue; } - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); -- From owner-xfs@oss.sgi.com Sun Aug 3 18:33:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:33:29 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741XLFO032251 for ; Sun, 3 Aug 2008 18:33:21 -0700 X-ASG-Debug-ID: 1217813674-16b402e00000-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 9359D1976448 for ; Sun, 3 Aug 2008 18:34:34 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jmuM2grRkgb4HdxB for ; Sun, 03 Aug 2008 18:34:34 -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 m741YaIF009168 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:34:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741YafG009166 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:34:36 +0200 Date: Mon, 4 Aug 2008 03:34:36 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 15/26] add get_maxrecs btree operation Subject: [PATCH 15/26] add get_maxrecs btree operation Message-ID: <20080804013436.GP8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-get_maxrecs-method 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: 1217813675 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.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17339 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 Factor xfs_btree_maxrecs into a per-btree operation. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 04:08:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 04:08:43.000000000 +0200 @@ -52,31 +52,6 @@ const __uint32_t xfs_magics[XFS_BTNUM_MA }; /* - * Checking routine: return maxrecs for the block. - */ -STATIC int /* number of records fitting in block */ -xfs_btree_maxrecs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block) /* generic btree block pointer */ -{ - switch (cur->bc_btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - return (int)XFS_ALLOC_BLOCK_MAXRECS( - be16_to_cpu(block->bb_level), cur); - case XFS_BTNUM_BMAP: - return (int)XFS_BMAP_BLOCK_IMAXRECS( - be16_to_cpu(block->bb_level), cur); - case XFS_BTNUM_INO: - return (int)XFS_INOBT_BLOCK_MAXRECS( - be16_to_cpu(block->bb_level), cur); - default: - ASSERT(0); - return 0; - } -} - -/* * External routines. */ @@ -208,7 +183,7 @@ xfs_btree_check_lblock( be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && be16_to_cpu(block->bb_level) == level && be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + cur->bc_ops->get_maxrecs(cur, level) && block->bb_leftsib && (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && @@ -245,7 +220,7 @@ xfs_btree_check_sblock( be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && be16_to_cpu(block->bb_level) == level && be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + cur->bc_ops->get_maxrecs(cur, level) && (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK || be32_to_cpu(block->bb_leftsib) < agflen) && block->bb_leftsib && Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:08:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:08:43.000000000 +0200 @@ -200,6 +200,9 @@ struct xfs_btree_ops { union xfs_btree_rec *(*rec_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); + /* records in block/level */ + int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); + /* init values of btree structures */ void (*init_key_from_rec)(struct xfs_btree_cur *cur, union xfs_btree_key *key, Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 04:08:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 04:08:43.000000000 +0200 @@ -1655,6 +1655,14 @@ xfs_allocbt_update_lastrec( xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } +STATIC int +xfs_allocbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mxr[level != 0]; +} + STATIC void xfs_allocbt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -1895,6 +1903,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, .update_lastrec = xfs_allocbt_update_lastrec, + .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:08:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:08:43.000000000 +0200 @@ -1955,6 +1955,14 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC int +xfs_bmbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return XFS_BMAP_BLOCK_IMAXRECS(level, cur); +} + STATIC void xfs_bmbt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -2179,6 +2187,7 @@ static const struct xfs_btree_ops xfs_bm .get_root_from_inode = xfs_bmbt_get_root_from_inode, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, + .get_maxrecs = xfs_bmbt_get_maxrecs, .ptr_addr = xfs_bmbt_ptr_addr, .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 04:08:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 04:08:43.000000000 +0200 @@ -1516,6 +1516,14 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC int +xfs_inobt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_inobt_mxr[level != 0]; +} + STATIC void xfs_inobt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -1720,6 +1728,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, .ptr_addr = xfs_inobt_ptr_addr, -- From owner-xfs@oss.sgi.com Sun Aug 3 18:31:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:21 -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 m741VIVA030368 for ; Sun, 3 Aug 2008 18:31:18 -0700 X-ASG-Debug-ID: 1217813551-2db303130000-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 2E79DEF6A14 for ; Sun, 3 Aug 2008 18:32:32 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id GZqlZoXGFmphuYia for ; Sun, 03 Aug 2008 18:32:32 -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 m741WXIF008910 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:32:33 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741WXmg008908 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:32:33 +0200 Date: Mon, 4 Aug 2008 03:32:33 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 03/26] add generic btree types Subject: [PATCH 03/26] add generic btree types Message-ID: <20080804013233.GD8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-add-generic-types 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: 1217813553 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17328 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 Add generic union types for btree pointers, keys and records. The generic btree pointer contains a 32 and 64bit big endian type for short and long form btrees, and the key and record contain the relevant type for each possible btree. Split out from a bigger patch from Dave Chinner and simplified a little further. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:01:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:04:16.000000000 +0200 @@ -79,6 +79,31 @@ typedef struct xfs_btree_block { } bb_u; /* rest */ } xfs_btree_block_t; + /* + * Generic key, ptr and record wrapper structures. + * + * These are disk format structures, and are converted where necessary + * by the btree specific code that needs to interpret them. + */ +union xfs_btree_ptr { + __be32 s; /* short form ptr */ + __be64 l; /* long form ptr */ +}; + +union xfs_btree_key { + xfs_bmbt_key_t bmbt; + xfs_bmdr_key_t bmbr; /* bmbt root block */ + xfs_alloc_key_t alloc; + xfs_inobt_key_t inobt; +}; + +union xfs_btree_rec { + xfs_bmbt_rec_t bmbt; + xfs_bmdr_rec_t bmbr; /* bmbt root block */ + xfs_alloc_rec_t alloc; + xfs_inobt_rec_t inobt; +}; + /* * For logging record fields. */ -- From owner-xfs@oss.sgi.com Sun Aug 3 18:33:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18: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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31, J_CHICKENPOX_73 autolearn=no 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 m741Xl19000378 for ; Sun, 3 Aug 2008 18:33:48 -0700 X-ASG-Debug-ID: 1217813698-40dc01b20000-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 F3A97EF6ACC for ; Sun, 3 Aug 2008 18:34:59 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id dDFfYXUiP5eZLEtC for ; Sun, 03 Aug 2008 18:34:59 -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 m741Z0IF009207 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:35:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741Z0uR009205 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:35:00 +0200 Date: Mon, 4 Aug 2008 03:35:00 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 17/26] implement generic xfs_btree_lshift Subject: [PATCH 17/26] implement generic xfs_btree_lshift Message-ID: <20080804013500.GR8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-lshift 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: 1217813700 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: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17342 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 Make the btree left shift code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-03 13:32:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-03 13:33:04.000000000 +0200 @@ -985,6 +985,21 @@ xfs_btree_move_ptrs( } } +STATIC void +xfs_btree_copy_ptrs( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *src_ptr, + union xfs_btree_ptr *dst_ptr, + int numptrs) +{ + ASSERT(numptrs > 0); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be64)); + else + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be32)); +} + /* * Log block pointer fields from a btree block (nonleaf). */ @@ -1612,6 +1627,186 @@ error0: } /* + * Move 1 record left from cur/level if possible. + * Update cur to reflect the new path. + */ +int /* error */ +xfs_btree_lshift( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + union xfs_btree_key key; /* btree key */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + int lrecs; /* left record count */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + int rrecs; /* right record count */ + union xfs_btree_ptr lptr; /* left btree pointer */ + union xfs_btree_key *rkp = NULL; /* right btree key */ + union xfs_btree_ptr *rpp = NULL; /* right address pointer */ + union xfs_btree_rec *rrp = NULL; /* right record pointer */ + int error; /* error return value */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + level == cur->bc_nlevels - 1) + goto out0; + + /* Set up variables for this block as "right". */ + right = xfs_btree_get_block(cur, level, &rbp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, right, level, rbp); + if (error) + goto error0; +#endif + + /* If we've got no left sibling then we can't shift an entry left. */ + xfs_btree_get_sibling(cur, right, &lptr, XFS_BB_LEFTSIB); + if (xfs_btree_ptr_is_null(cur, &lptr)) + goto out0; + + /* + * If the cursor entry is the one that would be moved, don't + * do it... it's too complicated. + */ + if (cur->bc_ptrs[level] <= 1) + goto out0; + + /* Set up the left neighbor as "left". */ + error = xfs_btree_read_buf_block(cur, &lptr, level, 0, &left, &lbp); + if (error) + goto error0; + + /* If it's full, it can't take another entry. */ + lrecs = xfs_btree_get_numrecs(left); + if (lrecs == cur->bc_ops->get_maxrecs(cur, level)) + goto out0; + + rrecs = xfs_btree_get_numrecs(right); + + /* + * We add one entry to the left side and remove one for the right side. + * Accout for it here, the changes will be updated on disk and logged + * later. + */ + lrecs++; + rrecs--; + + XFS_BTREE_STATS_INC(cur, lshift); + XFS_BTREE_STATS_ADD(cur, moves, 1); + + /* + * If non-leaf, copy a key and a ptr to the left block. + * Log the changes to the left block. + */ + if (level > 0) { + /* It's a non-leaf. Move keys and pointers. */ + union xfs_btree_key *lkp; /* left btree key */ + union xfs_btree_ptr *lpp; /* left address pointer */ + + lkp = cur->bc_ops->key_addr(cur, lrecs, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + + lpp = cur->bc_ops->ptr_addr(cur, lrecs, left); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, rpp, 0, level); + if (error) + goto error0; +#endif + cur->bc_ops->copy_keys(cur, rkp, lkp, 1); + xfs_btree_copy_ptrs(cur, rpp, lpp, 1); + + cur->bc_ops->log_keys(cur, lbp, lrecs, lrecs); + xfs_btree_log_ptrs(cur, lbp, lrecs, lrecs); + + xfs_btree_check_key(cur->bc_btnum, + cur->bc_ops->key_addr(cur, lrecs - 1, left), + lkp); + } else { + /* It's a leaf. Move records. */ + union xfs_btree_rec *lrp; /* left record pointer */ + + lrp = cur->bc_ops->rec_addr(cur, lrecs, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->copy_recs(cur, rrp, lrp, 1); + cur->bc_ops->log_recs(cur, lbp, lrecs, lrecs); + + xfs_btree_check_rec(cur->bc_btnum, + cur->bc_ops->rec_addr(cur, lrecs - 1, left), + lrp); + } + + xfs_btree_set_numrecs(left, lrecs); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS); + + xfs_btree_set_numrecs(right, rrecs); + xfs_btree_log_block(cur, rbp, XFS_BB_NUMRECS); + + /* + * Slide the contents of right down one entry. + */ + XFS_BTREE_STATS_ADD(cur, moves, rrecs - 1); + if (level > 0) { + /* It's a nonleaf. operate on keys and ptrs */ +#ifdef DEBUG + int i; /* loop index */ + + for (i = 0; i < rrecs; i++) { + error = xfs_btree_check_ptr(cur, rpp, i + 1, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->move_keys(cur, rkp, 1, 0, rrecs); + xfs_btree_move_ptrs(cur, rpp, 1, 0, rrecs); + cur->bc_ops->log_keys(cur, rbp, 1, rrecs); + xfs_btree_log_ptrs(cur, rbp, 1, rrecs); + } else { + /* It's a leaf. operate on records */ + + rrp = cur->bc_ops->rec_addr(cur, 1, right); + cur->bc_ops->move_recs(cur, rrp, 1, 0, rrecs); + cur->bc_ops->log_recs(cur, rbp, 1, rrecs); + + /* + * If it's the first record in the block, we'll need a key + * structure to pass up to the next level (updkey). + */ + cur->bc_ops->init_key_from_rec(cur, &key, rrp); + rkp = &key; + } + + /* Update the parent key values of right. */ + error = xfs_btree_updkey(cur, rkp, level + 1); + if (error) + goto error0; + + /* Slide the cursor value left one. */ + cur->bc_ptrs[level]--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + +/* * Move 1 record right from cur/level if possible. * Update cur to reflect the new path. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-03 13:30:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-03 13:33:04.000000000 +0200 @@ -52,7 +52,6 @@ STATIC void xfs_alloc_log_ptrs(xfs_btree STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); #define xfs_alloc_log_recs(c, b, i, j) \ xfs_allocbt_log_recs(c, b, i, j) -STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); @@ -331,7 +330,7 @@ xfs_alloc_delrec( */ if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_alloc_lshift(tcur, level, &i))) + if ((error = xfs_btree_lshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -696,7 +695,7 @@ xfs_alloc_insrec( * Next, try shifting an entry to the left neighbor. */ else { - if ((error = xfs_alloc_lshift(cur, level, &i))) + if ((error = xfs_btree_lshift(cur, level, &i))) return error; if (i) optr = ptr = cur->bc_ptrs[level]; @@ -884,147 +883,6 @@ xfs_alloc_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_alloc_lshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop index */ -#endif - xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left neighbor block */ - xfs_alloc_block_t *left; /* left neighbor btree block */ - int nrec; /* new number of left block entries */ - xfs_buf_t *rbp; /* buffer for right (current) block */ - xfs_alloc_block_t *right; /* right (current) btree block */ - xfs_alloc_key_t *rkp=NULL; /* key pointer for right block */ - xfs_alloc_ptr_t *rpp=NULL; /* address pointer for right block */ - xfs_alloc_rec_t *rrp=NULL; /* record pointer for right block */ - - /* - * Set up variables for this block as "right". - */ - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; -#endif - /* - * If we've got no left sibling then we can't shift an entry left. - */ - if (be32_to_cpu(right->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] <= 1) { - *stat = 0; - return 0; - } - /* - * Set up the left neighbor as "left". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(right->bb_leftsib), - 0, &lbp, XFS_ALLOC_BTREE_REF))) - return error; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(left->bb_numrecs) == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - nrec = be16_to_cpu(left->bb_numrecs) + 1; - /* - * If non-leaf, copy a key and a ptr to the left block. - */ - if (level > 0) { - xfs_alloc_key_t *lkp; /* key pointer for left block */ - xfs_alloc_ptr_t *lpp; /* address pointer for left block */ - - lkp = XFS_ALLOC_KEY_ADDR(left, nrec, cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - *lkp = *rkp; - xfs_alloc_log_keys(cur, lbp, nrec, nrec); - lpp = XFS_ALLOC_PTR_ADDR(left, nrec, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*rpp), level))) - return error; -#endif - *lpp = *rpp; - xfs_alloc_log_ptrs(cur, lbp, nrec, nrec); - xfs_btree_check_key(cur->bc_btnum, lkp - 1, lkp); - } - /* - * If leaf, copy a record to the left block. - */ - else { - xfs_alloc_rec_t *lrp; /* record pointer for left block */ - - lrp = XFS_ALLOC_REC_ADDR(left, nrec, cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - *lrp = *rrp; - xfs_alloc_log_recs(cur, lbp, nrec, nrec); - xfs_btree_check_rec(cur->bc_btnum, lrp - 1, lrp); - } - /* - * Bump and log left's numrecs, decrement and log right's numrecs. - */ - be16_add(&left->bb_numrecs, 1); - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, -1); - xfs_alloc_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Slide the contents of right down one entry. - */ - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i + 1]), - level))) - return error; - } -#endif - memmove(rkp, rkp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp, rpp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_alloc_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_alloc_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - } else { - memmove(rrp, rrp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_alloc_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - key.ar_startblock = rrp->ar_startblock; - key.ar_blockcount = rrp->ar_blockcount; - rkp = &key; - } - /* - * Update the parent key values of right. - */ - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) - return error; - /* - * Slide the cursor value left one. - */ - cur->bc_ptrs[level]--; - *stat = 1; - return 0; -} - -/* * Allocate a new root block, fill it in. */ STATIC int /* error */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-03 13:30:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-03 13:33:04.000000000 +0200 @@ -52,7 +52,6 @@ STATIC int xfs_bmbt_killroot(xfs_btree_cur_t *); STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_bmbt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); @@ -270,7 +269,7 @@ xfs_bmbt_delrec( bno = be64_to_cpu(right->bb_leftsib); if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_bmbt_lshift(tcur, level, &i))) { + if ((error = xfs_btree_lshift(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -544,7 +543,7 @@ xfs_bmbt_insrec( if (i) { /* nothing */ } else { - if ((error = xfs_bmbt_lshift(cur, level, &i))) { + if ((error = xfs_btree_lshift(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -775,139 +774,6 @@ xfs_bmbt_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_bmbt_lshift( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop counter */ -#endif - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp=NULL; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - int lrecs; /* left record count */ - xfs_bmbt_rec_t *lrp=NULL; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp=NULL; /* right btree key */ - xfs_bmbt_ptr_t *rpp=NULL; /* right address pointer */ - xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */ - int rrecs; /* right record count */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - if (level == cur->bc_nlevels - 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_BMBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(right->bb_leftsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (cur->bc_ptrs[level] <= 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - mp = cur->bc_mp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, be64_to_cpu(right->bb_leftsib), 0, - &lbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - left = XFS_BUF_TO_BMBT_BLOCK(lbp); - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (be16_to_cpu(left->bb_numrecs) == XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - lrecs = be16_to_cpu(left->bb_numrecs) + 1; - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, lrecs, cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - *lkp = *rkp; - xfs_bmbt_log_keys(cur, lbp, lrecs, lrecs); - lpp = XFS_BMAP_PTR_IADDR(left, lrecs, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *rpp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *lpp = *rpp; - xfs_bmbt_log_ptrs(cur, lbp, lrecs, lrecs); - } else { - lrp = XFS_BMAP_REC_IADDR(left, lrecs, cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - *lrp = *rrp; - xfs_bmbt_log_recs(cur, lbp, lrecs, lrecs); - } - left->bb_numrecs = cpu_to_be16(lrecs); - xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(XFS_BTNUM_BMAP, lkp - 1, lkp); - else - xfs_btree_check_rec(XFS_BTNUM_BMAP, lrp - 1, lrp); -#endif - rrecs = be16_to_cpu(right->bb_numrecs) - 1; - right->bb_numrecs = cpu_to_be16(rrecs); - xfs_bmbt_log_block(cur, rbp, XFS_BB_NUMRECS); - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i + 1], - level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memmove(rkp, rkp + 1, rrecs * sizeof(*rkp)); - memmove(rpp, rpp + 1, rrecs * sizeof(*rpp)); - xfs_bmbt_log_keys(cur, rbp, 1, rrecs); - xfs_bmbt_log_ptrs(cur, rbp, 1, rrecs); - } else { - memmove(rrp, rrp + 1, rrecs * sizeof(*rrp)); - xfs_bmbt_log_recs(cur, rbp, 1, rrecs); - key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); - rkp = &key; - } - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[level]--; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Determine the extent state. */ /* ARGSUSED */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-03 13:30:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-03 13:33:04.000000000 +0200 @@ -571,6 +571,7 @@ int xfs_btree_decrement(struct xfs_btree int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); +int xfs_btree_lshift(struct xfs_btree_cur *, int, int *); int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-03 13:30:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-03 13:33:04.000000000 +0200 @@ -44,7 +44,6 @@ STATIC void xfs_inobt_log_block(xfs_tran STATIC void xfs_inobt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_inobt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); @@ -277,7 +276,7 @@ xfs_inobt_delrec( */ if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_inobt_lshift(tcur, level, &i))) + if ((error = xfs_btree_lshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -617,7 +616,7 @@ xfs_inobt_insrec( * Next, try shifting an entry to the left neighbor. */ else { - if ((error = xfs_inobt_lshift(cur, level, &i))) + if ((error = xfs_btree_lshift(cur, level, &i))) return error; if (i) { optr = ptr = cur->bc_ptrs[level]; @@ -784,148 +783,6 @@ xfs_inobt_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_inobt_lshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop index */ -#endif - xfs_inobt_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left neighbor block */ - xfs_inobt_block_t *left; /* left neighbor btree block */ - xfs_inobt_key_t *lkp=NULL; /* key pointer for left block */ - xfs_inobt_ptr_t *lpp; /* address pointer for left block */ - xfs_inobt_rec_t *lrp=NULL; /* record pointer for left block */ - int nrec; /* new number of left block entries */ - xfs_buf_t *rbp; /* buffer for right (current) block */ - xfs_inobt_block_t *right; /* right (current) btree block */ - xfs_inobt_key_t *rkp=NULL; /* key pointer for right block */ - xfs_inobt_ptr_t *rpp=NULL; /* address pointer for right block */ - xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */ - - /* - * Set up variables for this block as "right". - */ - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; -#endif - /* - * If we've got no left sibling then we can't shift an entry left. - */ - if (be32_to_cpu(right->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] <= 1) { - *stat = 0; - return 0; - } - /* - * Set up the left neighbor as "left". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(right->bb_leftsib), - 0, &lbp, XFS_INO_BTREE_REF))) - return error; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(left->bb_numrecs) == XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - nrec = be16_to_cpu(left->bb_numrecs) + 1; - /* - * If non-leaf, copy a key and a ptr to the left block. - */ - if (level > 0) { - lkp = XFS_INOBT_KEY_ADDR(left, nrec, cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - *lkp = *rkp; - xfs_inobt_log_keys(cur, lbp, nrec, nrec); - lpp = XFS_INOBT_PTR_ADDR(left, nrec, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*rpp), level))) - return error; -#endif - *lpp = *rpp; - xfs_inobt_log_ptrs(cur, lbp, nrec, nrec); - } - /* - * If leaf, copy a record to the left block. - */ - else { - lrp = XFS_INOBT_REC_ADDR(left, nrec, cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - *lrp = *rrp; - xfs_inobt_log_recs(cur, lbp, nrec, nrec); - } - /* - * Bump and log left's numrecs, decrement and log right's numrecs. - */ - be16_add(&left->bb_numrecs, 1); - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(cur->bc_btnum, lkp - 1, lkp); - else - xfs_btree_check_rec(cur->bc_btnum, lrp - 1, lrp); -#endif - be16_add(&right->bb_numrecs, -1); - xfs_inobt_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Slide the contents of right down one entry. - */ - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i + 1]), - level))) - return error; - } -#endif - memmove(rkp, rkp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp, rpp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_inobt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_inobt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - } else { - memmove(rrp, rrp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_inobt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - key.ir_startino = rrp->ir_startino; - rkp = &key; - } - /* - * Update the parent key values of right. - */ - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) - return error; - /* - * Slide the cursor value left one. - */ - cur->bc_ptrs[level]--; - *stat = 1; - return 0; -} - -/* * Allocate a new root block, fill it in. */ STATIC int /* error */ -- From owner-xfs@oss.sgi.com Sun Aug 3 18:33:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:33:33 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 autolearn=no 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 m741XINk032166 for ; Sun, 3 Aug 2008 18:33:18 -0700 X-ASG-Debug-ID: 1217813668-40cb01cf0000-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 779A8EF6A7C for ; Sun, 3 Aug 2008 18:34:29 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 1vt4xt0KGdXlO6nk for ; Sun, 03 Aug 2008 18:34:29 -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 m741YUIF009151 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:34:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741YUYl009149 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:34:30 +0200 Date: Mon, 4 Aug 2008 03:34:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 14/26] implement generic xfs_btree_update Subject: [PATCH 14/26] implement generic xfs_btree_update Message-ID: <20080804013430.GO8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline; filename=xfs-common-btree-update Content-Transfer-Encoding: 8bit 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: 1217813671 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: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17340 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 From: Dave Chinner The most complicated part here is the lastrec tracking for the alloc btree. Most logic is in the update_lastrec method which has to do some hopefully good enough dirty magic to maintain it. [hch: split out from bigger patch and a rework of the lastrec logic] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 02:55:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 02:57:08.000000000 +0200 @@ -868,6 +868,30 @@ xfs_btree_get_sibling( } } +/* + * Return true if ptr is the last record in the btree and + * we need to track updateÑ• to this record. The decision + * will be further refined in the update_lastrec method. + */ +STATIC int +xfs_btree_is_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + int level) +{ + union xfs_btree_ptr ptr; + + if (level > 0) + return 0; + if (!(cur->bc_flags & XFS_BTREE_LASTREC_UPDATE)) + return 0; + + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &ptr)) + return 0; + return 1; +} + STATIC xfs_daddr_t xfs_btree_ptr_to_daddr( struct xfs_btree_cur *cur, @@ -1419,3 +1443,66 @@ xfs_btree_updkey( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); return 0; } + +/* + * Update the record referred to by cur to the value in the + * given record. This either works (return 0) or gets an + * EFSCORRUPTED error. + */ +int +xfs_btree_update( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + int error; + int ptr; + union xfs_btree_rec *rp; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGR(cur, rec); + + /* Pick up the current block. */ + block = xfs_btree_get_block(cur, 0, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, 0, bp); + if (error) + goto error0; +#endif + /* Get the address of the rec to be updated. */ + ptr = cur->bc_ptrs[0]; + rp = cur->bc_ops->rec_addr(cur, ptr, block); + + /* Fill in the new contents and log them. */ + cur->bc_ops->copy_recs(cur, rec, rp, 1); + cur->bc_ops->log_recs(cur, bp, ptr, ptr); + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, 0)) { + cur->bc_ops->update_lastrec(cur, block, rec, + ptr, LASTREC_UPDATE); + } + + /* Updating first rec in leaf. Pass new key value up to our parent. */ + if (ptr == 1) { + union xfs_btree_key key; + + cur->bc_ops->init_key_from_rec(cur, &key, rec); + error = xfs_btree_updkey(cur, &key, 1); + if (error) + goto error0; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 02:55:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 02:58:05.000000000 +0200 @@ -49,7 +49,9 @@ STATIC void xfs_allocbt_log_keys(xfs_btr #define xfs_alloc_log_keys(c, b, i, j) \ xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_recs(c, b, i, j) \ + xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); @@ -883,41 +885,6 @@ xfs_alloc_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_alloc_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_alloc_rec_t *rp; /* record pointer for btree block */ - - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - rp = XFS_ALLOC_REC_ADDR(block, 1, cur); -#ifdef DEBUG - { - xfs_agf_t *agf; - xfs_alloc_rec_t *p; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++) - ASSERT(be32_to_cpu(p->ar_startblock) + - be32_to_cpu(p->ar_blockcount) <= - be32_to_cpu(agf->agf_length)); - } -#endif - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1642,83 +1609,50 @@ xfs_alloc_insert( return 0; } +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + /* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. + * Update the longest extent in the AGF */ -int /* error */ -xfs_alloc_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len) /* length of extent */ +STATIC void +xfs_allocbt_update_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_rec *rec, + int ptr, + int reason) { - xfs_alloc_block_t *block; /* btree block to update */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + __be32 len; - ASSERT(len > 0); - /* - * Pick up the a.g. freelist struct and the current block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - { - xfs_alloc_rec_t *rp; /* pointer to updated record */ + ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); - rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); + switch (reason) { + case LASTREC_UPDATE: /* - * Fill in the new contents and log them. + * If this is the last leaf block and it's the last record, + * then update the size of the longest extent in the AG. */ - rp->ar_startblock = cpu_to_be32(bno); - rp->ar_blockcount = cpu_to_be32(len); - xfs_alloc_log_recs(cur, cur->bc_bufs[0], ptr, ptr); - } - /* - * If it's the by-size btree and it's the last leaf block and - * it's the last record... then update the size of the longest - * extent in the a.g., which we cache in the a.g. freelist header. - */ - if (cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - ptr == be16_to_cpu(block->bb_numrecs)) { - xfs_agf_t *agf; /* a.g. freespace header */ - xfs_agnumber_t seqno; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - seqno = be32_to_cpu(agf->agf_seqno); - cur->bc_mp->m_perag[seqno].pagf_longest = len; - agf->agf_longest = cpu_to_be32(len); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_alloc_key_t key; /* key containing [bno, len] */ - - key.ar_startblock = cpu_to_be32(bno); - key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; + if (ptr != xfs_btree_get_numrecs(block)) + return; + len = rec->alloc.ar_blockcount; + break; + default: + ASSERT(0); + return; } - return 0; -} -STATIC struct xfs_btree_cur * -xfs_allocbt_dup_cursor( - struct xfs_btree_cur *cur) -{ - return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agbp, cur->bc_private.a.agno, - cur->bc_btnum); + agf->agf_longest = len; + cur->bc_mp->m_perag[seqno].pagf_longest = be32_to_cpu(len); + xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } STATIC void @@ -1805,6 +1739,17 @@ xfs_allocbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); } +STATIC void +xfs_allocbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_alloc_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1831,6 +1776,54 @@ xfs_allocbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +#ifdef DEBUG +STATIC void +xfs_alloc_log_recs_check( + struct xfs_btree_cur *cur, + xfs_alloc_rec_t *rp, + int first, + int last) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + xfs_alloc_rec_t *p; + + for (p = &rp[first - 1]; p <= &rp[last - 1]; p++) { + ASSERT(be32_to_cpu(p->ar_startblock) + + be32_to_cpu(p->ar_blockcount) <= + be32_to_cpu(agf->agf_length)); + } +} +#else +#define xfs_alloc_log_recs_check(cur, bp, first, last) +#endif + +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_alloc_log_recs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int first, /* index of first record to log */ + int last) /* index of last record to log */ +{ + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_alloc_rec_t *rp = XFS_ALLOC_REC_ADDR(block, 1, cur); + char *baddr = (char *)block; + int start; /* first byte offset logged */ + int end; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + xfs_alloc_log_recs_check(cur, rp, first, last); + + start = (char *)&rp[first - 1] - baddr; + end = (char *)&rp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} #ifdef XFS_BTREE_TRACE @@ -1901,6 +1894,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .update_lastrec = xfs_allocbt_update_lastrec, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, @@ -1908,7 +1902,9 @@ static const struct xfs_btree_ops xfs_al .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, .copy_keys = xfs_allocbt_copy_keys, + .copy_recs = xfs_allocbt_copy_recs, .log_keys = xfs_allocbt_log_keys, + .log_recs = xfs_allocbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, @@ -1943,6 +1939,8 @@ xfs_allocbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_allocbt_ops; + if (btnum == XFS_BTNUM_CNT) + cur->bc_flags = XFS_BTREE_LASTREC_UPDATE; cur->bc_private.a.agbp = agbp; cur->bc_private.a.agno = agno; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 02:55:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 02:57:08.000000000 +0200 @@ -191,6 +191,12 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* updated last record information */ + void (*update_lastrec)(struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_rec *rec, + int ptr, int reason); + /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); @@ -214,11 +220,15 @@ struct xfs_btree_ops { void (*copy_keys)(struct xfs_btree_cur *cur, union xfs_btree_key *src_key, union xfs_btree_key *dst_key, int numkeys); + void (*copy_recs)(struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, int numkeys); /* log changes to btree structures */ void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last); - + void (*log_recs)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -241,6 +251,12 @@ struct xfs_btree_ops { }; /* + * Reasons for the update_lastrec method to be called. + */ +#define LASTREC_UPDATE 0 + + +/* * Btree cursor structure. * This collects all information needed by the btree code in one place. */ @@ -284,6 +300,7 @@ typedef struct xfs_btree_cur /* cursor flags */ #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ +#define XFS_BTREE_LASTREC_UPDATE (1<<2) /* track last rec externally */ #define XFS_BTREE_NOERROR 0 @@ -539,6 +556,7 @@ int xfs_btree_increment(struct xfs_btree int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); +int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-02 02:57:04.000000000 +0200 @@ -136,6 +136,23 @@ xfs_alloc_lookup_le( return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); } +/* + * Update the record referred to by cur to the value given + * by [bno, len]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_alloc_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len) /* length of extent */ +{ + union xfs_btree_rec rec; + + rec.alloc.ar_startblock = cpu_to_be32(bno); + rec.alloc.ar_blockcount = cpu_to_be32(len); + return xfs_btree_update(cur, &rec); +} /* * Compute aligned version of the found extent. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-02 02:57:04.000000000 +0200 @@ -113,13 +113,6 @@ extern int xfs_alloc_get_rec(struct xfs_ */ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len); - extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-02 02:57:04.000000000 +0200 @@ -172,6 +172,26 @@ xfs_inobt_lookup_le( } /* + * Update the record referred to by cur to the value given + * by [ino, fcnt, free]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_inobt_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free) /* free inode mask */ +{ + union xfs_btree_rec rec; + + rec.inobt.ir_startino = cpu_to_be32(ino); + rec.inobt.ir_freecount = cpu_to_be32(fcnt); + rec.inobt.ir_free = cpu_to_be64(free); + return xfs_btree_update(cur, &rec); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 02:55:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 02:58:27.000000000 +0200 @@ -785,28 +785,6 @@ xfs_inobt_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_inobt_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_inobt_rec_t *rp; /* record pointer for btree block */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1530,58 +1508,6 @@ xfs_inobt_insert( return 0; } -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -int /* error */ -xfs_inobt_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free) /* free inode mask */ -{ - xfs_inobt_block_t *block; /* btree block to update */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ - xfs_inobt_rec_t *rp; /* pointer to updated record */ - - /* - * Pick up the current block. - */ - bp = cur->bc_bufs[0]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, bp))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - rp = XFS_INOBT_REC_ADDR(block, ptr, cur); - /* - * Fill in the new contents and log them. - */ - rp->ir_startino = cpu_to_be32(ino); - rp->ir_freecount = cpu_to_be32(fcnt); - rp->ir_free = cpu_to_be64(free); - xfs_inobt_log_recs(cur, bp, ptr, ptr); - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_inobt_key_t key; /* key containing [ino] */ - - key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; - } - return 0; -} - STATIC struct xfs_btree_cur * xfs_inobt_dup_cursor( struct xfs_btree_cur *cur) @@ -1661,6 +1587,17 @@ xfs_inobt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); } +STATIC void +xfs_inobt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_inobt_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1687,6 +1624,33 @@ xfs_inobt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_inobt_log_recs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int first, /* index of first record to log */ + int last) /* index of last record to log */ +{ + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_inobt_rec_t *rp = XFS_INOBT_REC_ADDR(block, 1, cur); + char *baddr = (char *)block; + int start; /* first byte offset logged */ + int end; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + start = (char *)&rp[first - 1] - baddr; + end = (char *)&rp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1763,7 +1727,9 @@ static const struct xfs_btree_ops xfs_in .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, .copy_keys = xfs_inobt_copy_keys, + .copy_recs = xfs_inobt_copy_recs, .log_keys = xfs_inobt_log_keys, + .log_recs = xfs_inobt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-02 02:57:04.000000000 +0200 @@ -135,14 +135,6 @@ extern int xfs_inobt_get_rec(struct xfs_ */ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free); - extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-02 02:57:04.000000000 +0200 @@ -430,6 +430,24 @@ xfs_bmbt_lookup_ge( return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); } +/* +* Update the record referred to by cur to the value given + * by [off, bno, len, state]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int +xfs_bmbt_update( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + xfs_exntst_t state) +{ + union xfs_btree_rec rec; + + xfs_bmbt_disk_set_allf(&rec.bmbt, off, bno, len, state); + return xfs_btree_update(cur, &rec); +} /* * Called from xfs_bmap_add_attrfork to handle btree format files. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 02:55:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 02:57:36.000000000 +0200 @@ -1567,34 +1567,6 @@ xfs_bmbt_log_block( } /* - * Log record values from the btree block. - */ -void -xfs_bmbt_log_recs( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int rfirst, - int rlast) -{ - xfs_bmbt_block_t *block; - int first; - int last; - xfs_bmbt_rec_t *rp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, rfirst, rlast); - ASSERT(bp); - tp = cur->bc_tp; - block = XFS_BUF_TO_BMBT_BLOCK(bp); - rp = XFS_BMAP_REC_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. */ @@ -1928,51 +1900,6 @@ xfs_bmbt_to_bmdr( } /* - * Update the record to the passed values. - */ -int -xfs_bmbt_update( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - xfs_exntst_t state) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; - xfs_bmbt_key_t key; - int ptr; - xfs_bmbt_rec_t *rp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGFFFI(cur, (xfs_dfiloff_t)off, (xfs_dfsbno_t)bno, - (xfs_dfilblks_t)len, (int)state); - block = xfs_bmbt_get_block(cur, 0, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, 0, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[0]; - rp = XFS_BMAP_REC_IADDR(block, ptr, cur); - xfs_bmbt_disk_set_allf(rp, off, bno, len, state); - xfs_bmbt_log_recs(cur, bp, ptr, ptr); - if (ptr > 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - key.br_startoff = cpu_to_be64(off); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - -/* * Check extent records, which have just been read, for * any bit in the extent flag field. ASSERT on debug * kernels, as this condition should not occur. @@ -2094,6 +2021,17 @@ xfs_bmbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); } +STATIC void +xfs_bmbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_bmbt_rec_t)); +} + /* * Log key values from the btree block. */ @@ -2125,6 +2063,32 @@ xfs_bmbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log record values from the btree block. + */ +void +xfs_bmbt_log_recs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int first, + int last) +{ + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + xfs_bmbt_rec_t *rp = XFS_BMAP_REC_DADDR(block, 1, cur); + char *baddr = (char *)block; + int start; + int end; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + start = (char *)&rp[first - 1] - baddr; + end = (char *)&rp[last] - 1 - baddr; + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2221,7 +2185,9 @@ static const struct xfs_btree_ops xfs_bm .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, .copy_keys = xfs_bmbt_copy_keys, + .copy_recs = xfs_bmbt_copy_recs, .log_keys = xfs_bmbt_log_keys, + .log_recs = xfs_bmbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-02 02:53:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-02 02:57:04.000000000 +0200 @@ -274,8 +274,6 @@ extern void xfs_bmbt_disk_set_allf(xfs_b xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int); -extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, int); -- From owner-xfs@oss.sgi.com Sun Aug 3 18:31:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31: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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no 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 m741VU0U030453 for ; Sun, 3 Aug 2008 18:31:30 -0700 X-ASG-Debug-ID: 1217813562-739901a30000-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 3E8693566B0 for ; Sun, 3 Aug 2008 18:32:42 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 7QWqzMbP0KQFphDC for ; Sun, 03 Aug 2008 18:32:42 -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 m741WiIF008922 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:32:44 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741WidF008920 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:32:44 +0200 Date: Mon, 4 Aug 2008 03:32:44 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 04/26] make btree root in inode support generic Subject: [PATCH 04/26] make btree root in inode support generic Message-ID: <20080804013244.GE8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-generic-inode-root-support 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: 1217813564 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17329 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 The bmap btree is rooted in the inode and not in a single disk block. Make the support for this feature more generic by: (a) adding a btree flag to check for instead of the XFS_BTNUM_BMAP type (b) add a get_root_from_inode btree operation to get a btree block from the inode, with the implementation details left to the individual btree. Also clean up xfs_btree_get_block, which is the place these two features are used. The XFS_BTREE_ROOT_IN_INODE is based upon a patch from Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:05:37.000000000 +0200 @@ -2630,8 +2630,19 @@ xfs_bmbt_dup_cursor( return new; } +STATIC struct xfs_btree_block * +xfs_bmbt_get_root_from_inode( + struct xfs_btree_cur *cur) +{ + struct xfs_ifork *ifp; + + ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork); + return (struct xfs_btree_block *)ifp->if_broot; +} + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, + .get_root_from_inode = xfs_bmbt_get_root_from_inode, }; /* @@ -2656,6 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; + cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 04:05:37.000000000 +0200 @@ -425,29 +425,20 @@ xfs_btree_dup_cursor( * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */ -STATIC xfs_btree_block_t * /* generic btree block pointer */ +STATIC struct xfs_btree_block * /* generic btree block pointer */ xfs_btree_get_block( - xfs_btree_cur_t *cur, /* btree cursor */ + struct xfs_btree_cur *cur, /* btree cursor */ int level, /* level in btree */ - xfs_buf_t **bpp) /* buffer containing the block */ + struct xfs_buf **bpp) /* buffer containing the block */ { - xfs_btree_block_t *block; /* return value */ - xfs_buf_t *bp; /* return buffer */ - xfs_ifork_t *ifp; /* inode fork pointer */ - int whichfork; /* data or attr fork */ - - if (cur->bc_btnum == XFS_BTNUM_BMAP && level == cur->bc_nlevels - 1) { - whichfork = cur->bc_private.b.whichfork; - ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, whichfork); - block = (xfs_btree_block_t *)ifp->if_broot; - bp = NULL; - } else { - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_BLOCK(bp); + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *bpp = NULL; + return cur->bc_ops->get_root_from_inode(cur); } - ASSERT(block != NULL); - *bpp = bp; - return block; + + *bpp = cur->bc_bufs[level]; + return XFS_BUF_TO_BLOCK(*bpp); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:05:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:05:37.000000000 +0200 @@ -159,6 +159,9 @@ extern const __uint32_t xfs_magics[]; struct xfs_btree_ops { /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); + + /* get inode rooted btree root */ + struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); }; /* @@ -170,6 +173,7 @@ typedef struct xfs_btree_cur struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ const struct xfs_btree_ops *bc_ops; + uint bc_flags; /* btree features - below */ union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -201,6 +205,10 @@ typedef struct xfs_btree_cur } bc_private; /* per-btree type data */ } xfs_btree_cur_t; +/* cursor flags */ +#define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ + + #define XFS_BTREE_NOERROR 0 #define XFS_BTREE_ERROR 1 -- From owner-xfs@oss.sgi.com Sun Aug 3 18:32:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:32:17 -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 (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 m741WD2S031032 for ; Sun, 3 Aug 2008 18:32:13 -0700 X-ASG-Debug-ID: 1217813605-5a0302f50000-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 866A23566BC for ; Sun, 3 Aug 2008 18:33:26 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 8FXtPsBQXAztlsCN for ; Sun, 03 Aug 2008 18:33:26 -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 m741XRIF009018 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 4 Aug 2008 03:33:27 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741XR6c009016; Mon, 4 Aug 2008 03:33:27 +0200 Date: Mon, 4 Aug 2008 03:33:27 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 08/26] add new btree statistics Subject: [PATCH 08/26] add new btree statistics Message-ID: <20080804013327.GI8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-stats 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: 1217813607 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: -0.92 X-Barracuda-Spam-Status: No, SCORE=-0.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA081 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.10 BSF_SC0_SA081 Custom Rule SA081 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17333 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 From: Dave Chinner Introduce statistics coverage of all the btrees and cover all the btree operations, not just some. Invaluable for determining test code coverage of all the btree operations.... Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:29:17.000000000 +0200 @@ -53,6 +53,10 @@ xfs_read_xfsstats( { "icluster", XFSSTAT_END_INODE_CLUSTER }, { "vnodes", XFSSTAT_END_VNODE_OPS }, { "buf", XFSSTAT_END_BUF }, + { "abtb2", XFSSTAT_END_ABTB_V2 }, + { "abtc2", XFSSTAT_END_ABTC_V2 }, + { "bmbt2", XFSSTAT_END_BMBT_V2 }, + { "ibt2", XFSSTAT_END_IBT_V2 }, }; /* Loop over all stats groups */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:29:17.000000000 +0200 @@ -118,6 +118,71 @@ struct xfsstats { __uint32_t xb_page_retries; __uint32_t xb_page_found; __uint32_t xb_get_read; +/* Version 2 btree counters */ +#define XFSSTAT_END_ABTB_V2 (XFSSTAT_END_BUF+15) + __uint32_t xs_abtb_2_lookup; + __uint32_t xs_abtb_2_compare; + __uint32_t xs_abtb_2_insrec; + __uint32_t xs_abtb_2_delrec; + __uint32_t xs_abtb_2_newroot; + __uint32_t xs_abtb_2_killroot; + __uint32_t xs_abtb_2_increment; + __uint32_t xs_abtb_2_decrement; + __uint32_t xs_abtb_2_lshift; + __uint32_t xs_abtb_2_rshift; + __uint32_t xs_abtb_2_split; + __uint32_t xs_abtb_2_join; + __uint32_t xs_abtb_2_alloc; + __uint32_t xs_abtb_2_free; + __uint32_t xs_abtb_2_moves; +#define XFSSTAT_END_ABTC_V2 (XFSSTAT_END_ABTB_V2+15) + __uint32_t xs_abtc_2_lookup; + __uint32_t xs_abtc_2_compare; + __uint32_t xs_abtc_2_insrec; + __uint32_t xs_abtc_2_delrec; + __uint32_t xs_abtc_2_newroot; + __uint32_t xs_abtc_2_killroot; + __uint32_t xs_abtc_2_increment; + __uint32_t xs_abtc_2_decrement; + __uint32_t xs_abtc_2_lshift; + __uint32_t xs_abtc_2_rshift; + __uint32_t xs_abtc_2_split; + __uint32_t xs_abtc_2_join; + __uint32_t xs_abtc_2_alloc; + __uint32_t xs_abtc_2_free; + __uint32_t xs_abtc_2_moves; +#define XFSSTAT_END_BMBT_V2 (XFSSTAT_END_ABTC_V2+15) + __uint32_t xs_bmbt_2_lookup; + __uint32_t xs_bmbt_2_compare; + __uint32_t xs_bmbt_2_insrec; + __uint32_t xs_bmbt_2_delrec; + __uint32_t xs_bmbt_2_newroot; + __uint32_t xs_bmbt_2_killroot; + __uint32_t xs_bmbt_2_increment; + __uint32_t xs_bmbt_2_decrement; + __uint32_t xs_bmbt_2_lshift; + __uint32_t xs_bmbt_2_rshift; + __uint32_t xs_bmbt_2_split; + __uint32_t xs_bmbt_2_join; + __uint32_t xs_bmbt_2_alloc; + __uint32_t xs_bmbt_2_free; + __uint32_t xs_bmbt_2_moves; +#define XFSSTAT_END_IBT_V2 (XFSSTAT_END_BMBT_V2+15) + __uint32_t xs_ibt_2_lookup; + __uint32_t xs_ibt_2_compare; + __uint32_t xs_ibt_2_insrec; + __uint32_t xs_ibt_2_delrec; + __uint32_t xs_ibt_2_newroot; + __uint32_t xs_ibt_2_killroot; + __uint32_t xs_ibt_2_increment; + __uint32_t xs_ibt_2_decrement; + __uint32_t xs_ibt_2_lshift; + __uint32_t xs_ibt_2_rshift; + __uint32_t xs_ibt_2_split; + __uint32_t xs_ibt_2_join; + __uint32_t xs_ibt_2_alloc; + __uint32_t xs_ibt_2_free; + __uint32_t xs_ibt_2_moves; /* Extra precision counters */ __uint64_t xs_xstrat_bytes; __uint64_t xs_write_bytes; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:28:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:29:17.000000000 +0200 @@ -126,6 +126,34 @@ union xfs_btree_rec { extern const __uint32_t xfs_magics[]; /* + * Generic stats interface + */ +#define __XFS_BTREE_STATS_INC(type, stat) \ + XFS_STATS_INC(xs_ ## type ## _2_ ## stat) +#define XFS_BTREE_STATS_INC(cur, stat) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(ibt, stat); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) + +#define __XFS_BTREE_STATS_ADD(type, stat, val) \ + XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val) +#define XFS_BTREE_STATS_ADD(cur, stat, val) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_ADD(ibt, stat, val); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) +/* * Maximum and minimum records in a btree block. * Given block size, type prefix, and leaf flag (0 or 1). * The divisor below is equivalent to lf ? (e1) : (e2) but that produces -- From owner-xfs@oss.sgi.com Sun Aug 3 18:32:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:32:39 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_62,J_CHICKENPOX_63,J_CHICKENPOX_65 autolearn=no 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 m741WVZB031325 for ; Sun, 3 Aug 2008 18:32:31 -0700 X-ASG-Debug-ID: 1217813622-5a0202c50000-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 1257B3566BE for ; Sun, 3 Aug 2008 18:33:43 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id kS6le3E1qqkxPsxS for ; Sun, 03 Aug 2008 18:33:43 -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 m741XiIF009061 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:33:44 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741XhAn009059 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:33:43 +0200 Date: Mon, 4 Aug 2008 03:33:43 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 10/26] implement generic xfs_btree_increment Subject: [PATCH 10/26] implement generic xfs_btree_increment Message-ID: <20080804013343.GK8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-increment 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: 1217813625 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: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17335 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 From: Dave Chinner Because this is the first major generic btree routine this patch includes some infrastrucure, fistly a few routines to deal with a btree block that can be either in short or long form, and secondly xfs_btree_read_buf_block, which is the new central routine to read a btree block given a cursor. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Notes: - xfs_btree_read_buf_block now includes a xfs_btree_check_block, removed duplicate call Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:05:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:06:20.000000000 +0200 @@ -186,6 +186,10 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* return address of btree structures */ + union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -497,6 +501,23 @@ xfs_btree_setbuf( int lev, /* level in btree */ struct xfs_buf *bp); /* new buffer to set */ +/* + * Common btree core entry points. + */ + +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); + + +/* + * Helpers. + */ + +static inline int +xfs_btree_get_numrecs(struct xfs_btree_block *block) +{ + return be16_to_cpu(block->bb_numrecs); +} + #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 04:05:50.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 04:05:57.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_error.h" @@ -829,3 +830,224 @@ xfs_btree_setbuf( cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; } } + +STATIC int +xfs_btree_ptr_is_null( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return be64_to_cpu(ptr->l) == NULLFSBLOCK; + else + return be32_to_cpu(ptr->s) == NULLAGBLOCK; +} + +/* + * Get/set/init sibling pointers + */ +STATIC void +xfs_btree_get_sibling( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_ptr *ptr, + int lr) +{ + ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + if (lr == XFS_BB_RIGHTSIB) + ptr->l = block->bb_u.l.bb_rightsib; + else + ptr->l = block->bb_u.l.bb_leftsib; + } else { + if (lr == XFS_BB_RIGHTSIB) + ptr->s = block->bb_u.s.bb_rightsib; + else + ptr->s = block->bb_u.s.bb_leftsib; + } +} + +STATIC xfs_daddr_t +xfs_btree_ptr_to_daddr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + ASSERT(be64_to_cpu(ptr->l) != NULLFSBLOCK); + + return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); + } else { + ASSERT(cur->bc_private.a.agno != NULLAGNUMBER); + ASSERT(be32_to_cpu(ptr->s) != NULLAGBLOCK); + + return XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno, + be32_to_cpu(ptr->s)); + } +} + +STATIC void +xfs_btree_set_refs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + switch (cur->bc_btnum) { + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_ALLOC_BTREE_REF); + break; + case XFS_BTNUM_INO: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_INOMAP, XFS_INO_BTREE_REF); + break; + case XFS_BTNUM_BMAP: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_BMAP_BTREE_REF); + break; + default: + ASSERT(0); + } +} + +/* + * Read in the buffer at the given ptr and return the buffer and + * the block pointer within the buffer. + */ +STATIC int +xfs_btree_read_buf_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int level, + int flags, + struct xfs_btree_block **block, + struct xfs_buf **bpp) +{ + struct xfs_mount *mp = cur->bc_mp; + xfs_daddr_t d; + int error; + + /* need to sort out how callers deal with failures first */ + ASSERT(!(flags & XFS_BUF_TRYLOCK)); + + d = xfs_btree_ptr_to_daddr(cur, ptr); + error = xfs_trans_read_buf(mp, cur->bc_tp, mp->m_ddev_targp, d, + mp->m_bsize, flags, bpp); + if (error) + return error; + + ASSERT(*bpp != NULL); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + + xfs_btree_set_refs(cur, *bpp); + *block = XFS_BUF_TO_BLOCK(*bpp); + + error = xfs_btree_check_block(cur, *block, level, *bpp); + if (error) + xfs_trans_brelse(cur->bc_tp, *bpp); + return error; +} + +/* + * Increment cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_increment( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + union xfs_btree_ptr ptr; + struct xfs_buf *bp; + int error; /* error return value */ + int lev; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the right at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* We're done if we remain in the block after the increment. */ + if (++cur->bc_ptrs[level] <= xfs_btree_get_numrecs(block)) + goto out1; + + /* Fail if we just went off the right edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, increment); + + /* + * March up the tree incrementing pointers. + * Stop when we don't go off the right edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + block = xfs_btree_get_block(cur, lev, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, lev, bp); + if (error) + goto error0; +#endif + + if (++cur->bc_ptrs[lev] <= xfs_btree_get_numrecs(block)) + break; + + /* Read-ahead the right block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + } + + /* + * If we went off the root then we are either seriously + * confused or have the tree root in an inode. + */ + if (lev == cur->bc_nlevels) { + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) + goto out0; + ASSERT(0); + error = EFSCORRUPTED; + goto error0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = 1; + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-02 04:05:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-02 04:05:57.000000000 +0200 @@ -303,7 +303,7 @@ xfs_alloc_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -517,7 +517,7 @@ xfs_alloc_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1134,7 +1134,7 @@ xfs_alloc_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_alloc_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); *stat = 1; @@ -1570,7 +1570,7 @@ xfs_alloc_rshift( return error; i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_alloc_updkey(tcur, rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); @@ -1943,97 +1943,6 @@ xfs_alloc_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* tree block buffer */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_ALLOC_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2219,6 +2128,15 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC union xfs_btree_ptr * +xfs_allocbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *)XFS_ALLOC_PTR_ADDR(block, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2288,6 +2206,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .ptr_addr = xfs_allocbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-02 04:05:57.000000000 +0200 @@ -114,12 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ xfs_extlen_t *len, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-02 04:05:57.000000000 +0200 @@ -818,7 +818,7 @@ xfs_alloc_ag_vextent_near( XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (ltlen >= args->minlen) break; - if ((error = xfs_alloc_increment(cnt_cur, 0, &i))) + if ((error = xfs_btree_increment(cnt_cur, 0, &i))) goto error0; } while (i); ASSERT(ltlen >= args->minlen); @@ -828,7 +828,7 @@ xfs_alloc_ag_vextent_near( i = cnt_cur->bc_ptrs[0]; for (j = 1, blen = 0, bdiff = 0; !error && j && (blen < args->maxlen || bdiff > 0); - error = xfs_alloc_increment(cnt_cur, 0, &j)) { + error = xfs_btree_increment(cnt_cur, 0, &j)) { /* * For each entry, decide if it's better than * the previous best entry. @@ -938,7 +938,7 @@ xfs_alloc_ag_vextent_near( * Increment the cursor, so we will point at the entry just right * of the leftward entry if any, or to the leftmost entry. */ - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { /* @@ -977,7 +977,7 @@ xfs_alloc_ag_vextent_near( args->minlen, >bnoa, >lena); if (gtlena >= args->minlen) break; - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_gt, @@ -1066,7 +1066,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the right end. */ - if ((error = xfs_alloc_increment( + if ((error = xfs_btree_increment( bno_cur_gt, 0, &i))) goto error0; if (!i) { @@ -1548,7 +1548,7 @@ xfs_free_ag_extent( * Look for a neighboring block on the right (higher block numbers) * that is contiguous with this space. */ - if ((error = xfs_alloc_increment(bno_cur, 0, &haveright))) + if ((error = xfs_btree_increment(bno_cur, 0, &haveright))) goto error0; if (haveright) { /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-02 04:05:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-02 04:05:57.000000000 +0200 @@ -253,7 +253,7 @@ xfs_inobt_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_inobt_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -463,7 +463,7 @@ xfs_inobt_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1014,7 +1014,7 @@ xfs_inobt_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; ASSERT(i == 1); *stat = 1; @@ -1443,7 +1443,7 @@ xfs_inobt_rshift( if ((error = xfs_btree_dup_cursor(cur, &tcur))) return error; xfs_btree_lastrec(tcur, level); - if ((error = xfs_inobt_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; @@ -1821,97 +1821,6 @@ xfs_inobt_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_INOBT_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2085,6 +1994,15 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC union xfs_btree_ptr * +xfs_inobt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *)XFS_INOBT_PTR_ADDR(block, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -2154,6 +2072,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .ptr_addr = xfs_inobt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-02 04:05:57.000000000 +0200 @@ -695,7 +695,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); @@ -753,7 +753,7 @@ nextag: /* * Search right with cur, go forward 1 record. */ - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; if (!doneright) { @@ -835,7 +835,7 @@ nextag: * further right. */ else { - if ((error = xfs_inobt_increment(cur, 0, + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; @@ -890,7 +890,7 @@ nextag: XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (rec.ir_freecount > 0) break; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -924,7 +924,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); ASSERT(freecount == be32_to_cpu(agi->agi_freecount) || @@ -1033,7 +1033,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); @@ -1138,7 +1138,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-02 04:05:57.000000000 +0200 @@ -136,12 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ __int32_t *fcnt, xfs_inofree_t *free, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-08-02 04:05:57.000000000 +0200 @@ -471,7 +471,7 @@ xfs_bulkstat( * In any case, increment to the next record. */ if (!error) - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); } else { /* * Start of ag. Lookup the first inode chunk. @@ -538,7 +538,7 @@ xfs_bulkstat( * Set agino to after this chunk and bump the cursor. */ agino = gino + XFS_INODES_PER_CHUNK; - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); cond_resched(); } /* @@ -885,7 +885,7 @@ xfs_inumbers( bufidx = 0; } if (left) { - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); cur = NULL; Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-02 04:05:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-02 04:05:57.000000000 +0200 @@ -1646,7 +1646,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; if ((error = xfs_bmbt_update(cur, new->br_startoff, new->br_startblock, @@ -3253,7 +3253,7 @@ xfs_bmap_del_extent( got.br_startblock, temp, got.br_state))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; cur->bc_rec.b = new; error = xfs_bmbt_insert(cur, &i); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:05:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-02 04:06:30.000000000 +0200 @@ -254,7 +254,7 @@ xfs_bmbt_delrec( if (rbno != NULLFSBLOCK) { i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -445,7 +445,7 @@ xfs_bmbt_delrec( cur->bc_bufs[level] = lbp; cur->bc_ptrs[level] += lrecs; cur->bc_ra[level] = 0; - } else if ((error = xfs_bmbt_increment(cur, level + 1, &i))) { + } else if ((error = xfs_btree_increment(cur, level + 1, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -929,7 +929,7 @@ xfs_bmbt_lookup( if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { cur->bc_ptrs[0] = keyno; - if ((error = xfs_bmbt_increment(cur, 0, &i))) { + if ((error = xfs_btree_increment(cur, 0, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1202,7 +1202,7 @@ xfs_bmbt_rshift( } i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1761,86 +1761,6 @@ xfs_bmbt_disk_get_startoff( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_increment( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - if (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - block = xfs_bmbt_get_block(cur, lev, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = 1; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * * A multi-level split of the tree on insert will invalidate the original @@ -2425,6 +2345,15 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC union xfs_btree_ptr * +xfs_bmbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *)XFS_BMAP_PTR_IADDR(block, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2514,6 +2443,7 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .ptr_addr = xfs_bmbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-02 04:05:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-02 04:05:57.000000000 +0200 @@ -251,7 +251,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bm extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); -extern int xfs_bmbt_increment(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_insert(struct xfs_btree_cur *, int *); extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, -- From owner-xfs@oss.sgi.com Sun Aug 3 18:33:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:33:40 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64,J_CHICKENPOX_66,J_CHICKENPOX_73,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741XR13032394 for ; Sun, 3 Aug 2008 18:33:28 -0700 X-ASG-Debug-ID: 1217813680-16ab02e80000-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 51B4A1976449 for ; Sun, 3 Aug 2008 18:34:40 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 0Ek3iYo5HJdN4VKP for ; Sun, 03 Aug 2008 18:34:40 -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 m741YfIF009184 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:34:42 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741YfKb009182 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:34:41 +0200 Date: Mon, 4 Aug 2008 03:34:41 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 16/26] implement generic xfs_btree_rshift Subject: [PATCH 16/26] implement generic xfs_btree_rshift Message-ID: <20080804013441.GQ8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-rshift 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: 1217813681 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17341 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 Make the btree right shift code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-03 13:23:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-03 13:32:52.000000000 +0200 @@ -34,6 +34,7 @@ #include "xfs_attr_sf.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_inode_item.h" #include "xfs_btree.h" #include "xfs_btree_trace.h" #include "xfs_ialloc.h" @@ -943,6 +944,137 @@ xfs_btree_read_buf_block( return error; } +STATIC void +xfs_btree_set_ptr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr_addr, + int index, + union xfs_btree_ptr *newptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *pp = &ptr_addr->l; + + pp[index] = newptr->l; + } else { + __be32 *pp = &ptr_addr->s; + + pp[index] = newptr->s; + } +} + +STATIC void +xfs_btree_move_ptrs( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *base, + int from, + int to, + int numptrs) +{ + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numptrs >= 0); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *lpp = &base->l; + + memmove(&lpp[to], &lpp[from], numptrs * sizeof(*lpp)); + } else { + __be32 *spp = &base->s; + + memmove(&spp[to], &spp[from], numptrs * sizeof(*spp)); + } +} + +/* + * Log block pointer fields from a btree block (nonleaf). + */ +STATIC void +xfs_btree_log_ptrs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int first, /* index of first pointer to log */ + int last) /* index of last pointer to log */ +{ + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); + + if (bp) { + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + char *baddr = (char *)block; + union xfs_btree_ptr *pp; + int start; /* first byte offset logged */ + int end; /* last byte offset logged */ + + pp = cur->bc_ops->ptr_addr(cur, 1, block); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *lpp = &pp->l; + + start = (char *)&lpp[first - 1] - baddr; + end = (char *)&lpp[last] - 1 - baddr; + } else { + __be32 *spp = &pp->s; + + start = (char *)&spp[first - 1] - baddr; + end = (char *)&spp[last] - 1 - baddr; + } + + xfs_trans_log_buf(cur->bc_tp, bp, start, end); + } else { + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + +/* + * Log fields from the short from btree block header. + */ +STATIC void +xfs_btree_log_block( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int fields) /* mask of fields: XFS_BB_... */ +{ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + static const short soffsets[] = { /* table of offsets (short) */ + offsetof(struct xfs_btree_sblock, bb_magic), + offsetof(struct xfs_btree_sblock, bb_level), + offsetof(struct xfs_btree_sblock, bb_numrecs), + offsetof(struct xfs_btree_sblock, bb_leftsib), + offsetof(struct xfs_btree_sblock, bb_rightsib), + sizeof(struct xfs_btree_sblock) + }; + static const short loffsets[] = { /* table of offsets (long) */ + offsetof(struct xfs_btree_lblock, bb_magic), + offsetof(struct xfs_btree_lblock, bb_level), + offsetof(struct xfs_btree_lblock, bb_numrecs), + offsetof(struct xfs_btree_lblock, bb_leftsib), + offsetof(struct xfs_btree_lblock, bb_rightsib), + sizeof(struct xfs_btree_lblock) + }; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBI(cur, bp, fields); + + if (bp) { + xfs_btree_offsets(fields, + (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? + loffsets : soffsets, + XFS_BB_NUM_BITS, &first, &last); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + } else { + /* XXX(hch): maybe factor out into a method? */ + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + /* * Increment cursor by one record at the level. * For nonzero levels the leaf-ward information is untouched. @@ -1149,7 +1281,6 @@ error0: return error; } - STATIC int xfs_btree_lookup_get_block( struct xfs_btree_cur *cur, /* btree cursor */ @@ -1480,3 +1611,177 @@ error0: return error; } +/* + * Move 1 record right from cur/level if possible. + * Update cur to reflect the new path. + */ +int /* error */ +xfs_btree_rshift( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + union xfs_btree_key key; /* btree key */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + struct xfs_btree_cur *tcur; /* temporary btree cursor */ + union xfs_btree_ptr rptr; /* right block pointer */ + union xfs_btree_key *rkp; /* right btree key */ + int rrecs; /* right record count */ + int lrecs; /* left record count */ + int error; /* error return value */ + int i; /* loop counter */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) + goto out0; + + /* Set up variables for this block as "left". */ + left = xfs_btree_get_block(cur, level, &lbp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, left, level, lbp); + if (error) + goto error0; +#endif + + /* If we've got no right sibling then we can't shift an entry right. */ + xfs_btree_get_sibling(cur, left, &rptr, XFS_BB_RIGHTSIB); + if (xfs_btree_ptr_is_null(cur, &rptr)) + goto out0; + + /* + * If the cursor entry is the one that would be moved, don't + * do it... it's too complicated. + */ + lrecs = xfs_btree_get_numrecs(left); + if (cur->bc_ptrs[level] >= lrecs) + goto out0; + + /* Set up the right neighbor as "right". */ + error = xfs_btree_read_buf_block(cur, &rptr, level, 0, &right, &rbp); + if (error) + goto error0; + + /* If it's full, it can't take another entry. */ + rrecs = xfs_btree_get_numrecs(right); + if (rrecs == cur->bc_ops->get_maxrecs(cur, level)) + goto out0; + + XFS_BTREE_STATS_INC(cur, rshift); + XFS_BTREE_STATS_ADD(cur, moves, rrecs); + + /* + * Make a hole at the start of the right neighbor block, then + * copy the last left block entry to the hole. + */ + if (level > 0) { + /* It's a nonleaf. make a hole in the keys and ptrs */ + union xfs_btree_key *lkp; + union xfs_btree_ptr *lpp; + union xfs_btree_ptr *rpp; + + lkp = cur->bc_ops->key_addr(cur, lrecs, left); + lpp = cur->bc_ops->ptr_addr(cur, lrecs, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); + +#ifdef DEBUG + for (i = rrecs - 1; i >= 0; i--) { + error = xfs_btree_check_ptr(cur, rpp, i, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->move_keys(cur, rkp, 0, 1, rrecs); + xfs_btree_move_ptrs(cur, rpp, 0, 1, rrecs); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, lpp, 0, level); + if (error) + goto error0; +#endif + + /* Now put the new data in, and log it. */ + cur->bc_ops->set_key(cur, rkp, 0, lkp); + xfs_btree_set_ptr(cur, rpp, 0, lpp); + + cur->bc_ops->log_keys(cur, rbp, 1, rrecs + 1); + xfs_btree_log_ptrs(cur, rbp, 1, rrecs + 1); + + xfs_btree_check_key(cur->bc_btnum, rkp, + cur->bc_ops->key_addr(cur, 2, right)); + } else { + /* It's a leaf. make a hole in the records */ + union xfs_btree_rec *lrp; + union xfs_btree_rec *rrp; + + lrp = cur->bc_ops->rec_addr(cur, lrecs, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->move_recs(cur, rrp, 0, 1, rrecs); + + /* Now put the new data in, and log it. */ + cur->bc_ops->set_rec(cur, rrp, 0, lrp); + cur->bc_ops->log_recs(cur, rbp, 1, rrecs + 1); + + cur->bc_ops->init_key_from_rec(cur, &key, rrp); + rkp = &key; + + xfs_btree_check_rec(cur->bc_btnum, rrp, + cur->bc_ops->rec_addr(cur, 2, right)); + } + + /* + * Decrement and log left's numrecs, bump and log right's numrecs. + */ + xfs_btree_set_numrecs(left, --lrecs); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS); + + xfs_btree_set_numrecs(right, ++rrecs); + xfs_btree_log_block(cur, rbp, XFS_BB_NUMRECS); + + /* + * Using a temporary cursor, update the parent key values of the + * block on the right. + */ + error = xfs_btree_dup_cursor(cur, &tcur); + if (error) + goto error0; + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_increment(tcur, level, &i); + if (error) + goto error1; + + error = xfs_btree_updkey(tcur, rkp, level + 1); + if (error) + goto error1; + + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + +error1: + XFS_BTREE_TRACE_CURSOR(tcur, XBT_ERROR); + xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-03 13:23:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-03 13:30:46.000000000 +0200 @@ -214,6 +214,22 @@ struct xfs_btree_ops { __int64_t (*key_diff)(struct xfs_btree_cur *cur, union xfs_btree_key *key); + /* set values of btree structures */ + void (*set_key)(struct xfs_btree_cur *cur, + union xfs_btree_key *oldkey, int index, + union xfs_btree_key *newkey); + void (*set_rec)(struct xfs_btree_cur *cur, + union xfs_btree_rec *oldrec, int index, + union xfs_btree_rec *newrec); + + /* move bits of btree blocks within a block */ + void (*move_keys)(struct xfs_btree_cur *cur, + union xfs_btree_key *base, int src_index, + int dst_index, int numkeys); + void (*move_recs)(struct xfs_btree_cur *cur, + union xfs_btree_rec *base, int src_index, + int dst_index, int numrecs); + /* copy bits of btree blocks between blocks */ void (*copy_keys)(struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -555,6 +571,7 @@ int xfs_btree_decrement(struct xfs_btree int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); +int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); /* @@ -567,6 +584,12 @@ xfs_btree_get_numrecs(struct xfs_btree_b return be16_to_cpu(block->bb_numrecs); } +static inline void +xfs_btree_set_numrecs(struct xfs_btree_block *block, __uint16_t numrecs) +{ + block->bb_numrecs = cpu_to_be16(numrecs); +} + #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-03 13:23:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-03 13:30:46.000000000 +0200 @@ -54,7 +54,6 @@ STATIC void xfs_allocbt_log_recs(xfs_btr xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); @@ -396,7 +395,7 @@ xfs_alloc_delrec( */ if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_alloc_rshift(tcur, level, &i))) + if ((error = xfs_btree_rshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -688,7 +687,7 @@ xfs_alloc_insrec( /* * First, try shifting an entry to the right neighbor. */ - if ((error = xfs_alloc_rshift(cur, level, &i))) + if ((error = xfs_btree_rshift(cur, level, &i))) return error; if (i) { /* nothing */ @@ -1181,137 +1180,6 @@ xfs_alloc_newroot( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_alloc_rshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop index */ - xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left (current) block */ - xfs_alloc_block_t *left; /* left (current) btree block */ - xfs_buf_t *rbp; /* buffer for right neighbor block */ - xfs_alloc_block_t *right; /* right neighbor btree block */ - xfs_alloc_key_t *rkp; /* key pointer for right block */ - xfs_btree_cur_t *tcur; /* temporary cursor */ - - /* - * Set up variables for this block as "left". - */ - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * If we've got no right sibling then we can't shift an entry right. - */ - if (be32_to_cpu(left->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - *stat = 0; - return 0; - } - /* - * Set up the right neighbor as "right". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), - 0, &rbp, XFS_ALLOC_BTREE_REF))) - return error; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(right->bb_numrecs) == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - /* - * Make a hole at the start of the right neighbor block, then - * copy the last left block entry to the hole. - */ - if (level > 0) { - xfs_alloc_key_t *lkp; /* key pointer for left block */ - xfs_alloc_ptr_t *lpp; /* address pointer for left block */ - xfs_alloc_ptr_t *rpp; /* address pointer for right block */ - - lkp = XFS_ALLOC_KEY_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_ALLOC_PTR_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*lpp), level))) - return error; -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_alloc_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_alloc_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_btree_check_key(cur->bc_btnum, rkp, rkp + 1); - } else { - xfs_alloc_rec_t *lrp; /* record pointer for left block */ - xfs_alloc_rec_t *rrp; /* record pointer for right block */ - - lrp = XFS_ALLOC_REC_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_alloc_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.ar_startblock = rrp->ar_startblock; - key.ar_blockcount = rrp->ar_blockcount; - rkp = &key; - xfs_btree_check_rec(cur->bc_btnum, rrp, rrp + 1); - } - /* - * Decrement and log left's numrecs, bump and log right's numrecs. - */ - be16_add(&left->bb_numrecs, -1); - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); - xfs_alloc_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Using a temporary cursor, update the parent key values of the - * block on the right. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) - goto error0; - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - *stat = 1; - return 0; -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* * Split cur/level block in half. * Return new block number and its first record (to be inserted into parent). */ @@ -1737,6 +1605,64 @@ xfs_allocbt_key_diff( } STATIC void +xfs_allocbt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_alloc_key_t *kp = &key_addr->alloc; + + kp[index] = newkey->alloc; +} + +STATIC void +xfs_allocbt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_alloc_rec_t *rp = &rec_addr->alloc; + + rp[index] = newrec->alloc; +} + +STATIC void +xfs_allocbt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_alloc_key_t *kp = &base->alloc; + + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_allocbt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_alloc_rec_t *rp = &base->alloc; + + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_allocbt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -1910,6 +1836,10 @@ static const struct xfs_btree_ops xfs_al .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, + .set_key = xfs_allocbt_set_key, + .set_rec = xfs_allocbt_set_rec, + .move_keys = xfs_allocbt_move_keys, + .move_recs = xfs_allocbt_move_recs, .copy_keys = xfs_allocbt_copy_keys, .copy_recs = xfs_allocbt_copy_recs, .log_keys = xfs_allocbt_log_keys, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-03 13:23:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-03 13:30:46.000000000 +0200 @@ -46,7 +46,6 @@ STATIC void xfs_inobt_log_ptrs(xfs_btree STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_inobt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_inobt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); @@ -338,7 +337,7 @@ xfs_inobt_delrec( */ if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_inobt_rshift(tcur, level, &i))) + if ((error = xfs_btree_rshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -609,7 +608,7 @@ xfs_inobt_insrec( /* * First, try shifting an entry to the right neighbor. */ - if ((error = xfs_inobt_rshift(cur, level, &i))) + if ((error = xfs_btree_rshift(cur, level, &i))) return error; if (i) { /* nothing */ @@ -1074,136 +1073,6 @@ xfs_inobt_newroot( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_inobt_rshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop index */ - xfs_inobt_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left (current) block */ - xfs_inobt_block_t *left; /* left (current) btree block */ - xfs_inobt_key_t *lkp; /* key pointer for left block */ - xfs_inobt_ptr_t *lpp; /* address pointer for left block */ - xfs_inobt_rec_t *lrp; /* record pointer for left block */ - xfs_buf_t *rbp; /* buffer for right neighbor block */ - xfs_inobt_block_t *right; /* right neighbor btree block */ - xfs_inobt_key_t *rkp; /* key pointer for right block */ - xfs_inobt_ptr_t *rpp; /* address pointer for right block */ - xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */ - xfs_btree_cur_t *tcur; /* temporary cursor */ - - /* - * Set up variables for this block as "left". - */ - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * If we've got no right sibling then we can't shift an entry right. - */ - if (be32_to_cpu(left->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - *stat = 0; - return 0; - } - /* - * Set up the right neighbor as "right". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), - 0, &rbp, XFS_INO_BTREE_REF))) - return error; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(right->bb_numrecs) == XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - /* - * Make a hole at the start of the right neighbor block, then - * copy the last left block entry to the hole. - */ - if (level > 0) { - lkp = XFS_INOBT_KEY_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_INOBT_PTR_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*lpp), level))) - return error; -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_inobt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_inobt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - } else { - lrp = XFS_INOBT_REC_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_inobt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.ir_startino = rrp->ir_startino; - rkp = &key; - } - /* - * Decrement and log left's numrecs, bump and log right's numrecs. - */ - be16_add(&left->bb_numrecs, -1); - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(cur->bc_btnum, rkp, rkp + 1); - else - xfs_btree_check_rec(cur->bc_btnum, rrp, rrp + 1); -#endif - xfs_inobt_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Using a temporary cursor, update the parent key values of the - * block on the right. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - xfs_btree_lastrec(tcur, level); - if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - *stat = 1; - return 0; -} - -/* * Split cur/level block in half. * Return new block number and its first record (to be inserted into parent). */ @@ -1585,6 +1454,64 @@ xfs_inobt_key_diff( } STATIC void +xfs_inobt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_inobt_key_t *kp = &key_addr->inobt; + + kp[index] = newkey->inobt; +} + +STATIC void +xfs_inobt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_inobt_rec_t *rp = &rec_addr->inobt; + + rp[index] = newrec->inobt; +} + +STATIC void +xfs_inobt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_inobt_key_t *kp = &base->inobt; + + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_inobt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_inobt_rec_t *rp = &base->inobt; + + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_inobt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -1735,6 +1662,11 @@ static const struct xfs_btree_ops xfs_in .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, + .set_key = xfs_inobt_set_key, + .set_rec = xfs_inobt_set_rec, + .move_keys = xfs_inobt_move_keys, + .move_recs = xfs_inobt_move_recs, + .copy_keys = xfs_inobt_copy_keys, .copy_recs = xfs_inobt_copy_recs, .log_keys = xfs_inobt_log_keys, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-03 13:23:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-03 13:30:46.000000000 +0200 @@ -53,7 +53,6 @@ STATIC int xfs_bmbt_killroot(xfs_btree_c STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_bmbt_lshift(xfs_btree_cur_t *, int, int *); -STATIC int xfs_bmbt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); @@ -327,7 +326,7 @@ xfs_bmbt_delrec( bno = be64_to_cpu(left->bb_rightsib); if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_bmbt_rshift(tcur, level, &i))) { + if ((error = xfs_btree_rshift(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -538,7 +537,7 @@ xfs_bmbt_insrec( logflags); block = xfs_bmbt_get_block(cur, level, &bp); } else { - if ((error = xfs_bmbt_rshift(cur, level, &i))) { + if ((error = xfs_btree_rshift(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -909,143 +908,6 @@ xfs_bmbt_lshift( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_bmbt_rshift( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop counter */ - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - xfs_bmbt_rec_t *lrp; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp; /* right btree key */ - xfs_bmbt_ptr_t *rpp; /* right address pointer */ - xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */ - struct xfs_btree_cur *tcur; /* temporary btree cursor */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - if (level == cur->bc_nlevels - 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_BMBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(left->bb_rightsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - mp = cur->bc_mp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, be64_to_cpu(left->bb_rightsib), 0, - &rbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - right = XFS_BUF_TO_BMBT_BLOCK(rbp); - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (be16_to_cpu(right->bb_numrecs) == XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_BMAP_PTR_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *lpp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_bmbt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_bmbt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - } else { - lrp = XFS_BMAP_REC_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_bmbt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); - rkp = &key; - } - be16_add(&left->bb_numrecs, -1); - xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(XFS_BTNUM_BMAP, rkp, rkp + 1); - else - xfs_btree_check_rec(XFS_BTNUM_BMAP, rrp, rrp + 1); -#endif - xfs_bmbt_log_block(cur, rbp, XFS_BB_NUMRECS); - if ((error = xfs_btree_dup_cursor(cur, &tcur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(tcur, ERROR); - goto error1; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(tcur, ERROR); - goto error1; - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -error0: - XFS_BMBT_TRACE_CURSOR(cur, ERROR); -error1: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* * Determine the extent state. */ /* ARGSUSED */ @@ -2018,6 +1880,64 @@ xfs_bmbt_key_diff( } STATIC void +xfs_bmbt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_bmbt_key_t *kp = &key_addr->bmbt; + + kp[index] = newkey->bmbt; +} + +STATIC void +xfs_bmbt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_bmbt_rec_t *rp = &rec_addr->bmbt; + + rp[index] = newrec->bmbt; +} + +STATIC void +xfs_bmbt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_bmbt_key_t *kp = &base->bmbt; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_bmbt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_bmbt_rec_t *rp = &base->bmbt; + + ASSERT(from >= 0); + ASSERT(to >= 0); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_bmbt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -2192,6 +2112,10 @@ static const struct xfs_btree_ops xfs_bm .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, + .set_key = xfs_bmbt_set_key, + .set_rec = xfs_bmbt_set_rec, + .move_keys = xfs_bmbt_move_keys, + .move_recs = xfs_bmbt_move_recs, .copy_keys = xfs_bmbt_copy_keys, .copy_recs = xfs_bmbt_copy_recs, .log_keys = xfs_bmbt_log_keys, -- From owner-xfs@oss.sgi.com Sun Aug 3 18:31:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:39 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741VbV7030527 for ; Sun, 3 Aug 2008 18:31:38 -0700 X-ASG-Debug-ID: 1217813571-16ad02eb0000-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 0CB3C1976421 for ; Sun, 3 Aug 2008 18:32:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id hWOxQTv4umzBpmsD for ; Sun, 03 Aug 2008 18:32:51 -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 m741WrIF008934 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:32:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741WruO008932 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:32:53 +0200 Date: Mon, 4 Aug 2008 03:32:53 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 05/26] add a long pointers flag to xfs_btree_cur Subject: [PATCH 05/26] add a long pointers flag to xfs_btree_cur Message-ID: <20080804013253.GF8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-long-flag 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: 1217813572 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: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17330 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 Add a flag to the xfs btree cursor when using long (64bit) block pointers instead of checking btnum == XFS_BTNUM_BMAP. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -90,7 +90,7 @@ xfs_btree_check_block( int level, /* level of the btree block */ xfs_buf_t *bp) /* buffer containing block, if any */ { - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, bp); else @@ -500,7 +500,7 @@ xfs_btree_islastblock( block = xfs_btree_get_block(cur, level, &bp); xfs_btree_check_block(cur, block, level, bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) return be64_to_cpu(block->bb_u.l.bb_rightsib) == NULLDFSBNO; else return be32_to_cpu(block->bb_u.s.bb_rightsib) == NULLAGBLOCK; @@ -792,7 +792,7 @@ xfs_btree_setbuf( if (!bp) return; b = XFS_BUF_TO_BLOCK(bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) { + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { if (be64_to_cpu(b->bb_u.l.bb_leftsib) == NULLDFSBNO) cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA; if (be64_to_cpu(b->bb_u.l.bb_rightsib) == NULLDFSBNO) Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-11 11:13:15.000000000 +0200 @@ -121,11 +121,6 @@ union xfs_btree_rec { #define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1) /* - * Boolean to select which form of xfs_btree_block_t.bb_u to use. - */ -#define XFS_BTREE_LONG_PTRS(btnum) ((btnum) == XFS_BTNUM_BMAP) - -/* * Magic numbers for btree blocks. */ extern const __uint32_t xfs_magics[]; @@ -211,6 +206,7 @@ typedef struct xfs_btree_cur } xfs_btree_cur_t; /* cursor flags */ +#define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -2667,7 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; - cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; + cur->bc_flags = XFS_BTREE_LONG_PTRS | XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; -- From owner-xfs@oss.sgi.com Sun Aug 3 18:30:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:31:18 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741Uv02030321 for ; Sun, 3 Aug 2008 18:30:57 -0700 X-ASG-Debug-ID: 1217813529-16b502c50000-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 844F3197641E for ; Sun, 3 Aug 2008 18:32:09 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id nUE1F5FU4zlqEWE0 for ; Sun, 03 Aug 2008 18:32:09 -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 m741WBIF008884 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:32:11 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741WBVb008881 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:32:11 +0200 Date: Mon, 4 Aug 2008 03:32:11 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 01/26] kill struct xfs_btree_hdr Subject: [PATCH 01/26] kill struct xfs_btree_hdr Message-ID: <20080804013211.GB8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-kill-btree-hdr 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: 1217813531 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.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17326 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 This type is only embedded in struct xfs_btree_block and never used directly. By moving the fields directly into struct xfs_btree_block a lot of the macros for struct xfs_btree_sblock and struct xfs_btree_lblock can be used for struct xfs_btree_block too now which helps greatly with some of the migrations during implementing the generic btree code. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-02 04:01:21.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-02 04:04:22.000000000 +0200 @@ -62,13 +62,13 @@ xfs_btree_maxrecs( case XFS_BTNUM_BNO: case XFS_BTNUM_CNT: return (int)XFS_ALLOC_BLOCK_MAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); + be16_to_cpu(block->bb_level), cur); case XFS_BTNUM_BMAP: return (int)XFS_BMAP_BLOCK_IMAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); + be16_to_cpu(block->bb_level), cur); case XFS_BTNUM_INO: return (int)XFS_INOBT_BLOCK_MAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); + be16_to_cpu(block->bb_level), cur); default: ASSERT(0); return 0; @@ -634,7 +634,7 @@ xfs_btree_firstrec( /* * It's empty, there is no such record. */ - if (!block->bb_h.bb_numrecs) + if (!block->bb_numrecs) return 0; /* * Set the ptr value to 1, that's the first record/key. @@ -663,12 +663,12 @@ xfs_btree_lastrec( /* * It's empty, there is no such record. */ - if (!block->bb_h.bb_numrecs) + if (!block->bb_numrecs) return 0; /* * Set the ptr value to numrecs, that's the last record/key. */ - cur->bc_ptrs[level] = be16_to_cpu(block->bb_h.bb_numrecs); + cur->bc_ptrs[level] = be16_to_cpu(block->bb_numrecs); return 1; } Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-02 04:00:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-02 04:05:00.000000000 +0200 @@ -63,15 +63,10 @@ typedef struct xfs_btree_lblock { /* * Combined header and structure, used by common code. */ -typedef struct xfs_btree_hdr -{ +typedef struct xfs_btree_block { __be32 bb_magic; /* magic number for block type */ __be16 bb_level; /* 0 is a leaf */ __be16 bb_numrecs; /* current # of data records */ -} xfs_btree_hdr_t; - -typedef struct xfs_btree_block { - xfs_btree_hdr_t bb_h; /* header */ union { struct { __be32 bb_leftsib; -- From owner-xfs@oss.sgi.com Sun Aug 3 18:32:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:32:07 -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 m741W2a8030847 for ; Sun, 3 Aug 2008 18:32:03 -0700 X-ASG-Debug-ID: 1217813595-40d501b50000-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 228D7EF6A27 for ; Sun, 3 Aug 2008 18:33:15 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id wRWTlKmdRjaYqMBY for ; Sun, 03 Aug 2008 18:33:15 -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 m741XHIF009000 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:33:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741XHuo008998 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:33:17 +0200 Date: Mon, 4 Aug 2008 03:33:17 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 07/26] refactor btree validation helpers Subject: [PATCH 07/26] refactor btree validation helpers Message-ID: <20080804013317.GH8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-check-refactor 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: 1217813597 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: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17332 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 Move the various btree validation helpers around in xfs_btree.c so that they are close to each other and in common #ifdef DEBUG sections. Also add a new xfs_btree_check_ptr helper to check a btree ptr that can be either long or short form. Split out from a bigger patch from Dave Chinner with various small changes applied by me. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 21:35:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-01 02:34:35.000000000 +0200 @@ -81,24 +81,6 @@ xfs_btree_maxrecs( #ifdef DEBUG /* - * Debug routine: check that block header is ok. - */ -void -xfs_btree_check_block( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer containing block, if any */ -{ - if (cur->bc_flags & XFS_BTREE_LONG_PTRS) - xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, - bp); - else - xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, level, - bp); -} - -/* * Debug routine: check that keys are in the right order. */ void @@ -150,66 +132,8 @@ xfs_btree_check_key( ASSERT(0); } } -#endif /* DEBUG */ /* - * Checking routine: check that long form block header is ok. - */ -/* ARGSUSED */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer for block, if any */ -{ - int lblock_ok; /* block passes checks */ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - lblock_ok = - be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && - be16_to_cpu(block->bb_level) == level && - be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && - block->bb_leftsib && - (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && - block->bb_rightsib && - (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); - if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, - XFS_RANDOM_BTREE_CHECK_LBLOCK))) { - if (bp) - xfs_buftrace("LBTREE ERROR", bp); - XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, - mp); - return XFS_ERROR(EFSCORRUPTED); - } - return 0; -} - -/* - * Checking routine: check that (long) pointer is ok. - */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_dfsbno_t ptr, /* btree block disk address */ - int level) /* btree block level */ -{ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - XFS_WANT_CORRUPTED_RETURN( - level > 0 && - ptr != NULLDFSBNO && - XFS_FSB_SANITY_CHECK(mp, ptr)); - return 0; -} - -#ifdef DEBUG -/* * Debug routine: check that records are in the right order. */ void @@ -268,10 +192,39 @@ xfs_btree_check_rec( } #endif /* DEBUG */ -/* - * Checking routine: check that block header is ok. - */ -/* ARGSUSED */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer for block, if any */ +{ + int lblock_ok; /* block passes checks */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + lblock_ok = + be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && + be16_to_cpu(block->bb_level) == level && + be16_to_cpu(block->bb_numrecs) <= + xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + block->bb_leftsib && + (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && + block->bb_rightsib && + (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); + if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, + XFS_RANDOM_BTREE_CHECK_LBLOCK))) { + if (bp) + xfs_buftrace("LBTREE ERROR", bp); + XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, + mp); + return XFS_ERROR(EFSCORRUPTED); + } + return 0; +} + int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_sblock( xfs_btree_cur_t *cur, /* btree cursor */ @@ -311,27 +264,81 @@ xfs_btree_check_sblock( } /* - * Checking routine: check that (short) pointer is ok. + * Debug routine: check that block header is ok. + */ +int +xfs_btree_check_block( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_block_t *block, /* generic btree block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer containing block, if any */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, + level, bp); + } + + return xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, + level, bp); +} + +/* + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( +xfs_btree_check_lptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ + xfs_dfsbno_t bno, /* btree block disk address */ int level) /* btree block level */ { - xfs_buf_t *agbp; /* buffer for ag. freespace struct */ - xfs_agf_t *agf; /* ag. freespace structure */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + XFS_WANT_CORRUPTED_RETURN( + level > 0 && + bno != NULLDFSBNO && + XFS_FSB_SANITY_CHECK(mp, bno)); + return 0; +} + +/* + * Check that (short) pointer is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sptr( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_agblock_t bno, /* btree block disk address */ + int level) /* btree block level */ +{ + xfs_agblock_t agblocks = cur->bc_mp->m_sb.sb_agblocks; - agbp = cur->bc_private.a.agbp; - agf = XFS_BUF_TO_AGF(agbp); XFS_WANT_CORRUPTED_RETURN( level > 0 && - ptr != NULLAGBLOCK && ptr != 0 && - ptr < be32_to_cpu(agf->agf_length)); + bno != NULLAGBLOCK && + bno != 0 && + bno < agblocks); return 0; } /* + * Check that block ptr is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ + int level) /* btree block level */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lptr(cur, + be64_to_cpu((&ptr->l)[index]), + level); + } + return xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]), level); +} + +/* * Delete the btree cursor. */ void Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 21:35:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-01 02:34:35.000000000 +0200 @@ -223,52 +251,38 @@ typedef struct xfs_btree_cur #ifdef __KERNEL__ -#ifdef DEBUG /* - * Debug routine: check that block header is ok. + * Check that long form block header is ok. */ -void -xfs_btree_check_block( +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Debug routine: check that keys are in the right order. - */ -void -xfs_btree_check_key( - xfs_btnum_t btnum, /* btree identifier */ - void *ak1, /* pointer to left (lower) key */ - void *ak2); /* pointer to right (higher) key */ - -/* - * Debug routine: check that records are in the right order. + * Check that short form block header is ok. */ -void -xfs_btree_check_rec( - xfs_btnum_t btnum, /* btree identifier */ - void *ar1, /* pointer to left (lower) record */ - void *ar2); /* pointer to right (higher) record */ -#else -#define xfs_btree_check_block(a,b,c,d) -#define xfs_btree_check_key(a,b,c) -#define xfs_btree_check_rec(a,b,c) -#endif /* DEBUG */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_sblock_t *block, /* btree short form block pointer */ + int level, /* level of the btree block */ + struct xfs_buf *bp); /* buffer containing block */ /* - * Checking routine: check that long form block header is ok. + * Check that block header is ok. */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( +int +xfs_btree_check_block( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ + xfs_btree_block_t *block, /* generic btree block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Checking routine: check that (long) pointer is ok. + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_lptr( @@ -279,25 +293,50 @@ xfs_btree_check_lptr( #define xfs_btree_check_lptr_disk(cur, ptr, level) \ xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level) + /* - * Checking routine: check that short form block header is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sblock( +xfs_btree_check_sptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_sblock_t *block, /* btree short form block pointer */ - int level, /* level of the btree block */ - struct xfs_buf *bp); /* buffer containing block */ + xfs_agblock_t ptr, /* btree block disk address */ + int level); /* btree block level */ /* - * Checking routine: check that (short) pointer is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ int level); /* btree block level */ +#ifdef DEBUG + +/* + * Debug routine: check that keys are in the right order. + */ +void +xfs_btree_check_key( + xfs_btnum_t btnum, /* btree identifier */ + void *ak1, /* pointer to left (lower) key */ + void *ak2); /* pointer to right (higher) key */ + +/* + * Debug routine: check that records are in the right order. + */ +void +xfs_btree_check_rec( + xfs_btnum_t btnum, /* btree identifier */ + void *ar1, /* pointer to left (lower) record */ + void *ar2); /* pointer to right (higher) record */ +#else +#define xfs_btree_check_key(a,b,c) +#define xfs_btree_check_rec(a,b,c) +#endif /* DEBUG */ + /* * Delete the btree cursor. */ -- From owner-xfs@oss.sgi.com Sun Aug 3 18:34:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:34:29 -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=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_46, J_CHICKENPOX_47,J_CHICKENPOX_48,J_CHICKENPOX_63,J_CHICKENPOX_66 autolearn=no 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 m741YHKQ001058 for ; Sun, 3 Aug 2008 18:34:17 -0700 X-ASG-Debug-ID: 1217813728-40cc01ad0000-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 21391EF6ABA for ; Sun, 3 Aug 2008 18:35:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id X86ZcbO7M0l71UhA for ; Sun, 03 Aug 2008 18:35:28 -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 m741ZUIF009261 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:35:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741ZU7i009259 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:35:30 +0200 Date: Mon, 4 Aug 2008 03:35:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 20/26] move xfs_bmbt_newroot to common code Subject: [PATCH 20/26] move xfs_bmbt_newroot to common code Message-ID: <20080804013530.GU8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-iroot_to_root 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: 1217813731 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.1689 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17343 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 xfs_bmbt_newroot is a mostly generic implementation of moving from an inode root to a real block based root. So move it to xfs_btree.c where it can use all the nice infrastructure there and make it pointer size agnostic The new name for it is xfs_btree_iroot_to_root which is not very nice but at least slightly more descriptive than the old name. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-03 15:34:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-03 22:42:26.000000000 +0200 @@ -2250,6 +2250,106 @@ error0: } /* + * Give the btree a real root block. Copy the old broot contents + * down into a real block and make the broot point to it. + */ +int /* error */ +xfs_btree_iroot_to_root( + struct xfs_btree_cur *cur, /* btree cursor */ + int *logflags, /* logging flags for inode */ + int *stat) /* return status - 0 fail */ +{ + struct xfs_buf *bp; /* buffer for block */ + struct xfs_buf *cbp; /* buffer for cblock */ + struct xfs_btree_block *block; /* btree block */ + struct xfs_btree_block *cblock; /* child btree block */ + union xfs_btree_key *ckp; /* child key pointer */ + union xfs_btree_ptr *cpp; /* child ptr pointer */ + union xfs_btree_key *kp; /* pointer to btree key */ + union xfs_btree_ptr *pp; /* pointer to block addr */ + union xfs_btree_ptr nptr; /* new block addr */ + int level; /* btree level */ + int error; /* error return code */ +#ifdef DEBUG + int i; /* loop counter */ +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, newroot); + + level = cur->bc_nlevels - 1; + /* XXX(hch): this should be an get_inode_from_root, right? */ + block = xfs_btree_get_block(cur, level, &bp); + pp = cur->bc_ops->ptr_addr(cur, 1, block); + + /* Allocate the new block. If we can't do it, we're toast. Give up. */ + error = cur->bc_ops->alloc_block(cur, pp, &nptr, 1, stat); + if (error) + goto error0; + if (*stat == 0) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + } + XFS_BTREE_STATS_INC(cur, alloc); + + /* Copy the root into a real block. */ + error = xfs_btree_get_buf_block(cur, &nptr, 0, &cblock, &cbp); + if (error) + goto error0; + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + memcpy(cblock, block, sizeof(struct xfs_btree_lblock)); + else + memcpy(cblock, block, sizeof(struct xfs_btree_sblock)); + + be16_add(&block->bb_level, 1); + xfs_btree_set_numrecs(block, 1); + cur->bc_nlevels++; + cur->bc_ptrs[level + 1] = 1; + + kp = cur->bc_ops->key_addr(cur, 1, block); + ckp = cur->bc_ops->key_addr(cur, 1, cblock); + cur->bc_ops->copy_keys(cur, kp, ckp, xfs_btree_get_numrecs(cblock)); + + cpp = cur->bc_ops->ptr_addr(cur, 1, cblock); +#ifdef DEBUG + for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { + error = xfs_btree_check_ptr(cur, pp, i, level); + if (error) + goto error0; + } +#endif + xfs_btree_copy_ptrs(cur, pp, cpp, xfs_btree_get_numrecs(cblock)); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, &nptr, 0, level); + if (error) + goto error0; +#endif + xfs_btree_set_ptr(cur, pp, 0, &nptr); + + cur->bc_ops->realloc_root(cur, 1 - xfs_btree_get_numrecs(cblock)); + xfs_btree_setbuf(cur, level, cbp); + + /* + * Do all this logging at the end so that + * the root is at the right level. + */ + xfs_btree_log_block(cur, cbp, XFS_BB_ALL_BITS); + cur->bc_ops->log_keys(cur, cbp, 1, be16_to_cpu(cblock->bb_numrecs)); + xfs_btree_log_ptrs(cur, cbp, 1, be16_to_cpu(cblock->bb_numrecs)); + + *logflags |= + XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork); + *stat = 1; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + +/* * Allocate a new root block, fill it in. */ int /* error */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-03 16:02:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-03 22:42:26.000000000 +0200 @@ -476,7 +476,7 @@ xfs_bmap_add_attrfork_btree( goto error0; /* must be at least one entry */ XFS_WANT_CORRUPTED_GOTO(stat == 1, error0); - if ((error = xfs_bmbt_newroot(cur, flags, &stat))) + if ((error = xfs_btree_iroot_to_root(cur, flags, &stat))) goto error0; if (stat == 0) { xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-03 15:34:19.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-03 22:42:25.000000000 +0200 @@ -525,7 +525,7 @@ xfs_bmbt_insrec( cur->bc_private.b.whichfork); block = xfs_bmbt_get_block(cur, level, &bp); } else if (level == cur->bc_nlevels - 1) { - if ((error = xfs_bmbt_newroot(cur, &logflags, stat)) || + if ((error = xfs_btree_iroot_to_root(cur, &logflags, stat)) || *stat == 0) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; @@ -1119,117 +1119,6 @@ xfs_bmbt_log_block( } /* - * Give the bmap btree a new root block. Copy the old broot contents - * down into a real block and make the broot point to it. - */ -int /* error */ -xfs_bmbt_newroot( - xfs_btree_cur_t *cur, /* btree cursor */ - int *logflags, /* logging flags for inode */ - int *stat) /* return status - 0 fail */ -{ - xfs_alloc_arg_t args; /* allocation arguments */ - xfs_bmbt_block_t *block; /* bmap btree block */ - xfs_buf_t *bp; /* buffer for block */ - xfs_bmbt_block_t *cblock; /* child btree block */ - xfs_bmbt_key_t *ckp; /* child key pointer */ - xfs_bmbt_ptr_t *cpp; /* child ptr pointer */ - int error; /* error return code */ -#ifdef DEBUG - int i; /* loop counter */ -#endif - xfs_bmbt_key_t *kp; /* pointer to bmap btree key */ - int level; /* btree level */ - xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - level = cur->bc_nlevels - 1; - block = xfs_bmbt_get_block(cur, level, &bp); - /* - * Copy the root into a real block. - */ - args.mp = cur->bc_mp; - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); - args.tp = cur->bc_tp; - args.fsbno = cur->bc_private.b.firstblock; - args.mod = args.minleft = args.alignment = args.total = args.isfl = - args.userdata = args.minalignslop = 0; - args.minlen = args.maxlen = args.prod = 1; - args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; - args.firstblock = args.fsbno; - if (args.fsbno == NULLFSBLOCK) { -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *pp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - args.fsbno = be64_to_cpu(*pp); - args.type = XFS_ALLOCTYPE_START_BNO; - } else if (cur->bc_private.b.flist->xbf_low) - args.type = XFS_ALLOCTYPE_START_BNO; - else - args.type = XFS_ALLOCTYPE_NEAR_BNO; - if ((error = xfs_alloc_vextent(&args))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (args.fsbno == NULLFSBLOCK) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - ASSERT(args.len == 1); - cur->bc_private.b.firstblock = args.fsbno; - cur->bc_private.b.allocated++; - cur->bc_private.b.ip->i_d.di_nblocks++; - XFS_TRANS_MOD_DQUOT_BYINO(args.mp, args.tp, cur->bc_private.b.ip, - XFS_TRANS_DQ_BCOUNT, 1L); - bp = xfs_btree_get_bufl(args.mp, cur->bc_tp, args.fsbno, 0); - cblock = XFS_BUF_TO_BMBT_BLOCK(bp); - *cblock = *block; - be16_add(&block->bb_level, 1); - block->bb_numrecs = cpu_to_be16(1); - cur->bc_nlevels++; - cur->bc_ptrs[level + 1] = 1; - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - ckp = XFS_BMAP_KEY_IADDR(cblock, 1, cur); - memcpy(ckp, kp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*kp)); - cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { - if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memcpy(cpp, pp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*pp)); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, args.fsbno, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *pp = cpu_to_be64(args.fsbno); - xfs_iroot_realloc(cur->bc_private.b.ip, 1 - be16_to_cpu(cblock->bb_numrecs), - cur->bc_private.b.whichfork); - xfs_btree_setbuf(cur, level, bp); - /* - * Do all this logging at the end so that - * the root is at the right level. - */ - xfs_bmbt_log_block(cur, bp, XFS_BB_ALL_BITS); - xfs_bmbt_log_keys(cur, bp, 1, be16_to_cpu(cblock->bb_numrecs)); - xfs_bmbt_log_ptrs(cur, bp, 1, be16_to_cpu(cblock->bb_numrecs)); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *logflags |= - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork); - *stat = 1; - return 0; -} - -/* * Set all the fields in a bmap extent record from the arguments. */ void @@ -1593,6 +1482,15 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC void +xfs_bmbt_realloc_root( + struct xfs_btree_cur *cur, + int index) +{ + xfs_iroot_realloc(cur->bc_private.b.ip, index, + cur->bc_private.b.whichfork); +} + STATIC int xfs_bmbt_get_maxrecs( struct xfs_btree_cur *cur, @@ -1881,6 +1779,7 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .realloc_root = xfs_bmbt_realloc_root, .alloc_block = xfs_bmbt_alloc_block, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-03 16:01:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-03 22:42:26.000000000 +0200 @@ -255,12 +255,6 @@ extern void xfs_bmbt_log_block(struct xf extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); -/* - * Give the bmap btree a new root block. Copy the old broot contents - * down into a real block and make the broot point to it. - */ -extern int xfs_bmbt_newroot(struct xfs_btree_cur *cur, int *lflags, int *stat); - extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o, xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-03 15:59:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-03 22:42:25.000000000 +0200 @@ -183,8 +183,9 @@ struct xfs_btree_ops { /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); - /* get inode rooted btree root */ + /* btree root in inode support */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + void (*realloc_root)(struct xfs_btree_cur *cur, int index); /* btree root operations */ void (*set_root)(struct xfs_btree_cur *cur, @@ -586,6 +587,7 @@ int xfs_btree_rshift(struct xfs_btree_cu int xfs_btree_split(struct xfs_btree_cur *, int, union xfs_btree_ptr *, union xfs_btree_key *, struct xfs_btree_cur **, int *); int xfs_btree_new_root(struct xfs_btree_cur *, int *); +int xfs_btree_iroot_to_root(struct xfs_btree_cur *, int *, int *); /* -- From owner-xfs@oss.sgi.com Sun Aug 3 18:45:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:45:03 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m741j0ii004526 for ; Sun, 3 Aug 2008 18:45:01 -0700 X-ASG-Debug-ID: 1217814373-16ac03850000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B925C197648C for ; Sun, 3 Aug 2008 18:46:13 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 0G9RyZxwt2Hedihn for ; Sun, 03 Aug 2008 18:46:13 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwMAJP6lUh5LBjh/2dsb2JhbACKZKMZ X-IronPort-AV: E=Sophos;i="4.31,302,1215354600"; d="scan'208";a="163497816" Received: from ppp121-44-24-225.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.24.225]) by ipmail01.adl6.internode.on.net with ESMTP; 04 Aug 2008 11:16:11 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KPp9G-0001Xz-I0; Mon, 04 Aug 2008 11:46:10 +1000 Date: Mon, 4 Aug 2008 11:46:10 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 01/26] kill struct xfs_btree_hdr Subject: Re: [PATCH 01/26] kill struct xfs_btree_hdr Message-ID: <20080804014610.GD6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013211.GB8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013211.GB8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217814374 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.1688 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17351 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:32:11AM +0200, Christoph Hellwig wrote: > This type is only embedded in struct xfs_btree_block and never used > directly. By moving the fields directly into struct xfs_btree_block > a lot of the macros for struct xfs_btree_sblock and struct xfs_btree_lblock > can be used for struct xfs_btree_block too now which helps greatly > with some of the migrations during implementing the generic btree code. Looks fine. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 3 18:50:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:50:55 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_64,J_CHICKENPOX_65 autolearn=no 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 m741YeFP001455 for ; Sun, 3 Aug 2008 18:34:40 -0700 X-ASG-Debug-ID: 1217813750-739d01d20000-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 06C513566D5 for ; Sun, 3 Aug 2008 18:35:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id W3LPQ4D8y3yUKQQH for ; Sun, 03 Aug 2008 18:35:50 -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 m741ZoIF009311 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 4 Aug 2008 03:35:50 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m741ZoEA009309 for xfs@oss.sgi.com; Mon, 4 Aug 2008 03:35:50 +0200 Date: Mon, 4 Aug 2008 03:35:50 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 23/26] implement generic xfs_btree_delete/delrec Subject: [PATCH 23/26] implement generic xfs_btree_delete/delrec Message-ID: <20080804013550.GX8819@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-delete 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: 1217813753 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: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1687 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17352 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 Make the btree delete code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-04 01:18:45.000000000 +0200 @@ -2943,3 +2943,639 @@ out0: XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); return 0; } + +STATIC int +xfs_btree_dec_cursor( + struct xfs_btree_cur *cur, + int level, + int *stat) +{ + int error; + int i; + + if (level > 0) { + error = xfs_btree_decrement(cur, level, &i); + if (error) + return error; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +} + +STATIC int +xfs_btree_update_root( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int level, + union xfs_btree_ptr *newroot) +{ + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, killroot); + +#ifdef DEBUG + if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_CNT) { + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + + ASSERT(be32_to_cpu(agf->agf_roots[cur->bc_btnum]) == + XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); + } else if (cur->bc_btnum == XFS_BTNUM_INO) { + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + xfs_fsblock_t fsbno; + + fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, + be32_to_cpu(agi->agi_root)); + + ASSERT(fsbno == XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp))); + } +#endif + + /* + * Update the root pointer, decreasing the level by 1 and then + * free the old root. + */ + cur->bc_ops->set_root(cur, newroot, -1); + error = cur->bc_ops->free_block(cur, bp, 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + XFS_BTREE_STATS_INC(cur, free); + + /* Update the cursor so there's one fewer level. */ + xfs_btree_setbuf(cur, level, NULL); + cur->bc_nlevels--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + +/* + * Single level of the btree record deletion routine. + * Delete record pointed to by cur/level. + * Remove the record from its block then rebalance the tree. + * Return 0 for error, 1 for done, 2 to go on to the next level. + */ +STATIC int /* error */ +xfs_btree_delrec( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level removing record from */ + int *stat) /* fail/done/go-on */ +{ + struct xfs_btree_block *block; /* bmap btree block */ + union xfs_btree_ptr cptr; /* current block ptr */ + struct xfs_buf *bp; /* buffer for block */ + int error; /* error return value */ + int i; /* loop counter */ + union xfs_btree_key key; /* bmap btree key */ + union xfs_btree_ptr lptr; /* left sibling block ptr */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + int lrecs = 0; /* left record count */ + int ptr; /* key/record index */ + union xfs_btree_ptr rptr; /* right sibling block ptr */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + struct xfs_btree_block *rrblock; /* right-right btree block */ + struct xfs_buf *rrbp; /* right-right buffer pointer */ + int rrecs = 0; /* right record count */ + struct xfs_btree_cur *tcur; /* temporary btree cursor */ + int numrecs; /* temporary numrec count */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + tcur = NULL; + + /* Get the index of the entry being deleted, check for nothing there. */ + ptr = cur->bc_ptrs[level]; + if (ptr == 0) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + /* Get the buffer & block containing the record or key/ptr. */ + block = xfs_btree_get_block(cur, level, &bp); + numrecs = xfs_btree_get_numrecs(block); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* Fail if we're off the end of the block. */ + if (ptr > numrecs) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + XFS_BTREE_STATS_INC(cur, delrec); + XFS_BTREE_STATS_ADD(cur, moves, numrecs - ptr); + + /* Excise the entries being deleted. */ + if (level > 0) { + /* It's a nonleaf. operate on keys and ptrs */ + union xfs_btree_key *lkp; /* pointer to bmap btree key */ + union xfs_btree_ptr *lpp; /* pointer to bmap block addr */ + + lkp = cur->bc_ops->key_addr(cur, 1, block); + lpp = cur->bc_ops->ptr_addr(cur, 1, block); + +#ifdef DEBUG + for (i = ptr; i < numrecs; i++) { + error = xfs_btree_check_ptr(cur, lpp, i, level); + if (error) + goto error0; + } +#endif + + if (ptr < numrecs) { + cur->bc_ops->move_keys(cur, lkp, ptr, ptr - 1, + numrecs - ptr); + xfs_btree_move_ptrs(cur, lpp, ptr, ptr - 1, + numrecs - ptr); + cur->bc_ops->log_keys(cur, bp, ptr, numrecs - 1); + xfs_btree_log_ptrs(cur, bp, ptr, numrecs - 1); + } + } else { + /* It's a leaf. operate on records */ + union xfs_btree_rec *lrp; /* pointer to bmap btree rec */ + + lrp = cur->bc_ops->rec_addr(cur, 1, block); + if (ptr < numrecs) { + cur->bc_ops->move_recs(cur, lrp, ptr, ptr - 1, + numrecs - ptr); + cur->bc_ops->log_recs(cur, bp, ptr, numrecs - 1); + } + + /* + * If it's the first record in the block, we'll need a key + * structure to pass up to the next level (updkey). + */ + if (ptr == 1) + cur->bc_ops->init_key_from_rec(cur, &key, lrp); + } + + /* + * Decrement and log the number of entries in the block. + */ + xfs_btree_set_numrecs(block, --numrecs); + xfs_btree_log_block(cur, bp, XFS_BB_NUMRECS); + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, level)) { + cur->bc_ops->update_lastrec(cur, block, NULL, + ptr, LASTREC_DELREC); + } + + /* + * We're at the root level. First, shrink the root block in-memory. + * Try to get rid of the next level down. If we can't then there's + * nothing left to do. + */ + if (level == cur->bc_nlevels - 1) { + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { + cur->bc_ops->realloc_root(cur, -1); + + error = xfs_btree_root_to_iroot(cur); + if (error) + goto error0; + + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + *stat = 1; + return 0; + } + + /* + * If this is the root level, and there's only one entry left, + * and it's NOT the leaf level, then we can get rid of this + * level. + */ + if (numrecs == 1 && level > 0) { + union xfs_btree_ptr *pp; + /* + * pp is still set to the first pointer in the block. + * Make it the new root of the btree. + */ + pp = cur->bc_ops->ptr_addr(cur, 1, block); + error = xfs_btree_update_root(cur, bp, level, pp); + if (error) + goto error0; + } else if (level > 0) { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + } + *stat = 1; + return 0; + } + + /* + * If we deleted the leftmost entry in the block, update the + * key values above us in the tree. + */ + if (ptr == 1) { + error = xfs_btree_updkey(cur, &key, level + 1); + if (error) + goto error0; + } + + /* + * If the number of records remaining in the block is at least + * the minimum, we're done. + */ + if (numrecs >= cur->bc_ops->get_minrecs(cur, level)) { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + + /* + * Otherwise, we have to move some records around to keep the + * tree balanced. Look at the left and right sibling blocks to + * see if we can re-balance by moving only one record. + */ + xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); + xfs_btree_get_sibling(cur, block, &lptr, XFS_BB_LEFTSIB); + + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { + /* + * One child of root, need to get a chance to copy its contents + * into the root and delete it. Can't go up to next level, + * there's nothing to delete there. + */ + if (xfs_btree_ptr_is_null(cur, &rptr) && + xfs_btree_ptr_is_null(cur, &lptr) && + level == cur->bc_nlevels - 2) { + error = xfs_btree_root_to_iroot(cur); + if (!error) + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + } + + ASSERT(!xfs_btree_ptr_is_null(cur, &rptr) || + !xfs_btree_ptr_is_null(cur, &lptr)); + + /* + * Duplicate the cursor so our btree manipulations here won't + * disrupt the next level up. + */ + error = xfs_btree_dup_cursor(cur, &tcur); + if (error) + goto error0; + + /* + * If there's a right sibling, see if it's ok to shift an entry + * out of it. + */ + if (!xfs_btree_ptr_is_null(cur, &rptr)) { + /* + * Move the temp cursor to the last entry in the next block. + * Actually any entry but the first would suffice. + */ + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_increment(tcur, level, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + /* Grab a pointer to the block. */ + right = xfs_btree_get_block(tcur, level, &rbp); +#ifdef DEBUG + error = xfs_btree_check_block(tcur, right, level, rbp); + if (error) + goto error0; +#endif + /* Grab the current block number, for future use. */ + xfs_btree_get_sibling(tcur, right, &cptr, XFS_BB_LEFTSIB); + + /* + * If right block is full enough so that removing one entry + * won't make it too empty, and left-shifting an entry out + * of right to us works, we're done. + */ + if (xfs_btree_get_numrecs(right) - 1 >= + cur->bc_ops->get_minrecs(tcur, level)) { + error = xfs_btree_lshift(tcur, level, &i); + if (error) + goto error0; + if (i) { + ASSERT(xfs_btree_get_numrecs(block) >= + cur->bc_ops->get_minrecs(tcur, level)); + + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + } + + /* + * Otherwise, grab the number of records in right for + * future reference, and fix up the temp cursor to point + * to our block again (last record). + */ + rrecs = xfs_btree_get_numrecs(right); + if (!xfs_btree_ptr_is_null(cur, &lptr)) { + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_decrement(tcur, level, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + } + } + + /* + * If there's a left sibling, see if it's ok to shift an entry + * out of it. + */ + if (!xfs_btree_ptr_is_null(cur, &lptr)) { + /* + * Move the temp cursor to the first entry in the + * previous block. + */ + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_decrement(tcur, level, &i); + if (error) + goto error0; + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + /* Grab a pointer to the block. */ + left = xfs_btree_get_block(tcur, level, &lbp); +#ifdef DEBUG + error = xfs_btree_check_block(cur, left, level, lbp); + if (error) + goto error0; +#endif + /* Grab the current block number, for future use. */ + xfs_btree_get_sibling(tcur, left, &cptr, XFS_BB_RIGHTSIB); + + /* + * If left block is full enough so that removing one entry + * won't make it too empty, and right-shifting an entry out + * of left to us works, we're done. + */ + if (xfs_btree_get_numrecs(left) - 1 >= + cur->bc_ops->get_minrecs(tcur, level)) { + error = xfs_btree_rshift(tcur, level, &i); + if (error) + goto error0; + if (i) { + ASSERT(xfs_btree_get_numrecs(block) >= + cur->bc_ops->get_minrecs(tcur, level)); + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + if (level == 0) + cur->bc_ptrs[0]++; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + } + } + + /* + * Otherwise, grab the number of records in right for + * future reference. + */ + lrecs = xfs_btree_get_numrecs(left); + } + + /* Delete the temp cursor, we're done with it. */ + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + + /* If here, we need to do a join to keep the tree balanced. */ + ASSERT(!xfs_btree_ptr_is_null(cur, &cptr)); + + if (!xfs_btree_ptr_is_null(cur, &lptr) && + lrecs + xfs_btree_get_numrecs(block) <= + cur->bc_ops->get_maxrecs(cur, level)) { + /* + * Set "right" to be the starting block, + * "left" to be the left neighbor. + */ + rptr = cptr; + right = block; + rbp = bp; + error = xfs_btree_read_buf_block(cur, &lptr, level, + 0, &left, &lbp); + if (error) + goto error0; + + /* + * If that won't work, see if we can join with the right neighbor block. + */ + } else if (!xfs_btree_ptr_is_null(cur, &rptr) && + rrecs + xfs_btree_get_numrecs(block) <= + cur->bc_ops->get_maxrecs(cur, level)) { + /* + * Set "left" to be the starting block, + * "right" to be the right neighbor. + */ + lptr = cptr; + left = block; + lbp = bp; + error = xfs_btree_read_buf_block(cur, &rptr, level, + 0, &right, &rbp); + if (error) + goto error0; + + /* + * Otherwise, we can't fix the imbalance. + * Just return. This is probably a logic error, but it's not fatal. + */ + } else { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + + rrecs = xfs_btree_get_numrecs(right); + lrecs = xfs_btree_get_numrecs(left); + + /* + * We're now going to join "left" and "right" by moving all the stuff + * in "right" to "left" and deleting "right". + */ + XFS_BTREE_STATS_ADD(cur, moves, rrecs); + if (level > 0) { + /* It's a non-leaf. Move keys and pointers. */ + union xfs_btree_key *lkp; /* left btree key */ + union xfs_btree_ptr *lpp; /* left address pointer */ + union xfs_btree_key *rkp; /* right btree key */ + union xfs_btree_ptr *rpp; /* right address pointer */ + + lkp = cur->bc_ops->key_addr(cur, lrecs + 1, left); + lpp = cur->bc_ops->ptr_addr(cur, lrecs + 1, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); +#ifdef DEBUG + for (i = 1; i < rrecs; i++) { + error = xfs_btree_check_ptr(cur, rpp, i, level); + if (error) + goto error0; + } +#endif + cur->bc_ops->copy_keys(cur, rkp, lkp, rrecs); + xfs_btree_copy_ptrs(cur, rpp, lpp, rrecs); + + cur->bc_ops->log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); + xfs_btree_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); + } else { + /* It's a leaf. Move records. */ + union xfs_btree_rec *lrp; /* left record pointer */ + union xfs_btree_rec *rrp; /* right record pointer */ + + lrp = cur->bc_ops->rec_addr(cur, lrecs + 1, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->copy_recs(cur, rrp, lrp, rrecs); + cur->bc_ops->log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); + } + + XFS_BTREE_STATS_INC(cur, join); + + /* + * Fix up the the number of records and right block pointer in the + * surviving block, and log it. + */ + xfs_btree_set_numrecs(left, lrecs + rrecs); + xfs_btree_get_sibling(cur, right, &cptr, XFS_BB_RIGHTSIB), + xfs_btree_set_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); + + /* If there is a right sibling, point it to the remaining block. */ + xfs_btree_get_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &cptr)) { + error = xfs_btree_read_buf_block(cur, &cptr, level, + 0, &rrblock, &rrbp); + if (error) + goto error0; + xfs_btree_set_sibling(cur, rrblock, &lptr, XFS_BB_LEFTSIB); + xfs_btree_log_block(cur, rrbp, XFS_BB_LEFTSIB); + } + /* Free the deleted block. */ + error = cur->bc_ops->free_block(cur, rbp, 1); + if (error) + goto error0; + XFS_BTREE_STATS_INC(cur, free); + + /* + * If we joined with the left neighbor, set the buffer in the + * cursor to the left block, and fix up the index. + */ + if (bp != lbp) { + cur->bc_bufs[level] = lbp; + cur->bc_ptrs[level] += lrecs; + cur->bc_ra[level] = 0; + } + /* + * If we joined with the right neighbor and there's a level above + * us, increment the cursor at that level. + */ + else if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || + (level + 1 < cur->bc_nlevels)) { + error = xfs_btree_increment(cur, level + 1, &i); + if (error) + goto error0; + } + + /* + * Readjust the ptr at this level if it's not a leaf, since it's + * still pointing at the deletion point, which makes the cursor + * inconsistent. If this makes the ptr 0, the caller fixes it up. + * We can't use decrement because it would change the next level up. + */ + if (level > 0) + cur->bc_ptrs[level]--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + /* Return value means the next level up has something to do. */ + *stat = 2; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + if (tcur) + xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); + return error; +} + +/* + * Delete the record pointed to by cur. + * The cursor refers to the place where the record was (could be inserted) + * when the operation returns. + */ +int /* error */ +xfs_btree_delete( + struct xfs_btree_cur *cur, + int *stat) /* success/failure */ +{ + int error; /* error return value */ + int level; + int i; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + /* + * Go up the tree, starting at leaf level. + * + * If 2 is returned then a join was done; go to the next level. + * Otherwise we are done. + */ + for (level = 0, i = 2; i == 2; level++) { + error = xfs_btree_delrec(cur, level, &i); + if (error) + goto error0; + } + + if (i == 0) { + for (level = 1; level < cur->bc_nlevels; level++) { + if (cur->bc_ptrs[level] == 0) { + error = xfs_btree_decrement(cur, level, &i); + if (error) + goto error0; + break; + } + } + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = i; + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-08-04 01:18:45.000000000 +0200 @@ -40,638 +40,6 @@ #include "xfs_alloc.h" #include "xfs_error.h" -/* - * Prototypes for internal functions. - */ - -STATIC void xfs_alloc_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_allocbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -#define xfs_alloc_log_keys(c, b, i, j) \ - xfs_allocbt_log_keys(c, b, i, j) -STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -#define xfs_alloc_log_recs(c, b, i, j) \ - xfs_allocbt_log_recs(c, b, i, j) - -/* - * Internal functions. - */ - -/* - * Single level of the xfs_alloc_delete record deletion routine. - * Delete record pointed to by cur/level. - * Remove the record from its block then rebalance the tree. - * Return 0 for error, 1 for done, 2 to go on to the next level. - */ -STATIC int /* error */ -xfs_alloc_delrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level removing record from */ - int *stat) /* fail/done/go-on */ -{ - xfs_agf_t *agf; /* allocation group freelist header */ - xfs_alloc_block_t *block; /* btree block record/key lives in */ - xfs_agblock_t bno; /* btree block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_alloc_key_t key; /* kp points here if block is level 0 */ - xfs_agblock_t lbno; /* left block's block number */ - xfs_buf_t *lbp; /* left block's buffer pointer */ - xfs_alloc_block_t *left; /* left btree block */ - xfs_alloc_key_t *lkp=NULL; /* left block key pointer */ - xfs_alloc_ptr_t *lpp=NULL; /* left block address pointer */ - int lrecs=0; /* number of records in left block */ - xfs_alloc_rec_t *lrp; /* left block record pointer */ - xfs_mount_t *mp; /* mount structure */ - int ptr; /* index in btree block for this rec */ - xfs_agblock_t rbno; /* right block's block number */ - xfs_buf_t *rbp; /* right block's buffer pointer */ - xfs_alloc_block_t *right; /* right btree block */ - xfs_alloc_key_t *rkp; /* right block key pointer */ - xfs_alloc_ptr_t *rpp; /* right block address pointer */ - int rrecs=0; /* number of records in right block */ - int numrecs; - xfs_alloc_rec_t *rrp; /* right block record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - - /* - * Get the index of the entry being deleted, check for nothing there. - */ - ptr = cur->bc_ptrs[level]; - if (ptr == 0) { - *stat = 0; - return 0; - } - /* - * Get the buffer & block containing the record or key/ptr. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Fail if we're off the end of the block. - */ - numrecs = be16_to_cpu(block->bb_numrecs); - if (ptr > numrecs) { - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_abt_delrec); - /* - * It's a nonleaf. Excise the key and ptr being deleted, by - * sliding the entries past them down one. - * Log the changed areas of the block. - */ - if (level > 0) { - lkp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - lpp = XFS_ALLOC_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(lpp[i]), level))) - return error; - } -#endif - if (ptr < numrecs) { - memmove(&lkp[ptr - 1], &lkp[ptr], - (numrecs - ptr) * sizeof(*lkp)); - memmove(&lpp[ptr - 1], &lpp[ptr], - (numrecs - ptr) * sizeof(*lpp)); - xfs_alloc_log_ptrs(cur, bp, ptr, numrecs - 1); - xfs_alloc_log_keys(cur, bp, ptr, numrecs - 1); - } - } - /* - * It's a leaf. Excise the record being deleted, by sliding the - * entries past it down one. Log the changed areas of the block. - */ - else { - lrp = XFS_ALLOC_REC_ADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&lrp[ptr - 1], &lrp[ptr], - (numrecs - ptr) * sizeof(*lrp)); - xfs_alloc_log_recs(cur, bp, ptr, numrecs - 1); - } - /* - * If it's the first record in the block, we'll need a key - * structure to pass up to the next level (updkey). - */ - if (ptr == 1) { - key.ar_startblock = lrp->ar_startblock; - key.ar_blockcount = lrp->ar_blockcount; - lkp = &key; - } - } - /* - * Decrement and log the number of entries in the block. - */ - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_alloc_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); - /* - * See if the longest free extent in the allocation group was - * changed by this operation. True if it's the by-size btree, and - * this is the leaf level, and there is no right sibling block, - * and this was the last record. - */ - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - mp = cur->bc_mp; - - if (level == 0 && - cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - ptr > numrecs) { - ASSERT(ptr == numrecs + 1); - /* - * There are still records in the block. Grab the size - * from the last one. - */ - if (numrecs) { - rrp = XFS_ALLOC_REC_ADDR(block, numrecs, cur); - agf->agf_longest = rrp->ar_blockcount; - } - /* - * No free extents left. - */ - else - agf->agf_longest = 0; - mp->m_perag[be32_to_cpu(agf->agf_seqno)].pagf_longest = - be32_to_cpu(agf->agf_longest); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Is this the root level? If so, we're almost done. - */ - if (level == cur->bc_nlevels - 1) { - /* - * If this is the root level, - * and there's only one entry left, - * and it's NOT the leaf level, - * then we can get rid of this level. - */ - if (numrecs == 1 && level > 0) { - /* - * lpp is still set to the first pointer in the block. - * Make it the new root of the btree. - */ - bno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); - agf->agf_roots[cur->bc_btnum] = *lpp; - be32_add(&agf->agf_levels[cur->bc_btnum], -1); - mp->m_perag[be32_to_cpu(agf->agf_seqno)].pagf_levels[cur->bc_btnum]--; - /* - * Put this buffer/block on the ag's freelist. - */ - error = xfs_alloc_put_freelist(cur->bc_tp, - cur->bc_private.a.agbp, NULL, bno, 1); - if (error) - return error; - /* - * Since blocks move to the free list without the - * coordination used in xfs_bmap_finish, we can't allow - * block to be available for reallocation and - * non-transaction writing (user data) until we know - * that the transaction that moved it to the free list - * is permanently on disk. We track the blocks by - * declaring these blocks as "busy"; the busy list is - * maintained on a per-ag basis and each transaction - * records which entries should be removed when the - * iclog commits to disk. If a busy block is - * allocated, the iclog is pushed up to the LSN - * that freed the block. - */ - xfs_alloc_mark_busy(cur->bc_tp, - be32_to_cpu(agf->agf_seqno), bno, 1); - - xfs_trans_agbtree_delta(cur->bc_tp, -1); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_ROOTS | XFS_AGF_LEVELS); - /* - * Update the cursor so there's one fewer level. - */ - xfs_btree_setbuf(cur, level, NULL); - cur->bc_nlevels--; - } else if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * If we deleted the leftmost entry in the block, update the - * key values above us in the tree. - */ - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)lkp, level + 1))) - return error; - /* - * If the number of records remaining in the block is at least - * the minimum, we're done. - */ - if (numrecs >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * Otherwise, we have to move some records around to keep the - * tree balanced. Look at the left and right sibling blocks to - * see if we can re-balance by moving only one record. - */ - rbno = be32_to_cpu(block->bb_rightsib); - lbno = be32_to_cpu(block->bb_leftsib); - bno = NULLAGBLOCK; - ASSERT(rbno != NULLAGBLOCK || lbno != NULLAGBLOCK); - /* - * Duplicate the cursor so our btree manipulations here won't - * disrupt the next level up. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - /* - * If there's a right sibling, see if it's ok to shift an entry - * out of it. - */ - if (rbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the last entry in the next block. - * Actually any entry but the first would suffice. - */ - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * Grab a pointer to the block. - */ - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(right->bb_leftsib); - /* - * If right block is full enough so that removing one entry - * won't make it too empty, and left-shifting an entry out - * of right to us works, we're done. - */ - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level > 0 && - (error = xfs_btree_decrement(cur, level, - &i))) - return error; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference, and fix up the temp cursor to point - * to our block again (last record). - */ - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLAGBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - } - } - /* - * If there's a left sibling, see if it's ok to shift an entry - * out of it. - */ - if (lbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the first entry in the - * previous block. - */ - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - xfs_btree_firstrec(tcur, level); - /* - * Grab a pointer to the block. - */ - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(left->bb_rightsib); - /* - * If left block is full enough so that removing one entry - * won't make it too empty, and right-shifting an entry out - * of left to us works, we're done. - */ - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level == 0) - cur->bc_ptrs[0]++; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference. - */ - lrecs = be16_to_cpu(left->bb_numrecs); - } - /* - * Delete the temp cursor, we're done with it. - */ - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - /* - * If here, we need to do a join to keep the tree balanced. - */ - ASSERT(bno != NULLAGBLOCK); - /* - * See if we can join with the left neighbor block. - */ - if (lbno != NULLAGBLOCK && - lrecs + numrecs <= XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - /* - * Set "right" to be the starting block, - * "left" to be the left neighbor. - */ - rbno = bno; - right = block; - rrecs = be16_to_cpu(right->bb_numrecs); - rbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, lbno, 0, &lbp, - XFS_ALLOC_BTREE_REF))) - return error; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); - lrecs = be16_to_cpu(left->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - } - /* - * If that won't work, see if we can join with the right neighbor block. - */ - else if (rbno != NULLAGBLOCK && - rrecs + numrecs <= XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - /* - * Set "left" to be the starting block, - * "right" to be the right neighbor. - */ - lbno = bno; - left = block; - lrecs = be16_to_cpu(left->bb_numrecs); - lbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, rbno, 0, &rbp, - XFS_ALLOC_BTREE_REF))) - return error; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - rrecs = be16_to_cpu(right->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - } - /* - * Otherwise, we can't fix the imbalance. - * Just return. This is probably a logic error, but it's not fatal. - */ - else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * We're now going to join "left" and "right" by moving all the stuff - * in "right" to "left" and deleting "right". - */ - if (level > 0) { - /* - * It's a non-leaf. Move keys and pointers. - */ - lkp = XFS_ALLOC_KEY_ADDR(left, lrecs + 1, cur); - lpp = XFS_ALLOC_PTR_ADDR(left, lrecs + 1, cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memcpy(lkp, rkp, rrecs * sizeof(*lkp)); - memcpy(lpp, rpp, rrecs * sizeof(*lpp)); - xfs_alloc_log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); - xfs_alloc_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); - } else { - /* - * It's a leaf. Move records. - */ - lrp = XFS_ALLOC_REC_ADDR(left, lrecs + 1, cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - memcpy(lrp, rrp, rrecs * sizeof(*lrp)); - xfs_alloc_log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); - } - /* - * If we joined with the left neighbor, set the buffer in the - * cursor to the left block, and fix up the index. - */ - if (bp != lbp) { - xfs_btree_setbuf(cur, level, lbp); - cur->bc_ptrs[level] += lrecs; - } - /* - * If we joined with the right neighbor and there's a level above - * us, increment the cursor at that level. - */ - else if (level + 1 < cur->bc_nlevels && - (error = xfs_btree_increment(cur, level + 1, &i))) - return error; - /* - * Fix up the number of records in the surviving block. - */ - lrecs += rrecs; - left->bb_numrecs = cpu_to_be16(lrecs); - /* - * Fix up the right block pointer in the surviving block, and log it. - */ - left->bb_rightsib = right->bb_rightsib; - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there is a right sibling now, make it point to the - * remaining block. - */ - if (be32_to_cpu(left->bb_rightsib) != NULLAGBLOCK) { - xfs_alloc_block_t *rrblock; - xfs_buf_t *rrbp; - - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, - &rrbp, XFS_ALLOC_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_ALLOC_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(lbno); - xfs_alloc_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * Free the deleting block by putting it on the freelist. - */ - error = xfs_alloc_put_freelist(cur->bc_tp, - cur->bc_private.a.agbp, NULL, rbno, 1); - if (error) - return error; - /* - * Since blocks move to the free list without the coordination - * used in xfs_bmap_finish, we can't allow block to be available - * for reallocation and non-transaction writing (user data) - * until we know that the transaction that moved it to the free - * list is permanently on disk. We track the blocks by declaring - * these blocks as "busy"; the busy list is maintained on a - * per-ag basis and each transaction records which entries - * should be removed when the iclog commits to disk. If a - * busy block is allocated, the iclog is pushed up to the - * LSN that freed the block. - */ - xfs_alloc_mark_busy(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); - xfs_trans_agbtree_delta(cur->bc_tp, -1); - - /* - * Adjust the current level's cursor so that we're left referring - * to the right node, after we're done. - * If this leaves the ptr value 0 our caller will fix it up. - */ - if (level > 0) - cur->bc_ptrs[level]--; - /* - * Return value means the next level up has something to do. - */ - *stat = 2; - return 0; - -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* - * Log header fields from a btree block. - */ -STATIC void -xfs_alloc_log_block( - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *bp, /* buffer containing btree block */ - int fields) /* mask of fields: XFS_BB_... */ -{ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - static const short offsets[] = { /* table of offsets */ - offsetof(xfs_alloc_block_t, bb_magic), - offsetof(xfs_alloc_block_t, bb_level), - offsetof(xfs_alloc_block_t, bb_numrecs), - offsetof(xfs_alloc_block_t, bb_leftsib), - offsetof(xfs_alloc_block_t, bb_rightsib), - sizeof(xfs_alloc_block_t) - }; - - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first, &last); - xfs_trans_log_buf(tp, bp, first, last); -} - -/* - * Log block pointer fields from a btree block (nonleaf). - */ -STATIC void -xfs_alloc_log_ptrs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int pfirst, /* index of first pointer to log */ - int plast) /* index of last pointer to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_alloc_ptr_t *pp; /* block-pointer pointer in btree blk */ - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - pp = XFS_ALLOC_PTR_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - - -/* - * Externally visible routines. - */ - -/* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -int /* error */ -xfs_alloc_delete( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* result code */ - int level; /* btree level */ - - /* - * Go up the tree, starting at leaf level. - * If 2 is returned then a join was done; go to the next level. - * Otherwise we are done. - */ - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_alloc_delrec(cur, level, &i))) - return error; - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, &i))) - return error; - break; - } - } - } - *stat = i; - return 0; -} /* * Get the data from the pointed-to record. @@ -828,6 +196,7 @@ xfs_allocbt_update_lastrec( struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); __be32 len; + int numrecs; ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); @@ -847,6 +216,22 @@ xfs_allocbt_update_lastrec( return; len = rec->alloc.ar_blockcount; break; + case LASTREC_DELREC: + numrecs = xfs_btree_get_numrecs(block); + if (ptr <= numrecs) + return; + ASSERT(ptr == numrecs + 1); + + if (numrecs) { + xfs_alloc_rec_t *rrp; + + rrp = XFS_ALLOC_REC_ADDR(block, numrecs, cur); + len = rrp->ar_blockcount; + } else { + len = 0; + } + + break; default: ASSERT(0); return; @@ -858,6 +243,14 @@ xfs_allocbt_update_lastrec( } STATIC int +xfs_allocbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mnr[level != 0]; +} + +STATIC int xfs_allocbt_get_maxrecs( struct xfs_btree_cur *cur, int level) @@ -1091,7 +484,7 @@ xfs_alloc_log_recs_check( * Log records from a btree block (leaf). */ STATIC void -xfs_alloc_log_recs( +xfs_allocbt_log_recs( struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_buf *bp, /* buffer containing btree block */ int first, /* index of first record to log */ @@ -1188,6 +581,7 @@ static const struct xfs_btree_ops xfs_al .alloc_block = xfs_allocbt_alloc_block, .free_block = xfs_allocbt_free_block, .update_lastrec = xfs_allocbt_update_lastrec, + .get_minrecs = xfs_allocbt_get_minrecs, .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-08-04 01:19:05.000000000 +0200 @@ -44,14 +44,6 @@ #include "xfs_error.h" #include "xfs_quota.h" -/* - * Prototypes for internal btree functions. - */ - - -STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); - #undef EXIT #define ENTRY XBT_ENTRY @@ -82,416 +74,6 @@ STATIC void xfs_bmbt_log_ptrs(xfs_btree_ /* - * Internal functions. - */ - -/* - * Delete record pointed to by cur/level. - */ -STATIC int /* error */ -xfs_bmbt_delrec( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; /* bmap btree block */ - xfs_fsblock_t bno; /* fs-relative block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop counter */ - int j; /* temp state */ - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */ - xfs_fsblock_t lbno; /* left sibling block number */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - int lrecs=0; /* left record count */ - xfs_bmbt_rec_t *lrp; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */ - int ptr; /* key/record index */ - xfs_fsblock_t rbno; /* right sibling block number */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp; /* right btree key */ - xfs_bmbt_rec_t *rp; /* pointer to bmap btree rec */ - xfs_bmbt_ptr_t *rpp; /* right address pointer */ - xfs_bmbt_block_t *rrblock; /* right-right btree block */ - xfs_buf_t *rrbp; /* right-right buffer pointer */ - int rrecs=0; /* right record count */ - xfs_bmbt_rec_t *rrp; /* right record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - int numrecs; /* temporary numrec count */ - int numlrecs, numrrecs; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ptr = cur->bc_ptrs[level]; - tcur = NULL; - if (ptr == 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - block = xfs_bmbt_get_block(cur, level, &bp); - numrecs = be16_to_cpu(block->bb_numrecs); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - if (ptr > numrecs) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_bmbt_delrec); - if (level > 0) { - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } -#endif - if (ptr < numrecs) { - memmove(&kp[ptr - 1], &kp[ptr], - (numrecs - ptr) * sizeof(*kp)); - memmove(&pp[ptr - 1], &pp[ptr], - (numrecs - ptr) * sizeof(*pp)); - xfs_bmbt_log_ptrs(cur, bp, ptr, numrecs - 1); - xfs_bmbt_log_keys(cur, bp, ptr, numrecs - 1); - } - } else { - rp = XFS_BMAP_REC_IADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&rp[ptr - 1], &rp[ptr], - (numrecs - ptr) * sizeof(*rp)); - xfs_bmbt_log_recs(cur, bp, ptr, numrecs - 1); - } - if (ptr == 1) { - key.br_startoff = - cpu_to_be64(xfs_bmbt_disk_get_startoff(rp)); - kp = &key; - } - } - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_bmbt_log_block(cur, bp, XFS_BB_NUMRECS); - /* - * We're at the root level. - * First, shrink the root block in-memory. - * Try to get rid of the next level down. - * If we can't then there's nothing left to do. - */ - if (level == cur->bc_nlevels - 1) { - xfs_iroot_realloc(cur->bc_private.b.ip, -1, - cur->bc_private.b.whichfork); - if ((error = xfs_btree_root_to_iroot(cur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (numrecs >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - rbno = be64_to_cpu(block->bb_rightsib); - lbno = be64_to_cpu(block->bb_leftsib); - /* - * One child of root, need to get a chance to copy its contents - * into the root and delete it. Can't go up to next level, - * there's nothing to delete there. - */ - if (lbno == NULLFSBLOCK && rbno == NULLFSBLOCK && - level == cur->bc_nlevels - 2) { - if ((error = xfs_btree_root_to_iroot(cur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - ASSERT(rbno != NULLFSBLOCK || lbno != NULLFSBLOCK); - if ((error = xfs_btree_dup_cursor(cur, &tcur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - bno = NULLFSBLOCK; - if (rbno != NULLFSBLOCK) { - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_BMBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - bno = be64_to_cpu(right->bb_leftsib); - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_BMAP_BLOCK_IMINRECS(level, tcur)); - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - if (level > 0) { - if ((error = xfs_btree_decrement(cur, - level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, - ERROR); - goto error0; - } - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLFSBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - } - } - if (lbno != NULLFSBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * decrement to last in block - */ - if ((error = xfs_btree_decrement(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_BMBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - bno = be64_to_cpu(left->bb_rightsib); - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_BMAP_BLOCK_IMINRECS(level, tcur)); - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - if (level == 0) - cur->bc_ptrs[0]++; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - lrecs = be16_to_cpu(left->bb_numrecs); - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - mp = cur->bc_mp; - ASSERT(bno != NULLFSBLOCK); - if (lbno != NULLFSBLOCK && - lrecs + be16_to_cpu(block->bb_numrecs) <= XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - rbno = bno; - right = block; - rbp = bp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, lbno, 0, &lbp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - left = XFS_BUF_TO_BMBT_BLOCK(lbp); - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } else if (rbno != NULLFSBLOCK && - rrecs + be16_to_cpu(block->bb_numrecs) <= - XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - lbno = bno; - left = block; - lbp = bp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, rbno, 0, &rbp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - right = XFS_BUF_TO_BMBT_BLOCK(rbp); - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - lrecs = be16_to_cpu(left->bb_numrecs); - } else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - numlrecs = be16_to_cpu(left->bb_numrecs); - numrrecs = be16_to_cpu(right->bb_numrecs); - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, numlrecs + 1, cur); - lpp = XFS_BMAP_PTR_IADDR(left, numlrecs + 1, cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < numrrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } -#endif - memcpy(lkp, rkp, numrrecs * sizeof(*lkp)); - memcpy(lpp, rpp, numrrecs * sizeof(*lpp)); - xfs_bmbt_log_keys(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - xfs_bmbt_log_ptrs(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - } else { - lrp = XFS_BMAP_REC_IADDR(left, numlrecs + 1, cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - memcpy(lrp, rrp, numrrecs * sizeof(*lrp)); - xfs_bmbt_log_recs(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - } - be16_add(&left->bb_numrecs, numrrecs); - left->bb_rightsib = right->bb_rightsib; - xfs_bmbt_log_block(cur, lbp, XFS_BB_RIGHTSIB | XFS_BB_NUMRECS); - if (be64_to_cpu(left->bb_rightsib) != NULLDFSBNO) { - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, - be64_to_cpu(left->bb_rightsib), - 0, &rrbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - rrblock = XFS_BUF_TO_BMBT_BLOCK(rrbp); - if ((error = xfs_btree_check_lblock(cur, rrblock, level, rrbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - rrblock->bb_leftsib = cpu_to_be64(lbno); - xfs_bmbt_log_block(cur, rrbp, XFS_BB_LEFTSIB); - } - xfs_bmap_add_free(XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(rbp)), 1, - cur->bc_private.b.flist, mp); - cur->bc_private.b.ip->i_d.di_nblocks--; - xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, XFS_ILOG_CORE); - XFS_TRANS_MOD_DQUOT_BYINO(mp, cur->bc_tp, cur->bc_private.b.ip, - XFS_TRANS_DQ_BCOUNT, -1L); - xfs_trans_binval(cur->bc_tp, rbp); - if (bp != lbp) { - cur->bc_bufs[level] = lbp; - cur->bc_ptrs[level] += lrecs; - cur->bc_ra[level] = 0; - } else if ((error = xfs_btree_increment(cur, level + 1, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0) - cur->bc_ptrs[level]--; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 2; - return 0; - -error0: - if (tcur) - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* - * Log pointer values from the btree block. - */ -STATIC void -xfs_bmbt_log_ptrs( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int pfirst, - int plast) -{ - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, pfirst, plast); - tp = cur->bc_tp; - if (bp) { - xfs_bmbt_block_t *block; - int first; - int last; - xfs_bmbt_ptr_t *pp; - - block = XFS_BUF_TO_BMBT_BLOCK(bp); - pp = XFS_BMAP_PTR_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - } else { - xfs_inode_t *ip; - - ip = cur->bc_private.b.ip; - xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Determine the extent state. */ /* ARGSUSED */ @@ -540,42 +122,6 @@ xfs_bmdr_to_bmbt( } /* - * Delete the record pointed to by cur. - */ -int /* error */ -xfs_bmbt_delete( - xfs_btree_cur_t *cur, - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; - int level; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_bmbt_delrec(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, - &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - break; - } - } - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = i; - return 0; -} - -/* * Convert a compressed bmap extent record to an uncompressed form. * This code must be in sync with the routines xfs_bmbt_get_startoff, * xfs_bmbt_get_startblock, xfs_bmbt_get_blockcount and xfs_bmbt_get_state. @@ -629,31 +175,6 @@ xfs_bmbt_get_all( } /* - * Get the block pointer for the given level of the cursor. - * Fill in the buffer pointer, if applicable. - */ -xfs_bmbt_block_t * -xfs_bmbt_get_block( - xfs_btree_cur_t *cur, - int level, - xfs_buf_t **bpp) -{ - xfs_ifork_t *ifp; - xfs_bmbt_block_t *rval; - - if (level < cur->bc_nlevels - 1) { - *bpp = cur->bc_bufs[level]; - rval = XFS_BUF_TO_BMBT_BLOCK(*bpp); - } else { - *bpp = NULL; - ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, - cur->bc_private.b.whichfork); - rval = ifp->if_broot; - } - return rval; -} - -/* * Extract the blockcount field from an in memory bmap extent record. */ xfs_filblks_t @@ -1180,6 +701,14 @@ xfs_bmbt_realloc_root( } STATIC int +xfs_bmbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return XFS_BMAP_BLOCK_IMINRECS(level, cur); +} + +STATIC int xfs_bmbt_get_maxrecs( struct xfs_btree_cur *cur, int level) @@ -1502,6 +1031,7 @@ static const struct xfs_btree_ops xfs_bm .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .init_rec_from_key = xfs_bmbt_init_rec_from_key, .init_rec_from_cur = xfs_bmbt_init_rec_from_cur, + .get_minrecs = xfs_bmbt_get_minrecs, .get_maxrecs = xfs_bmbt_get_maxrecs, .get_dmaxrecs = xfs_bmbt_get_dmaxrecs, .ptr_addr = xfs_bmbt_ptr_addr, Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-08-04 01:18:45.000000000 +0200 @@ -216,6 +216,7 @@ struct xfs_btree_ops { struct xfs_btree_block *block); /* records in block/level */ + int (*get_minrecs)(struct xfs_btree_cur *cur, int level); int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); int (*get_dmaxrecs)(struct xfs_btree_cur *cur, int level); @@ -289,6 +290,7 @@ struct xfs_btree_ops { */ #define LASTREC_UPDATE 0 #define LASTREC_INSREC 1 +#define LASTREC_DELREC 2 /* @@ -600,6 +602,7 @@ int xfs_btree_new_root(struct xfs_btree_ int xfs_btree_iroot_to_root(struct xfs_btree_cur *, int *, int *); int xfs_btree_root_to_iroot(struct xfs_btree_cur *); int xfs_btree_insert(struct xfs_btree_cur *, int *); +int xfs_btree_delete(struct xfs_btree_cur *, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-08-04 01:18:45.000000000 +0200 @@ -40,567 +40,6 @@ #include "xfs_alloc.h" #include "xfs_error.h" -STATIC void xfs_inobt_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_inobt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); - -/* - * Single level of the xfs_inobt_delete record deletion routine. - * Delete record pointed to by cur/level. - * Remove the record from its block then rebalance the tree. - * Return 0 for error, 1 for done, 2 to go on to the next level. - */ -STATIC int /* error */ -xfs_inobt_delrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level removing record from */ - int *stat) /* fail/done/go-on */ -{ - xfs_buf_t *agbp; /* buffer for a.g. inode header */ - xfs_mount_t *mp; /* mount structure */ - xfs_agi_t *agi; /* allocation group inode header */ - xfs_inobt_block_t *block; /* btree block record/key lives in */ - xfs_agblock_t bno; /* btree block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_inobt_key_t key; /* kp points here if block is level 0 */ - xfs_inobt_key_t *kp = NULL; /* pointer to btree keys */ - xfs_agblock_t lbno; /* left block's block number */ - xfs_buf_t *lbp; /* left block's buffer pointer */ - xfs_inobt_block_t *left; /* left btree block */ - xfs_inobt_key_t *lkp; /* left block key pointer */ - xfs_inobt_ptr_t *lpp; /* left block address pointer */ - int lrecs = 0; /* number of records in left block */ - xfs_inobt_rec_t *lrp; /* left block record pointer */ - xfs_inobt_ptr_t *pp = NULL; /* pointer to btree addresses */ - int ptr; /* index in btree block for this rec */ - xfs_agblock_t rbno; /* right block's block number */ - xfs_buf_t *rbp; /* right block's buffer pointer */ - xfs_inobt_block_t *right; /* right btree block */ - xfs_inobt_key_t *rkp; /* right block key pointer */ - xfs_inobt_rec_t *rp; /* pointer to btree records */ - xfs_inobt_ptr_t *rpp; /* right block address pointer */ - int rrecs = 0; /* number of records in right block */ - int numrecs; - xfs_inobt_rec_t *rrp; /* right block record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - - mp = cur->bc_mp; - - /* - * Get the index of the entry being deleted, check for nothing there. - */ - ptr = cur->bc_ptrs[level]; - if (ptr == 0) { - *stat = 0; - return 0; - } - - /* - * Get the buffer & block containing the record or key/ptr. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Fail if we're off the end of the block. - */ - - numrecs = be16_to_cpu(block->bb_numrecs); - if (ptr > numrecs) { - *stat = 0; - return 0; - } - /* - * It's a nonleaf. Excise the key and ptr being deleted, by - * sliding the entries past them down one. - * Log the changed areas of the block. - */ - if (level > 0) { - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - pp = XFS_INOBT_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(pp[i]), level))) - return error; - } -#endif - if (ptr < numrecs) { - memmove(&kp[ptr - 1], &kp[ptr], - (numrecs - ptr) * sizeof(*kp)); - memmove(&pp[ptr - 1], &pp[ptr], - (numrecs - ptr) * sizeof(*kp)); - xfs_inobt_log_keys(cur, bp, ptr, numrecs - 1); - xfs_inobt_log_ptrs(cur, bp, ptr, numrecs - 1); - } - } - /* - * It's a leaf. Excise the record being deleted, by sliding the - * entries past it down one. Log the changed areas of the block. - */ - else { - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&rp[ptr - 1], &rp[ptr], - (numrecs - ptr) * sizeof(*rp)); - xfs_inobt_log_recs(cur, bp, ptr, numrecs - 1); - } - /* - * If it's the first record in the block, we'll need a key - * structure to pass up to the next level (updkey). - */ - if (ptr == 1) { - key.ir_startino = rp->ir_startino; - kp = &key; - } - } - /* - * Decrement and log the number of entries in the block. - */ - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_inobt_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); - /* - * Is this the root level? If so, we're almost done. - */ - if (level == cur->bc_nlevels - 1) { - /* - * If this is the root level, - * and there's only one entry left, - * and it's NOT the leaf level, - * then we can get rid of this level. - */ - if (numrecs == 1 && level > 0) { - agbp = cur->bc_private.a.agbp; - agi = XFS_BUF_TO_AGI(agbp); - /* - * pp is still set to the first pointer in the block. - * Make it the new root of the btree. - */ - bno = be32_to_cpu(agi->agi_root); - agi->agi_root = *pp; - be32_add(&agi->agi_level, -1); - /* - * Free the block. - */ - if ((error = xfs_free_extent(cur->bc_tp, - XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, bno), 1))) - return error; - xfs_trans_binval(cur->bc_tp, bp); - xfs_ialloc_log_agi(cur->bc_tp, agbp, - XFS_AGI_ROOT | XFS_AGI_LEVEL); - /* - * Update the cursor so there's one fewer level. - */ - cur->bc_bufs[level] = NULL; - cur->bc_nlevels--; - } else if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * If we deleted the leftmost entry in the block, update the - * key values above us in the tree. - */ - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) - return error; - /* - * If the number of records remaining in the block is at least - * the minimum, we're done. - */ - if (numrecs >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * Otherwise, we have to move some records around to keep the - * tree balanced. Look at the left and right sibling blocks to - * see if we can re-balance by moving only one record. - */ - rbno = be32_to_cpu(block->bb_rightsib); - lbno = be32_to_cpu(block->bb_leftsib); - bno = NULLAGBLOCK; - ASSERT(rbno != NULLAGBLOCK || lbno != NULLAGBLOCK); - /* - * Duplicate the cursor so our btree manipulations here won't - * disrupt the next level up. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - /* - * If there's a right sibling, see if it's ok to shift an entry - * out of it. - */ - if (rbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the last entry in the next block. - * Actually any entry but the first would suffice. - */ - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * Grab a pointer to the block. - */ - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(right->bb_leftsib); - /* - * If right block is full enough so that removing one entry - * won't make it too empty, and left-shifting an entry out - * of right to us works, we're done. - */ - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_INOBT_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level > 0 && - (error = xfs_btree_decrement(cur, level, - &i))) - return error; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference, and fix up the temp cursor to point - * to our block again (last record). - */ - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLAGBLOCK) { - xfs_btree_firstrec(tcur, level); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - } - } - /* - * If there's a left sibling, see if it's ok to shift an entry - * out of it. - */ - if (lbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the first entry in the - * previous block. - */ - xfs_btree_firstrec(tcur, level); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - xfs_btree_firstrec(tcur, level); - /* - * Grab a pointer to the block. - */ - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(left->bb_rightsib); - /* - * If left block is full enough so that removing one entry - * won't make it too empty, and right-shifting an entry out - * of left to us works, we're done. - */ - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_INOBT_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level == 0) - cur->bc_ptrs[0]++; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference. - */ - lrecs = be16_to_cpu(left->bb_numrecs); - } - /* - * Delete the temp cursor, we're done with it. - */ - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - /* - * If here, we need to do a join to keep the tree balanced. - */ - ASSERT(bno != NULLAGBLOCK); - /* - * See if we can join with the left neighbor block. - */ - if (lbno != NULLAGBLOCK && - lrecs + numrecs <= XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - /* - * Set "right" to be the starting block, - * "left" to be the left neighbor. - */ - rbno = bno; - right = block; - rrecs = be16_to_cpu(right->bb_numrecs); - rbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, lbno, 0, &lbp, - XFS_INO_BTREE_REF))) - return error; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); - lrecs = be16_to_cpu(left->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - } - /* - * If that won't work, see if we can join with the right neighbor block. - */ - else if (rbno != NULLAGBLOCK && - rrecs + numrecs <= XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - /* - * Set "left" to be the starting block, - * "right" to be the right neighbor. - */ - lbno = bno; - left = block; - lrecs = be16_to_cpu(left->bb_numrecs); - lbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, rbno, 0, &rbp, - XFS_INO_BTREE_REF))) - return error; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - rrecs = be16_to_cpu(right->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - } - /* - * Otherwise, we can't fix the imbalance. - * Just return. This is probably a logic error, but it's not fatal. - */ - else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * We're now going to join "left" and "right" by moving all the stuff - * in "right" to "left" and deleting "right". - */ - if (level > 0) { - /* - * It's a non-leaf. Move keys and pointers. - */ - lkp = XFS_INOBT_KEY_ADDR(left, lrecs + 1, cur); - lpp = XFS_INOBT_PTR_ADDR(left, lrecs + 1, cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memcpy(lkp, rkp, rrecs * sizeof(*lkp)); - memcpy(lpp, rpp, rrecs * sizeof(*lpp)); - xfs_inobt_log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); - xfs_inobt_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); - } else { - /* - * It's a leaf. Move records. - */ - lrp = XFS_INOBT_REC_ADDR(left, lrecs + 1, cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - memcpy(lrp, rrp, rrecs * sizeof(*lrp)); - xfs_inobt_log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); - } - /* - * If we joined with the left neighbor, set the buffer in the - * cursor to the left block, and fix up the index. - */ - if (bp != lbp) { - xfs_btree_setbuf(cur, level, lbp); - cur->bc_ptrs[level] += lrecs; - } - /* - * If we joined with the right neighbor and there's a level above - * us, increment the cursor at that level. - */ - else if (level + 1 < cur->bc_nlevels && - (error = xfs_btree_increment(cur, level + 1, &i))) - return error; - /* - * Fix up the number of records in the surviving block. - */ - lrecs += rrecs; - left->bb_numrecs = cpu_to_be16(lrecs); - /* - * Fix up the right block pointer in the surviving block, and log it. - */ - left->bb_rightsib = right->bb_rightsib; - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there is a right sibling now, make it point to the - * remaining block. - */ - if (be32_to_cpu(left->bb_rightsib) != NULLAGBLOCK) { - xfs_inobt_block_t *rrblock; - xfs_buf_t *rrbp; - - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, - &rrbp, XFS_INO_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_INOBT_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(lbno); - xfs_inobt_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * Free the deleting block. - */ - if ((error = xfs_free_extent(cur->bc_tp, XFS_AGB_TO_FSB(mp, - cur->bc_private.a.agno, rbno), 1))) - return error; - xfs_trans_binval(cur->bc_tp, rbp); - /* - * Readjust the ptr at this level if it's not a leaf, since it's - * still pointing at the deletion point, which makes the cursor - * inconsistent. If this makes the ptr 0, the caller fixes it up. - * We can't use decrement because it would change the next level up. - */ - if (level > 0) - cur->bc_ptrs[level]--; - /* - * Return value means the next level up has something to do. - */ - *stat = 2; - return 0; - -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* - * Log header fields from a btree block. - */ -STATIC void -xfs_inobt_log_block( - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *bp, /* buffer containing btree block */ - int fields) /* mask of fields: XFS_BB_... */ -{ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - static const short offsets[] = { /* table of offsets */ - offsetof(xfs_inobt_block_t, bb_magic), - offsetof(xfs_inobt_block_t, bb_level), - offsetof(xfs_inobt_block_t, bb_numrecs), - offsetof(xfs_inobt_block_t, bb_leftsib), - offsetof(xfs_inobt_block_t, bb_rightsib), - sizeof(xfs_inobt_block_t) - }; - - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first, &last); - xfs_trans_log_buf(tp, bp, first, last); -} - -/* - * Log block pointer fields from a btree block (nonleaf). - */ -STATIC void -xfs_inobt_log_ptrs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int pfirst, /* index of first pointer to log */ - int plast) /* index of last pointer to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_inobt_ptr_t *pp; /* block-pointer pointer in btree blk */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - pp = XFS_INOBT_PTR_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - - -/* - * Externally visible routines. - */ - -/* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -int /* error */ -xfs_inobt_delete( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; - int i; /* result code */ - int level; /* btree level */ - - /* - * Go up the tree, starting at leaf level. - * If 2 is returned then a join was done; go to the next level. - * Otherwise we are done. - */ - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_inobt_delrec(cur, level, &i))) - return error; - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, &i))) - return error; - break; - } - } - } - *stat = i; - return 0; -} - /* * Get the data from the pointed-to record. @@ -945,6 +384,13 @@ xfs_inobt_log_recs( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +STATIC int +xfs_inobt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_inobt_mnr[level != 0]; +} #ifdef XFS_BTREE_TRACE @@ -1018,6 +464,7 @@ static const struct xfs_btree_ops xfs_in .set_root = xfs_inobt_set_root, .alloc_block = xfs_inobt_alloc_block, .free_block = xfs_inobt_free_block, + .get_minrecs = xfs_inobt_get_minrecs, .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-08-04 01:18:45.000000000 +0200 @@ -398,7 +398,7 @@ xfs_alloc_fixup_trees( /* * Delete the entry from the by-size btree. */ - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); /* @@ -427,7 +427,7 @@ xfs_alloc_fixup_trees( /* * No remaining freespace, just delete the by-block tree entry. */ - if ((error = xfs_alloc_delete(bno_cur, &i))) + if ((error = xfs_btree_delete(bno_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); } else { @@ -1651,7 +1651,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1660,13 +1660,13 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* * Delete the old by-block entry for the right block. */ - if ((error = xfs_alloc_delete(bno_cur, &i))) + if ((error = xfs_btree_delete(bno_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1711,7 +1711,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1737,7 +1737,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-08-04 01:18:45.000000000 +0200 @@ -95,13 +95,6 @@ typedef struct xfs_btree_sblock xfs_allo XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) /* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -extern int xfs_alloc_delete(struct xfs_btree_cur *cur, int *stat); - -/* * Get the data from the pointed-to record. */ extern int xfs_alloc_get_rec(struct xfs_btree_cur *cur, xfs_agblock_t *bno, Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-08-04 01:18:45.000000000 +0200 @@ -864,7 +864,7 @@ xfs_bmap_add_extent_delay_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1425,13 +1425,13 @@ xfs_bmap_add_extent_unwritten_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1474,7 +1474,7 @@ xfs_bmap_add_extent_unwritten_real( &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1517,7 +1517,7 @@ xfs_bmap_add_extent_unwritten_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -2152,7 +2152,7 @@ xfs_bmap_add_extent_hole_real( right.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -3216,7 +3216,7 @@ xfs_bmap_del_extent( flags |= XFS_ILOG_FEXT(whichfork); break; } - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); break; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-08-04 01:18:45.000000000 +0200 @@ -237,10 +237,7 @@ typedef struct xfs_btree_lblock xfs_bmbt * Prototypes for xfs_bmap.c to call. */ extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); -extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); -extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, - int, struct xfs_buf **bpp); extern xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_host_t *r); extern xfs_fsblock_t xfs_bmbt_get_startblock(xfs_bmbt_rec_host_t *r); extern xfs_fileoff_t xfs_bmbt_get_startoff(xfs_bmbt_rec_host_t *r); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-08-04 01:18:45.000000000 +0200 @@ -1168,8 +1168,8 @@ xfs_difree( xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen); xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); - if ((error = xfs_inobt_delete(cur, &i))) { - cmn_err(CE_WARN, "xfs_difree: xfs_inobt_delete returned an error %d on %s.\n", + if ((error = xfs_btree_delete(cur, &i))) { + cmn_err(CE_WARN, "xfs_difree: xfs_btree_delete returned an error %d on %s.\n", error, mp->m_fsname); goto error0; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-08-04 01:18:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-08-04 01:18:45.000000000 +0200 @@ -117,13 +117,6 @@ typedef struct xfs_btree_sblock xfs_inob i, XFS_INOBT_BLOCK_MAXRECS(1, cur))) /* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -extern int xfs_inobt_delete(struct xfs_btree_cur *cur, int *stat); - -/* * Get the data from the pointed-to record. */ extern int xfs_inobt_get_rec(struct xfs_btree_cur *cur, xfs_agino_t *ino, -- From owner-xfs@oss.sgi.com Sun Aug 3 18:53:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 18:53:20 -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 (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 m741rFiE005734 for ; Sun, 3 Aug 2008 18:53:16 -0700 X-ASG-Debug-ID: 1217814868-40cc021b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0A708EF69DE for ; Sun, 3 Aug 2008 18:54:29 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 1xttSRFi8hnNX5Vw for ; Sun, 03 Aug 2008 18:54:29 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwMABf+lUh5LBjh/2dsb2JhbACKZKMp X-IronPort-AV: E=Sophos;i="4.31,302,1215354600"; d="scan'208";a="163504180" Received: from ppp121-44-24-225.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.24.225]) by ipmail01.adl6.internode.on.net with ESMTP; 04 Aug 2008 11:24:27 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KPpHF-0001ip-Rr; Mon, 04 Aug 2008 11:54:25 +1000 Date: Mon, 4 Aug 2008 11:54:25 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/26] generic btree implementation, version 3 Subject: Re: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080804015425.GE6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013158.GA8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013158.GA8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217814870 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1689 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17353 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:31:58AM +0200, Christoph Hellwig wrote: > Firstly all but one of Dave's review comments are addressed. There is also > a new first patch to clean up the defintion of struct xfs_btree_block which > I would consider an ASAP merge candidate. > > But there are also some bigger changes. For reimplemented the newroot and > killroot methods. In both cases one method was used for block rooted and > inode rooted btree but doing something quite different. This patchset > gets rid of these two method completely and implements both cases in > xfs_btree.c. For new_root that was as easy as just calling > xfs_btree_new_root directly for the !XFS_BTREE_ROOT_IN_INODE and moving > xfs_bmbt_newroot into the common code and calling it for the other case. > The XFS_BTREE_ROOT_IN_INODE case for kill_root was similarly easily solved > by just moving the code around and making it block/rec/key/ptr size > agnostic, but the !XFS_BTREE_ROOT_IN_INODE needed a little care. > > The alloc and inobt trees were in fact using the almost exact sequence > built from ->set_root and ->free_block but the odd way to pass the > block to be freed made this non-obvious. By changing the calling > convention to the normal one this one could be unified. I've left > in some nasty asserts to ensure the assumptions about these blocks > wasn't wrong. Ok. I'll comment on it when the patches come through.... > The other big news is the last patch in the series, which adds rec_len > and key_len members to the btree_ops structure and uses this to make the > ptr_addr, key_addr, rec_addr, set_key, set_rec, move_keys, move_recs, > copy_keys, copy_recsm log_keys and log_recs methods generic. This > patch by itselfs saves a few hundred lines of code and more than two > kilobytes in the binary image. With this eventual worse generated > code that needs to multiply by variables instead of constants should > easily be offset by the reduced instruction cache footprint. The patch > is so far not really comments and more a proof of concept - if everyone > agrees with this approach the changes will be merged into the earlier > patches. I think this is a good approach to take. It certainly makes the move/copy/logging interfaces simpler and easier for future btrees to implement.... > Now even with this move the set_*, move_* and copy_* interfaces are > left as-is. All the old discussion still applies except that things > might be a little more clear now that there's just one implementation > each and everything is contained in one file. I think keeping the > copy_* interfaces is a good idea, they are now basically just typed > memcpy wrappers - although we should switch the order of the src > and dst arguments to be the same as memcpy. Agreed. > The set_* interfaces > can probably go away - over copy_ they just add the index based > addressing which most callers don't use anyway. Yes, they could call the copy interface directly. > I'm not sure > what to do with move_* - these are the most ugly helpers, so maybe > we should just make them memmove wrappers in the style of copy_ > and leave all addressing to the callers. Yes, it would be nice to have them use the same interface. If we do that, then there's no real point for having a copy vs move distinction - we could just make everything use the memmove version and drop one of the interfaces altogether.... > With all these changes the stats for this series are now: > > 37 files changed, 6309 insertions(+), 7873 deletions(-) > > text data bss dec hex filename > 631577 4227 3092 638896 9bfb0 fs/xfs/xfs.ko.base > 614298 4435 3124 621857 97d21 fs/xfs/xfs.ko.btree FWIW, this aggregate doesn't show the real picture of the savings. What is really interesting is how small the individual implementations become.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 3 19:01:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 19:01:16 -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 (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 m7421EJL006564 for ; Sun, 3 Aug 2008 19:01:14 -0700 X-ASG-Debug-ID: 1217815344-739f02970000-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 73F3C355A86 for ; Sun, 3 Aug 2008 19:02:25 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id MAvYlMTpe608C2hh for ; Sun, 03 Aug 2008 19:02:25 -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 m7422QIF010238 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 4 Aug 2008 04:02:26 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7422QIT010236; Mon, 4 Aug 2008 04:02:26 +0200 Date: Mon, 4 Aug 2008 04:02:26 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/26] generic btree implementation, version 3 Subject: Re: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080804020226.GA9995@lst.de> References: <20080804013158.GA8819@lst.de> <20080804015425.GE6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804015425.GE6119@disturbed> 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: 1217815347 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1690 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17354 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 04, 2008 at 11:54:25AM +1000, Dave Chinner wrote: > > With all these changes the stats for this series are now: > > > > 37 files changed, 6309 insertions(+), 7873 deletions(-) > > > > text data bss dec hex filename > > 631577 4227 3092 638896 9bfb0 fs/xfs/xfs.ko.base > > 614298 4435 3124 621857 97d21 fs/xfs/xfs.ko.btree > > FWIW, this aggregate doesn't show the real picture of the savings. > What is really interesting is how small the individual > implementations become.... hch@bigmac:~/work/linux-2.6-xfs$ wc -l fs/xfs/xfs{_alloc,_ialloc,_bmap,}_btree.c 409 fs/xfs/xfs_alloc_btree.c 309 fs/xfs/xfs_ialloc_btree.c 858 fs/xfs/xfs_bmap_btree.c 3813 fs/xfs/xfs_btree.c 5389 total hch@bigmac:~/work/linux-2.6-xfs$ size fs/xfs/xfs{_alloc,_ialloc,_bmap,}_btree.o text data bss dec hex filename 2335 0 4 2339 923 fs/xfs/xfs_alloc_btree.o 1589 0 4 1593 639 fs/xfs_ialloc_btree.o 5827 0 4 5831 16c7 fs/xfs/xfs_bmap_btree.o 32785 0 4 32789 8015 fs/xfs/xfs_btree.o In comparism for the old code: hch@bigmac:~/work/linux-2.6-xfs$ wc -l fs/xfs/xfs{_alloc,_ialloc,_bmap,}_btree.c 2211 fs/xfs/xfs_alloc_btree.c 2078 fs/xfs/xfs_ialloc_btree.c 2610 fs/xfs/xfs_bmap_btree.c 914 fs/xfs/xfs_btree.c 7813 total hch@bigmac:~/work/linux-2.6-xfs$ size fs/xfs/xfs{_alloc,_ialloc,_bmap,}_btree.o text data bss dec hex filename 13383 0 0 13383 3447 fs/xfs/xfs_alloc_btree.o 12923 0 0 12923 327b fs/xfs/xfs_ialloc_btree.o 28870 22 4 28896 70e0 fs/xfs/xfs_bmap_btree.o 7062 0 4 7066 1b9a fs/xfs/xfs_btree.o From owner-xfs@oss.sgi.com Sun Aug 3 19:59:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 20:00:02 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m742xuwH010286 for ; Sun, 3 Aug 2008 19:59:56 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA02331; Mon, 4 Aug 2008 13:01:07 +1000 Message-ID: <489670F3.7070706@sgi.com> Date: Mon, 04 Aug 2008 13:01:07 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Ruben Porras CC: xfs@oss.sgi.com Subject: Re: [PING] do not test return value of xfs_bmap_*_count_leaves References: <1217281149.5345.39.camel@marzo> In-Reply-To: <1217281149.5345.39.camel@marzo> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17355 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Ruben Porras wrote: > http://oss.sgi.com/archives/xfs/2008-04/msg00087.html > Got it, sorry we dropped it for so long. Your second patch missed the int/void decleration changes, I've added that to the patch. I'm also assuming the following Signed-off-by and description, is that ok by you? Make xfs_bmap_*_count_leaves void. xfs_bmap_count_leaves and xfs_bmap_disk_count_leaves always return always 0, make them void. Signed-off-by: "Ruben Porras " --- fs/xfs/xfs_bmap.c.orig +++ fs/xfs/xfs_bmap.c @@ -384,14 +384,14 @@ xfs_bmap_count_tree( int levelin, int *count); -STATIC int +STATIC void xfs_bmap_count_leaves( xfs_ifork_t *ifp, xfs_extnum_t idx, int numrecs, int *count); -STATIC int +STATIC void xfs_bmap_disk_count_leaves( xfs_extnum_t idx, xfs_bmbt_block_t *block, @@ -6367,13 +6367,9 @@ xfs_bmap_count_blocks( mp = ip->i_mount; ifp = XFS_IFORK_PTR(ip, whichfork); if ( XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS ) { - if (unlikely(xfs_bmap_count_leaves(ifp, 0, + xfs_bmap_count_leaves(ifp, 0, ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t), - count) < 0)) { - XFS_ERROR_REPORT("xfs_bmap_count_blocks(1)", - XFS_ERRLEVEL_LOW, mp); - return XFS_ERROR(EFSCORRUPTED); - } + count); return 0; } @@ -6454,13 +6450,7 @@ xfs_bmap_count_tree( for (;;) { nextbno = be64_to_cpu(block->bb_rightsib); numrecs = be16_to_cpu(block->bb_numrecs); - if (unlikely(xfs_bmap_disk_count_leaves(0, - block, numrecs, count) < 0)) { - xfs_trans_brelse(tp, bp); - XFS_ERROR_REPORT("xfs_bmap_count_tree(2)", - XFS_ERRLEVEL_LOW, mp); - return XFS_ERROR(EFSCORRUPTED); - } + xfs_bmap_disk_count_leaves(0, block, numrecs, count); xfs_trans_brelse(tp, bp); if (nextbno == NULLFSBLOCK) break; @@ -6478,7 +6468,7 @@ xfs_bmap_count_tree( /* * Count leaf blocks given a range of extent records. */ -STATIC int +STATIC void xfs_bmap_count_leaves( xfs_ifork_t *ifp, xfs_extnum_t idx, @@ -6491,14 +6481,13 @@ xfs_bmap_count_leaves( xfs_bmbt_rec_host_t *frp = xfs_iext_get_ext(ifp, idx + b); *count += xfs_bmbt_get_blockcount(frp); } - return 0; } /* * Count leaf blocks given a range of extent records originally * in btree format. */ -STATIC int +STATIC void xfs_bmap_disk_count_leaves( xfs_extnum_t idx, xfs_bmbt_block_t *block, @@ -6512,5 +6501,4 @@ xfs_bmap_disk_count_leaves( frp = XFS_BTREE_REC_ADDR(xfs_bmbt, block, idx + b); *count += xfs_bmbt_disk_get_blockcount(frp); } - return 0; } From owner-xfs@oss.sgi.com Sun Aug 3 22:12:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 22:12:58 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m745CmYr022852 for ; Sun, 3 Aug 2008 22:12:50 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04565; Mon, 4 Aug 2008 15:13:57 +1000 Message-ID: <48969015.6020205@sgi.com> Date: Mon, 04 Aug 2008 15:13:57 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Dave Chinner , "Linda A. Walsh" CC: xfs-oss Subject: Re: Question about extended attributes... References: <48925495.7040804@tlinx.org> <4892B361.9030900@sgi.com> <20080801123253.GG6201@disturbed> In-Reply-To: <20080801123253.GG6201@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17356 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Fri, Aug 01, 2008 at 04:55:29PM +1000, Timothy Shimmin wrote: >> Hi Linda, >> >> Linda A. Walsh wrote: >>> my man page says extended xfs attributes can have 256-byte names >>> with up to 64K of data. >>> >>> Is there a limit on the number of extended attributes max data size or >>> name size? >>> >>> I.e. could I have 1000 attributes with 64K of data each? >>> >> Yep. >> >>> Is there a strong reason why the file and data sizes were limited to >>> 256/64K? > > .... > >> I'm not sure why 64K was chosen for a value size limit. > > Because changes to EAs are journalled. Hence there must be a bound > size limit because log space is limited. > Yeah, good point. Which I guess also reflects how we consider extended attributes to be more for metadata. --Tim From owner-xfs@oss.sgi.com Sun Aug 3 23:16:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 23:16:45 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m746GW64026859 for ; Sun, 3 Aug 2008 23:16:35 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA05706; Mon, 4 Aug 2008 16:17:37 +1000 Message-ID: <4896A070.2010805@sgi.com> Date: Mon, 04 Aug 2008 16:23:44 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Nick Piggin CC: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List , Andrew Morton , dri-devel@lists.sourceforge.net Subject: Re: [rfc][patch 2/3] xfs: remove vmap cache References: <20080728123438.GA13926@wotan.suse.de> <20080728123621.GB13926@wotan.suse.de> In-Reply-To: <20080728123621.GB13926@wotan.suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17357 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Nick Piggin wrote: > XFS's vmap batching simply defers a number (up to 64) of vunmaps, and keeps > track of them in a list. To purge the batch, it just goes through the list and > calls vunamp on each one. This is pretty poor: a global TLB flush is still > performed on each vunmap, with the most expensive parts of the operation > being the broadcast IPIs and locking involved in the SMP callouts, and the > locking involved in the vmap management -- none of these are avoided by just > batching up the calls. I'm actually surprised it ever made much difference > at all. So am I. > > Rip all this logic out of XFS completely. I improve vmap performance > and scalability directly in the previous and subsequent patch. Sounds good to me. > > Signed-off-by: Nick Piggin > --- > > Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c > +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c > @@ -166,75 +166,6 @@ test_page_region( > } > > /* > - * Mapping of multi-page buffers into contiguous virtual space > - */ > - > -typedef struct a_list { > - void *vm_addr; > - struct a_list *next; > -} a_list_t; > - > -static a_list_t *as_free_head; > -static int as_list_len; > -static DEFINE_SPINLOCK(as_lock); > - > -/* > - * Try to batch vunmaps because they are costly. > - */ > -STATIC void > -free_address( > - void *addr) > -{ > - a_list_t *aentry; > - > -#ifdef CONFIG_XEN > - /* > - * Xen needs to be able to make sure it can get an exclusive > - * RO mapping of pages it wants to turn into a pagetable. If > - * a newly allocated page is also still being vmap()ed by xfs, > - * it will cause pagetable construction to fail. This is a > - * quick workaround to always eagerly unmap pages so that Xen > - * is happy. > - */ > - vunmap(addr); > - return; > -#endif > - > - aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); > - if (likely(aentry)) { > - spin_lock(&as_lock); > - aentry->next = as_free_head; > - aentry->vm_addr = addr; > - as_free_head = aentry; > - as_list_len++; > - spin_unlock(&as_lock); > - } else { > - vunmap(addr); > - } > -} > - > -STATIC void > -purge_addresses(void) > -{ > - a_list_t *aentry, *old; > - > - if (as_free_head == NULL) > - return; > - > - spin_lock(&as_lock); > - aentry = as_free_head; > - as_free_head = NULL; > - as_list_len = 0; > - spin_unlock(&as_lock); > - > - while ((old = aentry) != NULL) { > - vunmap(aentry->vm_addr); > - aentry = aentry->next; > - kfree(old); > - } > -} > - > -/* > * Internal xfs_buf_t object manipulation > */ > > @@ -334,7 +265,7 @@ xfs_buf_free( > uint i; > > if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) > - free_address(bp->b_addr - bp->b_offset); > + vunmap(bp->b_addr - bp->b_offset); > > for (i = 0; i < bp->b_page_count; i++) { > struct page *page = bp->b_pages[i]; > @@ -456,8 +387,6 @@ _xfs_buf_map_pages( > bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; > bp->b_flags |= XBF_MAPPED; > } else if (flags & XBF_MAPPED) { > - if (as_list_len > 64) > - purge_addresses(); > bp->b_addr = vmap(bp->b_pages, bp->b_page_count, > VM_MAP, PAGE_KERNEL); > if (unlikely(bp->b_addr == NULL)) > @@ -1739,8 +1668,6 @@ xfsbufd( > count++; > } > > - if (as_list_len > 0) > - purge_addresses(); > if (count) > blk_run_address_space(target->bt_mapping); > > > > From owner-xfs@oss.sgi.com Sun Aug 3 23:21:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 03 Aug 2008 23:21:24 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m746LKQE027398 for ; Sun, 3 Aug 2008 23:21:21 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA05860; Mon, 4 Aug 2008 16:22:32 +1000 Message-ID: <4896A197.3090004@sgi.com> Date: Mon, 04 Aug 2008 16:28:39 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Nick Piggin CC: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List , Andrew Morton , dri-devel@lists.sourceforge.net Subject: Re: [rfc][patch 3/3] xfs: use new vmap API References: <20080728123438.GA13926@wotan.suse.de> <20080728123703.GC13926@wotan.suse.de> In-Reply-To: <20080728123703.GC13926@wotan.suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17358 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Looks good to me. Nick Piggin wrote: > Implement XFS's large buffer support with the new vmap APIs. See the vmap > rewrite patch for some numbers. > > Signed-off-by: Nick Piggin > --- > > Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c > +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c > @@ -265,7 +265,7 @@ xfs_buf_free( > uint i; > > if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) > - vunmap(bp->b_addr - bp->b_offset); > + vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count); > > for (i = 0; i < bp->b_page_count; i++) { > struct page *page = bp->b_pages[i]; > @@ -387,8 +387,8 @@ _xfs_buf_map_pages( > bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; > bp->b_flags |= XBF_MAPPED; > } else if (flags & XBF_MAPPED) { > - bp->b_addr = vmap(bp->b_pages, bp->b_page_count, > - VM_MAP, PAGE_KERNEL); > + bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, > + -1, PAGE_KERNEL); > if (unlikely(bp->b_addr == NULL)) > return -ENOMEM; > bp->b_addr += bp->b_offset; > > > From owner-xfs@oss.sgi.com Mon Aug 4 07:20:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 07:20:48 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 autolearn=no 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 m74EKK7A002839 for ; Mon, 4 Aug 2008 07:20:21 -0700 X-ASG-Debug-ID: 1217859693-46e603210000-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 7B340EFE952 for ; Mon, 4 Aug 2008 07:21:33 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id auB4GioeNUJRKnMV for ; Mon, 04 Aug 2008 07:21:33 -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 m74ELWIF010136 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 4 Aug 2008 16:21:32 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m74ELWsS010134; Mon, 4 Aug 2008 16:21:32 +0200 Date: Mon, 4 Aug 2008 16:21:32 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/26] generic btree implementation, version 3 Subject: Re: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080804142131.GA9892@lst.de> References: <20080804013158.GA8819@lst.de> <20080804015425.GE6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804015425.GE6119@disturbed> 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: 1217859695 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1736 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17359 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 04, 2008 at 11:54:25AM +1000, Dave Chinner wrote: > > I'm not sure > > what to do with move_* - these are the most ugly helpers, so maybe > > we should just make them memmove wrappers in the style of copy_ > > and leave all addressing to the callers. > > Yes, it would be nice to have them use the same interface. If > we do that, then there's no real point for having a copy vs move > distinction - we could just make everything use the > memmove version and drop one of the interfaces altogether.... I've actually come up with another variant. Since what we do in the memmove case is to move a number of entries in a single block up or down one position I've added the following helper: STATIC void xfs_btree_shift_keys( struct xfs_btree_cur *cur, union xfs_btree_key *key int dir, int numkeys) { char *dst_key; ASSERT(numkeys >= 0); ASSERT(dir == 1 || dir == -1); dst_key = (char *)key + (dir * cur->bc_ops->key_len); memmove(dst_key, key, numkeys * cur->bc_ops->key_len); } and the same for ptrs and recs. This follows the original code in spirit and is quite readable. From owner-xfs@oss.sgi.com Mon Aug 4 09:46:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 09:46:43 -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=-1.6 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 m74GkdFB016120 for ; Mon, 4 Aug 2008 09:46:40 -0700 X-ASG-Debug-ID: 1217868471-6a1c02a10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.stepping-stone.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 58DCAEFF711 for ; Mon, 4 Aug 2008 09:47:52 -0700 (PDT) Received: from smtp.stepping-stone.ch (smtp.stepping-stone.ch [193.58.255.135]) by cuda.sgi.com with ESMTP id P6PndgRMBADI6l0i for ; Mon, 04 Aug 2008 09:47:52 -0700 (PDT) Received: from localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) by smtp.stepping-stone.ch (Postfix) with ESMTP id 3497688F26C for ; Mon, 4 Aug 2008 18:47:50 +0200 (CEST) Received: from smtp.stepping-stone.ch ([10.59.255.135]) by localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) (amavisd-new, port 10024) with LMTP id 29903-02-23 for ; Mon, 4 Aug 2008 18:47:47 +0200 (CEST) Received: from [192.168.1.201] (unknown [212.103.65.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by smtp.stepping-stone.ch (Postfix) with ESMTP id 78F3889076D for ; Mon, 4 Aug 2008 18:47:47 +0200 (CEST) Message-ID: <489732B2.7000201@stepping-stone.ch> Date: Mon, 04 Aug 2008 18:47:46 +0200 From: Christian Affolter User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Corruption of in-memory data detected - on heavy hard linking Subject: Re: Corruption of in-memory data detected - on heavy hard linking References: <48876D03.8010804@stepping-stone.ch> <20080725052051.GA26367@infradead.org> In-Reply-To: <20080725052051.GA26367@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at stepping-stone.ch X-Barracuda-Connect: smtp.stepping-stone.ch[193.58.255.135] X-Barracuda-Start-Time: 1217868474 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.1748 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 17360 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: c.affolter@stepping-stone.ch Precedence: bulk X-list: xfs Hi > On Wed, Jul 23, 2008 at 07:40:19PM +0200, Christian Affolter wrote: >> Kernel-Error: >> Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1163 of >> file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf >> Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 > > 2.6.24 is pretty old. Did you try with a recent kernel? We had some > fixes for in-core memory corruption although I don't remember one in > this area. I finally found the time to update the kernel to a recent 2.6.26 version. Unfortunately the problem still exists: Filesystem "dm-3": XFS internal error xfs_trans_cancel at line 1163 of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a6672 Pid: 12584, comm: cp Not tainted 2.6.26-gentoo #1 Call Trace: [] xfs_create+0x1c2/0x4c0 [] xfs_trans_cancel+0x126/0x150 [] xfs_create+0x1c2/0x4c0 [] xfs_vn_mknod+0x16d/0x2c0 [] vfs_create+0xcc/0x130 [] do_filp_open+0x77f/0x860 [] do_sys_open+0x5a/0xf0 [] system_call_after_swapgs+0x7b/0x80 xfs_force_shutdown(dm-3,0x8) called from line 1164 of file fs/xfs/xfs_trans.c. Return address = 0xffffffff8039fd2f Filesystem "dm-3": Corruption of in-memory data detected. Shutting down filesystem: dm-3 Please umount the filesystem, and rectify the problem(s) Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. xfs_force_shutdown(dm-3,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xffffffff803a9529 Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. xfs_force_shutdown(dm-3,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xffffffff803a9529 Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Filesystem "dm-3": xfs_log_force: error 5 returned. Before the shutdown happens the copy command receives a "No space left on device" error: cp: cannot create regular file `[file name snipped': No space left on device cp: cannot create regular file `[file name snipped]': Input/output error Although the device has more than 50% free space as well as free inodes. The affected device was initialized with old xfsprogs (2.8.11): meta-data=/dev/evms/vol1 isize=256 agcount=3207, agsize=4096 blks = sectsz=512 attr=0 data = bsize=4096 blocks=13132799, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=1024, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=65536 blocks=0, rtextents=0 Creating a new device with xfsprogs (2.9.7) leads to the following layout: meta-data=/dev/sdc1 isize=256 agcount=5, agsize=3662818 blks = sectsz=512 attr=2 data = bsize=4096 blocks=17750000, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=7153, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 On the newly created device, the problem is much harder to reproduce, however it happens nonetheless after around a day of heavy copying and deleting. Any further hints? Many thanks Chris From owner-xfs@oss.sgi.com Mon Aug 4 17:18:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 17:18:55 -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 m750Iph3018189 for ; Mon, 4 Aug 2008 17:18:51 -0700 X-ASG-Debug-ID: 1217895603-246003b20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 158F535AEE4 for ; Mon, 4 Aug 2008 17:20:04 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id MaLyzP4k8JB52PxN for ; Mon, 04 Aug 2008 17:20:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwLAJU5l0h5LAiF/2dsb2JhbACKaKYG X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174248469" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 09:49:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQAHI-0000LQ-J0; Tue, 05 Aug 2008 10:19:52 +1000 Date: Tue, 5 Aug 2008 10:19:52 +1000 From: Dave Chinner To: Christian Affolter Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Corruption of in-memory data detected - on heavy hard linking Subject: Re: Corruption of in-memory data detected - on heavy hard linking Message-ID: <20080805001952.GI6119@disturbed> Mail-Followup-To: Christian Affolter , xfs@oss.sgi.com References: <48876D03.8010804@stepping-stone.ch> <20080725052051.GA26367@infradead.org> <489732B2.7000201@stepping-stone.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489732B2.7000201@stepping-stone.ch> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217895606 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.1778 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17361 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 06:47:46PM +0200, Christian Affolter wrote: > Hi > >> On Wed, Jul 23, 2008 at 07:40:19PM +0200, Christian Affolter wrote: >>> Kernel-Error: >>> Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1163 >>> of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf >>> Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 >> >> 2.6.24 is pretty old. Did you try with a recent kernel? We had some >> fixes for in-core memory corruption although I don't remember one in >> this area. > > I finally found the time to update the kernel to a recent 2.6.26 version. > > Unfortunately the problem still exists: > Filesystem "dm-3": XFS internal error xfs_trans_cancel at line 1163 of > file fs/xfs/xfs_trans.c. Caller 0xffffffff803a6672 > Pid: 12584, comm: cp Not tainted 2.6.26-gentoo #1 Ok, what we need is the following. First, try to reproduce the problem on a small filesystem (say a few GB). Once you've reproduced the problem, unmount and remount the filesystem to get the log replayed, then take a xfs_metadump image of the filesystem. Put the metadump image somewhere that can be downloaded (ftp/web site) and let us know where it is. If this is anything like the previous problem I found and fixed, then it will be a corner-case bug that is only triggered by a specific layout of free space and we need the filesystem image to be able to work out exactly what corner case is broken.... > Before the shutdown happens the copy command receives a > "No space left on device" error: > cp: cannot create regular file `[file name snipped': No space left on device > cp: cannot create regular file `[file name snipped]': Input/output error > > Although the device has more than 50% free space as well as free inodes. It will be an AG that is out of space, not the entire filesystem. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 17:24:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 17:25:01 -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,J_CHICKENPOX_63 autolearn=no 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 m750Owv0018801 for ; Mon, 4 Aug 2008 17:24:59 -0700 X-ASG-Debug-ID: 1217895972-194b02030000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 307B5F027BF for ; Mon, 4 Aug 2008 17:26:12 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id TijMNu21BMH2UwXg for ; Mon, 04 Aug 2008 17:26:12 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwLAJU5l0h5LAiF/2dsb2JhbACKaKYG X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174254005" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 09:56:10 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQANL-0000U1-8s; Tue, 05 Aug 2008 10:26:07 +1000 Date: Tue, 5 Aug 2008 10:26:07 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/26] generic btree implementation, version 3 Subject: Re: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080805002607.GJ6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013158.GA8819@lst.de> <20080804015425.GE6119@disturbed> <20080804142131.GA9892@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804142131.GA9892@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217895973 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1778 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17362 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 04:21:32PM +0200, Christoph Hellwig wrote: > On Mon, Aug 04, 2008 at 11:54:25AM +1000, Dave Chinner wrote: > > > I'm not sure > > > what to do with move_* - these are the most ugly helpers, so maybe > > > we should just make them memmove wrappers in the style of copy_ > > > and leave all addressing to the callers. > > > > Yes, it would be nice to have them use the same interface. If > > we do that, then there's no real point for having a copy vs move > > distinction - we could just make everything use the > > memmove version and drop one of the interfaces altogether.... > > I've actually come up with another variant. Since what we do in the > memmove case is to move a number of entries in a single block up or down > one position I've added the following helper: > > STATIC void > xfs_btree_shift_keys( > struct xfs_btree_cur *cur, > union xfs_btree_key *key > int dir, > int numkeys) > { > char *dst_key; > > ASSERT(numkeys >= 0); > ASSERT(dir == 1 || dir == -1); > > dst_key = (char *)key + (dir * cur->bc_ops->key_len); > memmove(dst_key, key, numkeys * cur->bc_ops->key_len); > } > > and the same for ptrs and recs. This follows the original code in > spirit and is quite readable. Nice. That fits nicely into the 'make a hole' or 'fill a hole' parts of various functions which will remove a lot of magic from them. The only thing I'd do is add an enum for the direction so the callers are self-documenting as to the direction of the shift.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 17:48:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 17:48:13 -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 m750mAT8020213 for ; Mon, 4 Aug 2008 17:48:11 -0700 X-ASG-Debug-ID: 1217897362-194d03600000-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 3DF8CF02A19 for ; Mon, 4 Aug 2008 17:49:23 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id F1VephwCmPrndohj for ; Mon, 04 Aug 2008 17:49:23 -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 m750nOIF005069 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 5 Aug 2008 02:49:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m750nOp1005067; Tue, 5 Aug 2008 02:49:24 +0200 Date: Tue, 5 Aug 2008 02:49:24 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/26] generic btree implementation, version 3 Subject: Re: [PATCH 00/26] generic btree implementation, version 3 Message-ID: <20080805004924.GA5002@lst.de> References: <20080804013158.GA8819@lst.de> <20080804015425.GE6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804015425.GE6119@disturbed> 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: 1217897365 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1778 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17363 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 04, 2008 at 11:54:25AM +1000, Dave Chinner wrote: > > The alloc and inobt trees were in fact using the almost exact sequence > > built from ->set_root and ->free_block but the odd way to pass the > > block to be freed made this non-obvious. By changing the calling > > convention to the normal one this one could be unified. I've left > > in some nasty asserts to ensure the assumptions about these blocks > > wasn't wrong. > > Ok. I'll comment on it when the patches come through.... The killroot unification turned out to be buggy, I'll fix it in the next round of patches. From owner-xfs@oss.sgi.com Mon Aug 4 17:49:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 17:49:21 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m750nJ0q020593 for ; Mon, 4 Aug 2008 17:49:19 -0700 X-ASG-Debug-ID: 1217897430-3f4a02900000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 853C519844B3 for ; Mon, 4 Aug 2008 17:50:31 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id ggd2JBrNNTOblqyt for ; Mon, 04 Aug 2008 17:50:31 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwLAJdAl0h5LAiF/2dsb2JhbACKaKV+ X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174274106" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 10:20:19 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQAkk-00019R-ES; Tue, 05 Aug 2008 10:50:18 +1000 Date: Tue, 5 Aug 2008 10:50:13 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 20/26] move xfs_bmbt_newroot to common code Subject: Re: [PATCH 20/26] move xfs_bmbt_newroot to common code Message-ID: <20080805005013.GK6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013530.GU8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013530.GU8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217897433 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.1780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17364 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:35:30AM +0200, Christoph Hellwig wrote: > xfs_bmbt_newroot is a mostly generic implementation of moving from > an inode root to a real block based root. So move it to xfs_btree.c > where it can use all the nice infrastructure there and make it pointer > size agnostic > > The new name for it is xfs_btree_iroot_to_root which is not very > nice but at least slightly more descriptive than the old name. ..... > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_STATS_INC(cur, newroot); > + > + level = cur->bc_nlevels - 1; > + /* XXX(hch): this should be an get_inode_from_root, right? */ > + block = xfs_btree_get_block(cur, level, &bp); Yes, probably should be. Also an assert to ensure the btree does have the root in inode falg set might be appropriate.... Otherwise looks fine. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:07:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:07:18 -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.3 required=5.0 tests=AWL,BAYES_00,MIME_8BIT_HEADER, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7517G3d021799 for ; Mon, 4 Aug 2008 18:07:16 -0700 X-ASG-Debug-ID: 1217898509-3f8e03bb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3502A1984588 for ; Mon, 4 Aug 2008 18:08:30 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id APzhMdqwHf0AUDk9 for ; Mon, 04 Aug 2008 18:08:30 -0700 (PDT) Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 10:35:58 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQAzt-0001Vi-5e; Tue, 05 Aug 2008 11:05:57 +1000 Date: Tue, 5 Aug 2008 11:05:57 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 21/26] implement =?utf-8?Q?gene?= =?utf-8?Q?ric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Subject: Re: [PATCH 21/26] implement =?utf-8?Q?gene?= =?utf-8?Q?ric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Message-ID: <20080805010557.GL6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013535.GV8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013535.GV8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217898511 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17365 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:35:35AM +0200, Christoph Hellwig wrote: > Make the btree insert code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. .... > + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { > + if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) { > + /* A resizeable root block that can be made bigger. */ > + cur->bc_ops->realloc_root(cur, 1); > + return 0; > + } I think that ->get_dmaxrecs is probably badly named. I called it that originally because it matched the macro name it was wrapping. Realisitically it should be ->get_root_maxrecs.... > + /* Make a key out of the record data to be inserted, and save it. */ > + cur->bc_ops->init_key_from_rec(cur, &key, recp); > + > + /* If we're off the left edge, return failure. */ > + ptr = cur->bc_ptrs[level]; > + if (ptr == 0) { > + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); > + *stat = 0; > + return 0; > + } You can probably move the key initialisation till after then initial 'in this block' checks. > + /* > + * If the block is full, we can't insert the new entry until we > + * make the block un-full. > + */ > + xfs_btree_set_ptr_null(cur, &nptr); > + if (numrecs == cur->bc_ops->get_maxrecs(cur, level)) { > + error = xfs_btree_make_block_unfull(cur, level, numrecs, > + &optr, &ptr, &nptr, &ncur, &nrec, stat); > + if (error || *stat == 0) > + goto error0; > + } > + > + /* The current block may have changed during the split. */ > + block = xfs_btree_get_block(cur, level, &bp); > + numrecs = xfs_btree_get_numrecs(block); The comment here should probably refer to the unfull call, not a 'split'. i.e.: /* * the current block may have changed if the block was * previously full and we have just made space in it. */ Otherwise looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:13:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:13:55 -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,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m751Dr31022427 for ; Mon, 4 Aug 2008 18:13:53 -0700 X-ASG-Debug-ID: 1217898906-6d0100b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B00F919845CF for ; Mon, 4 Aug 2008 18:15:06 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id LX5t736CKaSJDPct for ; Mon, 04 Aug 2008 18:15:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwLAOBDl0h5LAiF/2dsb2JhbACKaKVq X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174293186" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 10:44:38 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQB8H-0001gg-SG; Tue, 05 Aug 2008 11:14:37 +1000 Date: Tue, 5 Aug 2008 11:14:37 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Subject: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Message-ID: <20080805011437.GM6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013542.GW8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013542.GW8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217898907 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.1780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17366 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:35:42AM +0200, Christoph Hellwig wrote: > xfs_bmbt_killroot is a mostly generic implementation of moving from > a real block based root to an inode based root. So move it to xfs_btree.c > where it can use all the nice infrastructure there and make it pointer > size agnostic > > The new name for it is xfs_btree_root_to_iroot which is not very > nice but at least slightly more descriptive than the old name. ..... > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + level = cur->bc_nlevels - 1; > + ASSERT(level >= 1); probably should assert root in inode is set here. > + cblock = xfs_btree_get_block(cur, level - 1, &cbp); > + numrecs = xfs_btree_get_numrecs(cblock); > + > + if (numrecs > cur->bc_ops->get_dmaxrecs(cur, level)) > + goto out0; ^^^^ Stray whitespace. > + > + XFS_BTREE_STATS_INC(cur, killroot); > + > +#ifdef DEBUG > + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); > + ASSERT(xfs_btree_ptr_is_null(cur, &ptr)); > + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); > + ASSERT(xfs_btree_ptr_is_null(cur, &ptr)); > + > + // XXX(hch): this assert is bmap btree specific > + ASSERT(cur->bc_ops->get_maxrecs(cur, level) == ^ > + XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); Stray whitespace. As to the assert - what is it really trying to check? That the btree root space in the inode is large enough to fit the max number of records? If so, does it really need to be checked here (i.e. could the caller do it?) Otherwise looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:25:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:25:23 -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=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE,URIBL_BLACK autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m751PGU0023270 for ; Mon, 4 Aug 2008 18:25:18 -0700 X-ASG-Debug-ID: 1217899590-6cd4019e0000-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 C275B19848A1 for ; Mon, 4 Aug 2008 18:26:30 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id rVFx9uulCixCSbsr for ; Mon, 04 Aug 2008 18:26:30 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KQBJm-0006A0-CO; Tue, 05 Aug 2008 01:26:30 +0000 Date: Mon, 4 Aug 2008 21:26:30 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Subject: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Message-ID: <20080805012630.GA22147@infradead.org> References: <20080804013542.GW8819@lst.de> <20080805011437.GM6119@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805011437.GM6119@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: 1217899590 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.1780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17367 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 05, 2008 at 11:14:37AM +1000, Dave Chinner wrote: > On Mon, Aug 04, 2008 at 03:35:42AM +0200, Christoph Hellwig wrote: > > xfs_bmbt_killroot is a mostly generic implementation of moving from > > a real block based root to an inode based root. So move it to xfs_btree.c > > where it can use all the nice infrastructure there and make it pointer > > size agnostic > > > > The new name for it is xfs_btree_root_to_iroot which is not very > > nice but at least slightly more descriptive than the old name. > ..... > > + > > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > > + level = cur->bc_nlevels - 1; > > + ASSERT(level >= 1); > > probably should assert root in inode is set here. We have that check just before the call, so this might be a little overkill.. > > > + cblock = xfs_btree_get_block(cur, level - 1, &cbp); > > + numrecs = xfs_btree_get_numrecs(cblock); > > + > > + if (numrecs > cur->bc_ops->get_dmaxrecs(cur, level)) > > + goto out0; > ^^^^ > Stray whitespace. Already fixed before your mail after I ran checkpatch.pl over all patches - there were a few spread over the various patches. > > + // XXX(hch): this assert is bmap btree specific > > + ASSERT(cur->bc_ops->get_maxrecs(cur, level) == > ^ > > + XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); > > Stray whitespace. As to the assert - what is it really trying to > check? That the btree root space in the inode is large enough to > fit the max number of records? If so, does it really need to be > checked here (i.e. could the caller do it?) I don't think it makes much sense at all. My preference would be to simply kill it. From owner-xfs@oss.sgi.com Mon Aug 4 18:28:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:28:34 -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 (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 m751ST9v023720 for ; Mon, 4 Aug 2008 18:28:29 -0700 X-ASG-Debug-ID: 1217899783-3d6402320000-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 5222C12432CA for ; Mon, 4 Aug 2008 18:29:44 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id puDLVgivkGY3NzNw for ; Mon, 04 Aug 2008 18:29:44 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KQBMt-0006FN-L8; Tue, 05 Aug 2008 01:29:43 +0000 Date: Mon, 4 Aug 2008 21:29:43 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 21/26] implement generic xfs_btree_in??ert/insrec Subject: Re: [PATCH 21/26] implement generic xfs_btree_in??ert/insrec Message-ID: <20080805012943.GB22147@infradead.org> References: <20080804013535.GV8819@lst.de> <20080805010557.GL6119@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805010557.GL6119@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: 1217899784 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17368 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 05, 2008 at 11:05:57AM +1000, Dave Chinner wrote: > I think that ->get_dmaxrecs is probably badly named. I called it > that originally because it matched the macro name it was wrapping. > Realisitically it should be ->get_root_maxrecs.... Yeah. The name giving macro is already gone in my current tree. > > > + /* Make a key out of the record data to be inserted, and save it. */ > > + cur->bc_ops->init_key_from_rec(cur, &key, recp); > > + > > + /* If we're off the left edge, return failure. */ > > + ptr = cur->bc_ptrs[level]; > > + if (ptr == 0) { > > + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); > > + *stat = 0; > > + return 0; > > + } > > You can probably move the key initialisation till after then initial > 'in this block' checks. Done. > > + /* > > + * If the block is full, we can't insert the new entry until we > > + * make the block un-full. > > + */ > > + xfs_btree_set_ptr_null(cur, &nptr); > > + if (numrecs == cur->bc_ops->get_maxrecs(cur, level)) { > > + error = xfs_btree_make_block_unfull(cur, level, numrecs, > > + &optr, &ptr, &nptr, &ncur, &nrec, stat); > > + if (error || *stat == 0) > > + goto error0; > > + } > > + > > + /* The current block may have changed during the split. */ > > + block = xfs_btree_get_block(cur, level, &bp); > > + numrecs = xfs_btree_get_numrecs(block); > > The comment here should probably refer to the unfull call, not a > 'split'. i.e.: > > /* > * the current block may have changed if the block was > * previously full and we have just made space in it. > */ Updated. From owner-xfs@oss.sgi.com Mon Aug 4 18:35:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:35:37 -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,J_CHICKENPOX_65 autolearn=no 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 m751ZZnn024372 for ; Mon, 4 Aug 2008 18:35:36 -0700 X-ASG-Debug-ID: 1217900209-3cf0029e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7005612434AA for ; Mon, 4 Aug 2008 18:36:49 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id Serp44RR43fZmMHz for ; Mon, 04 Aug 2008 18:36:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcOACRLl0h5LAiFXWdsb2JhbACKaIZNHp5o X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174312851" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:06:26 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQBTN-0002A2-52; Tue, 05 Aug 2008 11:36:25 +1000 Date: Tue, 5 Aug 2008 11:36:25 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Subject: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Message-ID: <20080805013625.GN6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013550.GX8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013550.GX8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217900210 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17369 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:35:50AM +0200, Christoph Hellwig wrote: > Make the btree delete code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. ..... > +STATIC int > +xfs_btree_update_root( > + struct xfs_btree_cur *cur, > + struct xfs_buf *bp, > + int level, > + union xfs_btree_ptr *newroot) > +{ > + int error; > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_STATS_INC(cur, killroot); > + > +#ifdef DEBUG > + if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_CNT) { > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); > + > + ASSERT(be32_to_cpu(agf->agf_roots[cur->bc_btnum]) == > + XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); > + } else if (cur->bc_btnum == XFS_BTNUM_INO) { > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); > + xfs_fsblock_t fsbno; > + > + fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, > + be32_to_cpu(agi->agi_root)); > + > + ASSERT(fsbno == XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp))); > + } > +#endif That's kind of messy - can it be pushed out to a separate debug only function? Also, why do we check the inobt against a long pointer, and the allocbt against a short pointer? both are short pointer btrees, so it doesn't really make sense to me to have different checks on them... Otherwise looks pretty good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:36:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:36:47 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m751aeLk024659 for ; Mon, 4 Aug 2008 18:36:41 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA29805; Tue, 5 Aug 2008 11:37:45 +1000 Message-ID: <4897B05A.7040002@sgi.com> Date: Tue, 05 Aug 2008 11:43:54 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Nick Piggin CC: Nick Piggin , Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List , Andrew Morton , dri-devel@lists.sourceforge.net Subject: Re: [rfc][patch 3/3] xfs: use new vmap API References: <20080728123438.GA13926@wotan.suse.de> <20080728123703.GC13926@wotan.suse.de> <4896A197.3090004@sgi.com> <200808042057.20607.nickpiggin@yahoo.com.au> In-Reply-To: <200808042057.20607.nickpiggin@yahoo.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17370 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Okay. When the time comes will you push the XFS changes to mainline or would you like us to? Nick Piggin wrote: > Thanks for taking a look. I'll send them over to -mm with patch 1, > then, for some testing. > > On Monday 04 August 2008 16:28, Lachlan McIlroy wrote: >> Looks good to me. >> >> Nick Piggin wrote: >>> Implement XFS's large buffer support with the new vmap APIs. See the vmap >>> rewrite patch for some numbers. > > -- > 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/ > From owner-xfs@oss.sgi.com Mon Aug 4 18:42:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:42:22 -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 m751gIqv025277 for ; Mon, 4 Aug 2008 18:42:20 -0700 X-ASG-Debug-ID: 1217900611-705802e90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1E3FD35BEDB for ; Mon, 4 Aug 2008 18:43:31 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id DaNr5ezNyXDmdCIG for ; Mon, 04 Aug 2008 18:43:31 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcOACRLl0h5LAiFXWdsb2JhbACKaIZNHp5o X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174318447" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:13:08 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQBZq-0002Ie-51; Tue, 05 Aug 2008 11:43:06 +1000 Date: Tue, 5 Aug 2008 11:43:06 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 24/26] implement generic xfs_btree_getrec Subject: Re: [PATCH 24/26] implement generic xfs_btree_getrec Message-ID: <20080805014306.GO6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013556.GY8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013556.GY8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217900613 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17371 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:35:56AM +0200, Christoph Hellwig wrote: > Not really much reason to make it generic given that it's so small, > but this is the last non-method in xfs_alloc_btree.c and xfs_ialloc_btree.c, > so it makes the whole btree implementation more structured. .... > +int /* error */ > +xfs_btree_getrec( > + struct xfs_btree_cur *cur, /* btree cursor */ > + union xfs_btree_rec **recp, /* output: btree record */ > + int *stat) /* output: success/failure */ > +{ > + struct xfs_btree_block *block; /* btree block */ > + int ptr; /* record number */ > +#ifdef DEBUG > + int error; /* error return value */ > +#endif > + > + ptr = cur->bc_ptrs[0]; > + block = XFS_BUF_TO_BLOCK(cur->bc_bufs[0]); Would it make more sense to use: block = xfs_btree_get_block(cur, 0, &bp); > + > +#ifdef DEBUG > + error = xfs_btree_check_block(cur, block, 0, cur->bc_bufs[0]); and then pass bp here? I'd rather use the helpers to do this than open code it like everything else does.... Otherwise it looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:43:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:43:09 -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 m751h6Xf025594 for ; Mon, 4 Aug 2008 18:43:06 -0700 X-ASG-Debug-ID: 1217900659-0b3d00ce0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0BA235BEEC for ; Mon, 4 Aug 2008 18:44:19 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id 0e2F5YC3H6nP2svr for ; Mon, 04 Aug 2008 18:44:19 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcOACRLl0h5LAiFXWdsb2JhbACKaIZNHp5o X-IronPort-AV: E=Sophos;i="4.31,306,1215354600"; d="scan'208";a="174318983" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:13:52 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQBaW-0002Jd-GA; Tue, 05 Aug 2008 11:43:48 +1000 Date: Tue, 5 Aug 2008 11:43:48 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 25/26] kill xfs_bmbt_log_block Subject: Re: [PATCH 25/26] kill xfs_bmbt_log_block Message-ID: <20080805014348.GP6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013602.GZ8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013602.GZ8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217900660 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.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17372 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:36:02AM +0200, Christoph Hellwig wrote: > Only one caller left, which can just use xfs_btree_log_block if we export it. looks fine. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 18:44:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:44:13 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no 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 m751iBVl025974 for ; Mon, 4 Aug 2008 18:44:11 -0700 X-ASG-Debug-ID: 1217900724-3cc803310000-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 67744124399A for ; Mon, 4 Aug 2008 18:45:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id d1Gx5UiBIn5v0nX5 for ; Mon, 04 Aug 2008 18:45:24 -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 m751jOIF006853 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 5 Aug 2008 03:45:25 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m751jOHo006850; Tue, 5 Aug 2008 03:45:24 +0200 Date: Tue, 5 Aug 2008 03:45:24 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Subject: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Message-ID: <20080805014524.GA6465@lst.de> References: <20080804013550.GX8819@lst.de> <20080805013625.GN6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805013625.GN6119@disturbed> 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: 1217900726 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17373 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 Tue, Aug 05, 2008 at 11:36:25AM +1000, Dave Chinner wrote: > > +#ifdef DEBUG > > + if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_CNT) { > > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > > + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); > > + > > + ASSERT(be32_to_cpu(agf->agf_roots[cur->bc_btnum]) == > > + XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); > > + } else if (cur->bc_btnum == XFS_BTNUM_INO) { > > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > > + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); > > + xfs_fsblock_t fsbno; > > + > > + fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, > > + be32_to_cpu(agi->agi_root)); > > + > > + ASSERT(fsbno == XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp))); > > + } > > +#endif > > That's kind of messy - can it be pushed out to a separate debug only > function? Also, why do we check the inobt against a long pointer, > and the allocbt against a short pointer? both are short pointer > btrees, so it doesn't really make sense to me to have different > checks on them... The old inobt code built a long pointer to pass it to xfs_free_extent, and this assert validates we get the same block. The right thing to do here is to just remove this crap, it was just there to make sure I didn't add a really bad thinko. > Otherwise looks pretty good. Unfortunately it's buggy, though. The cur->bc_bufs[level] = NULL; vs xfs_btree_setbuf(cur, level, NULL); does make an enormous difference for 512byte block size filesystems. I'll have to find out what's going on in this area, and to make things worse I remember spotting a similar different between the ialloc and alloc btrees somewhere earlier in the series. From owner-xfs@oss.sgi.com Mon Aug 4 18:45:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 18:45:59 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m751jvJT026383 for ; Mon, 4 Aug 2008 18:45:57 -0700 X-ASG-Debug-ID: 1217900831-7afa02230000-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 28FEF1984A45 for ; Mon, 4 Aug 2008 18:47:11 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id aETbBvkt52A5KW5u for ; Mon, 04 Aug 2008 18:47:11 -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 m751lDIF007087 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 5 Aug 2008 03:47:13 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m751lDoa007085; Tue, 5 Aug 2008 03:47:13 +0200 Date: Tue, 5 Aug 2008 03:47:13 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 24/26] implement generic xfs_btree_getrec Subject: Re: [PATCH 24/26] implement generic xfs_btree_getrec Message-ID: <20080805014713.GB6465@lst.de> References: <20080804013556.GY8819@lst.de> <20080805014306.GO6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805014306.GO6119@disturbed> 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: 1217900832 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17374 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 Tue, Aug 05, 2008 at 11:43:06AM +1000, Dave Chinner wrote: > On Mon, Aug 04, 2008 at 03:35:56AM +0200, Christoph Hellwig wrote: > > Not really much reason to make it generic given that it's so small, > > but this is the last non-method in xfs_alloc_btree.c and xfs_ialloc_btree.c, > > so it makes the whole btree implementation more structured. > .... > > +int /* error */ > > +xfs_btree_getrec( > > + struct xfs_btree_cur *cur, /* btree cursor */ > > + union xfs_btree_rec **recp, /* output: btree record */ > > + int *stat) /* output: success/failure */ > > +{ > > + struct xfs_btree_block *block; /* btree block */ > > + int ptr; /* record number */ > > +#ifdef DEBUG > > + int error; /* error return value */ > > +#endif > > + > > + ptr = cur->bc_ptrs[0]; > > + block = XFS_BUF_TO_BLOCK(cur->bc_bufs[0]); > > Would it make more sense to use: > > block = xfs_btree_get_block(cur, 0, &bp); > > > + > > +#ifdef DEBUG > > + error = xfs_btree_check_block(cur, block, 0, cur->bc_bufs[0]); > > and then pass bp here? I'd rather use the helpers to do this than > open code it like everything else does.... Thanks, updated. From owner-xfs@oss.sgi.com Mon Aug 4 19:04:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 19:04:35 -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.2 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 m7524T7n027619 for ; Mon, 4 Aug 2008 19:04:32 -0700 X-ASG-Debug-ID: 1217901943-0b3d01cf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A18D935C33C for ; Mon, 4 Aug 2008 19:05:44 -0700 (PDT) Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id IbKIDGtBoMHrglxv for ; Mon, 04 Aug 2008 19:05:44 -0700 (PDT) X-ASG-Whitelist: Client X-ASG-Whitelist: Barracuda Reputation Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 071CD415E2; Tue, 5 Aug 2008 04:05:40 +0200 (CEST) Date: Tue, 5 Aug 2008 04:05:39 +0200 From: Nick Piggin To: Lachlan McIlroy Cc: Nick Piggin , Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List , Andrew Morton , dri-devel@lists.sourceforge.net X-ASG-Orig-Subj: Re: [rfc][patch 3/3] xfs: use new vmap API Subject: Re: [rfc][patch 3/3] xfs: use new vmap API Message-ID: <20080805020539.GA15075@wotan.suse.de> References: <20080728123438.GA13926@wotan.suse.de> <20080728123703.GC13926@wotan.suse.de> <4896A197.3090004@sgi.com> <200808042057.20607.nickpiggin@yahoo.com.au> <4897B05A.7040002@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4897B05A.7040002@sgi.com> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: ns1.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1217901944 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17375 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: npiggin@suse.de Precedence: bulk X-list: xfs Assuming patch 1 gets merged upstream, I think Andrew would normally send off 2 and 3 to the XFS maintainers at that point (ie. when its prerequisites are upstream) for you to merge. On Tue, Aug 05, 2008 at 11:43:54AM +1000, Lachlan McIlroy wrote: > Okay. When the time comes will you push the XFS changes to mainline > or would you like us to? > > Nick Piggin wrote: > >Thanks for taking a look. I'll send them over to -mm with patch 1, > >then, for some testing. > > > >On Monday 04 August 2008 16:28, Lachlan McIlroy wrote: > >>Looks good to me. > >> > >>Nick Piggin wrote: > >>>Implement XFS's large buffer support with the new vmap APIs. See the vmap > >>>rewrite patch for some numbers. From owner-xfs@oss.sgi.com Mon Aug 4 19:06:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 19:06:54 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64,J_CHICKENPOX_66,J_CHICKENPOX_74 autolearn=no 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 m7526qdK028074 for ; Mon, 4 Aug 2008 19:06:52 -0700 X-ASG-Debug-ID: 1217902085-0c5201c40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CBE6735C369 for ; Mon, 4 Aug 2008 19:08:05 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id hyoqI3gnJGSx1xQS for ; Mon, 04 Aug 2008 19:08:05 -0700 (PDT) Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:36:57 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQBwu-0002ol-UU; Tue, 05 Aug 2008 12:06:56 +1000 Date: Tue, 5 Aug 2008 12:06:51 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 26/26] add rec_len and key_len fields to struct xfs_btree_ops Subject: Re: [PATCH 26/26] add rec_len and key_len fields to struct xfs_btree_ops Message-ID: <20080805020651.GQ6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013608.GA8819@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080804013608.GA8819@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217902086 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.1781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17376 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 03:36:08AM +0200, Christoph Hellwig wrote: > XXX: add detailed patch explanation here heh ;) ..... > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-04 01:48:35.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-04 01:49:13.000000000 +0200 > @@ -1037,6 +1037,82 @@ xfs_btree_read_buf_block( > return error; > } > > +static inline size_t xfs_btree_block_len(struct xfs_btree_cur *cur) > +{ > + return (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? > + sizeof(struct xfs_btree_lblock) : > + sizeof(struct xfs_btree_sblock); > +} That's really the block header length, not the block length. Can you change the name to reflect that? > + > +static inline size_t xfs_btree_ptr_len(struct xfs_btree_cur *cur) > +{ > + return (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? > + sizeof(__be64) : sizeof(__be32); > +} > + > +static size_t > +xfs_btree_ptr_offset( > + struct xfs_btree_cur *cur, > + int index, > + int level) > +{ > + return xfs_btree_block_len(cur) + > + cur->bc_ops->get_maxrecs(cur, level) * cur->bc_ops->key_len + > + (index - 1) * xfs_btree_ptr_len(cur); > +} I'd suggest a comment here just reminding the reader about the key/ptr block structure. i.e. key space is at the start of the block, ptr space is after the key space. Also a comment here reminding that btree indexes are 1-numbered, not 0-numbered and hence the need for 'index - 1' in the offset calculations. > STATIC void > +xfs_btree_set_key( > + struct xfs_btree_cur *cur, > + union xfs_btree_key *key_addr, > + int index, > + union xfs_btree_key *newkey) > +{ > + char *kp; > + > + kp = (char *)key_addr + (index * cur->bc_ops->key_len); > + > + memcpy(kp, newkey, cur->bc_ops->key_len); > +} And then for these set functions, the index has already been converted from 1-numbered to 0-numbered by the caller, hence the direct use of 'index' without correction. > @@ -1079,6 +1183,44 @@ xfs_btree_move_ptrs( > } > > STATIC void > +xfs_btree_move_keys( > + struct xfs_btree_cur *cur, > + union xfs_btree_key *key, > + int from, > + int to, > + int numkeys) > +{ > + char *base = (char *)key; > + > + ASSERT(from >= 0); > + ASSERT(to >= 0); > + ASSERT(numkeys >= 0); > + > + memmove(base + (to * cur->bc_ops->key_len), > + base + (from * cur->bc_ops->key_len), > + numkeys * cur->bc_ops->key_len); > +} Comment about from and to being logical offsets from the base, not byte counts. Hmmm - seeing how frequently the functions like xfs_btree_key_addr() are called, should we prevent them from being inlined automatically by the compiler (i.e. make them STATIC or explictly noinline)? Otherwise seems sane to me. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 19:08:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 19:08:29 -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,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7528QjO028483 for ; Mon, 4 Aug 2008 19:08:27 -0700 X-ASG-Debug-ID: 1217902175-097e025e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F1CE2198487A for ; Mon, 4 Aug 2008 19:09:40 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id r4anVa9FG52aojV6 for ; Mon, 04 Aug 2008 19:09:40 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcOAO9Rl0h5LAiFXWdsb2JhbACKaIZNHp46 X-IronPort-AV: E=Sophos;i="4.31,307,1215354600"; d="scan'208";a="174334550" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:38:58 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQByq-0002rP-8t; Tue, 05 Aug 2008 12:08:56 +1000 Date: Tue, 5 Aug 2008 12:08:56 +1000 From: Dave Chinner To: Christoph Hellwig Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Subject: Re: [PATCH 22/26] move xfs_bmbt_killroot to common code Message-ID: <20080805020856.GR6119@disturbed> Mail-Followup-To: Christoph Hellwig , Christoph Hellwig , xfs@oss.sgi.com References: <20080804013542.GW8819@lst.de> <20080805011437.GM6119@disturbed> <20080805012630.GA22147@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805012630.GA22147@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217902180 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.1784 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17377 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 04, 2008 at 09:26:30PM -0400, Christoph Hellwig wrote: > On Tue, Aug 05, 2008 at 11:14:37AM +1000, Dave Chinner wrote: > > On Mon, Aug 04, 2008 at 03:35:42AM +0200, Christoph Hellwig wrote: > > > xfs_bmbt_killroot is a mostly generic implementation of moving from > > > a real block based root to an inode based root. So move it to xfs_btree.c > > > where it can use all the nice infrastructure there and make it pointer > > > size agnostic > > > > > > The new name for it is xfs_btree_root_to_iroot which is not very > > > nice but at least slightly more descriptive than the old name. > > ..... > > > + > > > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > > > + level = cur->bc_nlevels - 1; > > > + ASSERT(level >= 1); > > > > probably should assert root in inode is set here. > > We have that check just before the call, so this might be a little > overkill.. Fair enough. > > > + // XXX(hch): this assert is bmap btree specific > > > + ASSERT(cur->bc_ops->get_maxrecs(cur, level) == > > ^ > > > + XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); > > > > Stray whitespace. As to the assert - what is it really trying to > > check? That the btree root space in the inode is large enough to > > fit the max number of records? If so, does it really need to be > > checked here (i.e. could the caller do it?) > > I don't think it makes much sense at all. My preference would > be to simply kill it. Agreed. Kill it - I don't think it adds any value. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 19:19:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 19:19:52 -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,J_CHICKENPOX_65 autolearn=no 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 m752Jorh029537 for ; Mon, 4 Aug 2008 19:19:50 -0700 X-ASG-Debug-ID: 1217902864-0c1f028f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 89C5635C1A4 for ; Mon, 4 Aug 2008 19:21:04 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id XyWtGGADmrJG4jkG for ; Mon, 04 Aug 2008 19:21:04 -0700 (PDT) Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 11:48:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQC8A-00034G-V3; Tue, 05 Aug 2008 12:18:34 +1000 Date: Tue, 5 Aug 2008 12:18:34 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Subject: Re: [PATCH 23/26] implement generic xfs_btree_delete/delrec Message-ID: <20080805021834.GS6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080804013550.GX8819@lst.de> <20080805013625.GN6119@disturbed> <20080805014524.GA6465@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805014524.GA6465@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217902865 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0012 1.0000 -2.0135 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.41 X-Barracuda-Spam-Status: No, SCORE=-1.41 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1785 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17378 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 03:45:24AM +0200, Christoph Hellwig wrote: > On Tue, Aug 05, 2008 at 11:36:25AM +1000, Dave Chinner wrote: > > > +#ifdef DEBUG > > > + if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_CNT) { > > > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > > > + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); > > > + > > > + ASSERT(be32_to_cpu(agf->agf_roots[cur->bc_btnum]) == > > > + XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); > > > + } else if (cur->bc_btnum == XFS_BTNUM_INO) { > > > + struct xfs_buf *agbp = cur->bc_private.a.agbp; > > > + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); > > > + xfs_fsblock_t fsbno; > > > + > > > + fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, > > > + be32_to_cpu(agi->agi_root)); > > > + > > > + ASSERT(fsbno == XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp))); > > > + } > > > +#endif > > > > That's kind of messy - can it be pushed out to a separate debug only > > function? Also, why do we check the inobt against a long pointer, > > and the allocbt against a short pointer? both are short pointer > > btrees, so it doesn't really make sense to me to have different > > checks on them... > > The old inobt code built a long pointer to pass it to xfs_free_extent, > and this assert validates we get the same block. The right thing to > do here is to just remove this crap, it was just there to make sure > I didn't add a really bad thinko. > > > Otherwise looks pretty good. > > Unfortunately it's buggy, though. The cur->bc_bufs[level] = NULL; vs > xfs_btree_setbuf(cur, level, NULL); does make an enormous difference > for 512byte block size filesystems. I was going to come back to that - I'd noticed that difference but hadn't looked deeply into the change that it would cause. It looks like: a) it releases the old buffer b) clears the readahead status in the cursor a) will increase CPU overhead, but if the buffer is dirty won't affect behaviour at all as it will be held till transaction commit. b) will have a significant impact on the performance of btree traversals. That will show up most in small block size filesystems... So it shouldn't be a corruption causing change, only a performance degrading change. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 4 23:26:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 23:26:28 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m756Q0Fu015064 for ; Mon, 4 Aug 2008 23:26:00 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA05547; Tue, 5 Aug 2008 16:27:14 +1000 Message-ID: <4897F434.2010309@sgi.com> Date: Tue, 05 Aug 2008 16:33:24 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs@oss.sgi.com, xfs-dev Subject: [PATCH] Don't release root inode until finished using it Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17379 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs During unmount we're releasing the last reference on the root inode before we've finished using it so move it after the XFS_SEND_UNMOUNT hook. --- a/fs/xfs/linux-2.6/xfs_super.c 2008-08-05 13:12:39.000000000 +1000 +++ b/fs/xfs/linux-2.6/xfs_super.c 2008-08-04 14:34:56.000000000 +1000 @@ -1132,8 +1132,6 @@ xfs_fs_put_super( error = xfs_unmount_flush(mp, 0); WARN_ON(error); - IRELE(rip); - /* * If we're forcing a shutdown, typically because of a media error, * we want to make sure we invalidate dirty pages that belong to @@ -1149,6 +1147,8 @@ xfs_fs_put_super( unmount_event_flags); } + IRELE(rip); + xfs_unmountfs(mp); xfs_icsb_destroy_counters(mp); xfs_close_devices(mp); From owner-xfs@oss.sgi.com Mon Aug 4 23:36:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 04 Aug 2008 23:36:11 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m756a5Rl015846 for ; Mon, 4 Aug 2008 23:36:05 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA05799; Tue, 5 Aug 2008 16:37:19 +1000 Message-ID: <4897F691.6010806@sgi.com> Date: Tue, 05 Aug 2008 16:43:29 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs@oss.sgi.com, xfs-dev Subject: [PATCH] Move vn_iowait() earlier in the reclaim path Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17380 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Currently by the time we get to vn_iowait() in xfs_reclaim() we have already gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O completions still running (file size updates and unwritten extent conversions) may be working on an inode that is no longer valid. --- a/fs/xfs/linux-2.6/xfs_super.c 2008-08-05 16:27:57.000000000 +1000 +++ b/fs/xfs/linux-2.6/xfs_super.c 2008-08-05 13:54:41.000000000 +1000 @@ -935,6 +935,7 @@ xfs_fs_clear_inode( XFS_STATS_INC(vn_reclaim); XFS_STATS_DEC(vn_active); + vn_iowait(ip); xfs_inactive(ip); xfs_iflags_clear(ip, XFS_IMODIFIED); if (xfs_reclaim(ip)) --- a/fs/xfs/xfs_vnodeops.c 2008-08-05 16:27:57.000000000 +1000 +++ b/fs/xfs/xfs_vnodeops.c 2008-08-05 13:54:43.000000000 +1000 @@ -2802,8 +2802,6 @@ xfs_reclaim( return 0; } - vn_iowait(ip); - ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0); /* From owner-xfs@oss.sgi.com Tue Aug 5 00:02:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:02:47 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7572YPm019666 for ; Tue, 5 Aug 2008 00:02:35 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06321; Tue, 5 Aug 2008 17:03:49 +1000 Message-ID: <4897FCC7.400@sgi.com> Date: Tue, 05 Aug 2008 17:09:59 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs-oss , xfs-dev Subject: [PATCH] Use KM_NOFS for debug trace buffers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17381 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Use KM_NOFS to prevent recursion back into the filesystem which can cause deadlocks. In the case of xfs_iread() we hold the lock on the inode cluster buffer while allocating memory for the trace buffers. If we recurse back into XFS to flush data that may require a transaction to allocate extents which needs log space. This can deadlock with the xfsaild thread which can't push the tail of the log because it is trying to get the inode cluster buffer lock. --- a/fs/xfs/linux-2.6/xfs_buf.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/linux-2.6/xfs_buf.c 2008-08-05 16:38:43.000000000 +1000 @@ -1795,7 +1795,7 @@ int __init xfs_buf_init(void) { #ifdef XFS_BUF_TRACE - xfs_buf_trace_buf = ktrace_alloc(XFS_BUF_TRACE_SIZE, KM_SLEEP); + xfs_buf_trace_buf = ktrace_alloc(XFS_BUF_TRACE_SIZE, KM_NOFS); #endif xfs_buf_zone = kmem_zone_init_flags(sizeof(xfs_buf_t), "xfs_buf", --- a/fs/xfs/quota/xfs_dquot.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/quota/xfs_dquot.c 2008-08-05 13:54:41.000000000 +1000 @@ -105,7 +105,7 @@ xfs_qm_dqinit( sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq"); #ifdef XFS_DQUOT_TRACE - dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_SLEEP); + dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_NOFS); xfs_dqtrace_entry(dqp, "DQINIT"); #endif } else { --- a/fs/xfs/xfs_buf_item.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/xfs_buf_item.c 2008-08-05 13:54:42.000000000 +1000 @@ -737,7 +737,7 @@ xfs_buf_item_init( bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); bip->bli_format.blf_map_size = map_size; #ifdef XFS_BLI_TRACE - bip->bli_trace = ktrace_alloc(XFS_BLI_TRACE_SIZE, KM_SLEEP); + bip->bli_trace = ktrace_alloc(XFS_BLI_TRACE_SIZE, KM_NOFS); #endif #ifdef XFS_TRANS_DEBUG --- a/fs/xfs/xfs_filestream.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/xfs_filestream.c 2008-08-05 13:54:42.000000000 +1000 @@ -400,7 +400,7 @@ xfs_filestream_init(void) if (!item_zone) return -ENOMEM; #ifdef XFS_FILESTREAMS_TRACE - xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_SLEEP); + xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_NOFS); #endif return 0; } --- a/fs/xfs/xfs_inode.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/xfs_inode.c 2008-08-05 13:54:42.000000000 +1000 @@ -835,22 +835,22 @@ xfs_iread( * Do this before xfs_iformat in case it adds entries. */ #ifdef XFS_INODE_TRACE - ip->i_trace = ktrace_alloc(INODE_TRACE_SIZE, KM_SLEEP); + ip->i_trace = ktrace_alloc(INODE_TRACE_SIZE, KM_NOFS); #endif #ifdef XFS_BMAP_TRACE - ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); + ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_NOFS); #endif #ifdef XFS_BMBT_TRACE - ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_SLEEP); + ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_NOFS); #endif #ifdef XFS_RW_TRACE - ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, KM_SLEEP); + ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, KM_NOFS); #endif #ifdef XFS_ILOCK_TRACE - ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, KM_SLEEP); + ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, KM_NOFS); #endif #ifdef XFS_DIR2_TRACE - ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_SLEEP); + ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS); #endif /* --- a/fs/xfs/xfs_log.c 2008-08-05 16:38:48.000000000 +1000 +++ b/fs/xfs/xfs_log.c 2008-08-05 13:54:42.000000000 +1000 @@ -160,7 +160,7 @@ void xlog_trace_iclog(xlog_in_core_t *iclog, uint state) { if (!iclog->ic_trace) - iclog->ic_trace = ktrace_alloc(256, KM_SLEEP); + iclog->ic_trace = ktrace_alloc(256, KM_NOFS); ktrace_enter(iclog->ic_trace, (void *)((unsigned long)state), (void *)((unsigned long)current_pid()), From owner-xfs@oss.sgi.com Tue Aug 5 00:12:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:12:34 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757CPia024085 for ; Tue, 5 Aug 2008 00:12:26 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06637; Tue, 5 Aug 2008 17:13:37 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 3576B58C52A4; Tue, 5 Aug 2008 17:13:37 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - use get_unaligned_* helpers Message-Id: <20080805071337.3576B58C52A4@chook.melbourne.sgi.com> Date: Tue, 5 Aug 2008 17:13:37 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17382 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs use get_unaligned_* helpers Signed-off-by: Harvey Harrison Date: Tue Aug 5 17:12:48 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: harvey.harrison@gmail.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31813a fs/xfs/xfs_inode.c - 1.515 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.515&r2=text&tr2=1.514&f=h - use get_unaligned_* helpers From owner-xfs@oss.sgi.com Tue Aug 5 00:20:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:20:34 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757KR9m003760 for ; Tue, 5 Aug 2008 00:20:27 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06914; Tue, 5 Aug 2008 17:21:40 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id EBE0D58C52A4; Tue, 5 Aug 2008 17:21:39 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - clean up stale references to semaphores Message-Id: <20080805072139.EBE0D58C52A4@chook.melbourne.sgi.com> Date: Tue, 5 Aug 2008 17:21:39 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17383 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs clean up stale references to semaphores A lot of code has been converted away from semaphores, but there are still comments that reference semaphore behaviour. The log code is the worst offender. Update the comments to reflect what the code really does now. Signed-off-by: Dave Chinner Date: Tue Aug 5 17:20:54 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31814a fs/xfs/xfs_log.c - 1.360 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.360&r2=text&tr2=1.359&f=h fs/xfs/xfs_log_priv.h - 1.132 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_priv.h.diff?r1=text&tr1=1.132&r2=text&tr2=1.131&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.162 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.162&r2=text&tr2=1.161&f=h - clean up stale references to semaphores From owner-xfs@oss.sgi.com Tue Aug 5 00:25:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:25:23 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757PBlb007810 for ; Tue, 5 Aug 2008 00:25:12 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07004; Tue, 5 Aug 2008 17:26:24 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 9FFAA58C52A4; Tue, 5 Aug 2008 17:26:24 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - replace the XFS buf iodone semaphore with a completion Message-Id: <20080805072624.9FFAA58C52A4@chook.melbourne.sgi.com> Date: Tue, 5 Aug 2008 17:26:24 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17384 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs replace the XFS buf iodone semaphore with a completion The xfs_buf_t b_iodonesema is really just a semaphore that wants to be a completion. Change it to a completion and remove the last user of the sema_t from XFS. Signed-off-by: Dave Chinner Date: Tue Aug 5 17:25:44 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31815a fs/xfs/xfs_rw.c - 1.401 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rw.c.diff?r1=text&tr1=1.401&r2=text&tr2=1.400&f=h fs/xfs/xfs_buf_item.c - 1.167 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_buf_item.c.diff?r1=text&tr1=1.167&r2=text&tr2=1.166&f=h fs/xfs/linux-2.6/xfs_buf.h - 1.127 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.h.diff?r1=text&tr1=1.127&r2=text&tr2=1.126&f=h fs/xfs/linux-2.6/xfs_buf.c - 1.261 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.c.diff?r1=text&tr1=1.261&r2=text&tr2=1.260&f=h - replace the XFS buf iodone semaphore with a completion From owner-xfs@oss.sgi.com Tue Aug 5 00:34:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:34:43 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757YOmc012985 for ; Tue, 5 Aug 2008 00:34:25 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07259; Tue, 5 Aug 2008 17:35:36 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id A587B58C52A4; Tue, 5 Aug 2008 17:35:36 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - extend completions to provide XFS object flush requirements Message-Id: <20080805073536.A587B58C52A4@chook.melbourne.sgi.com> Date: Tue, 5 Aug 2008 17:35:36 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17385 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Date: Tue Aug 5 17:34:21 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: 2.6.x-xfs-melb:linux:31816a include/linux/completion.h - 1.6 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/include/linux/completion.h.diff?r1=text&tr1=1.6&r2=text&tr2=1.5&f=h - extend completions to provide XFS object flush requirements XFS object flushing doesn't quite match existing completion semantics. It mixed exclusive access with completion. That is, we need to mark an object as being flushed before flushing it to disk, and then block any other attempt to flush it until the completion occurs. We do this but adding an extra count to the completion before we start using them. However, we still need to determine if there is a completion in progress, and allow no-blocking attempts fo completions to decrement the count. To do this we introduce: int try_wait_for_completion(struct completion *x) returns a failure status if done == 0, otherwise decrements done to zero and returns a "started" status. This is provided to allow counted completions to begin safely while holding object locks in inverted order. int completion_done(struct completion *x) returns 1 if there is no waiter, 0 if there is a waiter (i.e. a completion in progress). This replaces the use of semaphores for providing this exclusion and completion mechanism. Signed-off-by: Dave Chinner From owner-xfs@oss.sgi.com Tue Aug 5 00:36:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:36:18 -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 m757a8RH013247 for ; Tue, 5 Aug 2008 00:36:08 -0700 X-ASG-Debug-ID: 1217921841-75e702c20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A607E35CE61 for ; Tue, 5 Aug 2008 00:37:21 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id 7i03jcvdICXypBot for ; Tue, 05 Aug 2008 00:37:21 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUMAN+dl0h5LAiFXWdsb2JhbACKc4Y7Hpxn X-IronPort-AV: E=Sophos;i="4.31,309,1215354600"; d="scan'208";a="174560785" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 17:07:18 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQH6V-0001Up-F2; Tue, 05 Aug 2008 17:37:11 +1000 Date: Tue, 5 Aug 2008 17:37:11 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Message-ID: <20080805073711.GA21635@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F691.6010806@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4897F691.6010806@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217921842 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.1803 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17386 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: > Currently by the time we get to vn_iowait() in xfs_reclaim() we have already > gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O xfs_free()? What's that? > completions still running (file size updates and unwritten extent conversions) > may be working on an inode that is no longer valid. The linux inode does not get freed until after ->clear_inode completes, hence it is perfectly valid to reference it anywhere in the ->clear_inode path. My bet is that you are seeing I/O completion mark an inode dirty that is being freed. ie. Calling mark_inode_dirty_sync() in the I/O completion blindly assumes that the linux inode is still valid, when it may be in the 'being freed' path. e.g. we can put it back on the superblock dirty list just before it gets freed for real... I came across this about a week ago when tracking down a QA failure with a combined linux/XFS inode patch. The fix is to make I/O completion call xfs_mark_inode_dirty_sync() so we check that this linux inode not in the process of being freed before we try to mark it dirty. Cheers, Dave. -- Dave Chinner david@fromorbit.com XFS: Never call mark_inode_dirty_sync() directly Once the Linux inode and the XFS inode are combined, we cannot rely on just checking if the linux inode exists as a method of determining if it is valid or not. Hence we should always call xfs_mark_inode_dirty_sync() as it does the correct checks to determine if the linux inode is in a valid state or not before marking it dirty. --- fs/xfs/linux-2.6/xfs_aops.c | 2 +- fs/xfs/linux-2.6/xfs_iops.c | 4 ++-- fs/xfs/linux-2.6/xfs_super.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 0b211cb..45c53a7 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -192,7 +192,7 @@ xfs_setfilesize( ip->i_d.di_size = isize; ip->i_update_core = 1; ip->i_update_size = 1; - mark_inode_dirty_sync(ioend->io_inode); + xfs_mark_inode_dirty_sync(ip); } xfs_iunlock(ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 1240b73..379f19b 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -133,7 +133,7 @@ xfs_ichgtime( SYNCHRONIZE(); ip->i_update_core = 1; if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(ip); } /* @@ -178,7 +178,7 @@ xfs_ichgtime_fast( SYNCHRONIZE(); ip->i_update_core = 1; if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(ip); } /* diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index fc00499..e9cb0e9 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -963,7 +963,7 @@ xfs_fs_write_inode( * it dirty again so we'll try again later. */ if (error) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(XFS_I(inode)); return -error; } From owner-xfs@oss.sgi.com Tue Aug 5 00:37:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:38:10 -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 (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 m757bGR6013656 for ; Tue, 5 Aug 2008 00:37:16 -0700 X-ASG-Debug-ID: 1217921910-5564030d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 26DBF1246C5E for ; Tue, 5 Aug 2008 00:38:30 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id ttc85ZGPhUMG9Qeu for ; Tue, 05 Aug 2008 00:38:30 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUMAN+dl0h5LAiFXWdsb2JhbACKc4Y7Hpxn X-IronPort-AV: E=Sophos;i="4.31,309,1215354600"; d="scan'208";a="174561504" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 17:08:27 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQH7j-0001WX-4f; Tue, 05 Aug 2008 17:38:27 +1000 Date: Tue, 5 Aug 2008 17:38:27 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Don't release root inode until finished using it Subject: Re: [PATCH] Don't release root inode until finished using it Message-ID: <20080805073827.GB21635@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F434.2010309@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4897F434.2010309@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217921911 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.1805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17387 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 04:33:24PM +1000, Lachlan McIlroy wrote: > During unmount we're releasing the last reference on the root inode > before we've finished using it so move it after the XFS_SEND_UNMOUNT > hook. Looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 00:38:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:38:44 -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 (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 m757cO22013889 for ; Tue, 5 Aug 2008 00:38:24 -0700 X-ASG-Debug-ID: 1217921978-591902900000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 563B11246DB8 for ; Tue, 5 Aug 2008 00:39:38 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id ZbgDJJKgTugaTSgH for ; Tue, 05 Aug 2008 00:39:38 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUMAN+dl0h5LAiFXWdsb2JhbACKc4Y7Hpxn X-IronPort-AV: E=Sophos;i="4.31,309,1215354600"; d="scan'208";a="174562178" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 17:09:37 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQH8r-0001Y4-AH; Tue, 05 Aug 2008 17:39:37 +1000 Date: Tue, 5 Aug 2008 17:39:37 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs-oss , xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Use KM_NOFS for debug trace buffers Subject: Re: [PATCH] Use KM_NOFS for debug trace buffers Message-ID: <20080805073937.GC21635@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs-oss , xfs-dev References: <4897FCC7.400@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4897FCC7.400@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217921979 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.1805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17388 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 05:09:59PM +1000, Lachlan McIlroy wrote: > Use KM_NOFS to prevent recursion back into the filesystem which can > cause deadlocks. > > In the case of xfs_iread() we hold the lock on the inode cluster buffer > while allocating memory for the trace buffers. If we recurse back into > XFS to flush data that may require a transaction to allocate extents > which needs log space. This can deadlock with the xfsaild thread which > can't push the tail of the log because it is trying to get the inode > cluster buffer lock. Looks OK. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 00:40:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:40:26 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757eDYt014531 for ; Tue, 5 Aug 2008 00:40:14 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07454; Tue, 5 Aug 2008 17:41:26 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 7B66358C52A4; Tue, 5 Aug 2008 17:41:26 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - replace inode flush semaphore with a completion Message-Id: <20080805074126.7B66358C52A4@chook.melbourne.sgi.com> Date: Tue, 5 Aug 2008 17:41:26 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17389 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs replace inode flush semaphore with a completion Use the new completion flush code to implement the inode flush lock. Removes one of the final users of semaphores in the XFS code base. Signed-off-by: Dave Chinner Date: Tue Aug 5 17:40:34 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31817a fs/xfs/xfs_inode_item.c - 1.139 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode_item.c.diff?r1=text&tr1=1.139&r2=text&tr2=1.138&f=h fs/xfs/xfs_iget.c - 1.244 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iget.c.diff?r1=text&tr1=1.244&r2=text&tr2=1.243&f=h fs/xfs/xfs_inode.c - 1.516 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.516&r2=text&tr2=1.515&f=h fs/xfs/xfs_inode.h - 1.255 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.255&r2=text&tr2=1.254&f=h - replace inode flush semaphore with a completion From owner-xfs@oss.sgi.com Tue Aug 5 00:43:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:43:22 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m757hGdj014975 for ; Tue, 5 Aug 2008 00:43:16 -0700 X-ASG-Debug-ID: 1217922269-19da038e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0F19E1985425 for ; Tue, 5 Aug 2008 00:44:30 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id wTMs54y6no6aJyvx for ; Tue, 05 Aug 2008 00:44:30 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUMAGOhl0h5LAiFXWdsb2JhbACKc4Y7HpxV X-IronPort-AV: E=Sophos;i="4.31,309,1215354600"; d="scan'208";a="174565112" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 17:14:27 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQHDV-0001ee-KG; Tue, 05 Aug 2008 17:44:25 +1000 Date: Tue, 5 Aug 2008 17:44:25 +1000 From: Dave Chinner To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Message-ID: <20080805074425.GD21635@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080805073711.GA21635@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217922271 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.1804 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17390 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 05:37:11PM +1000, Dave Chinner wrote: > On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: > > Currently by the time we get to vn_iowait() in xfs_reclaim() we have already > > gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O > > xfs_free()? What's that? > > > completions still running (file size updates and unwritten extent conversions) > > may be working on an inode that is no longer valid. > > The linux inode does not get freed until after ->clear_inode > completes, hence it is perfectly valid to reference it anywhere > in the ->clear_inode path. > > My bet is that you are seeing I/O completion mark an inode dirty > that is being freed. ie. Calling mark_inode_dirty_sync() in the I/O > completion blindly assumes that the linux inode is still valid, > when it may be in the 'being freed' path. e.g. we can put it back on the > superblock dirty list just before it gets freed for real... > > I came across this about a week ago when tracking down a QA failure > with a combined linux/XFS inode patch. The fix is to make I/O > completion call xfs_mark_inode_dirty_sync() so we check that this > linux inode not in the process of being freed before we try to > mark it dirty. Oh, I should point out that that xfs_mark_inode_dirty sync looked like this prior to the patch I posted: /* * If the linux inode is valid, mark it dirty. * Used when commiting a dirty inode into a transaction so that * the inode will get written back by the linux code */ void xfs_mark_inode_dirty_sync( xfs_inode_t *ip) { struct inode *inode = VFS_I(ip); if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR))) mark_inode_dirty_sync(inode); } Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 00:45:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 00:45:24 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m757jBaV015389 for ; Tue, 5 Aug 2008 00:45:11 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07675; Tue, 5 Aug 2008 17:46:23 +1000 Message-ID: <489806C2.7020200@sgi.com> Date: Tue, 05 Aug 2008 17:52:34 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> In-Reply-To: <20080805073711.GA21635@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17391 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O > > xfs_free()? What's that? Sorry that should have been xfs_ifree() (we set the inode's mode to zero in there). > >> completions still running (file size updates and unwritten extent conversions) >> may be working on an inode that is no longer valid. > > The linux inode does not get freed until after ->clear_inode > completes, hence it is perfectly valid to reference it anywhere > in the ->clear_inode path. The problem I see is an assert in xfs_setfilesize() fail: ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); The mode of the XFS inode is zero at this time. > > My bet is that you are seeing I/O completion mark an inode dirty > that is being freed. ie. Calling mark_inode_dirty_sync() in the I/O > completion blindly assumes that the linux inode is still valid, > when it may be in the 'being freed' path. e.g. we can put it back on the > superblock dirty list just before it gets freed for real... > > I came across this about a week ago when tracking down a QA failure > with a combined linux/XFS inode patch. The fix is to make I/O > completion call xfs_mark_inode_dirty_sync() so we check that this > linux inode not in the process of being freed before we try to > mark it dirty. > > Cheers, > > Dave. From owner-xfs@oss.sgi.com Tue Aug 5 01:41:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 01:41:13 -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 (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 m758fAfb018441 for ; Tue, 5 Aug 2008 01:41:10 -0700 X-ASG-Debug-ID: 1217925744-30cf01010000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7150AB1600B for ; Tue, 5 Aug 2008 01:42:24 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id lt9sZDubs3CwMxOg for ; Tue, 05 Aug 2008 01:42:24 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUMAHivl0h5LAiFXWdsb2JhbACKc4Y7Hpxl X-IronPort-AV: E=Sophos;i="4.31,309,1215354600"; d="scan'208";a="174598368" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 05 Aug 2008 18:12:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQI7Z-0002tQ-1I; Tue, 05 Aug 2008 18:42:21 +1000 Date: Tue, 5 Aug 2008 18:42:20 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Message-ID: <20080805084220.GF21635@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489806C2.7020200@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217925745 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.1809 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17392 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >> >> xfs_free()? What's that? > Sorry that should have been xfs_ifree() (we set the inode's mode to > zero in there). > >> >>> completions still running (file size updates and unwritten extent conversions) >>> may be working on an inode that is no longer valid. >> >> The linux inode does not get freed until after ->clear_inode >> completes, hence it is perfectly valid to reference it anywhere >> in the ->clear_inode path. > The problem I see is an assert in xfs_setfilesize() fail: > > ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); > > The mode of the XFS inode is zero at this time. Ok, so the question has to be why is there I/O still in progress after the truncate is supposed to have already occurred and the vn_iowait() in xfs_itruncate_start() been executed. Something doesn't add up here - you can't be doing I/O on a file with no extents or delalloc blocks, hence that means we should be passing through the truncate path in xfs_inactive() before we call xfs_ifree() and therefore doing the vn_iowait().. Hmmmm - the vn_iowait() is conditional based on: /* wait for the completion of any pending DIOs */ if (new_size < ip->i_size) vn_iowait(ip); We are truncating to zero (new_size == 0), so the only case where this would not wait is if ip->i_size == 0. Still - I can't see how we'd be doing I/O on an inode with a zero i_size. I suspect ensuring we call vn_iowait() if newsize == 0 as well would fix the problem. If not, there's something much more subtle going on here that we should understand.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 04:02:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 04:03:01 -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=BAYES_00,J_CHICKENPOX_12, J_CHICKENPOX_72 autolearn=no 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 m75B2tI9025355 for ; Tue, 5 Aug 2008 04:02:56 -0700 X-ASG-Debug-ID: 1217934250-1b9f03070000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E4BF135D91F for ; Tue, 5 Aug 2008 04:04:10 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id JLeWBBSp8GOQ73EC for ; Tue, 05 Aug 2008 04:04:10 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m75B422I027040; Tue, 5 Aug 2008 07:04:02 -0400 Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m75B42HR029116; Tue, 5 Aug 2008 07:04:02 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [10.10.36.72]) by file.rdu.redhat.com (8.13.1/8.13.1) with ESMTP id m75B416e009204; Tue, 5 Aug 2008 07:04:01 -0400 Received: from nb (vpn-4-109.str.redhat.com [10.32.4.109]) by devserv.devel.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id m75B3w4P012731; Tue, 5 Aug 2008 07:03:58 -0400 Date: Tue, 5 Aug 2008 13:03:57 +0200 From: Karel Zak To: Christoph Hellwig Cc: Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Message-ID: <20080805110357.GL21873@nb.net.home> References: <1217553598.3860.16.camel@luna.unix.geek.nz> <20080801073033.GF6201@disturbed> <20080801193133.GA838@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080801193133.GA838@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1217934250 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17393 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: kzak@redhat.com Precedence: bulk X-list: xfs On Fri, Aug 01, 2008 at 09:31:33PM +0200, Christoph Hellwig wrote: > I'ts most likely a fallout, but I wonder why. To get this behaviour > moutn would have to add all the options it finds in /proc/self/mounts > to the command line. mount(8) does not read and use /proc/self/mounts at all. Karel Man mount: remount Attempt to remount an already-mounted file system. This is commonly used to change the mount flags for a file system, especially to make a readonly file system writeable. It does not change device or mount point. The remount functionality follows the standard way how the mount command works with options from fstab. It means the mount command doesn’t read fstab (or mtab) only when a device and dir are fully specified. mount -o remount,rw /dev/foo /dir After this call all old mount options are replaced and arbitrary stuff from fstab is ignored, except the loop= option which is internally gener- ated and maintained by the mount command. mount -o remount,rw /dir After this call mount reads fstab (or mtab) and merges these options with options from command line ( -o ). -- Karel Zak From owner-xfs@oss.sgi.com Tue Aug 5 05:02:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 05:02:59 -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,J_CHICKENPOX_24, J_CHICKENPOX_53 autolearn=no 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 m75C2qm3001147 for ; Tue, 5 Aug 2008 05:02:53 -0700 X-ASG-Debug-ID: 1217937846-5eb702f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3806835DC29 for ; Tue, 5 Aug 2008 05:04:06 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id 2RLgjAjj2GSebsZ5 for ; Tue, 05 Aug 2008 05:04:06 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54A.nec.co.jp [10.7.69.193]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m75C3Ml1000651; Tue, 5 Aug 2008 21:03:22 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m75C3Me26984; Tue, 5 Aug 2008 21:03:22 +0900 (JST) Received: from yonosuke.jp.nec.com (yonosuke.jp.nec.com [10.26.220.15]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id m75C3MNd024232; Tue, 5 Aug 2008 21:03:22 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 5 Aug 2008 21:03:21 +0900 To: Takashi Sato Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , Andrew Morton , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: Re: [PATCH 0/3] freeze feature ver 1.9 Subject: Re: [PATCH 0/3] freeze feature ver 1.9 In-reply-to: <20080805113411t-sato@mail.jp.nec.com> References: <20080805113411t-sato@mail.jp.nec.com> Message-Id: <20080805210321t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Tue, 5 Aug 2008 21:03:21 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1217937847 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.1822 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17394 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, I sent the latest patch-set of the freeze feature (ver 1.9) as the following mail. The points are: - When multiple freeze requests arrive simultaneously, only the last unfreeze process should unfreeze the frozen filesystem actually. So I added the reference counter to the freeze feature. - I left the timeout feature in my patch-set because we need it for the case someone dirties so much data that the freeze process is swapped out. Any comments? >When multiple freeze requests arrive simultaneously, only the last >unfreeze process should unfreeze the frozen filesystem actually >(as Dave Chinner, Eric Sandeen and Alasdair G Kergon commented). >So I've added the reference counter to the freeze feature. >It counts up in freeze_bdev() and counts down in thaw_bdev(). >When it becomes "0", thaw_bdev() will unfreeze actually. > >The following regular cases have worked correctly. > >A) >1. dmsetup suspend >2. FIFREEZE >3. FITHAW >4. dmsetup resume >B) >1. FIFREEZE >2. dmsetup suspend >3. dmsetup resume >4. FITHAW > >But in the following case, the last FITHAW has been frozen >for writing the super block because device-mapper layer is still frozen. >It's a irregular case (app's bug) and the next "dmsetup resume" >can solve it. So I don't think it is a problem. >C) >1. dmsetup suspend >2. FIFREEZE >3. FITHAW >4. FITHAW<- The thaw process was frozen. > >In my previous mail, I have mentioned considering removing the timeout >feature. But I leave it in my patch-set because we need it for the case >someone dirties so much data that the freeze process is swapped out >(as some people said). > >Currently, ext3 in mainline Linux doesn't have the freeze feature which >suspends write requests. So, we cannot take a backup which keeps >the filesystem's consistency with the storage device's features >(snapshot and replication) while it is mounted. >In many case, a commercial filesystem (e.g. VxFS) has >the freeze feature and it would be used to get the consistent backup. >If Linux's standard filesytem ext3 has the freeze feature, we can do it >without a commercial filesystem. > >So I have implemented the ioctls of the freeze feature. >I think we can take the consistent backup with the following steps. >1. Freeze the filesystem with the freeze ioctl. >2. Separate the replication volume or create the snapshot > with the storage device's feature. >3. Unfreeze the filesystem with the unfreeze ioctl. >4. Take the backup from the separated replication volume > or the snapshot. > >[PATCH 1/3] Implement generic freeze feature > I have modified to set the suitable error number (EOPNOTSUPP) > in case the filesystem doesn't support the freeze feature. > > The ioctls for the generic freeze feature are below. > o Freeze the filesystem > int ioctl(int fd, int FIFREEZE, arg) > fd: The file descriptor of the mountpoint > FIFREEZE: request code for the freeze > arg: Ignored > Return value: 0 if the operation succeeds. Otherwise, -1 > > o Unfreeze the filesystem > int ioctl(int fd, int FITHAW, arg) > fd: The file descriptor of the mountpoint > FITHAW: request code for unfreeze > arg: Ignored > Return value: 0 if the operation succeeds. Otherwise, -1 > >[PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature > It removes XFS specific ioctl interfaces and request codes > for freeze feature. > This patch has been supplied by David Chinner. > >[PATCH 3/3] Add timeout feature > The timeout feature is added to freeze ioctl. And new ioctl > to reset the timeout period is added. > o Freeze the filesystem > int ioctl(int fd, int FIFREEZE, long *timeout_sec) > fd: The file descriptor of the mountpoint > FIFREEZE: request code for the freeze > timeout_sec: the timeout period in seconds > If it's 0 or 1, the timeout isn't set. > This special case of "1" is implemented to keep > the compatibility with XFS applications. > Return value: 0 if the operation succeeds. Otherwise, -1 > > o Reset the timeout period > This is useful for the application to set the timeout_sec more accurately. > For example, the freezer resets the timeout_sec to 10 seconds every 5 > seconds. In this approach, even if the freezer causes a deadlock > by accessing the frozen filesystem, it will be solved by the timeout > in 10 seconds and the freezer can recognize that at the next reset > of timeout_sec. > int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) > fd:file descriptor of mountpoint > FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period > timeout_sec: new timeout period in seconds > Return value: 0 if the operation succeeds. Otherwise, -1 > Error number: If the filesystem has already been unfrozen, > errno is set to EINVAL. > >Any comments are very welcome. > >Cheers, Takashi From owner-xfs@oss.sgi.com Tue Aug 5 16:39:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 16:39:13 -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,J_CHICKENPOX_12, J_CHICKENPOX_72,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m75Nd7BF025032 for ; Tue, 5 Aug 2008 16:39:07 -0700 X-ASG-Debug-ID: 1217979619-26e1039a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8EE87198FBC4 for ; Tue, 5 Aug 2008 16:40:20 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id PxQ9WBXbMtzV6jda for ; Tue, 05 Aug 2008 16:40:20 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0FAN9+mEh5LAiFXWdsb2JhbACKcoY6Hp06 X-IronPort-AV: E=Sophos;i="4.31,312,1215354600"; d="scan'208";a="175042409" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 06 Aug 2008 09:09:58 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQW8D-0001uJ-2f; Wed, 06 Aug 2008 09:39:57 +1000 Date: Wed, 6 Aug 2008 09:39:57 +1000 From: Dave Chinner To: Karel Zak Cc: Christoph Hellwig , Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Message-ID: <20080805233956.GI21635@disturbed> Mail-Followup-To: Karel Zak , Christoph Hellwig , Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org References: <1217553598.3860.16.camel@luna.unix.geek.nz> <20080801073033.GF6201@disturbed> <20080801193133.GA838@lst.de> <20080805110357.GL21873@nb.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080805110357.GL21873@nb.net.home> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217979621 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0017 1.0000 -2.0096 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 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.1865 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17395 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 05, 2008 at 01:03:57PM +0200, Karel Zak wrote: > On Fri, Aug 01, 2008 at 09:31:33PM +0200, Christoph Hellwig wrote: > > I'ts most likely a fallout, but I wonder why. To get this behaviour > > moutn would have to add all the options it finds in /proc/self/mounts > > to the command line. > > mount(8) does not read and use /proc/self/mounts at all. > > Karel > > > Man mount: > > remount > > Attempt to remount an already-mounted file system. This is commonly used > to change the mount flags for a file system, especially to make a readonly > file system writeable. It does not change device or mount point. > > The remount functionality follows the standard way how the mount command > works with options from fstab. It means the mount command doesn’t read > fstab (or mtab) only when a device and dir are fully specified. > > mount -o remount,rw /dev/foo /dir > > After this call all old mount options are replaced and arbitrary stuff > from fstab is ignored, except the loop= option which is internally gener- > ated and maintained by the mount command. > > mount -o remount,rw /dir > > After this call mount reads fstab (or mtab) and merges these options with > options from command line ( -o ). So, given the command at issue was: luna ~ # mount -o remount,rw /usr We're seeing the second case where mount is merging all the options in /etc/fstab into the options passed into the remount command. How is the filesystem expected to behave in these difference cases? The first simply changes the ro/rw status, the second potentially asks for the filesystem to change a bunch of other mount options as well, which it may not be able to do. So what is the correct behaviour? Should the filesystem *silently ignore* unchangable options in the remount command, or should it fail the remount and warn the user that certain options are not allowed in remount? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 16:43:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 16:43:04 -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.6 required=5.0 tests=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 m75Nh1YC025562 for ; Tue, 5 Aug 2008 16:43:01 -0700 X-ASG-Debug-ID: 1217979855-01c601ce0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mars.unix.geek.nz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 532D4F05BE5 for ; Tue, 5 Aug 2008 16:44:15 -0700 (PDT) Received: from mars.unix.geek.nz ([116.90.133.99]) by cuda.sgi.com with ESMTP id Sq5uSYRJrbOGKSgV for ; Tue, 05 Aug 2008 16:44:15 -0700 (PDT) Received: from [202.6.116.165] (unknown [202.6.116.165]) (Authenticated sender: jasper) by mars.unix.geek.nz (Postfix) with ESMTPSA id 6BD6F159B21; Wed, 6 Aug 2008 11:44:13 +1200 (NZST) X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 From: Jasper Bryant-Greene To: Dave Chinner Cc: Karel Zak , Christoph Hellwig , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org In-Reply-To: <20080805233956.GI21635@disturbed> References: <1217553598.3860.16.camel@luna.unix.geek.nz> <20080801073033.GF6201@disturbed> <20080801193133.GA838@lst.de> <20080805110357.GL21873@nb.net.home> <20080805233956.GI21635@disturbed> Content-Type: text/plain Organization: Amiton Ltd Date: Wed, 06 Aug 2008 11:44:22 +1200 Message-Id: <1217979862.2887.39.camel@luna.unix.geek.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: UNKNOWN[116.90.133.99] X-Barracuda-Start-Time: 1217979856 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: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1864 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17396 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jasper@amiton.co.nz Precedence: bulk X-list: xfs On Wed, 2008-08-06 at 09:39 +1000, Dave Chinner wrote: > We're seeing the second case where mount is merging all the options in > /etc/fstab into the options passed into the remount command. How is > the filesystem expected to behave in these difference cases? The > first simply changes the ro/rw status, the second potentially > asks for the filesystem to change a bunch of other mount options > as well, which it may not be able to do. > > So what is the correct behaviour? Should the filesystem *silently > ignore* unchangable options in the remount command, or should it > fail the remount and warn the user that certain options are not > allowed in remount? (forgive me, I'm an XFS user, not an XFS developer, so this might be ignorant) The filesystem presumably knows what options it was originally mounted with. Thus if you take the difference of the set of options you were mounted with, and the set of options you are now being asked to remount with, you have the options which are being asked to change. If changing any of them is unsupported I would expect an error, but in this case the result of taking the above set difference would be merely replacing ro with rw, and thus the filesystem is presumably capable of doing the remount. -jasper From owner-xfs@oss.sgi.com Tue Aug 5 17:00:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 17:00:06 -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 m760026G027058 for ; Tue, 5 Aug 2008 17:00:03 -0700 X-ASG-Debug-ID: 1217980876-1ae0023b0000-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 C002B361C99; Tue, 5 Aug 2008 17:01:17 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id lC5fh9w4TGPfjRCk; Tue, 05 Aug 2008 17:01:17 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KQWSq-0007ie-MK; Wed, 06 Aug 2008 00:01:16 +0000 Date: Tue, 5 Aug 2008 20:01:16 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Don't release root inode until finished using it Subject: Re: [PATCH] Don't release root inode until finished using it Message-ID: <20080806000116.GA15930@infradead.org> References: <4897F434.2010309@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4897F434.2010309@sgi.com> 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: 1217980877 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.1865 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17397 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 Looks good, but I've already sent a nicer version on the 26th: [PATCH 1/6] move root inode IRELE into xfs_unmountfs Sometimes I wish people would at least glance over my patches when they hit the list.. From owner-xfs@oss.sgi.com Tue Aug 5 17:52:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 17:52:51 -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,J_CHICKENPOX_72, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m760qiAZ032043 for ; Tue, 5 Aug 2008 17:52:45 -0700 X-ASG-Debug-ID: 1217984037-202a01520000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A935D198F977 for ; Tue, 5 Aug 2008 17:53:57 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id LCSDpqHvoprOn7t0 for ; Tue, 05 Aug 2008 17:53:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0FAHSQmEh5LAiFXWdsb2JhbACKcoY5Hp0O X-IronPort-AV: E=Sophos;i="4.31,313,1215354600"; d="scan'208";a="175099886" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 06 Aug 2008 10:23:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQXHm-0003Ua-CA; Wed, 06 Aug 2008 10:53:54 +1000 Date: Wed, 6 Aug 2008 10:53:54 +1000 From: Dave Chinner To: Jasper Bryant-Greene Cc: Karel Zak , Christoph Hellwig , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Message-ID: <20080806005354.GL21635@disturbed> Mail-Followup-To: Jasper Bryant-Greene , Karel Zak , Christoph Hellwig , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org References: <1217553598.3860.16.camel@luna.unix.geek.nz> <20080801073033.GF6201@disturbed> <20080801193133.GA838@lst.de> <20080805110357.GL21873@nb.net.home> <20080805233956.GI21635@disturbed> <1217979862.2887.39.camel@luna.unix.geek.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1217979862.2887.39.camel@luna.unix.geek.nz> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1217984038 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.1873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17398 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 06, 2008 at 11:44:22AM +1200, Jasper Bryant-Greene wrote: > On Wed, 2008-08-06 at 09:39 +1000, Dave Chinner wrote: > > We're seeing the second case where mount is merging all the options in > > /etc/fstab into the options passed into the remount command. How is > > the filesystem expected to behave in these difference cases? The > > first simply changes the ro/rw status, the second potentially > > asks for the filesystem to change a bunch of other mount options > > as well, which it may not be able to do. > > > > So what is the correct behaviour? Should the filesystem *silently > > ignore* unchangable options in the remount command, or should it > > fail the remount and warn the user that certain options are not > > allowed in remount? > > (forgive me, I'm an XFS user, not an XFS developer, so this might be > ignorant) > > The filesystem presumably knows what options it was originally mounted > with. > > Thus if you take the difference of the set of options you were mounted > with, and the set of options you are now being asked to remount with, > you have the options which are being asked to change. Sure. But that does not answer my question about what to do with options that can't be changed. Options can come from more than just /etc/fstab - they can come from the mount command line itself as entered by the admin. What do we do if an option is specified that we do not support in a remount? The problem is the way mount combines command line options with options in fstab. I'm not questioning what you did - I'm asking what the expected behaviour is supposed to be so we can make it behave the same way as all the other filesystems. > If changing any of them is unsupported I would expect an error, but in > this case the result of taking the above set difference would be merely > replacing ro with rw, and thus the filesystem is presumably capable of > doing the remount. Use the full device/directory syntax for the remount command and it will do just that. The command you issued was not a "pure" remount,rw, it was silently changed by mount.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 19:01:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 19:01:09 -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=1.9 required=5.0 tests=BAYES_05,HTML_MESSAGE autolearn=no 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 m76214T1003680 for ; Tue, 5 Aug 2008 19:01:06 -0700 X-ASG-Debug-ID: 1217988138-0f9b02fa0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from dolby.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 153163621D1 for ; Tue, 5 Aug 2008 19:02:18 -0700 (PDT) Received: from dolby.com (silver.dolby.com [12.144.165.24]) by cuda.sgi.com with ESMTP id 2z6Hie4Q64teM2PO for ; Tue, 05 Aug 2008 19:02:18 -0700 (PDT) Received: from ([172.16.17.29]) by silver.dolby.com with ESMTP id 5202052.97509635; Tue, 05 Aug 2008 19:01:29 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: xfs_force_shutdown - file fs/xfs/xfs_rw.c Subject: xfs_force_shutdown - file fs/xfs/xfs_rw.c Date: Tue, 5 Aug 2008 19:02:05 -0700 Message-ID: <05BB196AB3DA6C4BBE11AB6C957581FE0E61DA47@sfo-exch-01.dolby.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: xfs_force_shutdown - file fs/xfs/xfs_rw.c Thread-Index: Acj3aGz8s0PqbVTiS/W6d2jV2mf5OQ== From: "Martinez, Sergio" To: X-Barracuda-Connect: silver.dolby.com[12.144.165.24] X-Barracuda-Start-Time: 1217988139 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=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1877 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 943 X-archive-position: 17399 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sergio.martinez@dolby.com Precedence: bulk X-list: xfs I'm running into a force shutdown issue on a system running linux-2.6.25. The xfs partition is 2 GB and we're using a hardware RAID-5 for storage. dmesg shows this error: xfs_force_shutdown(sda2,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xc02ddebc An XFS_bwrite() calls is failing. Any suggestions on how to debug this? I'm suspecting that there's a problem with the RAID controller firmware, but I'd like to eliminate the possibility of a file system bug. Thanks, Sergio ----------------------------------------- This message (including any attachments) may contain confidential information intended for a specific individual and purpose. If you are not the intended recipient, delete this message. If you are not the intended recipient, disclosing, copying, distributing, or taking any action based on this message is strictly prohibited. [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Aug 5 19:21:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 19:21:15 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m762LAmv005245 for ; Tue, 5 Aug 2008 19:21:11 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA00299; Wed, 6 Aug 2008 12:22:18 +1000 Message-ID: <48990C4E.9070102@sgi.com> Date: Wed, 06 Aug 2008 12:28:30 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> In-Reply-To: <20080805084220.GF21635@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17400 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >> Dave Chinner wrote: >>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >>> xfs_free()? What's that? >> Sorry that should have been xfs_ifree() (we set the inode's mode to >> zero in there). >> >>>> completions still running (file size updates and unwritten extent conversions) >>>> may be working on an inode that is no longer valid. >>> The linux inode does not get freed until after ->clear_inode >>> completes, hence it is perfectly valid to reference it anywhere >>> in the ->clear_inode path. >> The problem I see is an assert in xfs_setfilesize() fail: >> >> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >> >> The mode of the XFS inode is zero at this time. > > Ok, so the question has to be why is there I/O still in progress > after the truncate is supposed to have already occurred and the > vn_iowait() in xfs_itruncate_start() been executed. > > Something doesn't add up here - you can't be doing I/O on a file > with no extents or delalloc blocks, hence that means we should be > passing through the truncate path in xfs_inactive() before we > call xfs_ifree() and therefore doing the vn_iowait().. > > Hmmmm - the vn_iowait() is conditional based on: > > /* wait for the completion of any pending DIOs */ > if (new_size < ip->i_size) > vn_iowait(ip); > > We are truncating to zero (new_size == 0), so the only case where > this would not wait is if ip->i_size == 0. Still - I can't see > how we'd be doing I/O on an inode with a zero i_size. I suspect > ensuring we call vn_iowait() if newsize == 0 as well would fix > the problem. If not, there's something much more subtle going > on here that we should understand.... If we make the vn_iowait() unconditional we might re-introduce the NFS exclusivity bug that killed performance. That was through xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). So if we leave the above code as is then we need another vn_iowait() in xfs_inactive() to catch any remaining workqueue items that we didn't wait for in xfs_itruncate_start(). In that case the last call to vn_iowait() should be inside xfs_inactive() after the truncate but before the call to xfs_ifree(). From owner-xfs@oss.sgi.com Tue Aug 5 19:25:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 19:25: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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m762PRbs005899 for ; Tue, 5 Aug 2008 19:25:28 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA00375; Wed, 6 Aug 2008 12:26:38 +1000 Message-ID: <48990D53.3070305@sgi.com> Date: Wed, 06 Aug 2008 12:32:51 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Don't release root inode until finished using it References: <4897F434.2010309@sgi.com> <20080806000116.GA15930@infradead.org> In-Reply-To: <20080806000116.GA15930@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17401 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Looks good, but I've already sent a nicer version on the 26th: > > [PATCH 1/6] move root inode IRELE into xfs_unmountfs > > > Sometimes I wish people would at least glance over my patches when they > hit the list.. Some of us are trying to fix bugs and don't have time to look at every cleanup patch that hits the list. From owner-xfs@oss.sgi.com Tue Aug 5 21:11:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:12:38 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m764Bk1J018098 for ; Tue, 5 Aug 2008 21:11:48 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA02290; Wed, 6 Aug 2008 14:12:57 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id B9C6758C52A4; Wed, 6 Aug 2008 14:12:57 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - replace dquot flush semaphore with a completion Message-Id: <20080806041257.B9C6758C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 14:12:57 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17402 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs replace dquot flush semaphore with a completion Use the new completion flush code to implement the dquot flush lock. Removes one of the final users of semaphores in the XFS code base. Signed-off-by: Dave Chinner Date: Wed Aug 6 14:12:02 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31822a fs/xfs/quota/xfs_dquot_item.c - 1.23 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot_item.c.diff?r1=text&tr1=1.23&r2=text&tr2=1.22&f=h fs/xfs/quota/xfs_dquot.h - 1.13 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.h.diff?r1=text&tr1=1.13&r2=text&tr2=1.12&f=h fs/xfs/quota/xfs_dquot.c - 1.37 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.37&r2=text&tr2=1.36&f=h fs/xfs/quota/xfs_qm.c - 1.72 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.72&r2=text&tr2=1.71&f=h - replace dquot flush semaphore with a completion From owner-xfs@oss.sgi.com Tue Aug 5 21:30:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:30:33 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m764UPv4019947 for ; Tue, 5 Aug 2008 21:30:26 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA02746; Wed, 6 Aug 2008 14:31:38 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 1E66D58C52A4; Wed, 6 Aug 2008 14:31:38 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove the sema_t from XFS. Message-Id: <20080806043138.1E66D58C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 14:31:38 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17403 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs remove the sema_t from XFS. Now that all users of the sema_t are gone from XFS we can finally kill it. Signed-off-by: Dave Chinner Date: Wed Aug 6 14:30:56 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31823a fs/xfs/linux-2.6/xfs_linux.h - 1.170 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_linux.h.diff?r1=text&tr1=1.170&r2=text&tr2=1.169&f=h fs/xfs/linux-2.6/sema.h - 1.16 - deleted http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/sema.h.diff?r1=text&tr1=1.16&r2=text&tr2=1.15&f=h - remove the sema_t from XFS. From owner-xfs@oss.sgi.com Tue Aug 5 21:32:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:32:49 -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.2 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 m764Wc04020419 for ; Tue, 5 Aug 2008 21:32:38 -0700 X-ASG-Debug-ID: 1217997232-218900b70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web34502.mail.mud.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 59E6E362848 for ; Tue, 5 Aug 2008 21:33:52 -0700 (PDT) Received: from web34502.mail.mud.yahoo.com (web34502.mail.mud.yahoo.com [66.163.178.168]) by cuda.sgi.com with SMTP id XJSVaaALqU54sPWi for ; Tue, 05 Aug 2008 21:33:52 -0700 (PDT) Received: (qmail 22407 invoked by uid 60001); 6 Aug 2008 04:33:52 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=NCAN3LvYp4nWQiuipjCc47UDDgbzsY+b+SZQRHsDG52mc7JMybvAJ6+wXQTsREnVfVxOQx7+4MyGVVKsVHzToTpjZjlqIvDdS3573ccI5fJKEddWT1q84+NwJ7Z6zZhqEwO0YvB8m0Oobt5biHLi+90Xdvv4vCvGnjsJ8x+Pufo=; Received: from [96.14.187.213] by web34502.mail.mud.yahoo.com via HTTP; Tue, 05 Aug 2008 21:33:52 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Tue, 5 Aug 2008 21:33:52 -0700 (PDT) From: gus3 Reply-To: MusicMan529@yahoo.com X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 To: Karel Zak , Dave Chinner Cc: Christoph Hellwig , Jasper Bryant-Greene , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org In-Reply-To: <20080805233956.GI21635@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <510965.21937.qm@web34502.mail.mud.yahoo.com> X-Barracuda-Connect: web34502.mail.mud.yahoo.com[66.163.178.168] X-Barracuda-Start-Time: 1217997233 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3412 1.0000 -0.1845 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.18 X-Barracuda-Spam-Status: No, SCORE=-0.18 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.1886 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17404 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: musicman529@yahoo.com Precedence: bulk X-list: xfs --- On Tue, 8/5/08, Dave Chinner wrote: > So what is the correct behaviour? Should the filesystem > *silently > ignore* unchangable options in the remount command, or > should it > fail the remount and warn the user that certain options are > not > allowed in remount? How about a middle ground: ignore, but not silently? Report an error, or send it to the syslog, or both, but ultimately ignore unchangeable options, change what can be changed, and give the user/admin as much as possible. This can be particularly pertinent for XFS root. If it's mounted RO at first, it may (will?) need to become RW at some later point. Failing the remount could result in a system that requires a rescue CD (or lots of headaches for remote administration). From owner-xfs@oss.sgi.com Tue Aug 5 21:35:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:35:39 -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.6 required=5.0 tests=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 m764ZBis020859 for ; Tue, 5 Aug 2008 21:35:12 -0700 X-ASG-Debug-ID: 1217997385-1e8f01100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mars.unix.geek.nz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A416635BE23 for ; Tue, 5 Aug 2008 21:36:25 -0700 (PDT) Received: from mars.unix.geek.nz ([116.90.133.99]) by cuda.sgi.com with ESMTP id yBFWFKohUfS4rcSY for ; Tue, 05 Aug 2008 21:36:25 -0700 (PDT) Received: from [192.168.21.2] (ip-58-28-152-52.static-xdsl.xnet.co.nz [58.28.152.52]) (Authenticated sender: jasper) by mars.unix.geek.nz (Postfix) with ESMTPSA id 3E7D3124F3F; Wed, 6 Aug 2008 16:36:24 +1200 (NZST) X-ASG-Orig-Subj: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 Subject: Re: XFS noikeep remount in 2.6.27-rc1-next-20080730 From: Jasper Bryant-Greene To: MusicMan529@yahoo.com Cc: Karel Zak , Dave Chinner , Christoph Hellwig , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, util-linux-ng@vger.kernel.org In-Reply-To: <510965.21937.qm@web34502.mail.mud.yahoo.com> References: <510965.21937.qm@web34502.mail.mud.yahoo.com> Content-Type: text/plain Organization: Amiton Ltd Date: Wed, 06 Aug 2008 16:36:35 +1200 Message-Id: <1217997395.3456.1.camel@luna.unix.geek.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: UNKNOWN[116.90.133.99] X-Barracuda-Start-Time: 1217997386 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0204 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1886 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17405 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jasper@amiton.co.nz Precedence: bulk X-list: xfs On Tue, 2008-08-05 at 21:33 -0700, gus3 wrote: > --- On Tue, 8/5/08, Dave Chinner wrote: > > > So what is the correct behaviour? Should the filesystem > > *silently > > ignore* unchangable options in the remount command, or > > should it > > fail the remount and warn the user that certain options are > > not > > allowed in remount? > > How about a middle ground: ignore, but not silently? Report an error, or send it to the syslog, or both, but ultimately ignore unchangeable options, change what can be changed, and give the user/admin as much as possible. I think the idea is to behave the same as other FS do, not to innovate. > This can be particularly pertinent for XFS root. If it's mounted RO at first, it may (will?) need to become RW at some later point. Failing the remount could result in a system that requires a rescue CD (or lots of headaches for remote administration). FWIW, your root filesystem does not need to be rw. I keep mine ro nearly all the time on my laptop, only mounting rw if I need to install software that puts files outside /usr or if I need to modify a config file in /etc. -jasper From owner-xfs@oss.sgi.com Tue Aug 5 21:45:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:45:37 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m764jVsK022249 for ; Tue, 5 Aug 2008 21:45:32 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA03070; Wed, 6 Aug 2008 14:46:43 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 6DC7858C52A4; Wed, 6 Aug 2008 14:46:43 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - update timestamp in xfs_ialloc manually Message-Id: <20080806044643.6DC7858C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 14:46:43 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17406 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs update timestamp in xfs_ialloc manually In xfs_ialloc we just want to set all timestamps to the current time. We don't need to mark the inode dirty like xfs_ichgtime does, and we don't need nor want the opimizations in xfs_ichgtime that I will introduce in the next patch. So just opencode the timestamp update in xfs_ialloc, and remove the new unused XFS_ICHGTIME_ACC case in xfs_ichgtime. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 14:44:59 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31825a fs/xfs/xfs_vnodeops.c - 1.772 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.772&r2=text&tr2=1.771&f=h fs/xfs/xfs_inode.c - 1.517 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.517&r2=text&tr2=1.516&f=h fs/xfs/xfs_inode.h - 1.256 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.256&r2=text&tr2=1.255&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.297 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.297&r2=text&tr2=1.296&f=h - update timestamp in xfs_ialloc manually From owner-xfs@oss.sgi.com Tue Aug 5 21:50:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:50:28 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m764nx1U023028 for ; Tue, 5 Aug 2008 21:50:24 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA03188; Wed, 6 Aug 2008 14:51:11 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 7E17458C52A4; Wed, 6 Aug 2008 14:51:11 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - optimize xfs_ichgtime Message-Id: <20080806045111.7E17458C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 14:51:11 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17407 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs optimize xfs_ichgtime Port a little optmization from file_update_time to xfs_ichgtime, and only update the timestamp and mark the inode dirty if the timestamp actually changes in the timer tick resultion supported by the running kernel. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 14:50:29 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31827a fs/xfs/linux-2.6/xfs_iops.c - 1.298 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.298&r2=text&tr2=1.297&f=h - optimize xfs_ichgtime From owner-xfs@oss.sgi.com Tue Aug 5 21:51:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:51:50 -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=0.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m764pdlM023520 for ; Tue, 5 Aug 2008 21:51:41 -0700 X-ASG-Debug-ID: 1217998371-1d0c007b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4C8BDF06DC4 for ; Tue, 5 Aug 2008 21:52:51 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.230]) by cuda.sgi.com with ESMTP id oxDAuK1IIEXj7dIP for ; Tue, 05 Aug 2008 21:52:51 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so2248136wri.12 for ; Tue, 05 Aug 2008 21:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=E1KBD+1lYURkbuple1y7uzoahW8JBHTX5LD4BmuEMOY=; b=KwZDs3hAUT7QkLQ8TU9cbiohkZlfxu3CnjAK+3qnSLDbWhcvcMhe2Y2zy5OIXhycC8 59AX99XT7/H6Nv7Ro1dPcg00ZgUbt8vCYli7LHJIYUvEuEmM0Qt+BnKabCOAO88QjXX6 4OO+DpBz2FFBBpDIUYkutO6txlfBLyZBeu5Mw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=GIj8m+f2k/bHqXIrMDyi8UNy7UHnQ2nBAXG7YSIbe3vuZ2lrrh8I6uHrYjEh2M9Fp7 zgvJ5gCMYkLct6oUkdS/iG49/fnf03g3y+IvX16pNhdDSdJPkSlkvaXQ9K8AoDRx94n6 g1JDOvCeRUL37hFKAH+DRz0s0vPCcc/4y1hB0= Received: by 10.90.31.8 with SMTP id e8mr2562081age.68.1217998370868; Tue, 05 Aug 2008 21:52:50 -0700 (PDT) Received: by 10.90.115.11 with HTTP; Tue, 5 Aug 2008 21:52:49 -0700 (PDT) Message-ID: Date: Wed, 6 Aug 2008 10:22:49 +0530 From: "Bhagi rathi" To: "Martinez, Sergio" X-ASG-Orig-Subj: Re: xfs_force_shutdown - file fs/xfs/xfs_rw.c Subject: Re: xfs_force_shutdown - file fs/xfs/xfs_rw.c Cc: xfs@oss.sgi.com In-Reply-To: <05BB196AB3DA6C4BBE11AB6C957581FE0E61DA47@sfo-exch-01.dolby.net> MIME-Version: 1.0 References: <05BB196AB3DA6C4BBE11AB6C957581FE0E61DA47@sfo-exch-01.dolby.net> X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.230] X-Barracuda-Start-Time: 1217998374 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0532 1.0000 -1.6796 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.68 X-Barracuda-Spam-Status: No, SCORE=-1.68 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1888 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1367 X-archive-position: 17408 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs You can just run without raid controller and rule out XFS issue. If the file-system meta-data/log-flush update meets an error, the file-system will be marked for shutdown. The reason for this seems to be xfs_bwrite failure. Investigate on xfs_bwrite failure. -Bhagi. On Wed, Aug 6, 2008 at 7:32 AM, Martinez, Sergio wrote: > > I'm running into a force shutdown issue on a system running > linux-2.6.25. The xfs partition is 2 GB and we're using a hardware > RAID-5 for storage. > > dmesg shows this error: > > xfs_force_shutdown(sda2,0x1) called from line 420 of file > fs/xfs/xfs_rw.c. Return address = 0xc02ddebc > > An XFS_bwrite() calls is failing. > > Any suggestions on how to debug this? I'm suspecting that there's a > problem with the RAID controller firmware, but I'd like to eliminate the > possibility of a file system bug. > > Thanks, > Sergio > > > > > > ----------------------------------------- > This message (including any attachments) may contain confidential > information intended for a specific individual and purpose. If you > are not the intended recipient, delete this message. If you are > not the intended recipient, disclosing, copying, distributing, or > taking any action based on this message is strictly prohibited. > > [[HTML alternate version deleted]] > > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Aug 5 21:55:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 21:55: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.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m764th2a024217 for ; Tue, 5 Aug 2008 21:55:45 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA03285; Wed, 6 Aug 2008 14:56:55 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 3489958C52A4; Wed, 6 Aug 2008 14:56:55 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - stop using file_update_time Message-Id: <20080806045655.3489958C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 14:56:55 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17409 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs stop using file_update_time xfs_ichtime updates the xfs_inode and Linux inode timestamps just fine, no need to call file_update_time and then copy the values over to the XFS inode. The only additional thing in file_update_time are checks not applicable to the write path. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 14:56:16 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan david@fromorbit.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31829a fs/xfs/linux-2.6/xfs_lrw.c - 1.282 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_lrw.c.diff?r1=text&tr1=1.282&r2=text&tr2=1.281&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.299 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.299&r2=text&tr2=1.298&f=h fs/xfs/linux-2.6/xfs_iops.h - 1.37 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.h.diff?r1=text&tr1=1.37&r2=text&tr2=1.36&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.89 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.89&r2=text&tr2=1.88&f=h - stop using file_update_time From owner-xfs@oss.sgi.com Tue Aug 5 22:10:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:10:23 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765AJkL006976 for ; Tue, 5 Aug 2008 22:10:20 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA03617; Wed, 6 Aug 2008 15:11:32 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 0E58A58C52A4; Wed, 6 Aug 2008 15:11:32 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - move root inode IRELE into xfs_unmountfs Message-Id: <20080806051132.0E58A58C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:11:32 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17410 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs move root inode IRELE into xfs_unmountfs The root inode is allocated in xfs_mountfs so it should be release in xfs_unmountfs. For the unmount case that means we do it after the the xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE) in the forced shutdown case and the dmapi unmount event. Note that both reference the rip variable which might be freed by that time in case inode flushing has kicked in, so strictly speaking this might count as a bug fix Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:10:49 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31830a fs/xfs/xfs_mount.c - 1.440 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.440&r2=text&tr2=1.439&f=h fs/xfs/linux-2.6/xfs_super.c - 1.444 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.444&r2=text&tr2=1.443&f=h - move root inode IRELE into xfs_unmountfs From owner-xfs@oss.sgi.com Tue Aug 5 22:19:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:19:47 -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 m765JhSt008561 for ; Tue, 5 Aug 2008 22:19:44 -0700 X-ASG-Debug-ID: 1218000056-4cab00830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2C31D362967 for ; Tue, 5 Aug 2008 22:20:57 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id TvYSxN30Ik3Yah9p for ; Tue, 05 Aug 2008 22:20:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALzPmEh5LAiF/2dsb2JhbACKcqIs X-IronPort-AV: E=Sophos;i="4.31,314,1215354600"; d="scan'208";a="175297063" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 06 Aug 2008 14:50:54 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQbS9-0002lc-AF; Wed, 06 Aug 2008 15:20:53 +1000 Date: Wed, 6 Aug 2008 15:20:53 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Message-ID: <20080806052053.GU6119@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> <48990C4E.9070102@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48990C4E.9070102@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1218000058 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0003 1.0000 -2.0189 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.1890 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17412 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 06, 2008 at 12:28:30PM +1000, Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >>> Dave Chinner wrote: >>>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>>>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >>>> xfs_free()? What's that? >>> Sorry that should have been xfs_ifree() (we set the inode's mode to >>> zero in there). >>> >>>>> completions still running (file size updates and unwritten extent conversions) >>>>> may be working on an inode that is no longer valid. >>>> The linux inode does not get freed until after ->clear_inode >>>> completes, hence it is perfectly valid to reference it anywhere >>>> in the ->clear_inode path. >>> The problem I see is an assert in xfs_setfilesize() fail: >>> >>> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >>> >>> The mode of the XFS inode is zero at this time. >> >> Ok, so the question has to be why is there I/O still in progress >> after the truncate is supposed to have already occurred and the >> vn_iowait() in xfs_itruncate_start() been executed. >> >> Something doesn't add up here - you can't be doing I/O on a file >> with no extents or delalloc blocks, hence that means we should be >> passing through the truncate path in xfs_inactive() before we >> call xfs_ifree() and therefore doing the vn_iowait().. >> >> Hmmmm - the vn_iowait() is conditional based on: >> >> /* wait for the completion of any pending DIOs */ >> if (new_size < ip->i_size) >> vn_iowait(ip); >> >> We are truncating to zero (new_size == 0), so the only case where >> this would not wait is if ip->i_size == 0. Still - I can't see >> how we'd be doing I/O on an inode with a zero i_size. I suspect >> ensuring we call vn_iowait() if newsize == 0 as well would fix >> the problem. If not, there's something much more subtle going >> on here that we should understand.... > > If we make the vn_iowait() unconditional we might re-introduce the > NFS exclusivity bug that killed performance. That was through > xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). It won't reintroduce that problem because ->clear_inode() is not called on every NFS write operation. > So if we leave the above code as is then we need another > vn_iowait() in xfs_inactive() to catch any remaining workqueue > items that we didn't wait for in xfs_itruncate_start(). How do we have any new *data* I/O at all in progress at this point? That does not explain why we need an additional vn_iowait() call. All I see from this is a truncate race that has somethign to do with the vn_iowait() call being conditional. That is, if we truncate to zero, then the current code in xfs_itruncate_start() should wait unconditinally for *all* I/O to complete because, by definition, all that I/O is beyond the new EOF and we have to wait for it to complete before truncating the file. Seeing as we are in ->clear_inode(), no new data I/O can start while we are deep in this code, hence we should not be seeing I/O completions after the truncate starts and vn_iowait() has completed. Hence we need to know, firstly, if the truncate code has been called; Secondly, what the value of i_size and i_new_size was when the truncate was started and, finally, whether ip->i_iocount was non-zero when the truncate was run. That is, we need to gather enough data to determine whether we should have waited in the truncate but didn't. If either the vn_iowait() in the truncate path is not sufficient, or the truncate code is not being called, there is *some other bug* that we don't yet understand. Adding an unconditional vn_iowait() appear to me to be fixing a symptom, not the underlying cause of the problem.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 5 22:18:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:18:50 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765Ij91008237 for ; Tue, 5 Aug 2008 22:18:46 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA03898; Wed, 6 Aug 2008 15:19:57 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 3F05758C52A4; Wed, 6 Aug 2008 15:19:57 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - cleanup xfs_mountfs Message-Id: <20080806051957.3F05758C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:19:57 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17411 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs cleanup xfs_mountfs Remove all the useless flags and code keyed off it in xfs_mountfs. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:19:16 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31831a fs/xfs/xfs_log.h - 1.82 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.h.diff?r1=text&tr1=1.82&r2=text&tr2=1.81&f=h fs/xfs/xfs_log.c - 1.361 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.361&r2=text&tr2=1.360&f=h fs/xfs/xfs_log_priv.h - 1.133 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_priv.h.diff?r1=text&tr1=1.133&r2=text&tr2=1.132&f=h fs/xfs/xfs_log_recover.c - 1.347 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.347&r2=text&tr2=1.346&f=h fs/xfs/xfs_mount.h - 1.273 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.273&r2=text&tr2=1.272&f=h fs/xfs/xfs_mount.c - 1.441 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.441&r2=text&tr2=1.440&f=h fs/xfs/quota/xfs_qm_bhv.c - 1.29 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm_bhv.c.diff?r1=text&tr1=1.29&r2=text&tr2=1.28&f=h fs/xfs/quota/xfs_qm.h - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h fs/xfs/quota/xfs_qm.c - 1.73 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.73&r2=text&tr2=1.72&f=h fs/xfs/linux-2.6/xfs_super.c - 1.445 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h - cleanup xfs_mountfs From owner-xfs@oss.sgi.com Tue Aug 5 22:22:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:22:34 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765MT2H009378 for ; Tue, 5 Aug 2008 22:22:30 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04010; Wed, 6 Aug 2008 15:23:41 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id D436A58C52A4; Wed, 6 Aug 2008 15:23:41 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - xfs_unmountfs should return void Message-Id: <20080806052341.D436A58C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:23:41 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17413 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs xfs_unmountfs should return void xfs_unmounts can't and shouldn't return errors so declare it as returning void. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:23:03 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31833a fs/xfs/xfs_mount.h - 1.274 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.274&r2=text&tr2=1.273&f=h fs/xfs/xfs_mount.c - 1.442 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.442&r2=text&tr2=1.441&f=h - xfs_unmountfs should return void From owner-xfs@oss.sgi.com Tue Aug 5 22:31:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:31:23 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765VI9U010699 for ; Tue, 5 Aug 2008 22:31:19 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04277; Wed, 6 Aug 2008 15:32:30 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 7444A58C52A4; Wed, 6 Aug 2008 15:32:30 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - don't call xfs_freesb from xfs_unmountfs Message-Id: <20080806053230.7444A58C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:32:30 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17414 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs don't call xfs_freesb from xfs_unmountfs xfs_readsb is called before xfs_mount so xfs_freesb should be called after xfs_unmountfs, too. This means it now happens after a few things during the of xfs_unmount which all have nothing to do with the superblock. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:31:50 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31835a fs/xfs/xfs_mount.c - 1.443 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.443&r2=text&tr2=1.442&f=h fs/xfs/linux-2.6/xfs_super.c - 1.446 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.446&r2=text&tr2=1.445&f=h - don't call xfs_freesb from xfs_unmountfs From owner-xfs@oss.sgi.com Tue Aug 5 22:36:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:37:01 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765aubW011896 for ; Tue, 5 Aug 2008 22:36:57 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04392; Wed, 6 Aug 2008 15:38:08 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 6790658C52A4; Wed, 6 Aug 2008 15:38:08 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - refactor xfs_mount_free Message-Id: <20080806053808.6790658C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:38:08 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17415 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs refactor xfs_mount_free xfs_mount_free mostly frees the perag data, which is something that is duplicated in the mount error path. Move the XFS_QM_DONE call to the caller and remove the useless mutex_destroy/spinlock_destroy calls so that we can re-use it for the mount error path. Also rename it to xfs_free_perag to reflect what it does. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:37:28 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31836a fs/xfs/xfs_mount.c - 1.444 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.444&r2=text&tr2=1.443&f=h - refactor xfs_mount_free From owner-xfs@oss.sgi.com Tue Aug 5 22:40:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 22:40:13 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m765e9kx012776 for ; Tue, 5 Aug 2008 22:40:10 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04464; Wed, 6 Aug 2008 15:41:21 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id CB2F258C52A4; Wed, 6 Aug 2008 15:41:21 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Message-Id: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 15:41:21 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17416 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs use KM_MAYFAIL in xfs_mountfs Use KM_MAYFAIL for the m_perag allocation, we can deal with the error easily and blocking forever during mount is not a good idea either. Signed-off-by: Christoph Hellwig Date: Wed Aug 6 15:40:44 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31837a fs/xfs/xfs_mount.c - 1.445 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h - use KM_MAYFAIL in xfs_mountfs From owner-xfs@oss.sgi.com Tue Aug 5 23:03:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 23:03:39 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7663ScW015594 for ; Tue, 5 Aug 2008 23:03:29 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA04934; Wed, 6 Aug 2008 16:04:40 +1000 Message-ID: <4899406D.5020802@sgi.com> Date: Wed, 06 Aug 2008 16:10:53 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> <48990C4E.9070102@sgi.com> <20080806052053.GU6119@disturbed> In-Reply-To: <20080806052053.GU6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17417 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Wed, Aug 06, 2008 at 12:28:30PM +1000, Lachlan McIlroy wrote: >> Dave Chinner wrote: >>> On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >>>> Dave Chinner wrote: >>>>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>>>>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >>>>> xfs_free()? What's that? >>>> Sorry that should have been xfs_ifree() (we set the inode's mode to >>>> zero in there). >>>> >>>>>> completions still running (file size updates and unwritten extent conversions) >>>>>> may be working on an inode that is no longer valid. >>>>> The linux inode does not get freed until after ->clear_inode >>>>> completes, hence it is perfectly valid to reference it anywhere >>>>> in the ->clear_inode path. >>>> The problem I see is an assert in xfs_setfilesize() fail: >>>> >>>> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >>>> >>>> The mode of the XFS inode is zero at this time. >>> Ok, so the question has to be why is there I/O still in progress >>> after the truncate is supposed to have already occurred and the >>> vn_iowait() in xfs_itruncate_start() been executed. >>> >>> Something doesn't add up here - you can't be doing I/O on a file >>> with no extents or delalloc blocks, hence that means we should be >>> passing through the truncate path in xfs_inactive() before we >>> call xfs_ifree() and therefore doing the vn_iowait().. >>> >>> Hmmmm - the vn_iowait() is conditional based on: >>> >>> /* wait for the completion of any pending DIOs */ >>> if (new_size < ip->i_size) >>> vn_iowait(ip); >>> >>> We are truncating to zero (new_size == 0), so the only case where >>> this would not wait is if ip->i_size == 0. Still - I can't see >>> how we'd be doing I/O on an inode with a zero i_size. I suspect >>> ensuring we call vn_iowait() if newsize == 0 as well would fix >>> the problem. If not, there's something much more subtle going >>> on here that we should understand.... >> If we make the vn_iowait() unconditional we might re-introduce the >> NFS exclusivity bug that killed performance. That was through >> xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). > > It won't reintroduce that problem because ->clear_inode() > is not called on every NFS write operation. Yes but xfs_itruncate_start() can be called from every NFS write so modifying the above code will re-introduce the problem. > >> So if we leave the above code as is then we need another >> vn_iowait() in xfs_inactive() to catch any remaining workqueue >> items that we didn't wait for in xfs_itruncate_start(). > > How do we have any new *data* I/O at all in progress at this point? It's not new data I/O. It's workqueue items that have been queued from previous I/Os that are still outstanding. > That does not explain why we need an additional vn_iowait() call. > All I see from this is a truncate race that has somethign to do with > the vn_iowait() call being conditional. > > That is, if we truncate to zero, then the current code in > xfs_itruncate_start() should wait unconditinally for *all* I/O to > complete because, by definition, all that I/O is beyond the new EOF > and we have to wait for it to complete before truncating the file. That makes sense. If new_size is zero and ip->i_size is not then we will wait. If ip->i_size is also zero we will not wait but if the file size is already zero there should not be any I/Os in progress and therefore no workqueue items outstanding. > Seeing as we are in ->clear_inode(), no new data I/O can start > while we are deep in this code, hence we should not be seeing > I/O completions after the truncate starts and vn_iowait() has > completed. > > Hence we need to know, firstly, if the truncate code has been > called; Secondly, what the value of i_size and i_new_size was when > the truncate was started and, finally, whether ip->i_iocount was > non-zero when the truncate was run. That is, we need to gather > enough data to determine whether we should have waited in the > truncate but didn't. > > If either the vn_iowait() in the truncate path is not sufficient, or > the truncate code is not being called, there is *some other bug* > that we don't yet understand. Adding an unconditional vn_iowait() > appear to me to be fixing a symptom, not the underlying cause of > the problem.... I'm not adding a new call to vn_iowait(). I'm just moving the existing one from xfs_ireclaim() so that we wait for all I/O to complete before we tear the inode down. Here's some info from the bug: Stack traceback for pid 272 0xffff81007f3ea600 272 2 1 3 R 0xffff81007f3ea950 *xfsdatad/3 rsp rip Function (args) 0xffff81007e275e28 0xffffffff803b8cd0 assfail+0x1a (invalid, invalid, invalid) 0xffff81007e275e58 0xffffffff803adaad xfs_setfilesize+0x3d (0xffff8100383de7f8) 0xffff81007e275e78 0xffffffff803adc28 xfs_end_bio_written+0x10 (invalid) 0xffff81007e275e88 0xffffffff8023cf9a run_workqueue+0xdf (0xffff81007e7d0070) 0xffff81007e275ed8 0xffffffff8023da8f worker_thread+0xd8 (0xffff81007e7d0070) 0xffff81007e275f28 0xffffffff80240314 kthread+0x47 (invalid) 0xffff81007e275f48 0xffffffff8020bd08 child_rip+0xa (invalid, invalid) <5>Filesystem "sdb1": Disabling barriers, not supported with external log device <5>XFS mounting filesystem sdb1 <7>Ending clean XFS mount for filesystem: sdb1 <4>Assertion failed: (ip->i_d.di_mode & S_IFMT) == S_IFREG, file: fs/xfs/linux-2.6/xfs_aops.c, line: 178 <0>------------[ cut here ]------------ <2>kernel BUG at fs/xfs/support/debug.c:81! <0>invalid opcode: 0000 [1] SMP [3]kdb> md8c20 0xffff8100383de7f8 0xffff8100383de7f8 0000000000000000 0000000000000020 ........ ....... 0xffff8100383de808 5a5a5a5a00000000 ffff810054062048 ....ZZZZH .T.... 0xffff8100383de818 0000000000000000 0000000000000000 ................ 0xffff8100383de828 0000000000003400 00000000000fe200 .4.............. 0xffff8100383de838 ffff81007e7d0070 ffff8100383de840 p.}~....@.=8.... 0xffff8100383de848 ffff8100383de840 ffffffff803adc18 @.=8......:..... 0xffff8100383de858 ffffffff80b162a0 0000000000000000 .b.............. 0xffff8100383de868 ffffffff80784c51 d84156c5635688c0 QLx.......Vc.VA. 0xffff8100383de878 ffffffff8025d1f6 09f911029d74e35b ..%.....[.t..... 0xffff8100383de888 6b6b6b6b6b6b6b6b 6b6b6b6b6b6b6b6b kkkkkkkkkkkkkkkk I think io_type here is 0x20 which is IOMAP_UNWRITTEN. Since we've come through xfs_end_bio_written() (not xfs_end_bio_unwritten()) this must be a direct I/O write to a written extent. [3]kdb> inode ffff810054062048 struct inode at 0xffff810054062048 i_ino = 80848951 i_count = 0 i_size 0 i_mode = 0100666 i_nlink = 0 i_rdev = 0x0 i_hash.nxt = 0x0000000000000000 i_hash.pprev = 0xffffc20000208518 i_list.nxt = 0xffff810054062048 i_list.prv = 0xffff810054062048 i_dentry.nxt = 0xffff810054061fe0 i_dentry.prv = 0xffff810054061fe0 i_sb = 0xffff81006d5b0508 i_op = 0xffffffff806647a0 i_data = 0xffff810054062230 nrpages = 0 i_fop= 0xffffffff806644e0 i_flock = 0x0000000000000000 i_mapping = 0xffff810054062230 i_flags 0x0 i_state 0x21 [I_DIRTY_SYNC I_FREEING] fs specific info @ 0xffff810054062418 Mode is 0100666. S_IFREG is 0100000 so linux inode would not have failed assert. So why did XFS inode fail it? From owner-xfs@oss.sgi.com Tue Aug 5 23:14:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 05 Aug 2008 23:14:46 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m766EfZ4016659 for ; Tue, 5 Aug 2008 23:14:42 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA05025; Wed, 6 Aug 2008 16:15:53 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id A8D8958C52A4; Wed, 6 Aug 2008 16:15:53 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-Id: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 16:15:53 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17418 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Use KM_NOFS for debug trace buffers Use KM_NOFS to prevent recursion back into the filesystem which can cause deadlocks. In the case of xfs_iread() we hold the lock on the inode cluster buffer while allocating memory for the trace buffers. If we recurse back into XFS to flush data that may require a transaction to allocate extents which needs log space. This can deadlock with the xfsaild thread which can't push the tail of the log because it is trying to get the inode cluster buffer lock. Date: Wed Aug 6 16:15:14 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm Inspected by: david@fromorbit.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31838a fs/xfs/xfs_log.c - 1.362 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.362&r2=text&tr2=1.361&f=h fs/xfs/xfs_buf_item.c - 1.168 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_buf_item.c.diff?r1=text&tr1=1.168&r2=text&tr2=1.167&f=h fs/xfs/xfs_inode.c - 1.518 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.518&r2=text&tr2=1.517&f=h fs/xfs/quota/xfs_dquot.c - 1.38 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.38&r2=text&tr2=1.37&f=h fs/xfs/linux-2.6/xfs_buf.c - 1.262 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.c.diff?r1=text&tr1=1.262&r2=text&tr2=1.261&f=h fs/xfs/xfs_filestream.c - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_filestream.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h - Use KM_NOFS for debug trace buffers From owner-xfs@oss.sgi.com Wed Aug 6 00:26:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 00:26:30 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m767QMmV032052 for ; Wed, 6 Aug 2008 00:26:23 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06430; Wed, 6 Aug 2008 17:27:35 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 1DD3858C52A4; Wed, 6 Aug 2008 17:27:35 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Fix fallout from semaphore -> completion changes. Message-Id: <20080806072735.1DD3858C52A4@chook.melbourne.sgi.com> Date: Wed, 6 Aug 2008 17:27:35 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17419 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Fix fallout from semaphore -> completion changes. Date: Wed Aug 6 17:26:51 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-tot Inspected by: lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31839a fs/xfs/xfsidbg.c - 1.360 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.360&r2=text&tr2=1.359&f=h - Fix fallout from semaphore -> completion changes. From owner-xfs@oss.sgi.com Wed Aug 6 01:50:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 01:50:15 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m768oAll008900 for ; Wed, 6 Aug 2008 01:50:11 -0700 Received: from chapter11.melbourne.sgi.com (chapter11.melbourne.sgi.com [134.14.54.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA08363; Wed, 6 Aug 2008 18:51:22 +1000 Received: by chapter11.melbourne.sgi.com (Postfix, from userid 16365) id E146D3D2B6DB; Wed, 6 Aug 2008 18:51:21 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 981498 - Make xfs_bmap_*_count_leaves void. Message-Id: <20080806085121.E146D3D2B6DB@chapter11.melbourne.sgi.com> Date: Wed, 6 Aug 2008 18:51:21 +1000 (EST) From: donaldd@sgi.com (Donald Douwsma) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17420 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Make xfs_bmap_*_count_leaves void. xfs_bmap_count_leaves and xfs_bmap_disk_count_leaves always return always 0, make them void. Signed-off-by: Ruben Porras Date: Wed Aug 6 18:50:30 AEST 2008 Workarea: chapter11.melbourne.sgi.com:/scratch/donaldd/isms/2.6.x-xfs Inspected by: ruben.porras@linworks.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31844a fs/xfs/xfs_bmap.c - 1.401 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.401&r2=text&tr2=1.400&f=h - Make xfs_bmap_*_count_leaves void. From owner-xfs@oss.sgi.com Wed Aug 6 02:37:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 02:37:38 -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,J_CHICKENPOX_44 autolearn=no 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 m769bZ4k009502 for ; Wed, 6 Aug 2008 02:37:35 -0700 X-ASG-Debug-ID: 1218015527-319c00a40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6555B363505 for ; Wed, 6 Aug 2008 02:38:48 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id GXOm9dUEhU25NVpI for ; Wed, 06 Aug 2008 02:38:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIALmUh5LAiF/2dsb2JhbACtUEQ X-IronPort-AV: E=Sophos;i="4.31,314,1215354600"; d="scan'208";a="175512847" Received: from ppp121-44-8-133.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.8.133]) by ipmail04.adl2.internode.on.net with ESMTP; 06 Aug 2008 19:08:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQfTg-0008LA-Hr; Wed, 06 Aug 2008 19:38:44 +1000 Date: Wed, 6 Aug 2008 19:38:44 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, xfs-dev X-ASG-Orig-Subj: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path Message-ID: <20080806093844.GZ6119@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> <48990C4E.9070102@sgi.com> <20080806052053.GU6119@disturbed> <4899406D.5020802@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4899406D.5020802@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1218015530 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.1906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17421 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 06, 2008 at 04:10:53PM +1000, Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Wed, Aug 06, 2008 at 12:28:30PM +1000, Lachlan McIlroy wrote: >>> Dave Chinner wrote: >>>> On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >>>>> Dave Chinner wrote: >>>>>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>>>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>>>>>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >>>>>> xfs_free()? What's that? >>>>> Sorry that should have been xfs_ifree() (we set the inode's mode to >>>>> zero in there). >>>>> >>>>>>> completions still running (file size updates and unwritten extent conversions) >>>>>>> may be working on an inode that is no longer valid. >>>>>> The linux inode does not get freed until after ->clear_inode >>>>>> completes, hence it is perfectly valid to reference it anywhere >>>>>> in the ->clear_inode path. >>>>> The problem I see is an assert in xfs_setfilesize() fail: >>>>> >>>>> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >>>>> >>>>> The mode of the XFS inode is zero at this time. >>>> Ok, so the question has to be why is there I/O still in progress >>>> after the truncate is supposed to have already occurred and the >>>> vn_iowait() in xfs_itruncate_start() been executed. >>>> >>>> Something doesn't add up here - you can't be doing I/O on a file >>>> with no extents or delalloc blocks, hence that means we should be >>>> passing through the truncate path in xfs_inactive() before we >>>> call xfs_ifree() and therefore doing the vn_iowait().. >>>> >>>> Hmmmm - the vn_iowait() is conditional based on: >>>> >>>> /* wait for the completion of any pending DIOs */ >>>> if (new_size < ip->i_size) >>>> vn_iowait(ip); >>>> >>>> We are truncating to zero (new_size == 0), so the only case where >>>> this would not wait is if ip->i_size == 0. Still - I can't see >>>> how we'd be doing I/O on an inode with a zero i_size. I suspect >>>> ensuring we call vn_iowait() if newsize == 0 as well would fix >>>> the problem. If not, there's something much more subtle going >>>> on here that we should understand.... >>> If we make the vn_iowait() unconditional we might re-introduce the >>> NFS exclusivity bug that killed performance. That was through >>> xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). >> >> It won't reintroduce that problem because ->clear_inode() >> is not called on every NFS write operation. > Yes but xfs_itruncate_start() can be called from every NFS write so > modifying the above code will re-introduce the problem. Ah, no. The case here is new_size == 0, which will almost never be the case in the ->release call... > >> >>> So if we leave the above code as is then we need another >>> vn_iowait() in xfs_inactive() to catch any remaining workqueue >>> items that we didn't wait for in xfs_itruncate_start(). >> >> How do we have any new *data* I/O at all in progress at this point? > It's not new data I/O. Then why isn't is being caught by the vn_iowait() in the truncate code????? > It's workqueue items that have been queued > from previous I/Os that are still outstanding. The iocount is decremented when the completion is finished, not when it is queued. Hence vn_iowait() should be taking into account this case. >> That does not explain why we need an additional vn_iowait() call. >> All I see from this is a truncate race that has somethign to do with >> the vn_iowait() call being conditional. >> >> That is, if we truncate to zero, then the current code in >> xfs_itruncate_start() should wait unconditinally for *all* I/O to >> complete because, by definition, all that I/O is beyond the new EOF >> and we have to wait for it to complete before truncating the file. > That makes sense. If new_size is zero and ip->i_size is not then we > will wait. If ip->i_size is also zero we will not wait but if the > file size is already zero there should not be any I/Os in progress > and therefore no workqueue items outstanding. I note from the debug below that the linux inode size is zero, but you didn't include the dump of the xfs inode so we can't see what the other variables are. Also, i_size is updated after write I/O is dispatched. If we are doing synchronous I/O, then i_size is not updated until after the I/O completes (in xfs_write()). Hence we could have the situation of I/O being run while i_size = 0. This is why I wanted to know what i_new_size is, because that gets set before the I/O is issued. if i_new_size is non-zero and i_size is zero,that tends to imply the conditional vn_iowait() in the truncate path needs to take MAX(ip->i_size, ip->i_new_size) for the check, not just ip->i_size... FWIW, from the dump below, we have: typedef struct xfs_ioend { struct xfs_ioend *io_list = NULL unsigned int io_type = 0x20 = IOMAP_UNWRITTEN int io_error = 0 atomic_t io_remaining = 0; struct inode *io_inode = 0xffff810054062048 struct buffer_head *io_buffer_head = NULL struct buffer_head *io_buffer_tail = NULL size_t io_size = 0x3400 xfs_off_t io_offset = 0xfe200 struct work_struct io_work; /* xfsdatad work queue */ } xfs_ioend_t; So the I/O was not even close to offset zero. Also, the fact that the stack trace says it came through the written path, but the io_type says unwritten which says that there's something fishy here. Either the stack trace is wrong, or there's been a memory corruption.... >> If either the vn_iowait() in the truncate path is not sufficient, or >> the truncate code is not being called, there is *some other bug* >> that we don't yet understand. Adding an unconditional vn_iowait() >> appear to me to be fixing a symptom, not the underlying cause of >> the problem.... > > I'm not adding a new call to vn_iowait(). I'm just moving the > existing one from xfs_ireclaim() so that we wait for all I/O to > complete before we tear the inode down. Yes, but that is there to catch inodes with non-zero link counts because we are not doing a truncate in that case. We still need to get to the bottom of why the truncate is not waiting for all I/O. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 6 10:11:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 10:11: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=0.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m76HB5Qc029677 for ; Wed, 6 Aug 2008 10:11:06 -0700 X-ASG-Debug-ID: 1218042739-10f0039e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8917EF0BAE7 for ; Wed, 6 Aug 2008 10:12:19 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.228]) by cuda.sgi.com with ESMTP id 2LUX5fjDZvbYLq8E for ; Wed, 06 Aug 2008 10:12:19 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so16231wri.12 for ; Wed, 06 Aug 2008 10:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=oXhd3wRalpHIU3gV2lrKE0VOtPMq08+mQxNUn5iKik0=; b=RPW1zgLmp7rJ9bdM6FdaqKkAeeIhY0kyNrSTimBBXHDy07Y2GN15tuUD2hgNM4x3ts H6fQt0jY34nryo9k0fq6fS7WKJr+/bCLKvgjYVRmoU9vjRnHxZqjXYEFGmfR3L2ekhWD jbn0kxphNT4uAKyAZP5zLSaM0CDwCeB7lm7vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=Hi1mCCslWXTj4ru5c/2IUeQcUsE3HOHJkVWzFm+U+Av1oLhinhV8FGMZo4dUEifahO ge6vRBWN/XRiGjo5MXNz+uiRKuUbdDvjk9lm/vJofhh3TrmVtBTVLOcM7vuMQ6e9IGGA 8DgQdVtHsiskisYBQke2SCyBAaafJ8mhxZ8E4= Received: by 10.90.33.5 with SMTP id g5mr3441010agg.113.1218042738227; Wed, 06 Aug 2008 10:12:18 -0700 (PDT) Received: by 10.90.115.11 with HTTP; Wed, 6 Aug 2008 10:12:15 -0700 (PDT) Message-ID: Date: Wed, 6 Aug 2008 22:42:15 +0530 From: "Bhagi rathi" To: "Lachlan McIlroy" X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com In-Reply-To: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> MIME-Version: 1.0 References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.228] X-Barracuda-Start-Time: 1218042740 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=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1938 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 3263 X-archive-position: 17422 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs I couldn't get a chance to read the diff's completely. If I click on Lachlan's url for diff's, I couldn't access them. It looks to me that the issue is not just with trace buffers. It can extend to xfs_iformat as well. The same dead-lock can spring via xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> xfs_iext_inline_to_direct -> which can do kmem_alloc with KM_SLEEP flag. The source of the problem is that holding a lock and entering into file-system once again. This can lead to dead-lock on the same clustered buffer during cleaning of log space. Cheers, Bhagi. On Wed, Aug 6, 2008 at 11:45 AM, Lachlan McIlroy wrote: > Use KM_NOFS for debug trace buffers > > Use KM_NOFS to prevent recursion back into the filesystem which can > cause deadlocks. > > In the case of xfs_iread() we hold the lock on the inode cluster buffer > while allocating memory for the trace buffers. If we recurse back into > XFS to flush data that may require a transaction to allocate extents > which needs log space. This can deadlock with the xfsaild thread which > can't push the tail of the log because it is trying to get the inode > cluster buffer lock. > > Date: Wed Aug 6 16:15:14 AEST 2008 > Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm > Inspected by: david@fromorbit.com > Author: lachlan > > The following file(s) were checked into: > longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb > > > Modid: xfs-linux-melb:xfs-kern:31838a > fs/xfs/xfs_log.c - 1.362 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_log.c.diff?r1=text&tr1=1.362&r2=text&tr2=1.361&f=h > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.362&r2=text&tr2=1.361&f=h > fs/xfs/xfs_buf_item.c- 1.168 - changed > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_buf_item.c.diff?r1=text&tr1=1.168&r2=text&tr2=1.167&f=h > fs/xfs/xfs_inode.c- 1.518 - changed > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.518&r2=text&tr2=1.517&f=h > fs/xfs/quota/xfs_dquot.c- 1.38 - changed > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.38&r2=text&tr2=1.37&f=h > fs/xfs/linux-2.6/xfs_buf.c- 1.262 - changed > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.c.diff?r1=text&tr1=1.262&r2=text&tr2=1.261&f=h > fs/xfs/xfs_filestream.c- 1.9 - changed > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_filestream.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h > - Use KM_NOFS for debug trace buffers > > > > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Aug 6 10:21:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 10:21:28 -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=0.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m76HLPuH002542 for ; Wed, 6 Aug 2008 10:21:25 -0700 X-ASG-Debug-ID: 1218043359-7b3b00830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6D3F2365BCF for ; Wed, 6 Aug 2008 10:22:39 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by cuda.sgi.com with ESMTP id 5I2eVLR70zy4dREz for ; Wed, 06 Aug 2008 10:22:39 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so20820wri.12 for ; Wed, 06 Aug 2008 10:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=24q5A6b9S0FYMxRmAAnqG8biWTe0WdsP2IgVJGF0wDk=; b=ELTVHHU4WTxpuel3InfBaAZIU4hvcIkxWxEkKxxD5ymv7n5dCt+bZEAJrzKUx5ONc7 7R/sFdD5sVldBroBWj8TEBcu/4WvzWfkXeZ2q7xOEDxpDPW7XBeGv7yvvLeycXic5Fsl fz9fyvgWam6LPO6oHaKemqS2Bw/b1jwS1Gn1Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=spncBunkRR/OMS3i54AoXry1UUghrA4Fs/38C9Nfhj+dLxIDJ/F8MQVZFpPks1HkQ/ g5dOkh9ZuGAyMJwhGl/SSMIByZFFYTGdg7ezYAP9zZfEsjyO8gApd+1i1OT5/1Z3pB17 uGqVv4BVVDpGloc/j2orJad3Z8+1U4PxcyZfE= Received: by 10.90.118.19 with SMTP id q19mr3488663agc.62.1218043359008; Wed, 06 Aug 2008 10:22:39 -0700 (PDT) Received: by 10.90.115.11 with HTTP; Wed, 6 Aug 2008 10:22:38 -0700 (PDT) Message-ID: Date: Wed, 6 Aug 2008 22:52:38 +0530 From: "Bhagi rathi" To: "Lachlan McIlroy" X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com In-Reply-To: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> MIME-Version: 1.0 References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.234] X-Barracuda-Start-Time: 1218043360 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0098 1.0000 -1.9570 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.96 X-Barracuda-Spam-Status: No, SCORE=-1.96 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1938 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1332 X-archive-position: 17423 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures. I am trying to understand why xfs_perag_t? Mount/Unmount are not frequent activities, it is better for them to succeed if operating system can allocate memory and take them forward. -Saradhi. On Wed, Aug 6, 2008 at 11:11 AM, Lachlan McIlroy wrote: > use KM_MAYFAIL in xfs_mountfs > > Use KM_MAYFAIL for the m_perag allocation, we can deal with the error > easily and blocking forever during mount is not a good idea either. > > > Signed-off-by: Christoph Hellwig > > Date: Wed Aug 6 15:40:44 AEST 2008 > Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm > Inspected by: > hch > lachlan > Author: lachlan > > The following file(s) were checked into: > longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb > > > Modid: xfs-linux-melb:xfs-kern:31837a > fs/xfs/xfs_mount.c - 1.445 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h > > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h > - use KM_MAYFAIL in xfs_mountfs > > > > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Aug 6 12:55:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 12:55:18 -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.7 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 m76JtCOq007239 for ; Wed, 6 Aug 2008 12:55:12 -0700 X-ASG-Debug-ID: 1218052579-4ce103210002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ABBED366F43; Wed, 6 Aug 2008 12:56:26 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id oxZmx4OiL4lAgh0q; Wed, 06 Aug 2008 12:56:26 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m76JuIOp011750; Wed, 6 Aug 2008 15:56:18 -0400 Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m76JuIJf007152; Wed, 6 Aug 2008 15:56:18 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by file.rdu.redhat.com (8.13.1/8.13.1) with ESMTP id m76JuHJP005982; Wed, 6 Aug 2008 15:56:18 -0400 Message-ID: <489A01E1.1040309@sandeen.net> Date: Wed, 06 Aug 2008 14:56:17 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Bhagi rathi CC: Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1218052587 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17425 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Bhagi rathi wrote: > I couldn't get a chance to read the diff's completely. If I click on > Lachlan's url for diff's, I couldn't access them. Try again, it takes a while for cvs to catch up. -Eric > It looks to me that > the issue is not just with trace buffers. It can extend to xfs_iformat > as well. The same dead-lock can spring via > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > xfs_iext_inline_to_direct -> which can do kmem_alloc with > KM_SLEEP flag. > > > The source of the problem is that holding a lock and entering into > file-system once again. This can lead to dead-lock on the same > clustered buffer during cleaning of log space. > > Cheers, > Bhagi. From owner-xfs@oss.sgi.com Wed Aug 6 12:54:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 12:54:24 -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.7 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m76JsM14006847 for ; Wed, 6 Aug 2008 12:54:22 -0700 X-ASG-Debug-ID: 1218052530-2feb03010002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9425B18307C9; Wed, 6 Aug 2008 12:55:35 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id yqFZRiMUGUICuoTq; Wed, 06 Aug 2008 12:55:35 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m76JtUcF011425; Wed, 6 Aug 2008 15:55:30 -0400 Received: from file.rdu.redhat.com (file.rdu.redhat.com [10.11.255.147]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m76JtTEE006722; Wed, 6 Aug 2008 15:55:29 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by file.rdu.redhat.com (8.13.1/8.13.1) with ESMTP id m76JtSeF005571; Wed, 6 Aug 2008 15:55:29 -0400 Message-ID: <489A01B0.5050606@sandeen.net> Date: Wed, 06 Aug 2008 14:55:28 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Bhagi rathi CC: Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1218052537 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17424 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Bhagi rathi wrote: > Why are we going to block for ever? Mounting a file-system > requires in-core log space buffers, reading of other buffers > which needs allocation of memory greater than per ag > structures. > > I am trying to understand why xfs_perag_t? Mount/Unmount > are not frequent activities, it is better for them to succeed > if operating system can allocate memory and take them > forward. But that's the big if, right? If the system is so starved that you can't get this memory to even start the mount process, I'm sure it's better to fail the mount with -ENOMEM than to add to the current system memory stress. In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think. -Eric From owner-xfs@oss.sgi.com Wed Aug 6 13:18:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 13:18:50 -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 m76KIjn6016195 for ; Wed, 6 Aug 2008 13:18:47 -0700 X-ASG-Debug-ID: 1218053999-5b9402e70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A33D6367340 for ; Wed, 6 Aug 2008 13:19:59 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 8eR20UH91HzjWsQ4 for ; Wed, 06 Aug 2008 13:19:59 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKyimUh5LAMb/2dsb2JhbACuEw X-IronPort-AV: E=Sophos;i="4.31,316,1215354600"; d="scan'208";a="175864780" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 07 Aug 2008 05:49:57 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQpUD-0007k2-8q; Thu, 07 Aug 2008 06:19:57 +1000 Date: Thu, 7 Aug 2008 06:19:57 +1000 From: Dave Chinner To: Bhagi rathi Cc: Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080806201957.GQ21635@disturbed> Mail-Followup-To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218054000 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0069 1.0000 -1.9756 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.98 X-Barracuda-Spam-Status: No, SCORE=-1.98 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.1950 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17426 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: > I couldn't get a chance to read the diff's completely. If I click on > Lachlan's url for diff's, I couldn't access them. It looks to me that > the issue is not just with trace buffers. It can extend to xfs_iformat > as well. The same dead-lock can spring via > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > xfs_iext_inline_to_direct -> which can do kmem_alloc with > KM_SLEEP flag. Fixed already: Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 6 13:21:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 13:21:46 -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 m76KLiew017598 for ; Wed, 6 Aug 2008 13:21:44 -0700 X-ASG-Debug-ID: 1218054178-5b9603140000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D3EEA36736D for ; Wed, 6 Aug 2008 13:22:59 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id Vp9D30rlruD0RTgm for ; Wed, 06 Aug 2008 13:22:59 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKyimUh5LAMb/2dsb2JhbACuEw X-IronPort-AV: E=Sophos;i="4.31,316,1215354600"; d="scan'208";a="175866215" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 07 Aug 2008 05:52:57 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQpX6-0007oN-5G; Thu, 07 Aug 2008 06:22:56 +1000 Date: Thu, 7 Aug 2008 06:22:56 +1000 From: Dave Chinner To: Eric Sandeen Cc: Bhagi rathi , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Message-ID: <20080806202256.GR21635@disturbed> Mail-Followup-To: Eric Sandeen , Bhagi rathi , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489A01B0.5050606@sandeen.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218054179 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.1950 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17427 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 06, 2008 at 02:55:28PM -0500, Eric Sandeen wrote: > Bhagi rathi wrote: > > Why are we going to block for ever? Mounting a file-system > > requires in-core log space buffers, reading of other buffers > > which needs allocation of memory greater than per ag > > structures. ..... > In general KM_MAYFAIL sounds like a good plan when you can handle the > failure gracefully, I think. Yes, and that is the long term plan - to remove all KM_SLEEP allocations from XFS and allow them to fail gracefully. There's lots of work needed before we get there, though. e.g. right now we cannot survive an ENOMEM error in a transaction.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 6 13:26:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 13:26:36 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m76KQXOZ019479 for ; Wed, 6 Aug 2008 13:26:34 -0700 X-ASG-Debug-ID: 1218054467-23f4003b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9344F1994535 for ; Wed, 6 Aug 2008 13:27:47 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 5PaRPuTHzR6V0Zz5 for ; Wed, 06 Aug 2008 13:27:47 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHqmmUh5LAMb/2dsb2JhbACtfw X-IronPort-AV: E=Sophos;i="4.31,316,1215354600"; d="scan'208";a="175868346" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 07 Aug 2008 05:57:46 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQpbm-00082F-CG; Thu, 07 Aug 2008 06:27:46 +1000 Date: Thu, 7 Aug 2008 06:27:46 +1000 From: Dave Chinner To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080806202746.GC6119@disturbed> Mail-Followup-To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080806201957.GQ21635@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218054468 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0010 1.0000 -2.0143 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 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.1951 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17428 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 07, 2008 at 06:19:57AM +1000, Dave Chinner wrote: > On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: > > I couldn't get a chance to read the diff's completely. If I click on > > Lachlan's url for diff's, I couldn't access them. It looks to me that > > the issue is not just with trace buffers. It can extend to xfs_iformat > > as well. The same dead-lock can spring via > > > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > > xfs_iext_inline_to_direct -> which can do kmem_alloc with > > KM_SLEEP flag. > > Fixed already: > > Hmmm. where did that url go? Try again: Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 6 14:02:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 14:02:47 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m76L2iwN032358 for ; Wed, 6 Aug 2008 14:02:44 -0700 X-ASG-Debug-ID: 1218056638-1f1a02bc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A0E931994CC8 for ; Wed, 6 Aug 2008 14:03:58 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id SEv9z2kmaYru9Ula for ; Wed, 06 Aug 2008 14:03:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHqtmUh5LAMb/2dsb2JhbACuCQ X-IronPort-AV: E=Sophos;i="4.31,316,1215354600"; d="scan'208";a="175881309" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 07 Aug 2008 06:33:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KQqAl-0000d4-Kp; Thu, 07 Aug 2008 07:03:55 +1000 Date: Thu, 7 Aug 2008 07:03:55 +1000 From: Dave Chinner To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080806210355.GS21635@disturbed> Mail-Followup-To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080806202746.GC6119@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080806202746.GC6119@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218056639 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0012 1.0000 -2.0131 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 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.1953 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17429 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 07, 2008 at 06:27:46AM +1000, Dave Chinner wrote: > On Thu, Aug 07, 2008 at 06:19:57AM +1000, Dave Chinner wrote: > > On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: > > > I couldn't get a chance to read the diff's completely. If I click on > > > Lachlan's url for diff's, I couldn't access them. It looks to me that > > > the issue is not just with trace buffers. It can extend to xfs_iformat > > > as well. The same dead-lock can spring via > > > > > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > > > xfs_iext_inline_to_direct -> which can do kmem_alloc with > > > KM_SLEEP flag. > > > > Fixed already: > > > > > > Hmmm. where did that url go? Try again: Ok, something is stripping URLs out of emails. I just sent that URL to myself and it wasn't stripped so it's not my mail infrastructure that is doing it. Did someone "upgrade" the spam filters on oss.sgi.com or the barracuda overnight? The link - minus the "http://" bit is: oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=8c6266658cb76e282c14cb92f8ba5a1c674f4928 let's see if that gets stripped.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 6 19:18:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 06 Aug 2008 19:18:23 -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 m772II7p030212 for ; Wed, 6 Aug 2008 19:18:18 -0700 X-ASG-Debug-ID: 1218075572-275a03b20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 99682F10B87; Wed, 6 Aug 2008 19:19:32 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id OV2n97hGGxIfofPf; Wed, 06 Aug 2008 19:19:32 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m772JSw2073892; Wed, 6 Aug 2008 21:19:29 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <489A5BB0.9020900@thebarn.com> Date: Wed, 06 Aug 2008 21:19:28 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080806202746.GC6119@disturbed> <20080806210355.GS21635@disturbed> In-Reply-To: <20080806210355.GS21635@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7966/Wed Aug 6 21:05:25 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1218075573 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0126 1.0000 -1.9390 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.94 X-Barracuda-Spam-Status: No, SCORE=-1.94 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.1974 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17430 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Thu, Aug 07, 2008 at 06:27:46AM +1000, Dave Chinner wrote: > >> On Thu, Aug 07, 2008 at 06:19:57AM +1000, Dave Chinner wrote: >> >>> On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: >>> >>>> I couldn't get a chance to read the diff's completely. If I click on >>>> Lachlan's url for diff's, I couldn't access them. It looks to me that >>>> the issue is not just with trace buffers. It can extend to xfs_iformat >>>> as well. The same dead-lock can spring via >>>> >>>> xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> >>>> xfs_iext_inline_to_direct -> which can do kmem_alloc with >>>> KM_SLEEP flag. >>>> >>> Fixed already: >>> >>> >>> >> Hmmm. where did that url go? Try again: >> > > Ok, something is stripping URLs out of emails. I just sent that URL > to myself and it wasn't stripped so it's not my mail infrastructure > that is doing it. > > Did someone "upgrade" the spam filters on oss.sgi.com or the > barracuda overnight? > not oss I'm seeing the correct url's BTW > The link - minus the "http://" bit is: > > oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=8c6266658cb76e282c14cb92f8ba5a1c674f4928 > > let's see if that gets stripped.... > > Cheers, > > Dave. > From owner-xfs@oss.sgi.com Thu Aug 7 01:35:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 01:36:03 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m778ZWYf002292 for ; Thu, 7 Aug 2008 01:35:33 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA07224; Thu, 7 Aug 2008 18:36:44 +1000 Message-ID: <489AB596.1010505@sgi.com> Date: Thu, 07 Aug 2008 18:43:02 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> <48990C4E.9070102@sgi.com> <20080806052053.GU6119@disturbed> <4899406D.5020802@sgi.com> <20080806093844.GZ6119@disturbed> In-Reply-To: <20080806093844.GZ6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17431 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Wed, Aug 06, 2008 at 04:10:53PM +1000, Lachlan McIlroy wrote: >> Dave Chinner wrote: >>> On Wed, Aug 06, 2008 at 12:28:30PM +1000, Lachlan McIlroy wrote: >>>> Dave Chinner wrote: >>>>> On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >>>>>> Dave Chinner wrote: >>>>>>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>>>>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we have already >>>>>>>> gone through xfs_inactive()/xfs_free() and recycled the inode. Any I/O >>>>>>> xfs_free()? What's that? >>>>>> Sorry that should have been xfs_ifree() (we set the inode's mode to >>>>>> zero in there). >>>>>> >>>>>>>> completions still running (file size updates and unwritten extent conversions) >>>>>>>> may be working on an inode that is no longer valid. >>>>>>> The linux inode does not get freed until after ->clear_inode >>>>>>> completes, hence it is perfectly valid to reference it anywhere >>>>>>> in the ->clear_inode path. >>>>>> The problem I see is an assert in xfs_setfilesize() fail: >>>>>> >>>>>> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >>>>>> >>>>>> The mode of the XFS inode is zero at this time. >>>>> Ok, so the question has to be why is there I/O still in progress >>>>> after the truncate is supposed to have already occurred and the >>>>> vn_iowait() in xfs_itruncate_start() been executed. >>>>> >>>>> Something doesn't add up here - you can't be doing I/O on a file >>>>> with no extents or delalloc blocks, hence that means we should be >>>>> passing through the truncate path in xfs_inactive() before we >>>>> call xfs_ifree() and therefore doing the vn_iowait().. >>>>> >>>>> Hmmmm - the vn_iowait() is conditional based on: >>>>> >>>>> /* wait for the completion of any pending DIOs */ >>>>> if (new_size < ip->i_size) >>>>> vn_iowait(ip); >>>>> >>>>> We are truncating to zero (new_size == 0), so the only case where >>>>> this would not wait is if ip->i_size == 0. Still - I can't see >>>>> how we'd be doing I/O on an inode with a zero i_size. I suspect >>>>> ensuring we call vn_iowait() if newsize == 0 as well would fix >>>>> the problem. If not, there's something much more subtle going >>>>> on here that we should understand.... >>>> If we make the vn_iowait() unconditional we might re-introduce the >>>> NFS exclusivity bug that killed performance. That was through >>>> xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). >>> It won't reintroduce that problem because ->clear_inode() >>> is not called on every NFS write operation. >> Yes but xfs_itruncate_start() can be called from every NFS write so >> modifying the above code will re-introduce the problem. > > Ah, no. The case here is new_size == 0, which will almost never be > the case in the ->release call... True. > >>>> So if we leave the above code as is then we need another >>>> vn_iowait() in xfs_inactive() to catch any remaining workqueue >>>> items that we didn't wait for in xfs_itruncate_start(). >>> How do we have any new *data* I/O at all in progress at this point? >> It's not new data I/O. > > Then why isn't is being caught by the vn_iowait() in the truncate > code????? No idea. > >> It's workqueue items that have been queued >> from previous I/Os that are still outstanding. > > The iocount is decremented when the completion is finished, not when it > is queued. Hence vn_iowait() should be taking into account this case. Hmmm. It should. > >>> That does not explain why we need an additional vn_iowait() call. >>> All I see from this is a truncate race that has somethign to do with >>> the vn_iowait() call being conditional. >>> >>> That is, if we truncate to zero, then the current code in >>> xfs_itruncate_start() should wait unconditinally for *all* I/O to >>> complete because, by definition, all that I/O is beyond the new EOF >>> and we have to wait for it to complete before truncating the file. >> That makes sense. If new_size is zero and ip->i_size is not then we >> will wait. If ip->i_size is also zero we will not wait but if the >> file size is already zero there should not be any I/Os in progress >> and therefore no workqueue items outstanding. > > I note from the debug below that the linux inode size is zero, > but you didn't include the dump of the xfs inode so we can't see > what the other variables are. I tried to dump the xfs inode at the time but kdb encountered a bad address. I'm pretty sure I was able to get a dump of the XFS inode on another crash - that's how I found the mode to be zero. I can't be sure now - I'll have to reproduce the problem again. > > Also, i_size is updated after write I/O is dispatched. If we are > doing synchronous I/O, then i_size is not updated until after the > I/O completes (in xfs_write()). Hence we could have the situation of > I/O being run while i_size = 0. This is why I wanted to know what > i_new_size is, because that gets set before the I/O is issued. > > if i_new_size is non-zero and i_size is zero,that tends to imply > the conditional vn_iowait() in the truncate path needs to take > MAX(ip->i_size, ip->i_new_size) for the check, not just ip->i_size... > > FWIW, from the dump below, we have: > > typedef struct xfs_ioend { > struct xfs_ioend *io_list = NULL > unsigned int io_type = 0x20 = IOMAP_UNWRITTEN > int io_error = 0 > atomic_t io_remaining = 0; > struct inode *io_inode = 0xffff810054062048 > struct buffer_head *io_buffer_head = NULL > struct buffer_head *io_buffer_tail = NULL > size_t io_size = 0x3400 > xfs_off_t io_offset = 0xfe200 > struct work_struct io_work; /* xfsdatad work queue */ > } xfs_ioend_t; > > So the I/O was not even close to offset zero. > > Also, the fact that the stack trace says it came through the > written path, but the io_type says unwritten which says that there's > something fishy here. Either the stack trace is wrong, or there's > been a memory corruption.... I'm pretty sure that's because it was a direct I/O write to a written extent. The I/O starts out as IOMAP_UNWRITTEN and if we didn't map to an unwritten extent it's completion handler is switched to the written one. Looking at the direct I/O write path I can see where the direct I/O write would wait for the bio's to complete but it's not waiting for the workqueue items to be flushed. Not sure if that's part of the problem though. > >>> If either the vn_iowait() in the truncate path is not sufficient, or >>> the truncate code is not being called, there is *some other bug* >>> that we don't yet understand. Adding an unconditional vn_iowait() >>> appear to me to be fixing a symptom, not the underlying cause of >>> the problem.... >> I'm not adding a new call to vn_iowait(). I'm just moving the >> existing one from xfs_ireclaim() so that we wait for all I/O to >> complete before we tear the inode down. > > Yes, but that is there to catch inodes with non-zero link counts because > we are not doing a truncate in that case. We still need to get to the > bottom of why the truncate is not waiting for all I/O. I'm wondering if we have an extra decrement on the i_iocount atomic counter that tricked vn_iowait() into thinking that all I/Os have completed. Should this code in xfs_vm_direct_IO(): if (unlikely(ret != -EIOCBQUEUED && iocb->private)) xfs_destroy_ioend(iocb->private); be: if (unlikely(ret < 0 && ret != -EIOCBQUEUED && iocb->private)) xfs_destroy_ioend(iocb->private); Ordinarily we'd drop the i_iocount reference by calling xfs_end_io_direct(). From owner-xfs@oss.sgi.com Thu Aug 7 10:17:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 10:17:35 -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=0.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m77HHWPG017728 for ; Thu, 7 Aug 2008 10:17:33 -0700 X-ASG-Debug-ID: 1218129527-595302080000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5209C124CA89 for ; Thu, 7 Aug 2008 10:18:47 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.230]) by cuda.sgi.com with ESMTP id b4dkVsMXfVTi3BhD for ; Thu, 07 Aug 2008 10:18:47 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so438565wri.12 for ; Thu, 07 Aug 2008 10:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=PXZ4XiFcR0ho2hDiSGvoK6BFKOOvfu+rk2SMGuFwZoE=; b=BkmkoLomBhVmjuXEPVaF/Koek0lNYiZZeu3TDrmngCv4sjL+s+P2fxVU828oHxIumA wSsQelO5jmhr1Z8SqyiUOoTBD9XcUjSktXfbMEr81fVLRuAbLUHItqyS/7FKYd6SdMHl CCJOgoE9d05S4ipvBx9LqIaqAABmo2zrffmaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=VlCUFEokbSYeqY3grGb9ghqj4okckE5Ki3IeEml7oO9jPHqTENyTSp9wpfDNQYXIdv MDkzUM6BYyvzUM65PwHpcxvPPdwiqfni9IQtyS6Tk4rBy2wbOIaiAIj+M6wGCpo1/SOS Ul3tI7rrUqr37O7bH4TKNLBdBuC5wz8KifJMA= Received: by 10.90.98.13 with SMTP id v13mr5250345agb.86.1218129527158; Thu, 07 Aug 2008 10:18:47 -0700 (PDT) Received: by 10.90.115.11 with HTTP; Thu, 7 Aug 2008 10:18:46 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 22:48:46 +0530 From: "Bhagi rathi" To: "Eric Sandeen" X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Cc: "Lachlan McIlroy" , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com In-Reply-To: <489A01B0.5050606@sandeen.net> MIME-Version: 1.0 References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.230] X-Barracuda-Start-Time: 1218129528 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4969 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2034 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1493 X-archive-position: 17432 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Thu, Aug 7, 2008 at 1:25 AM, Eric Sandeen wrote: > Bhagi rathi wrote: > > Why are we going to block for ever? Mounting a file-system > > requires in-core log space buffers, reading of other buffers > > which needs allocation of memory greater than per ag > > structures. > > > > I am trying to understand why xfs_perag_t? Mount/Unmount > > are not frequent activities, it is better for them to succeed > > if operating system can allocate memory and take them > > forward. > > But that's the big if, right? > > If the system is so starved that you can't get this memory to even start > the mount process, I'm sure it's better to fail the mount with -ENOMEM > than to add to the current system memory stress. Not really. It is going to fail many automated scripts. We are designing for a problem that system is starved with memory. It points to a bug in memory & system dirty state cleaning, they are the ideal problems to be solved this instead of this. As long as system recovers, it is good not to disturb automated scripts by introducing these kind of unnecessary failures of the mount command. > > > In general KM_MAYFAIL sounds like a good plan when you can handle the > failure gracefully, I think. Not really. It fails mount gracefully, however, it needs administrative action. It is expected that operating system will recover and functional without admin intervention. Cheers, Bhagi. > > > -Eric > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 7 10:22:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 10:22:45 -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=0.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m77HMhGj018461 for ; Thu, 7 Aug 2008 10:22:43 -0700 X-ASG-Debug-ID: 1218129836-67d302080000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 39D6E373493 for ; Thu, 7 Aug 2008 10:23:56 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.229]) by cuda.sgi.com with ESMTP id FFYvfDrtrxYhcHMG for ; Thu, 07 Aug 2008 10:23:56 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so440709wri.12 for ; Thu, 07 Aug 2008 10:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=uvdD4/E6v59xphbXmHr7Hk4uU1tFe4JJVmqnHAFVKJE=; b=iOTH0vSzo9Exgt0V/KppxRgJsNHluyiaJLHKjPXzs5U1vT03SkRiQ1+F9LqupouNpP /bYposkzbfOArZKPh/NehlsKEpoNRqqDrJjhQj1dkPagn/bq8H1U/YExS1NzcQwaIK1/ cjQFBnOU7jbIb4ggPthJ8wu+0liELpwmRhBrg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=LrWlz3X0FkCJmtYqaS0pWTsKACwU/fHxt2j0LWHekiwNFiI2uPTpPxlosDKwXOQ/Zw dBjtYvekjN+VnNtrFULcnf41U6gPKEndhYOxEp0rQjefI5ybO75+XrIyvM8+osSTcWH0 13AMQSO+elvsXZRkIXnSy5IO+4WK7IOSMdix8= Received: by 10.90.118.19 with SMTP id q19mr5272715agc.62.1218129836195; Thu, 07 Aug 2008 10:23:56 -0700 (PDT) Received: by 10.90.115.11 with HTTP; Thu, 7 Aug 2008 10:23:55 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 22:53:55 +0530 From: "Bhagi rathi" To: "Eric Sandeen" , "Bhagi rathi" , "Lachlan McIlroy" , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs In-Reply-To: <20080806202256.GR21635@disturbed> MIME-Version: 1.0 References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> <20080806202256.GR21635@disturbed> X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.229] X-Barracuda-Start-Time: 1218129839 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4725 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2034 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1074 X-archive-position: 17433 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Thu, Aug 7, 2008 at 1:52 AM, Dave Chinner wrote: > On Wed, Aug 06, 2008 at 02:55:28PM -0500, Eric Sandeen wrote: > > Bhagi rathi wrote: > > > Why are we going to block for ever? Mounting a file-system > > > requires in-core log space buffers, reading of other buffers > > > which needs allocation of memory greater than per ag > > > structures. > ..... > > In general KM_MAYFAIL sounds like a good plan when you can handle the > > failure gracefully, I think. > > Yes, and that is the long term plan - to remove all KM_SLEEP > allocations from XFS and allow them to fail gracefully. There's > lots of work needed before we get there, though. e.g. > right now we cannot survive an ENOMEM error in a transaction.... I am not sure that we are solving right problem. Isn't the above is fall-out of XFS needing memory to clean dirty memory? That is of good priority to engineer than this handling of ENOMEM in transactions. Cheers, Bhagi. > > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 7 10:42:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 10:42:49 -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=1.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m77HgkM0020196 for ; Thu, 7 Aug 2008 10:42:47 -0700 X-ASG-Debug-ID: 1218131040-596b03590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D84CE124C9CF for ; Thu, 7 Aug 2008 10:44:00 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.173]) by cuda.sgi.com with ESMTP id d8cXTcvhG1L73thw for ; Thu, 07 Aug 2008 10:44:00 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so480661wfd.32 for ; Thu, 07 Aug 2008 10:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=7Du/9PYAokNN1B0xzaiQSj2YTI/oMwp+E8V+S15Dhe0=; b=KN9kxexnKlGOQpKJgRY8arsu6saJLVCWuRy6oQskG4AzasQh/WtJDeTAULRsvLB8fm HA6P3aD5ZjfoLjeHwx6K12w8+FNRGJZdTluP63O3iTCAQpGX/UBTiMPLukGbx7xmLf5p +6aB4O387OrptRkF/rmz6vlRYQex7nLDvGQL8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=veFtohS2mkY7XV7dvmyLK6p+KldaMYqPHxeO/UeaUdAyl7PaF1kAY30tVwShjlFlmL G8X7emm6SsBGQG6+mCxtYuK0NQKE80IVxupFxw+5hbNTG4JppmFe8aIMsyINAtXUH9Te BJlXBNHEmszBtOVTjrJKobWVGgbaMAj4dyQFQ= Received: by 10.142.105.13 with SMTP id d13mr558287wfc.275.1218131040096; Thu, 07 Aug 2008 10:44:00 -0700 (PDT) Received: by 10.142.164.8 with HTTP; Thu, 7 Aug 2008 10:43:59 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 23:13:59 +0530 From: "Bhagi rathi" To: "Bhagi rathi" , "Lachlan McIlroy" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers In-Reply-To: <20080806201957.GQ21635@disturbed> MIME-Version: 1.0 References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.173] X-Barracuda-Start-Time: 1218131040 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4987 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2036 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1490 X-archive-position: 17434 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Thu, Aug 7, 2008 at 1:49 AM, Dave Chinner wrote: > On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: > > I couldn't get a chance to read the diff's completely. If I click on > > Lachlan's url for diff's, I couldn't access them. It looks to me that > > the issue is not just with trace buffers. It can extend to xfs_iformat > > as well. The same dead-lock can spring via > > > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > > xfs_iext_inline_to_direct -> which can do kmem_alloc with > > KM_SLEEP flag. > > Fixed already: > > > http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=8c6266658cb76e282c14cb92f8ba5a1c674f4928 > Thanks Dave. However, My concern is just not one allocation. We need to clean all allocations that can re-enter to file-system. I see that this issue exists in attributes format for i_afp allocations. It may exist with local format of data and attributes too. xfs_iread->xfs_iformat->xfs_iformat_local. Are we safe that we fixed all these real problems by looking into possible allocations that will enter into file-system? The problem with trace buffers is telling us to clean this code path. By the way, I browse the source code from lxr.linux.no. If I have to browse the latest xfs source code with linux kernel that is used at SGI, how can I do that? Cheers, Bhagi. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 7 10:44:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 10:44:19 -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=1.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m77HiHxb020607 for ; Thu, 7 Aug 2008 10:44:17 -0700 X-ASG-Debug-ID: 1218131132-67c003310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AAA4937390E for ; Thu, 7 Aug 2008 10:45:32 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.171]) by cuda.sgi.com with ESMTP id 47c72dCY1VKms56T for ; Thu, 07 Aug 2008 10:45:32 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so481152wfd.32 for ; Thu, 07 Aug 2008 10:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=DBQyiIneRRlhG5dwt2J9yP7ycq/MSXDrZmBzby/PTkk=; b=ln7PzuE/U+2EyafwZTPfOjz8sotMVEveHVX26EDAEr9FTaqP5nce7lk5SdjqTdG5eU tPGwP9+viTbMKFiffWDJ8/ZnV1rw18vKCCxrpnDIucXvw8VgZp4zx9ThWg27VPcR2aP7 Vedg/uPCQ50FdXEmhV+UqsPcNek8GgzDD6uRs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=qPTr7w9b0Pp9D+zg63eRkA5a4IE4BBt1DeIEy786FqO6koVpTTpgNvMPQcRJWB+NUO 69hqMZh2ClFPOrtvSAmSExkMY7KcdRsqTB22LXiYDlMtUjM4EGGksnUufzdoL25pvgkk Io13XROMV6W3CqjGmw66lln+gjG2w6TaVrhxs= Received: by 10.142.180.19 with SMTP id c19mr347777wff.263.1218131131988; Thu, 07 Aug 2008 10:45:31 -0700 (PDT) Received: by 10.142.164.8 with HTTP; Thu, 7 Aug 2008 10:45:31 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 23:15:31 +0530 From: "Bhagi rathi" To: "Bhagi rathi" , "Lachlan McIlroy" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers In-Reply-To: <20080806210355.GS21635@disturbed> MIME-Version: 1.0 References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080806202746.GC6119@disturbed> <20080806210355.GS21635@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.171] X-Barracuda-Start-Time: 1218131132 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4774 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2034 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1575 X-archive-position: 17435 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Thu, Aug 7, 2008 at 2:33 AM, Dave Chinner wrote: > On Thu, Aug 07, 2008 at 06:27:46AM +1000, Dave Chinner wrote: > > On Thu, Aug 07, 2008 at 06:19:57AM +1000, Dave Chinner wrote: > > > On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: > > > > I couldn't get a chance to read the diff's completely. If I click on > > > > Lachlan's url for diff's, I couldn't access them. It looks to me that > > > > the issue is not just with trace buffers. It can extend to > xfs_iformat > > > > as well. The same dead-lock can spring via > > > > > > > > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> > > > > xfs_iext_inline_to_direct -> which can do kmem_alloc with > > > > KM_SLEEP flag. > > > > > > Fixed already: > > > > > > > > > > Hmmm. where did that url go? Try again: > > Ok, something is stripping URLs out of emails. I just sent that URL > to myself and it wasn't stripped so it's not my mail infrastructure > that is doing it. > > Did someone "upgrade" the spam filters on oss.sgi.com or the > barracuda overnight? > > The link - minus the "http://" bit is: > > > oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=8c6266658cb76e282c14cb92f8ba5a1c674f4928 > The above just worked fine for me. Lachlan's URL still have the same issue. Cheers, Bhagi. > > > > let's see if that gets stripped.... > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 7 14:53:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 14:54:23 -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=-0.5 required=5.0 tests=BAYES_00,RCVD_NUMERIC_HELO autolearn=no 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 m77LrsYw028297 for ; Thu, 7 Aug 2008 14:53:55 -0700 X-ASG-Debug-ID: 1218146108-1171024e0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ciao.gmane.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 185CA374C72 for ; Thu, 7 Aug 2008 14:55:08 -0700 (PDT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by cuda.sgi.com with ESMTP id 1wnCkpXmMwgxSXjP for ; Thu, 07 Aug 2008 14:55:08 -0700 (PDT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KRDRm-0001Jj-Te for linux-xfs@oss.sgi.com; Thu, 07 Aug 2008 21:55:03 +0000 Received: from 155.91.45.232 ([155.91.45.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Aug 2008 21:55:02 +0000 Received: from freemanrich by 155.91.45.232 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Aug 2008 21:55:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: linux-xfs@oss.sgi.com From: Richard Freeman X-ASG-Orig-Subj: Re: =?utf-8?b?eGZzX2ZvcmNlX3NodXRkb3du?= called from file =?utf-8?b?ZnMveGZzL3hmc190cmFuc19idWYuYw==?= Subject: Re: =?utf-8?b?eGZzX2ZvcmNlX3NodXRkb3du?= called from file =?utf-8?b?ZnMveGZzL3hmc190cmFuc19idWYuYw==?= Date: Mon, 4 Aug 2008 16:55:41 +0000 (UTC) Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 155.91.45.232 (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)) X-Barracuda-Connect: main.gmane.org[80.91.229.2] X-Barracuda-Start-Time: 1218146110 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: -0.77 X-Barracuda-Spam-Status: No, SCORE=-0.77 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RCVD_NUMERIC_HELO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.25 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17436 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: freemanrich@gmail.com Precedence: bulk X-list: xfs Jay Sullivan rit.edu> writes: > > Today I upgraded to the latest stable kernel in Gentoo (2.6.23-r3) and > I'm still on xfsprogs 2.9.4, also the latest stable release. A few > hours after rebooting to load the new kernel, I saw the following in > dmesg: > > #################### > attempt to access beyond end of device > dm-0: rw=0, want=68609558288793608, limit=8178892800 I just started getting these on an ext3 filesystem also on gentoo, with the latest stable kernel. I suspect there is an lvm bug of some kind that is responsible. I ran an e2fsck on the filesystem and managed to corrupt not only that filesystem, but also several others on the same RAID. I'm probably going to have to try to salvage what I can from the no-longer-booting system and rebuild from scatch/backups. Either lvm has some major bug, or somehow e2fsck is bypassing the lvm layer and writing directly to the drives. It shouldn't be possible to write to one logical volume and modify data stored in a different logical volume on the same md raid-5 device. A check of the underlying RAID turns up no issues - I suspect the problem is in the lvm layer. Googling around for "access beyond end of device" turns up other reports of similar issues. Obviously the problem is rare. From owner-xfs@oss.sgi.com Thu Aug 7 14:54:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 14:54:40 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m77LsaQZ028419 for ; Thu, 7 Aug 2008 14:54:37 -0700 X-ASG-Debug-ID: 1218146149-1690021b0000-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 8776A199CC1F for ; Thu, 7 Aug 2008 14:55:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id gjZL54lIRql83IHh for ; Thu, 07 Aug 2008 14:55:50 -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 m77LtpIF011301 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 7 Aug 2008 23:55:52 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m77LtpxC011299 for xfs@oss.sgi.com; Thu, 7 Aug 2008 23:55:51 +0200 Date: Thu, 7 Aug 2008 23:55:51 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: generic btree implementation, version 4 Subject: generic btree implementation, version 4 Message-ID: <20080807215551.GA11084@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218146151 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17437 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 As the mainlinglist seems to have some problems with the large number of patches and I don't want to monopolize it anyway there is just this announcement with a link to the patches: http://verein.lst.de/~hch/xfs/patches.btree.tgz The biggest change this time around is that the generic record, key and pointer addressing has been merged into the main patches. There is a new patch early in the series introducing the helpers for this, and a big comment describing how all this addressing works. The smalles and most important changes is a fix for xfs_btree_delrec which used to pass an unitialized xfs_btree_key structure to xfs_btree_updkey for the non-leaf case since the very first version of the generic btree patches. On the method side ->get_root_from_inode and ->resize_root have been dropped because we hardcode that way the btree is rooted in the inode in so many other places. If we ever get a differently inode rooted btree we can add the proper abstractions for it. The ->kill_root is back for now, I hope we can sort out the tiny difference between the alloc and inobt btrees later. There also are two new methods to move xfs_btree_check_key / xfs_btree_check_rec into the btree implementations. In addition to that I've addressed Dave's review comments, except that I've kept the name for the get_dmaxrecs and instead documented why it's called that way (hint the d stands for disk) and what the callers try to do with it. I think the code is in shape now, and ready for some more QA. I will post a test harness based on Dave's WIP code to help with that shortly. From owner-xfs@oss.sgi.com Thu Aug 7 14:57:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 14:57:37 -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 (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 m77LvYg4029251 for ; Thu, 7 Aug 2008 14:57:35 -0700 X-ASG-Debug-ID: 1218146327-12e202a80000-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 CF6C0374CD7 for ; Thu, 7 Aug 2008 14:58:47 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id rjPN9md18B74KNBv for ; Thu, 07 Aug 2008 14:58:47 -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 m77LwnIF011426 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 7 Aug 2008 23:58:49 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m77Lwnht011424 for xfs@oss.sgi.com; Thu, 7 Aug 2008 23:58:49 +0200 Date: Thu, 7 Aug 2008 23:58:49 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: PATCH] trivial xfs_remove comment fixup Subject: PATCH] trivial xfs_remove comment fixup Message-ID: <20080807215849.GA11345@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218146329 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.2053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17438 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 The dp to ip comment should be for the unconditional xfs_droplink call, and the "." link obviously only exists for directories, so it should be in the is_dir conditional. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-08-06 17:26:37.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-08-06 17:36:44.000000000 -0300 @@ -2014,7 +2014,7 @@ xfs_remove( goto out_bmap_cancel; /* - * Drop the link from dp to ip. + * Drop the "." link from ip to self. */ error = xfs_droplink(tp, ip); if (error) @@ -2029,7 +2029,7 @@ xfs_remove( } /* - * Drop the "." link from ip to self. + * Drop the link from dp to ip. */ error = xfs_droplink(tp, ip); if (error) From owner-xfs@oss.sgi.com Thu Aug 7 15:03:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 15:03:50 -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,J_CHICKENPOX_22 autolearn=no 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 m77M3m3j030262 for ; Thu, 7 Aug 2008 15:03:48 -0700 X-ASG-Debug-ID: 1218146699-1eb402990000-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 E742F374D12; Thu, 7 Aug 2008 15:05:00 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id vWxr7ZIRGdSYQrGN; Thu, 07 Aug 2008 15:05:00 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KRDbP-00043R-O4; Thu, 07 Aug 2008 22:04:59 +0000 Date: Thu, 7 Aug 2008 18:04:59 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080807220459.GA15199@infradead.org> References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> 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: 1218146703 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.2053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17439 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 Sorry for the later review, but the xfs_super.c changes don't make sense. These allocations are done during module_init time and thus it'ss fien to call back into any fs to reclaim pages for it. Fortunately the affect is harmless, but I'd suggest reverting that part of the change. From owner-xfs@oss.sgi.com Thu Aug 7 17:30:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 17:30:41 -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 (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 m780Uab4012622 for ; Thu, 7 Aug 2008 17:30:38 -0700 X-ASG-Debug-ID: 1218155510-290b028d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 32E5EF193C2 for ; Thu, 7 Aug 2008 17:31:51 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 7RXFd4EHHSqtbjt0 for ; Thu, 07 Aug 2008 17:31:51 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADYwm0h5LAMb/2dsb2JhbACsbQ X-IronPort-AV: E=Sophos;i="4.31,323,1215354600"; d="scan'208";a="176784491" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 08 Aug 2008 10:01:48 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KRFtT-0007aT-6H; Fri, 08 Aug 2008 10:31:47 +1000 Date: Fri, 8 Aug 2008 10:31:47 +1000 From: Dave Chinner To: Bhagi rathi Cc: Eric Sandeen , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Message-ID: <20080808003147.GA24344@disturbed> Mail-Followup-To: Bhagi rathi , Eric Sandeen , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> <20080806202256.GR21635@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218155512 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.2061 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17440 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 07, 2008 at 10:53:55PM +0530, Bhagi rathi wrote: > On Thu, Aug 7, 2008 at 1:52 AM, Dave Chinner wrote: > > > On Wed, Aug 06, 2008 at 02:55:28PM -0500, Eric Sandeen wrote: > > > Bhagi rathi wrote: > > > > Why are we going to block for ever? Mounting a file-system > > > > requires in-core log space buffers, reading of other buffers > > > > which needs allocation of memory greater than per ag > > > > structures. > > ..... > > > In general KM_MAYFAIL sounds like a good plan when you can handle the > > > failure gracefully, I think. > > > > Yes, and that is the long term plan - to remove all KM_SLEEP > > allocations from XFS and allow them to fail gracefully. There's > > lots of work needed before we get there, though. e.g. > > right now we cannot survive an ENOMEM error in a transaction.... > > > I am not sure that we are solving right problem. Isn't the above is > fall-out > of XFS needing memory to clean dirty memory? We can't avoid that. It is inherent in the design of XFS. And the amount of memory is not easily bounded so existing solutions like wrapping slabs in mempools don't work, either. > That is of good priority > to engineer than this handling of ENOMEM in transactions. That's just one example of an extremely non-trivial piece of work that needs to be done to allow all memory allocations to fail. This work will be done for other reasons (like transaction rollback to prevent shutdowns on errors inside a dirty transaction), not specifically to allow memory allocations to fail. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 7 17:32:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 17:32:35 -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 m780WWeC012976 for ; Thu, 7 Aug 2008 17:32:32 -0700 X-ASG-Debug-ID: 1218155626-70da00bb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 32D04375830 for ; Thu, 7 Aug 2008 17:33:46 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id LsKblLLKHZIpZQjG for ; Thu, 07 Aug 2008 17:33:46 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADYwm0h5LAMb/2dsb2JhbACsbQ X-IronPort-AV: E=Sophos;i="4.31,323,1215354600"; d="scan'208";a="176785781" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 08 Aug 2008 10:03:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KRFvM-0007cy-FM; Fri, 08 Aug 2008 10:33:44 +1000 Date: Fri, 8 Aug 2008 10:33:44 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: PATCH] trivial xfs_remove comment fixup Subject: Re: PATCH] trivial xfs_remove comment fixup Message-ID: <20080808003344.GB24344@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080807215849.GA11345@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080807215849.GA11345@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218155628 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.2054 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17441 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 07, 2008 at 11:58:49PM +0200, Christoph Hellwig wrote: > The dp to ip comment should be for the unconditional xfs_droplink > call, and the "." link obviously only exists for directories, > so it should be in the is_dir conditional. Ack. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 7 22:15:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 22:16:24 -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=1.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m785FkjU017046 for ; Thu, 7 Aug 2008 22:15:46 -0700 X-ASG-Debug-ID: 1218172617-1d4102f30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F196A375CA0 for ; Thu, 7 Aug 2008 22:16:57 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by cuda.sgi.com with ESMTP id SwtYChjJ6ijNjAY3 for ; Thu, 07 Aug 2008 22:16:57 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so696615wfd.32 for ; Thu, 07 Aug 2008 22:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=uS881Ku/WMmszhFp85i6Ktk/N/G7l+V5jMlPzvPD30A=; b=ZzJEvfN9PMl8hfvuaTuDlKOdui90pDWhSkPNx1wg3oOmLGFIMyQBXoOYConL/6/9ik Ycpq050bfiYo4DBn6CWXNzNxkKzCB169UE7o9oJ4sCD9UNs2+YjOZta1IM8tJmjAyxbw kJ9eB8wpxOMzlwzHupZ5RYcZMqlZH1GhUMKfQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=h36oE/wFEL3A0g7f32fxDgj3hDUb8I84EbKKuOJ7/bZgAdQ39m/ywK5dpwpzKXSg1+ yCWwqMnIW7ho7BjgZQD97oqPZ/bZc8UpirusxRUkWsbin3v7q+oCBzcmnjK3hFDb9axD G3Sz99p1xliQE5Es4q4rm9yi/Fji5yPr2F910= Received: by 10.142.162.9 with SMTP id k9mr782749wfe.211.1218172616945; Thu, 07 Aug 2008 22:16:56 -0700 (PDT) Received: by 10.142.164.8 with HTTP; Thu, 7 Aug 2008 22:16:56 -0700 (PDT) Message-ID: Date: Fri, 8 Aug 2008 10:46:56 +0530 From: "Bhagi rathi" To: "Bhagi rathi" , "Lachlan McIlroy" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers In-Reply-To: MIME-Version: 1.0 References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.172] X-Barracuda-Start-Time: 1218172617 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0029 1.0000 -2.0021 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.00 X-Barracuda-Spam-Status: No, SCORE=-2.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE, MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2081 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1849 X-archive-position: 17442 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Thu, Aug 7, 2008 at 11:13 PM, Bhagi rathi wrote: > > > On Thu, Aug 7, 2008 at 1:49 AM, Dave Chinner wrote: > >> On Wed, Aug 06, 2008 at 10:42:15PM +0530, Bhagi rathi wrote: >> > I couldn't get a chance to read the diff's completely. If I click on >> > Lachlan's url for diff's, I couldn't access them. It looks to me that >> > the issue is not just with trace buffers. It can extend to xfs_iformat >> > as well. The same dead-lock can spring via >> > >> > xfs_iread -> xfs_iformat -> xfs_iformat_extents -> xfs_iext_add -> >> > xfs_iext_inline_to_direct -> which can do kmem_alloc with >> > KM_SLEEP flag. >> >> Fixed already: >> >> >> http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=commit;h=8c6266658cb76e282c14cb92f8ba5a1c674f4928 >> > > Thanks Dave. However, My concern is just not one allocation. We > need to clean all allocations that can re-enter to file-system. > I see that this issue exists in attributes format for i_afp allocations. > It may exist with local format of data and attributes too. > > xfs_iread->xfs_iformat->xfs_iformat_local. > Is the above issue fixed already? I see this existing in latest linux kernel. > > Are we safe that we fixed all these real problems by looking > into possible allocations that will enter into file-system? The > problem with trace buffers is telling us to clean this code path. > > By the way, I browse the source code from lxr.linux.no. > If I have to browse the latest xfs source code with linux > kernel that is used at SGI, how can I do that? > Any pointers on this? I wish to setup my own xfs development enviroment and details on this will be helpful. Cheers, Bhagi. > > > Cheers, > Bhagi. > >> >> Cheers, >> >> Dave. >> -- >> Dave Chinner >> david@fromorbit.com >> > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 7 22:21:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 07 Aug 2008 22:21:37 -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=1.3 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no 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 m785LZLA017654 for ; Thu, 7 Aug 2008 22:21:36 -0700 X-ASG-Debug-ID: 1218172970-12a602100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 243F211F5CEF for ; Thu, 7 Aug 2008 22:22:50 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by cuda.sgi.com with ESMTP id Ai7uBcbotS4Ptxyz for ; Thu, 07 Aug 2008 22:22:50 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so698268wfd.32 for ; Thu, 07 Aug 2008 22:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=9AyXsxYkVeKTsS5V32yoUzvKx9jm4q1s9ujgdDh2Y+M=; b=Hjrzy/60jU5DBAFAd4vDB+tg6dlvfo3jzPtNaukg6vuieNTHwyavgI6h4pnRBSGPF3 GBfvpx1Gpu6itI6RHdKTnzsMNxsspQemCQTsAQwVgEqVwVm1LmKqjrQBcTfkfRi0InGw OkmVP//hjIKydlJ94NAk5vIr86rJys4Tg8/Ys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=HyvTcxE4pI4/JWEWEEPP/OgEZaeMdhgy3AHPHxyf9BUY0SMH4buPdTZFkfRBHE47ef UweV18GiWdIw+FM8KpDPTl/p9lkLuL2Y745HQS5LV3trmCfbRJvg5FvPJzgaX/CrZomI zuSfLcCXPXD10jR+Y38RGp5AuyAEmmBg8NOIQ= Received: by 10.143.29.17 with SMTP id g17mr783963wfj.239.1218172970092; Thu, 07 Aug 2008 22:22:50 -0700 (PDT) Received: by 10.142.164.8 with HTTP; Thu, 7 Aug 2008 22:22:50 -0700 (PDT) Message-ID: Date: Fri, 8 Aug 2008 10:52:50 +0530 From: "Bhagi rathi" To: "Bhagi rathi" , "Eric Sandeen" , "Lachlan McIlroy" , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs In-Reply-To: <20080808003147.GA24344@disturbed> MIME-Version: 1.0 References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> <20080806202256.GR21635@disturbed> <20080808003147.GA24344@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.169] X-Barracuda-Start-Time: 1218172971 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0082 1.0000 -1.9673 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2081 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 2093 X-archive-position: 17443 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jahnu77@gmail.com Precedence: bulk X-list: xfs On Fri, Aug 8, 2008 at 6:01 AM, Dave Chinner wrote: > On Thu, Aug 07, 2008 at 10:53:55PM +0530, Bhagi rathi wrote: > > On Thu, Aug 7, 2008 at 1:52 AM, Dave Chinner > wrote: > > > > > On Wed, Aug 06, 2008 at 02:55:28PM -0500, Eric Sandeen wrote: > > > > Bhagi rathi wrote: > > > > > Why are we going to block for ever? Mounting a file-system > > > > > requires in-core log space buffers, reading of other buffers > > > > > which needs allocation of memory greater than per ag > > > > > structures. > > > ..... > > > > In general KM_MAYFAIL sounds like a good plan when you can handle the > > > > failure gracefully, I think. > > > > > > Yes, and that is the long term plan - to remove all KM_SLEEP > > > allocations from XFS and allow them to fail gracefully. There's > > > lots of work needed before we get there, though. e.g. > > > right now we cannot survive an ENOMEM error in a transaction.... > > > > > > I am not sure that we are solving right problem. Isn't the above is > > fall-out > > of XFS needing memory to clean dirty memory? > > We can't avoid that. It is inherent in the design of XFS. And the > amount of memory is not easily bounded so existing solutions like > wrapping slabs in mempools don't work, either. Interesting. The only dirty items are xfs inodes, quota's and meta-data buffers. We can fixed number of these items and ensure pushing of data one after the other in the case of crunch. What are the objects of dirty data where the memory is not bounded? > > > That is of good priority > > to engineer than this handling of ENOMEM in transactions. > > That's just one example of an extremely non-trivial piece of work > that needs to be done to allow all memory allocations to fail. > This work will be done for other reasons (like transaction > rollback to prevent shutdowns on errors inside a dirty > transaction), not specifically to allow memory allocations > to fail. Yes. I agree. -Saradhi. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Fri Aug 8 01:24:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 08 Aug 2008 01:24:33 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m788OR43003212 for ; Fri, 8 Aug 2008 01:24:29 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA05661; Fri, 8 Aug 2008 18:25:41 +1000 Message-ID: <489C0481.4060204@sgi.com> Date: Fri, 08 Aug 2008 18:32:01 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: lachlan@sgi.com CC: xfs@oss.sgi.com, xfs-dev Subject: Re: [PATCH] Move vn_iowait() earlier in the reclaim path References: <4897F691.6010806@sgi.com> <20080805073711.GA21635@disturbed> <489806C2.7020200@sgi.com> <20080805084220.GF21635@disturbed> <48990C4E.9070102@sgi.com> <20080806052053.GU6119@disturbed> <4899406D.5020802@sgi.com> <20080806093844.GZ6119@disturbed> <489AB596.1010505@sgi.com> In-Reply-To: <489AB596.1010505@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17444 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Wed, Aug 06, 2008 at 04:10:53PM +1000, Lachlan McIlroy wrote: >>> Dave Chinner wrote: >>>> On Wed, Aug 06, 2008 at 12:28:30PM +1000, Lachlan McIlroy wrote: >>>>> Dave Chinner wrote: >>>>>> On Tue, Aug 05, 2008 at 05:52:34PM +1000, Lachlan McIlroy wrote: >>>>>>> Dave Chinner wrote: >>>>>>>> On Tue, Aug 05, 2008 at 04:43:29PM +1000, Lachlan McIlroy wrote: >>>>>>>>> Currently by the time we get to vn_iowait() in xfs_reclaim() we >>>>>>>>> have already >>>>>>>>> gone through xfs_inactive()/xfs_free() and recycled the inode. >>>>>>>>> Any I/O >>>>>>>> xfs_free()? What's that? >>>>>>> Sorry that should have been xfs_ifree() (we set the inode's mode to >>>>>>> zero in there). >>>>>>> >>>>>>>>> completions still running (file size updates and unwritten >>>>>>>>> extent conversions) >>>>>>>>> may be working on an inode that is no longer valid. >>>>>>>> The linux inode does not get freed until after ->clear_inode >>>>>>>> completes, hence it is perfectly valid to reference it anywhere >>>>>>>> in the ->clear_inode path. >>>>>>> The problem I see is an assert in xfs_setfilesize() fail: >>>>>>> >>>>>>> ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); >>>>>>> >>>>>>> The mode of the XFS inode is zero at this time. >>>>>> Ok, so the question has to be why is there I/O still in progress >>>>>> after the truncate is supposed to have already occurred and the >>>>>> vn_iowait() in xfs_itruncate_start() been executed. >>>>>> >>>>>> Something doesn't add up here - you can't be doing I/O on a file >>>>>> with no extents or delalloc blocks, hence that means we should be >>>>>> passing through the truncate path in xfs_inactive() before we >>>>>> call xfs_ifree() and therefore doing the vn_iowait().. >>>>>> >>>>>> Hmmmm - the vn_iowait() is conditional based on: >>>>>> >>>>>> /* wait for the completion of any pending DIOs */ >>>>>> if (new_size < ip->i_size) >>>>>> vn_iowait(ip); >>>>>> >>>>>> We are truncating to zero (new_size == 0), so the only case where >>>>>> this would not wait is if ip->i_size == 0. Still - I can't see >>>>>> how we'd be doing I/O on an inode with a zero i_size. I suspect >>>>>> ensuring we call vn_iowait() if newsize == 0 as well would fix >>>>>> the problem. If not, there's something much more subtle going >>>>>> on here that we should understand.... >>>>> If we make the vn_iowait() unconditional we might re-introduce the >>>>> NFS exclusivity bug that killed performance. That was through >>>>> xfs_release()->xfs_free_eofblocks()->xfs_itruncate_start(). >>>> It won't reintroduce that problem because ->clear_inode() >>>> is not called on every NFS write operation. >>> Yes but xfs_itruncate_start() can be called from every NFS write so >>> modifying the above code will re-introduce the problem. >> >> Ah, no. The case here is new_size == 0, which will almost never be >> the case in the ->release call... > True. > >> >>>>> So if we leave the above code as is then we need another >>>>> vn_iowait() in xfs_inactive() to catch any remaining workqueue >>>>> items that we didn't wait for in xfs_itruncate_start(). >>>> How do we have any new *data* I/O at all in progress at this point? >>> It's not new data I/O. >> >> Then why isn't is being caught by the vn_iowait() in the truncate >> code????? > No idea. > >> >>> It's workqueue items that have been queued >>> from previous I/Os that are still outstanding. >> >> The iocount is decremented when the completion is finished, not when it >> is queued. Hence vn_iowait() should be taking into account this case. > Hmmm. It should. > >> >>>> That does not explain why we need an additional vn_iowait() call. >>>> All I see from this is a truncate race that has somethign to do with >>>> the vn_iowait() call being conditional. >>>> >>>> That is, if we truncate to zero, then the current code in >>>> xfs_itruncate_start() should wait unconditinally for *all* I/O to >>>> complete because, by definition, all that I/O is beyond the new EOF >>>> and we have to wait for it to complete before truncating the file. >>> That makes sense. If new_size is zero and ip->i_size is not then we >>> will wait. If ip->i_size is also zero we will not wait but if the >>> file size is already zero there should not be any I/Os in progress >>> and therefore no workqueue items outstanding. >> >> I note from the debug below that the linux inode size is zero, >> but you didn't include the dump of the xfs inode so we can't see >> what the other variables are. > I tried to dump the xfs inode at the time but kdb encountered a bad > address. I'm pretty sure I was able to get a dump of the XFS inode > on another crash - that's how I found the mode to be zero. I can't > be sure now - I'll have to reproduce the problem again. > >> >> Also, i_size is updated after write I/O is dispatched. If we are >> doing synchronous I/O, then i_size is not updated until after the >> I/O completes (in xfs_write()). Hence we could have the situation of >> I/O being run while i_size = 0. This is why I wanted to know what >> i_new_size is, because that gets set before the I/O is issued. >> >> if i_new_size is non-zero and i_size is zero,that tends to imply >> the conditional vn_iowait() in the truncate path needs to take >> MAX(ip->i_size, ip->i_new_size) for the check, not just ip->i_size... >> >> FWIW, from the dump below, we have: >> >> typedef struct xfs_ioend { >> struct xfs_ioend *io_list = NULL >> unsigned int io_type = 0x20 = IOMAP_UNWRITTEN >> int io_error = 0 >> atomic_t io_remaining = 0; >> struct inode *io_inode = 0xffff810054062048 >> struct buffer_head *io_buffer_head = NULL >> struct buffer_head *io_buffer_tail = NULL >> size_t io_size = 0x3400 >> xfs_off_t io_offset = 0xfe200 >> struct work_struct io_work; /* xfsdatad work queue */ >> } xfs_ioend_t; >> >> So the I/O was not even close to offset zero. >> >> Also, the fact that the stack trace says it came through the >> written path, but the io_type says unwritten which says that there's >> something fishy here. Either the stack trace is wrong, or there's >> been a memory corruption.... > I'm pretty sure that's because it was a direct I/O write to a written > extent. The I/O starts out as IOMAP_UNWRITTEN and if we didn't map to > an unwritten extent it's completion handler is switched to the written > one. Looking at the direct I/O write path I can see where the direct > I/O write would wait for the bio's to complete but it's not waiting for > the workqueue items to be flushed. Not sure if that's part of the > problem though. > >> >>>> If either the vn_iowait() in the truncate path is not sufficient, or >>>> the truncate code is not being called, there is *some other bug* >>>> that we don't yet understand. Adding an unconditional vn_iowait() >>>> appear to me to be fixing a symptom, not the underlying cause of >>>> the problem.... >>> I'm not adding a new call to vn_iowait(). I'm just moving the >>> existing one from xfs_ireclaim() so that we wait for all I/O to >>> complete before we tear the inode down. >> >> Yes, but that is there to catch inodes with non-zero link counts because >> we are not doing a truncate in that case. We still need to get to the >> bottom of why the truncate is not waiting for all I/O. > > I'm wondering if we have an extra decrement on the i_iocount atomic counter > that tricked vn_iowait() into thinking that all I/Os have completed. > > Should this code in xfs_vm_direct_IO(): > > if (unlikely(ret != -EIOCBQUEUED && iocb->private)) > xfs_destroy_ioend(iocb->private); > > be: > > if (unlikely(ret < 0 && ret != -EIOCBQUEUED && iocb->private)) > xfs_destroy_ioend(iocb->private); > > Ordinarily we'd drop the i_iocount reference by calling > xfs_end_io_direct(). > I think I'm able to reproduce this at will now. The stacktrace from kdb has no arguments so I added a printk to give us the key items. inode->i_size, ip->i_size, ip->i_new_size and ip->i_d.di_size are all zero ip->i_iocount is 1 inode->i_mode is valid but ip->i_d.di_mode is zero This assert triggered when the filesystem became full. I suspect that a direct I/O write failed due to ENOSPC (and that's why the file size is still zero) but the ioend still got queued. <5>XFS mounting filesystem dm-0 <7>Ending clean XFS mount for filesystem: dm-0 <7>xfs_setfilesize: ip 0xffff810fd3920c90, inode 0xffff810fd391fc18, iocount 1, ioend 0xffff810f96059be8 <4>Assertion failed: (ip->i_d.di_mode & S_IFMT) == S_IFREG, file: fs/xfs/linux-2.6/xfs_aops.c, line: 180 <0>------------[ cut here ]------------ <2>kernel BUG at fs/xfs/support/debug.c:81! [1]kdb> [1]kdb> [1]kdb> xnode 0xffff810fd3920c90, mount 0xffff81101acc0488 mnext 0xffff810f8e54c670 mprev 0xffff810f5b90a050 vnode 0xffff810fd391fc18 dev fe00000 ino 4048200[7:5c54:8] blkno 0x1ee2a0 len 0x10 boffset 0x800 transp 0x0000000000000000 &itemp 0xffff810f32236240 &lock 0xffff810fd3920d40 &iolock 0xffff810fd3920da8 &flush 0xffff810fd3920e10 (1) pincount 0x0 udquotp 0x0000000000000000 gdquotp 0x0000000000000000 new_size 0 flags 0x0 <> update_core 0 update size 0 gen 0x0 delayed blks 0size 0 trace 0xffff810fcc693620 bmap_trace 0xffff810fcc6935f0 bmbt trace 0xffff810fcc6935c0 rw trace 0xffff810fcc693590 ilock trace 0xffff810fcc693560 dir trace 0xffff810fcc693530 data fork bytes 0x0 real_bytes 0x0 lastex 0x0 u1:extents 0x0000000000000000 broot 0x0000000000000000 broot_bytes 0x0 ext_max 9 flags 0x2 u2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 attr fork empty [1]more> magic 0x494e mode 00 (?------------) version 0x2 format 0x2 (extents) nlink 0 uid 0 gid 0 projid 0 flushiter 0 atime 1218176355:126020521 mtime 1218176355d:554017996 ctime 1218176355:554017996 size 0 nblocks 0 extsize 0x0 nextents 0x0 anextents 0x0 forkoff 0 aformat 0x2 (extents) dmevmask 0x0 dmstate 0x0 flags 0x0 <> gen 0x593e66c8 --> itrace @ 0xffff810fd3920c90/0xffff810fcc693620 ref @fs/xfs/xfs_vnodeops.c:1589(xfs_create+0x390) i_count = 1 cpu = 6 pid = 9502 ra = xfs_vn_mknod+0x144 hold @fs/xfs/xfs_vnodeops.c:1642(xfs_create+0x568) i_count 1 => 2 cpu = 6 pid = 9502 ra = xfs_vn_mknod+0x144 entry to xfs_iput i_count = 2 cpu = 6 pid = 9502 ra = xfs_trans_unlock_chunk+0x77 rele @fs/xfs/xfs_iget.c:421(xfs_iput+0x42) i_count 2 => 1 cpu = 6 pid = 9502 ra = xfs_trans_unlock_chunk+0x77 entry to xfs_vn_getattr i_count = 1 cpu = 1 pid = 9502 ra = vfs_fstat+0x29 entry to xfs_vn_getattr i_count = 1 cpu = 1 pid = 9502 ra = vfs_fstat+0x29 entry to xfs_ioctl i_count = 1 cpu = 1 pid = 9502 ra = xfs_file_ioctl+0x26 entry to xfs_vn_getattr i_count = 1 cpu = 1 pid = 9502 ra = vfs_fstat+0x29 [1]more> entry to xfs_remove i_count = 2 cpu = 1 pid = 9502 ra = xfs_vn_unlink+0x37 hold @fs/xfs/xfs_vnodeops.c:1958(xfs_remove+0x26d) i_count 2 => 3 cpu = 1 pid = 9502 ra = xfs_vn_unlink+0x37 entry to xfs_iput i_count = 3 cpu = 1 pid = 9502 ra = xfs_trans_unlock_chunk+0x77 rele @fs/xfs/xfs_iget.c:421(xfs_iput+0x42) i_count 3 => 2 cpu = 1 pid = 9502 ra = xfs_trans_unlock_chunk+0x77 exit from xfs_remove i_count = 2 cpu = 1 pid = 9502 ra = xfs_vn_unlink+0x37 entry to xfs_fs_clear_inode i_count = 0 cpu = 1 pid = 9502 ra = clear_inode+0x9c entry to xfs_inactive i_count = 0 cpu = 1 pid = 9502 ra = xfs_fs_clear_inode+0xbd entry to xfs_reclaim i_count = 0 cpu = 1 pid = 9502 ra = xfs_fs_clear_inode+0xde [1]kdb> inode 0xffff810fd391fc18 struct inode at 0xffff810fd391fc18 i_ino = 4048200 i_count = 0 i_size 0 i_mode = 0100666 i_nlink = 0 i_rdev = 0x0 i_hash.nxt = 0x0000000000000000 i_hash.pprev = 0xffffc20005712980 i_list.nxt = 0xffff810fd391fc18 i_list.prv = 0xffff810fd391fc18 i_dentry.nxt = 0xffff810fd391fbb0 i_dentry.prv = 0xffff810fd391fbb0 i_sb = 0xffff810f1ca10148 i_op = 0xffffffff80690e20 i_data = 0xffff810fd391fe00 nrpages = 0 i_fop= 0xffffffff80690b40 i_flock = 0x0000000000000000 i_mapping = 0xffff810fd391fe00 i_flags 0x0 i_state 0x21 [I_DIRTY_SYNC I_FREEING] fs specific info @ 0xffff810fd391ffe8 [1]kdb> [1]kdb> md8c20 0xffff810f96059be8 0xffff810f96059be8 0000000000000000 0000000000000020 ........ ....... 0xffff810f96059bf8 5a5a5a5a00000000 ffff810fd391fc18 ....ZZZZ........ 0xffff810f96059c08 0000000000000000 0000000000000000 ................ 0xffff810f96059c18 0000000000001800 000000000002f800 ................ 0xffff810f96059c28 ffff8110270654d0 ffff810f96059c30 .T.'....0....... 0xffff810f96059c38 ffff810f96059c30 ffffffff803b0b69 0.......i.;..... 0xffff810f96059c48 ffffffff80b7f698 0000000000000000 ................ 0xffff810f96059c58 ffffffff807c0b92 d84156c5635688c0 ..|.......Vc.VA. 0xffff810f96059c68 ffffffff8025c2b6 09f911029d74e35b ..%.....[.t..... 0xffff810f96059c78 6b6b6b6b6b6b6b6b 6b6b6b6b6b6b6b6b kkkkkkkkkkkkkkkk [1]kdb> bt Stack traceback for pid 379 0xffff811029484680 379 2 1 1 R 0xffff8110294849c8 *xfsdatad/1 sp ip Function (args) 0xffff81102708be28 0xffffffff803bbf40 assfail+0x1a (invalid, invalid, invalid) kdb_bb: address 0x0000000000010286 not recognised Using old style backtrace, unreliable with no arguments sp ip Function (args) 0xffff81102708bdb8 0xffffffff803b0b69 xfs_end_bio_written 0xffff81102708be28 0xffffffff803bbf40 assfail+0x1a 0xffff81102708be58 0xffffffff803b0a50 xfs_setfilesize+0x6a 0xffff81102708be78 0xffffffff803b0b79 xfs_end_bio_written+0x10 0xffff81102708be88 0xffffffff8023bb02 run_workqueue+0xdf 0xffff81102708bed8 0xffffffff8023c5bd worker_thread+0xd8 0xffff81102708bef0 0xffffffff8023ef6e autoremove_wake_function 0xffff81102708bf20 0xffffffff8023c4e5 worker_thread 0xffff81102708bf28 0xffffffff8023ee5c kthread+0x47 0xffff81102708bf30 0xffffffff802294a8 schedule_tail+0x27 0xffff81102708bf48 0xffffffff8020bea8 child_rip+0xa As suggested, I'm now running with this patch: --- fs/xfs/xfs_inode.c_1.518 2008-08-08 17:31:02.000000000 +1000 +++ fs/xfs/xfs_inode.c 2008-08-08 17:35:11.000000000 +1000 @@ -1414,7 +1414,7 @@ xfs_itruncate_start( mp = ip->i_mount; /* wait for the completion of any pending DIOs */ - if (new_size < ip->i_size) + if (new_size == 0 || new_size < ip->i_size) vn_iowait(ip); /* and so far so good. From owner-xfs@oss.sgi.com Fri Aug 8 02:48:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 08 Aug 2008 02:48:59 -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.6 required=5.0 tests=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 m789mtud007957 for ; Fri, 8 Aug 2008 02:48:56 -0700 X-ASG-Debug-ID: 1218189008-0aa700e00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from subscriber.detik.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EFB6A37653F for ; Fri, 8 Aug 2008 02:50:09 -0700 (PDT) Received: from subscriber.detik.com ([202.158.66.14]) by cuda.sgi.com with ESMTP id R2RZhuQBk5WfuPfj for ; Fri, 08 Aug 2008 02:50:09 -0700 (PDT) Received: from venus (localhost [127.0.0.1]) by subscriber.detik.com (Postfix) with ESMTP id 358DC3788C5 for ; Fri, 8 Aug 2008 16:50:07 +0700 (WIT) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-ASG-Orig-Subj: Your message to Milis awaits moderator approval Subject: Your message to Milis awaits moderator approval From: milis-bounces@subscriber.detik.com To: xfs@oss.sgi.com Message-ID: Date: Fri, 08 Aug 2008 16:49:47 +0700 Precedence: bulk X-BeenThere: milis@subscriber.detik.com X-Mailman-Version: 2.1.5 X-Barracuda-Connect: UNKNOWN[202.158.66.14] X-Barracuda-Start-Time: 1218189009 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: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=NO_REAL_NAME, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2091 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17445 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: milis-bounces@subscriber.detik.com Precedence: bulk X-list: xfs Your mail to 'Milis' with the subject Returned mail: see transcript for details Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://subscriber.detik.com/mailman/confirm/milis/f336b4638fcacdef01d7416f1cf9dc3ac838a651 From owner-xfs@oss.sgi.com Fri Aug 8 11:08:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 08 Aug 2008 11:08:35 -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.2 required=5.0 tests=AWL,BAYES_00, FROM_DOMAIN_NOVOWEL,J_CHICKENPOX_23 autolearn=no 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 m78I8TL5013134 for ; Fri, 8 Aug 2008 11:08:30 -0700 X-ASG-Debug-ID: 1218218982-4852016e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from dolly.gnuher.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8046D11F880C for ; Fri, 8 Aug 2008 11:09:42 -0700 (PDT) Received: from dolly.gnuher.de (dolly.gnuher.de [212.227.64.154]) by cuda.sgi.com with ESMTP id JqNr6dgv8ppvDjYi for ; Fri, 08 Aug 2008 11:09:42 -0700 (PDT) Received: from ultimate100.geggus.net ([2a01:198:297:1::1]) by dolly.gnuher.de (envelope-from ) with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) id 1KRWPF-000472-2A for xfs@oss.sgi.com; Fri, 08 Aug 2008 20:09:41 +0200 Received: from diesel.geggus.net ([192.168.3.2] ident=mail) by ultimate100.geggus.net (envelope-from ) with esmtp (Exim 4.66) id 1KRWPD-0003jQ-8a for xfs@oss.sgi.com; Fri, 08 Aug 2008 20:09:39 +0200 Received: from sven by diesel.geggus.net (envelope-from ) with local (Exim 3.36) id 1KRWPD-0000zj-00 for xfs@oss.sgi.com; Fri, 08 Aug 2008 20:09:39 +0200 Date: Fri, 8 Aug 2008 20:09:38 +0200 From: Sven Geggus To: xfs@oss.sgi.com X-ASG-Orig-Subj: Ooops in Kernel 2.6.26.2 Subject: Ooops in Kernel 2.6.26.2 Message-ID: <20080808180938.GA3760@diesel.geggus.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-MimeOLE: Produced By Exchange Microsoft V6.6.6 X-Message-Flag: CAUTION: Usage of another Email-Software is highly recommended see http://mozilla.org/thunderbird/ for details. User-Agent: Mutt/1.5.13 (2006-08-11) X-Barracuda-Connect: dolly.gnuher.de[212.227.64.154] X-Barracuda-Start-Time: 1218218983 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=FROM_DOMAIN_NOVOWEL X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2106 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 FROM_DOMAIN_NOVOWEL From: domain has series of non-vowel letters X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17446 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@fuchsschwanzdomain.de Precedence: bulk X-list: xfs Hi there, I've got a (somewhat) reproducable bug with Kernel 2.6.26.2 * Do an xfs-repair on the device (a dm-crypt in this case) just in case * mount the device * try to remove a given file (rm foo.html) XFS mounting filesystem dm-0 Ending clean XFS mount for filesystem: dm-0 BUG: unable to handle kernel paging request at f3040f5f IP: [] xfs_log_done+0x86/0xa7 *pde = 35dea163 *pte = 33040160 Oops: 0000 [#1] PREEMPT DEBUG_PAGEALLOC Modules linked in: radeon drm rfcomm l2cap sym53c8xx scsi_transport_spi snd_via82xx 8139too snd_mpu401_uart snd_ens1371 snd_rawmidi snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_timer via_agp snd_page_alloc agpgart Pid: 4043, comm: rm Not tainted (2.6.26.2 #1) EIP: 0060:[] EFLAGS: 00010282 CPU: 0 EIP is at xfs_log_done+0x86/0xa7 EAX: 00000282 EBX: f3040f30 ECX: 00000000 EDX: f31d5c58 ESI: f304def0 EDI: 00000001 EBP: f31a5dcc ESP: f31a5db4 DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 Process rm (pid: 4043, ti=f31a4000 task=f31d5c58 task.ti=f31a4000) Stack: f47f8bf0 00000002 00000001 f31a5e04 0000000c f321ed88 f31a5ed4 c0206c8e 00000001 f3040f30 f321edb8 f321edb8 00000001 00000000 00000004 f31a5e0c f47f8bf0 c020e7c9 c020e7c9 00000000 f321eed0 00000010 00000013 f47e2ab0 Call Trace: [] ? _xfs_trans_commit+0x20c/0x36a [] ? kmem_zone_alloc+0x49/0x8f [] ? kmem_zone_alloc+0x49/0x8f [] ? xfs_trans_log_inode+0x14/0x2f [] ? xfs_remove+0x204/0x286 [] ? xfs_vn_unlink+0x2e/0x4d [] ? vfs_unlink+0x5d/0xac [] ? do_unlinkat+0x9b/0x133 [] ? sys_unlink+0x10/0x12 [] ? syscall_call+0x7/0xb ======================= Code: f6 43 2f 02 74 08 f7 c7 01 00 00 00 74 14 89 da 89 f0 e8 46 d7 ff ff 89 da 89 f0 e8 9e d9 ff ff eb 09 89 da 89 f0 e8 f6 fe ff ff <8a> 43 2f a8 02 74 0b 83 e7 01 75 06 83 c8 01 88 43 2f 8b 45 ec EIP: [] xfs_log_done+0x86/0xa7 SS:ESP 0068:f31a5db4 ---[ end trace fdfcf6b8ebb2164b ]--- Rebooting into my former kernel (2.6.25.10) I was now able to remove the file without a kernel crash. Unfortunately this may well mean that I can not reproduce this bug anymore... Sven -- The main thing to note is that when you choose open source you don't get a Windows operating system. (from http://www.dell.com/ubuntu) /me is giggls@ircnet, http://sven.gegg.us/ on the Web From owner-xfs@oss.sgi.com Fri Aug 8 14:09:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 08 Aug 2008 14:09:18 -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.1 required=5.0 tests=BAYES_50, RCVD_IN_BL_SPAMCOP_NET,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m78L9DpV028507 for ; Fri, 8 Aug 2008 14:09:15 -0700 X-ASG-Debug-ID: 1218229827-313001060000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from hyperion.ccf.auth.gr (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2AD6219AAB92 for ; Fri, 8 Aug 2008 14:10:28 -0700 (PDT) Received: from hyperion.ccf.auth.gr (hyperion.ccf.auth.gr [155.207.1.42]) by cuda.sgi.com with ESMTP id 9DUDNpfcMJ8FT8qu for ; Fri, 08 Aug 2008 14:10:28 -0700 (PDT) Received: from auth.gr (electra.ccf.auth.gr [155.207.1.59]) by hyperion.ccf.auth.gr (8.14.3/8.14.3) with ESMTP id m78KmgwB001857; Fri, 8 Aug 2008 23:48:43 +0300 Received: from 196-207-0-227.netcomng.com (196-207-0-227.netcomng.com [196.207.0.227]) by webmail.auth.gr (Horde MIME library) with HTTP; Fri, 08 Aug 2008 23:48:42 +0300 Message-ID: <20080808234842.wyypsruk0ss4cssw@webmail.auth.gr> Date: Fri, 08 Aug 2008 23:48:42 +0300 From: Alexandros Chatzipetros Reply-To: eduwebupgrade@live.com To: undisclosed-recipients:; X-ASG-Orig-Subj: Important Web-mail Account Verification Update Subject: Important Web-mail Account Verification Update MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline User-Agent: Internet Messaging Program (IMP) H3 (4.1.4-cvs) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.93.1/7984/Fri Aug 8 21:51:24 2008 on cronus.ccf.auth.gr X-Virus-Status: Clean X-Barracuda-Connect: hyperion.ccf.auth.gr[155.207.1.42] X-Barracuda-Start-Time: 1218229829 X-Barracuda-Bayes: INNOCENT GLOBAL 0.6460 1.0000 0.9966 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.82 X-Barracuda-Spam-Status: No, SCORE=1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MIME_QP_LONG_LINE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2105 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.82 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m78L9FpV028510 X-archive-position: 17447 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ac@geo.auth.gr Precedence: bulk X-list: xfs Dear Webmail Email users, This message is from All Webmail Database messaging center to all webmail email account owners. We are currently upgrading our data base and e-mail center. We are deleting all unusend webmail email accounts to create more space for new email accounts. To prevent us from closing your webmail Email Account, you are advised to verify it. For verification and update, you are expected to provide us with the below information's so as to enable us know that your email account is currently in use and also help you upgrade it; CONFIRM YOUR EMAIL IDENTITY BELOW Full Name : Email Username : Email Password : Comfirm Password : webmail Site:http:// Warning!!! Failure to do this will immediately render your account deactivated from our database. We apologize for the inconvenience that this will cause you during this period, but trust you understand that our primary concern is for our customers and for the security of their data. our customers are totally secure Thank you for using Webmail!! Notification Code:VX2G99AAJ From owner-xfs@oss.sgi.com Sat Aug 9 12:50:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 09 Aug 2008 12:51:20 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m79JoqjS012360 for ; Sat, 9 Aug 2008 12:50:53 -0700 X-ASG-Debug-ID: 1218311527-52fb03580000-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 49F0B1BC22DA for ; Sat, 9 Aug 2008 12:52:07 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id aTp9JkrBHLxDRl2u for ; Sat, 09 Aug 2008 12:52:07 -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 m79Jq0IF008623 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 9 Aug 2008 21:52:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m79JpxPX008621; Sat, 9 Aug 2008 21:51:59 +0200 Date: Sat, 9 Aug 2008 21:51:59 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: jasper@amiton.co.nz X-ASG-Orig-Subj: [PATCH] stop rejecting options in remount Subject: [PATCH] stop rejecting options in remount Message-ID: <20080809195159.GA8562@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218311528 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.2188 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17448 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 Thanks to some not so nice code in mount(8) we can't blindly reject moun options we don't support to be changed in remount. See the comment in the code for more details. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 16:34:33.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 16:36:55.000000000 -0300 @@ -1349,9 +1349,28 @@ xfs_fs_remount( mp->m_flags &= ~XFS_MOUNT_BARRIER; break; default: + /* + * Logically we would return an error here to prevent + * users from believing they might have changed + * mount options using remount which can't be changed. + * + * But unfortunately mount(8) adds all options from + * mtab and fstab to the mount arguments in some + * cases so we can't blindly reject options. + * + * The workaround for that behaviour will be to + * check for each specified option whether it actually + * is a change compared to the status quo and if yes + * silently ignore it or otherwise reject the remount + * and tell the user about the reason. + */ +#if 0 printk(KERN_INFO "XFS: mount option \"%s\" not supported for remount\n", p); return -EINVAL; +#else + return 0; +#endif } } From owner-xfs@oss.sgi.com Sat Aug 9 12:57:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 09 Aug 2008 12:57:52 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m79JvoQn013588 for ; Sat, 9 Aug 2008 12:57:50 -0700 X-ASG-Debug-ID: 1218311945-7f3700490000-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 CD6D11BC22FA for ; Sat, 9 Aug 2008 12:59:06 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2gfjLh3FMIru0K9Y for ; Sat, 09 Aug 2008 12:59:06 -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 m79Jx8IF009056 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 9 Aug 2008 21:59:08 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m79Jx8sq009054 for xfs@oss.sgi.com; Sat, 9 Aug 2008 21:59:08 +0200 Date: Sat, 9 Aug 2008 21:59:08 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] tiny nametest.c warning fixes Subject: [PATCH] tiny nametest.c warning fixes Message-ID: <20080809195908.GA9005@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218311946 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.2188 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17449 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 Include ctype.h for toupper/tolower and remove an unused variable. Signed-off-by: Christoph Hellwig --- xfstests/src/nametest.c 24 Jun 2008 16:29:51 -0000 1.8 +++ xfstests/src/nametest.c 9 Aug 2008 19:55:37 -0000 @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "global.h" /* @@ -308,7 +309,6 @@ main(int argc, char *argv[]) char *get_name(struct info *ip) { static char path[PATH_MAX]; - int i; char *p; if (!mixcase) From owner-xfs@oss.sgi.com Sun Aug 10 19:19:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 10 Aug 2008 19:19:29 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45, J_CHICKENPOX_46,J_CHICKENPOX_63,J_CHICKENPOX_65,J_CHICKENPOX_66,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7B2JQaK008209 for ; Sun, 10 Aug 2008 19:19:26 -0700 X-ASG-Debug-ID: 1218421242-1d8501e40000-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 1495B1BC2F13 for ; Sun, 10 Aug 2008 19:20:42 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 7eoBY9lDgUGutN1R for ; Sun, 10 Aug 2008 19:20:42 -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 m7B2KgIF021148 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 11 Aug 2008 04:20:43 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7B2KgEp021146 for xfs@oss.sgi.com; Mon, 11 Aug 2008 04:20:42 +0200 Date: Mon, 11 Aug 2008 04:20:42 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfsprogs: fix some trivial sparse warnings Subject: [PATCH] xfsprogs: fix some trivial sparse warnings Message-ID: <20080811022042.GB21003@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218421243 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: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2309 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17451 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 Fix some trivial not endianess related sparse warnings in xfsprogs: - change the ASSERT defintion to avoid too deep token expansion warnings - fix 0 vs NULL noise - make sure functions without paramter are declared with a void pseudo-paramter so that they are proper ANSI declarations and can't be confused with a K&R declaration. Signed-off-by: Christoph Hellwig Index: xfsprogs/include/platform_defs.h.in =================================================================== --- xfsprogs.orig/include/platform_defs.h.in 2008-08-08 14:42:18.000000000 -0300 +++ xfsprogs/include/platform_defs.h.in 2008-08-08 14:58:12.000000000 -0300 @@ -130,7 +132,7 @@ typedef unsigned long long __psunsigned_ #include #ifdef DEBUG -# define ASSERT assert +# define ASSERT(EX) assert(EX) #else # define ASSERT(EX) ((void) 0) #endif Index: xfsprogs/io/parent.c =================================================================== --- xfsprogs.orig/io/parent.c 2008-08-08 15:11:20.000000000 -0300 +++ xfsprogs/io/parent.c 2008-08-08 15:11:36.000000000 -0300 @@ -242,7 +242,7 @@ parent_check(void) fsfd = file->fd; fshandlep = jdm_getfshandle(mntpt); - if (fshandlep == 0) { + if (fshandlep == NULL) { fprintf(stderr, _("unable to open \"%s\" for jdm: %s\n"), mntpt, strerror(errno)); Index: xfsprogs/libdisk/fstype.c =================================================================== --- xfsprogs.orig/libdisk/fstype.c 2008-08-08 15:08:48.000000000 -0300 +++ xfsprogs/libdisk/fstype.c 2008-08-08 15:09:47.000000000 -0300 @@ -199,11 +199,11 @@ fstype(const char *device) { to a block device or ordinary file */ if (stat (device, &statbuf) || !(S_ISBLK(statbuf.st_mode) || S_ISREG(statbuf.st_mode))) - return 0; + return NULL; fd = open(device, O_RDONLY); if (fd < 0) - return 0; + return NULL; /* do seeks and reads in disk order, otherwise a very short partition may cause a failure because of read error */ @@ -409,5 +409,5 @@ fstype(const char *device) { io_error: close(fd); - return 0; + return NULL; } Index: xfsprogs/libhandle/jdm.c =================================================================== --- xfsprogs.orig/libhandle/jdm.c 2008-08-08 15:08:31.000000000 -0300 +++ xfsprogs/libhandle/jdm.c 2008-08-08 15:08:40.000000000 -0300 @@ -70,7 +70,7 @@ jdm_getfshandle( char *mntpnt ) ASSERT( sizeofmember( filehandle_t, fh_pad ) == FILEHANDLE_SZ_PAD ); ASSERT( FILEHANDLE_SZ_PAD == sizeof( int16_t )); - fshandlep = 0; /* for lint */ + fshandlep = NULL; /* for lint */ fshandlesz = sizeof( *fshandlep ); if (!realpath( mntpnt, resolved )) Index: xfsprogs/libxcmd/projects.c =================================================================== --- xfsprogs.orig/libxcmd/projects.c 2008-08-08 15:08:14.000000000 -0300 +++ xfsprogs/libxcmd/projects.c 2008-08-08 15:08:23.000000000 -0300 @@ -44,14 +44,14 @@ setprfiles(void) } void -setprent() +setprent(void) { setprfiles(); projects = fopen(projid_file, "r"); } void -setprpathent() +setprpathent(void) { setprfiles(); project_paths = fopen(projects_file, "r"); Index: xfsprogs/mdrestore/xfs_mdrestore.c =================================================================== --- xfsprogs.orig/mdrestore/xfs_mdrestore.c 2008-08-08 15:12:55.000000000 -0300 +++ xfsprogs/mdrestore/xfs_mdrestore.c 2008-08-08 15:13:40.000000000 -0300 @@ -121,7 +121,7 @@ perform_restore( } else { /* ensure device is sufficiently large enough */ - char *lb[XFS_MAX_SECTORSIZE] = { 0 }; + char *lb[XFS_MAX_SECTORSIZE] = { NULL }; off64_t off; off = sb.sb_dblocks * sb.sb_blocksize - sizeof(lb); Index: xfsprogs/mkfs/proto.c =================================================================== --- xfsprogs.orig/mkfs/proto.c 2008-08-08 15:11:48.000000000 -0300 +++ xfsprogs/mkfs/proto.c 2008-08-08 15:24:13.000000000 -0300 @@ -255,7 +255,7 @@ newfile( exit(1); } d = XFS_FSB_TO_DADDR(mp, map.br_startblock); - bp = libxfs_trans_get_buf(logit ? tp : 0, mp->m_dev, d, + bp = libxfs_trans_get_buf(logit ? tp : NULL, mp->m_dev, d, nb << mp->m_blkbb_log, 0); memmove(XFS_BUF_PTR(bp), buf, len); if (len < XFS_BUF_COUNT(bp)) @@ -293,7 +293,7 @@ newregfile( exit(1); } } else - buf = 0; + buf = NULL; close(fd); return buf; } Index: xfsprogs/quota/quot.c =================================================================== --- xfsprogs.orig/quota/quot.c 2008-08-08 15:12:30.000000000 -0300 +++ xfsprogs/quota/quot.c 2008-08-08 15:24:44.000000000 -0300 @@ -107,7 +107,7 @@ quot_bulkstat_add( for (dp = *hp; dp; dp = dp->next) if (dp->id == id) break; - if (dp == 0) { + if (dp == NULL) { if (ndu[i] >= NDU) return; dp = &du[i][(ndu[i]++)]; @@ -153,7 +153,7 @@ quot_bulkstat_mount( overflow = 0; for (i = 0; i < 3; i++) for (dp = duhash[i]; dp < &duhash[i][DUHASH]; dp++) - *dp = 0; + *dp = NULL; ndu[0] = ndu[1] = ndu[2] = 0; fsfd = open(fsdir, O_RDONLY); @@ -275,7 +275,7 @@ quot_report( fs_cursor_t cursor; fs_path_t *mount; - now = time(0); + now = time(NULL); fs_cursor_initialise(dir, FS_MOUNT_POINT, &cursor); while ((mount = fs_cursor_next_entry(&cursor))) { quot_bulkstat_mount(mount->fs_dir, flags); Index: xfsprogs/repair/xfs_repair.c =================================================================== --- xfsprogs.orig/repair/xfs_repair.c 2008-08-08 15:14:16.000000000 -0300 +++ xfsprogs/repair/xfs_repair.c 2008-08-08 15:15:16.000000000 -0300 @@ -245,18 +245,18 @@ process_args(int argc, char **argv) pre_65_beta = 1; break; case IHASH_SIZE: - libxfs_ihash_size = (int) strtol(val, 0, 0); + libxfs_ihash_size = (int) strtol(val, NULL, 0); ihash_option_used = 1; break; case BHASH_SIZE: if (max_mem_specified) do_abort( _("-o bhash option cannot be used with -m option\n")); - libxfs_bhash_size = (int) strtol(val, 0, 0); + libxfs_bhash_size = (int) strtol(val, NULL, 0); bhash_option_used = 1; break; case AG_STRIDE: - ag_stride = (int) strtol(val, 0, 0); + ag_stride = (int) strtol(val, NULL, 0); break; default: unknown('o', val); @@ -271,7 +271,7 @@ process_args(int argc, char **argv) switch (getsubopt(&p, (constpp)c_opts, &val)) { case CONVERT_LAZY_COUNT: - lazy_count = (int)strtol(val, 0, 0); + lazy_count = (int)strtol(val, NULL, 0); convert_lazy_count = 1; break; default: @@ -295,7 +295,7 @@ process_args(int argc, char **argv) if (bhash_option_used) do_abort(_("-m option cannot be used with " "-o bhash option\n")); - max_mem_specified = strtol(optarg, 0, 0); + max_mem_specified = strtol(optarg, NULL, 0); break; case 'L': zap_log = 1; @@ -316,7 +316,7 @@ process_args(int argc, char **argv) do_prefetch = 0; break; case 't': - report_interval = (int) strtol(optarg, 0, 0); + report_interval = (int) strtol(optarg, NULL, 0); break; case '?': usage(); Index: xfsprogs/rtcp/xfs_rtcp.c =================================================================== --- xfsprogs.orig/rtcp/xfs_rtcp.c 2008-08-08 15:15:26.000000000 -0300 +++ xfsprogs/rtcp/xfs_rtcp.c 2008-08-08 15:15:31.000000000 -0300 @@ -25,7 +25,7 @@ int pflag; char *progname; void -usage() +usage(void) { fprintf(stderr, _("%s [-e extsize] [-p] source target\n"), progname); exit(2); Index: xfsprogs/mkfs/xfs_mkfs.c =================================================================== --- xfsprogs.orig/mkfs/xfs_mkfs.c 2008-08-08 15:24:17.000000000 -0300 +++ xfsprogs/mkfs/xfs_mkfs.c 2008-08-08 15:24:29.000000000 -0300 @@ -1258,7 +1258,7 @@ main( break; case 'p': if (protofile) - respec('p', 0, 0); + respec('p', NULL, 0); protofile = optarg; break; case 'q': From owner-xfs@oss.sgi.com Sun Aug 10 19:17:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 10 Aug 2008 19:18:06 -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 m7B2Hbwt007856 for ; Sun, 10 Aug 2008 19:17:38 -0700 X-ASG-Debug-ID: 1218421131-021e03120000-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 5E142F24196 for ; Sun, 10 Aug 2008 19:18:52 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Jfuk96FiTwOLNEtE for ; Sun, 10 Aug 2008 19:18:52 -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 m7B2IqIF021074 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 11 Aug 2008 04:18:52 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7B2IqOU021072 for xfs@oss.sgi.com; Mon, 11 Aug 2008 04:18:52 +0200 Date: Mon, 11 Aug 2008 04:18:52 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfsprogs: sparse support Subject: [PATCH] xfsprogs: sparse support Message-ID: <20080811021852.GA21003@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218421134 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.2308 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17450 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 Allow to compile xfsprogs using the sparse gcc wrapper cgcc and check for endianess warnings. First this patch adds explicit --tag=CC arguments to the libtool invocations because it can't auto-detect cgcc as a C compiler. Second add endianess annotations to the __be* types and the macros operating on them. And last but not least add a new doc/sparse.txt describing how to invoke sparse on xfsprogs. Signed-off-by: Christoph Hellwig Index: xfsprogs/include/platform_defs.h.in =================================================================== --- xfsprogs.orig/include/platform_defs.h.in 2008-08-10 23:04:36.000000000 -0300 +++ xfsprogs/include/platform_defs.h.in 2008-08-10 23:04:39.000000000 -0300 @@ -45,9 +45,17 @@ typedef unsigned long long int __u64; typedef signed long long int __s64; #endif -typedef __u16 __be16; -typedef __u32 __be32; -typedef __u64 __be64; +#ifdef __CHECKER__ +#define __bitwise __attribute__((bitwise)) +#define __force __attribute__((force)) +#else +#define __bitwise +#define __force +#endif + +typedef __u16 __bitwise __be16; +typedef __u32 __bitwise __be32; +typedef __u64 __bitwise __be64; #if defined(__linux__) #include Index: xfsprogs/include/xfs_arch.h =================================================================== --- xfsprogs.orig/include/xfs_arch.h 2008-08-09 16:55:08.000000000 -0300 +++ xfsprogs/include/xfs_arch.h 2008-08-10 23:04:39.000000000 -0300 @@ -41,19 +41,19 @@ #endif #ifdef XFS_NATIVE_HOST -#define cpu_to_be16(val) ((__be16)(val)) -#define cpu_to_be32(val) ((__be32)(val)) -#define cpu_to_be64(val) ((__be64)(val)) -#define be16_to_cpu(val) ((__uint16_t)(val)) -#define be32_to_cpu(val) ((__uint32_t)(val)) -#define be64_to_cpu(val) ((__uint64_t)(val)) +#define cpu_to_be16(val) ((__force __be16)(__u16)(val)) +#define cpu_to_be32(val) ((__force __be32)(__u32)(val)) +#define cpu_to_be64(val) ((__force __be64)(__u64)(val)) +#define be16_to_cpu(val) ((__force __u16)(__be16)(val)) +#define be32_to_cpu(val) ((__force __u32)(__be32)(val)) +#define be64_to_cpu(val) ((__force __u64)(__be64)(val)) #else -#define cpu_to_be16(val) (__swab16((__uint16_t)(val))) -#define cpu_to_be32(val) (__swab32((__uint32_t)(val))) -#define cpu_to_be64(val) (__swab64((__uint64_t)(val))) -#define be16_to_cpu(val) (__swab16((__be16)(val))) -#define be32_to_cpu(val) (__swab32((__be32)(val))) -#define be64_to_cpu(val) (__swab64((__be64)(val))) +#define cpu_to_be16(val) ((__force __be16)__swab16((__u16)(val))) +#define cpu_to_be32(val) ((__force __be32)__swab32((__u32)(val))) +#define cpu_to_be64(val) ((__force __be64)__swab64((__u64)(val))) +#define be16_to_cpu(val) (__swab16((__force __u16)(__be16)(val))) +#define be32_to_cpu(val) (__swab32((__force __u32)(__be32)(val))) +#define be64_to_cpu(val) (__swab64((__force __u64)(__be64)(val))) #endif #endif /* __KERNEL__ */ Index: xfsprogs/include/buildmacros =================================================================== --- xfsprogs.orig/include/buildmacros 2008-08-09 16:55:08.000000000 -0300 +++ xfsprogs/include/buildmacros 2008-08-10 23:04:39.000000000 -0300 @@ -42,10 +42,10 @@ LIBNAME = $(basename $(LTLIBRARY)) LTOBJECTS = $(OBJECTS:.o=.lo) LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -LTLINK = $(LIBTOOL) --mode=link $(CC) +LTLINK = $(LIBTOOL) --tag=CC --mode=link $(CC) LTEXEC = $(LIBTOOL) --mode=execute LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CCF) ifeq ($(ENABLE_SHARED),yes) LTLDFLAGS += -rpath $(PKG_LIB_DIR) Index: xfsprogs/doc/sparse.txt =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xfsprogs/doc/sparse.txt 2008-08-10 23:15:58.000000000 -0300 @@ -0,0 +1,24 @@ +This document describes how to use the sparse source code checking tool +to check the source code of the open source XFS commands and utilites +("xfsprogs"). + +First you need to install sparse, either from your distribution or from +source as provided at http://www.kernel.org/pub/software/devel/sparse/. + +To simply build the xfsprogs source code while checking the source using +sparse just set the compiler to cgcc, which is a wrapper that calls both +sparse and gcc using: + + CC=cgcc ./configure + +Now that default warnings from sparse are a little bit verbose checking +for various not that important things and also complaining about the +glibc system headers. It does however not check for bitwise annotation +which are very important for xfsprogs to verify the endianess handling +of the on-disk structures is correct. To get a more reasonable set +of warnings build xfsprogs using: + + LCFLAGS="-Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl" make + +You are of course free to experiment with the warnings flags documented +in the sparse manpage to check xfsprogs for other issues. From owner-xfs@oss.sgi.com Sun Aug 10 20:41:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 10 Aug 2008 20:41:45 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B3fZgQ023031 for ; Sun, 10 Aug 2008 20:41:36 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA07132; Mon, 11 Aug 2008 13:42:47 +1000 Message-ID: <489FB537.70001@sgi.com> Date: Mon, 11 Aug 2008 13:42:47 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com, jasper@amiton.co.nz Subject: Re: [PATCH] stop rejecting options in remount References: <20080809195159.GA8562@lst.de> In-Reply-To: <20080809195159.GA8562@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17452 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Thanks to some not so nice code in mount(8) we can't blindly reject moun > options we don't support to be changed in remount. See the comment in > the code for more details. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 16:34:33.000000000 -0300 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 16:36:55.000000000 -0300 > @@ -1349,9 +1349,28 @@ xfs_fs_remount( > mp->m_flags &= ~XFS_MOUNT_BARRIER; > break; > default: > + /* > + * Logically we would return an error here to prevent > + * users from believing they might have changed > + * mount options using remount which can't be changed. > + * > + * But unfortunately mount(8) adds all options from > + * mtab and fstab to the mount arguments in some > + * cases so we can't blindly reject options. > + * > + * The workaround for that behaviour will be to > + * check for each specified option whether it actually > + * is a change compared to the status quo and if yes > + * silently ignore it or otherwise reject the remount > + * and tell the user about the reason. > + */ > +#if 0 > printk(KERN_INFO > "XFS: mount option \"%s\" not supported for remount\n", p); > return -EINVAL; > +#else > + return 0; > +#endif > } > } > We should sill issue a warning that the option was ignored. It's not as obvious as refusing the mount but will allow some kind of triage if strange behavior results. Don From owner-xfs@oss.sgi.com Sun Aug 10 21:47:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 10 Aug 2008 21:47:49 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B4ldxp030839 for ; Sun, 10 Aug 2008 21:47:41 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08231; Mon, 11 Aug 2008 14:48:49 +1000 Message-ID: <489FC4B1.5040402@sgi.com> Date: Mon, 11 Aug 2008 14:48:49 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Donald Douwsma CC: Christoph Hellwig , xfs@oss.sgi.com, jasper@amiton.co.nz Subject: Re: [PATCH] stop rejecting options in remount References: <20080809195159.GA8562@lst.de> <489FB537.70001@sgi.com> In-Reply-To: <489FB537.70001@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17453 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Donald Douwsma wrote: > Christoph Hellwig wrote: >> Thanks to some not so nice code in mount(8) we can't blindly reject moun >> options we don't support to be changed in remount. See the comment in >> the code for more details. >> >> >> Signed-off-by: Christoph Hellwig >> >> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c >> =================================================================== >> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 >> 16:34:33.000000000 -0300 >> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-09 >> 16:36:55.000000000 -0300 >> @@ -1349,9 +1349,28 @@ xfs_fs_remount( >> mp->m_flags &= ~XFS_MOUNT_BARRIER; >> break; >> default: >> + /* >> + * Logically we would return an error here to prevent >> + * users from believing they might have changed >> + * mount options using remount which can't be changed. >> + * >> + * But unfortunately mount(8) adds all options from >> + * mtab and fstab to the mount arguments in some >> + * cases so we can't blindly reject options. >> + * >> + * The workaround for that behaviour will be to >> + * check for each specified option whether it actually >> + * is a change compared to the status quo and if yes >> + * silently ignore it or otherwise reject the remount >> + * and tell the user about the reason. >> + */ >> +#if 0 >> printk(KERN_INFO >> "XFS: mount option \"%s\" not supported for remount\n", p); >> return -EINVAL; >> +#else >> + return 0; >> +#endif >> } >> } >> > > We should sill issue a warning that the option was ignored. It's not as > obvious as refusing the mount but will allow some kind of triage if > strange behavior results. > Well, this is just a temporary partial fix, right. If we warn then we will be warning incorrectly in the cases where we are just carrying through the original mount options (which could be in fstab etc.) AFAICT which was the problem that was reported. I don't follow the 3rd paragraph of the comment above. The current workaround looks like to always let the options through (ignoring the unallowed changed ones), and a better fix would be to compare what the requested opts are with the current opts and for the changed one's see if they are allowed on remount. --Tim From owner-xfs@oss.sgi.com Mon Aug 11 00:32:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 00:32:21 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B7WGFx024554 for ; Mon, 11 Aug 2008 00:32:17 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA11263; Mon, 11 Aug 2008 17:33:26 +1000 Message-ID: <489FECCD.6050703@sgi.com> Date: Mon, 11 Aug 2008 17:39:57 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Sven Geggus CC: xfs@oss.sgi.com Subject: Re: Ooops in Kernel 2.6.26.2 References: <20080808180938.GA3760@diesel.geggus.net> In-Reply-To: <20080808180938.GA3760@diesel.geggus.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17454 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Sven, I'm not exactly sure what's caused this panic but it could be a use after free problem. In xfs_log_done() (the function that we panicked in) we call xlog_ticket_put() which frees the ticket and then we access the ticket again a few lines later. if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) == 0 || (flags & XFS_LOG_REL_PERM_RESERV)) { /* * Release ticket if not permanent reservation or a specific * request has been made to release a permanent reservation. */ xlog_trace_loggrant(log, ticket, "xfs_log_done: (non-permanent)"); xlog_ungrant_log_space(log, ticket); xlog_ticket_put(log, ticket); <=== freed the ticket here } else { xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); xlog_regrant_reserve_log_space(log, ticket); } /* If this ticket was a permanent reservation and we aren't * trying to release it, reset the inited flags; so next time * we write, a start record will be written out. */ if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) && <=== accessed it again here (flags & XFS_LOG_REL_PERM_RESERV) == 0) ticket->t_flags |= XLOG_TIC_INITED; Lachlan Sven Geggus wrote: > Hi there, > > I've got a (somewhat) reproducable bug with Kernel 2.6.26.2 > > * Do an xfs-repair on the device (a dm-crypt in this case) just in > case > * mount the device > * try to remove a given file (rm foo.html) > > XFS mounting filesystem dm-0 > Ending clean XFS mount for filesystem: dm-0 > BUG: unable to handle kernel paging request at f3040f5f > IP: [] xfs_log_done+0x86/0xa7 > *pde = 35dea163 *pte = 33040160 > Oops: 0000 [#1] PREEMPT DEBUG_PAGEALLOC > Modules linked in: radeon drm rfcomm l2cap sym53c8xx scsi_transport_spi snd_via82xx 8139too snd_mpu401_uart snd_ens1371 snd_rawmidi snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_timer via_agp snd_page_alloc agpgart > > Pid: 4043, comm: rm Not tainted (2.6.26.2 #1) > EIP: 0060:[] EFLAGS: 00010282 CPU: 0 > EIP is at xfs_log_done+0x86/0xa7 > EAX: 00000282 EBX: f3040f30 ECX: 00000000 EDX: f31d5c58 > ESI: f304def0 EDI: 00000001 EBP: f31a5dcc ESP: f31a5db4 > DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 > Process rm (pid: 4043, ti=f31a4000 task=f31d5c58 task.ti=f31a4000) > Stack: f47f8bf0 00000002 00000001 f31a5e04 0000000c f321ed88 f31a5ed4 c0206c8e > 00000001 f3040f30 f321edb8 f321edb8 00000001 00000000 00000004 f31a5e0c > f47f8bf0 c020e7c9 c020e7c9 00000000 f321eed0 00000010 00000013 f47e2ab0 > Call Trace: > [] ? _xfs_trans_commit+0x20c/0x36a > [] ? kmem_zone_alloc+0x49/0x8f > [] ? kmem_zone_alloc+0x49/0x8f > [] ? xfs_trans_log_inode+0x14/0x2f > [] ? xfs_remove+0x204/0x286 > [] ? xfs_vn_unlink+0x2e/0x4d > [] ? vfs_unlink+0x5d/0xac > [] ? do_unlinkat+0x9b/0x133 > [] ? sys_unlink+0x10/0x12 > [] ? syscall_call+0x7/0xb > ======================= > Code: f6 43 2f 02 74 08 f7 c7 01 00 00 00 74 14 89 da 89 f0 e8 46 d7 ff ff 89 da 89 f0 e8 9e d9 ff ff eb 09 89 da 89 f0 e8 f6 fe ff ff <8a> 43 2f a8 02 74 0b 83 e7 01 75 06 83 c8 01 88 43 2f 8b 45 ec > EIP: [] xfs_log_done+0x86/0xa7 SS:ESP 0068:f31a5db4 > ---[ end trace fdfcf6b8ebb2164b ]--- > > Rebooting into my former kernel (2.6.25.10) I was now able to remove > the file without a kernel crash. > > Unfortunately this may well mean that I can not reproduce this bug > anymore... > > Sven > From owner-xfs@oss.sgi.com Mon Aug 11 00:49:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 00:49: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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B7npSH026723 for ; Mon, 11 Aug 2008 00:49:55 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA11545; Mon, 11 Aug 2008 17:51:03 +1000 Message-ID: <489FF0EE.5040607@sgi.com> Date: Mon, 11 Aug 2008 17:57:34 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: lachlan@sgi.com CC: Sven Geggus , xfs@oss.sgi.com Subject: Re: Ooops in Kernel 2.6.26.2 References: <20080808180938.GA3760@diesel.geggus.net> <489FECCD.6050703@sgi.com> In-Reply-To: <489FECCD.6050703@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17455 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs The ticket allocation code got reworked in 2.6.26 and we now free tickets whereas before we used to cache them so the use-after-free went undetected. This patch should do the trick. --- a/fs/xfs/xfs_log.c 2008-08-11 17:47:18.000000000 +1000 +++ b/fs/xfs/xfs_log.c 2008-08-11 17:53:24.000000000 +1000 @@ -336,15 +364,12 @@ xfs_log_done(xfs_mount_t *mp, } else { xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); xlog_regrant_reserve_log_space(log, ticket); - } - - /* If this ticket was a permanent reservation and we aren't - * trying to release it, reset the inited flags; so next time - * we write, a start record will be written out. - */ - if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) && - (flags & XFS_LOG_REL_PERM_RESERV) == 0) + /* If this ticket was a permanent reservation and we aren't + * trying to release it, reset the inited flags; so next time + * we write, a start record will be written out. + */ ticket->t_flags |= XLOG_TIC_INITED; + } return lsn; } /* xfs_log_done */ Lachlan McIlroy wrote: > Sven, > > I'm not exactly sure what's caused this panic but it could be a use > after free problem. In xfs_log_done() (the function that we panicked > in) we call xlog_ticket_put() which frees the ticket and then we > access the ticket again a few lines later. > > if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) == 0 || > (flags & XFS_LOG_REL_PERM_RESERV)) { > /* > * Release ticket if not permanent reservation or a specific > * request has been made to release a permanent reservation. > */ > xlog_trace_loggrant(log, ticket, "xfs_log_done: (non-permanent)"); > xlog_ungrant_log_space(log, ticket); > xlog_ticket_put(log, ticket); <=== freed the ticket here > } else { > xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); > xlog_regrant_reserve_log_space(log, ticket); > } > > /* If this ticket was a permanent reservation and we aren't > * trying to release it, reset the inited flags; so next time > * we write, a start record will be written out. > */ > if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) && <=== accessed it > again here > (flags & XFS_LOG_REL_PERM_RESERV) == 0) > ticket->t_flags |= XLOG_TIC_INITED; > > Lachlan > > Sven Geggus wrote: >> Hi there, >> >> I've got a (somewhat) reproducable bug with Kernel 2.6.26.2 >> >> * Do an xfs-repair on the device (a dm-crypt in this case) just in >> case >> * mount the device >> * try to remove a given file (rm foo.html) >> >> XFS mounting filesystem dm-0 >> Ending clean XFS mount for filesystem: dm-0 >> BUG: unable to handle kernel paging request at f3040f5f >> IP: [] xfs_log_done+0x86/0xa7 >> *pde = 35dea163 *pte = 33040160 Oops: 0000 [#1] PREEMPT DEBUG_PAGEALLOC >> Modules linked in: radeon drm rfcomm l2cap sym53c8xx >> scsi_transport_spi snd_via82xx 8139too snd_mpu401_uart snd_ens1371 >> snd_rawmidi snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm >> snd_timer via_agp snd_page_alloc agpgart >> >> Pid: 4043, comm: rm Not tainted (2.6.26.2 #1) >> EIP: 0060:[] EFLAGS: 00010282 CPU: 0 >> EIP is at xfs_log_done+0x86/0xa7 >> EAX: 00000282 EBX: f3040f30 ECX: 00000000 EDX: f31d5c58 >> ESI: f304def0 EDI: 00000001 EBP: f31a5dcc ESP: f31a5db4 >> DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 >> Process rm (pid: 4043, ti=f31a4000 task=f31d5c58 task.ti=f31a4000) >> Stack: f47f8bf0 00000002 00000001 f31a5e04 0000000c f321ed88 f31a5ed4 >> c0206c8e 00000001 f3040f30 f321edb8 f321edb8 00000001 00000000 >> 00000004 f31a5e0c f47f8bf0 c020e7c9 c020e7c9 00000000 f321eed0 >> 00000010 00000013 f47e2ab0 Call Trace: >> [] ? _xfs_trans_commit+0x20c/0x36a >> [] ? kmem_zone_alloc+0x49/0x8f >> [] ? kmem_zone_alloc+0x49/0x8f >> [] ? xfs_trans_log_inode+0x14/0x2f >> [] ? xfs_remove+0x204/0x286 >> [] ? xfs_vn_unlink+0x2e/0x4d >> [] ? vfs_unlink+0x5d/0xac >> [] ? do_unlinkat+0x9b/0x133 >> [] ? sys_unlink+0x10/0x12 >> [] ? syscall_call+0x7/0xb >> ======================= >> Code: f6 43 2f 02 74 08 f7 c7 01 00 00 00 74 14 89 da 89 f0 e8 46 d7 >> ff ff 89 da 89 f0 e8 9e d9 ff ff eb 09 89 da 89 f0 e8 f6 fe ff ff <8a> >> 43 2f a8 02 74 0b 83 e7 01 75 06 83 c8 01 88 43 2f 8b 45 ec EIP: >> [] xfs_log_done+0x86/0xa7 SS:ESP 0068:f31a5db4 >> ---[ end trace fdfcf6b8ebb2164b ]--- >> >> Rebooting into my former kernel (2.6.25.10) I was now able to remove >> the file without a kernel crash. >> >> Unfortunately this may well mean that I can not reproduce this bug >> anymore... >> >> Sven >> > > > From owner-xfs@oss.sgi.com Mon Aug 11 00:53:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 00:53:42 -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 (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 m7B7rbUv027449 for ; Mon, 11 Aug 2008 00:53:38 -0700 X-ASG-Debug-ID: 1218441291-382900720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 169B5F255D9 for ; Mon, 11 Aug 2008 00:54:52 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id gd4CI9kcUmrgDGbW for ; Mon, 11 Aug 2008 00:54:52 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANuKn0h5LAMb/2dsb2JhbACodA X-IronPort-AV: E=Sophos;i="4.31,341,1215354600"; d="scan'208";a="179142322" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 11 Aug 2008 17:24:42 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSSEi-0000Sp-UI; Mon, 11 Aug 2008 17:54:40 +1000 Date: Mon, 11 Aug 2008 17:54:40 +1000 From: Dave Chinner To: Bhagi rathi Cc: Eric Sandeen , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Subject: Re: TAKE 981498 - use KM_MAYFAIL in xfs_mountfs Message-ID: <20080811075440.GH24344@disturbed> Mail-Followup-To: Bhagi rathi , Eric Sandeen , Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com References: <20080806054121.CB2F258C52A4@chook.melbourne.sgi.com> <489A01B0.5050606@sandeen.net> <20080806202256.GR21635@disturbed> <20080808003147.GA24344@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218441294 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0314 1.0000 -1.8178 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 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.2330 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17456 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 08, 2008 at 10:52:50AM +0530, Bhagi rathi wrote: > On Fri, Aug 8, 2008 at 6:01 AM, Dave Chinner wrote: > > > On Thu, Aug 07, 2008 at 10:53:55PM +0530, Bhagi rathi wrote: > > > On Thu, Aug 7, 2008 at 1:52 AM, Dave Chinner > > wrote: > > > > > > > On Wed, Aug 06, 2008 at 02:55:28PM -0500, Eric Sandeen wrote: > > > > > Bhagi rathi wrote: > > > > > > Why are we going to block for ever? Mounting a file-system > > > > > > requires in-core log space buffers, reading of other buffers > > > > > > which needs allocation of memory greater than per ag > > > > > > structures. > > > > ..... > > > > > In general KM_MAYFAIL sounds like a good plan when you can handle the > > > > > failure gracefully, I think. > > > > > > > > Yes, and that is the long term plan - to remove all KM_SLEEP > > > > allocations from XFS and allow them to fail gracefully. There's > > > > lots of work needed before we get there, though. e.g. > > > > right now we cannot survive an ENOMEM error in a transaction.... > > > > > > > > > I am not sure that we are solving right problem. Isn't the above is > > > fall-out > > > of XFS needing memory to clean dirty memory? > > > > We can't avoid that. It is inherent in the design of XFS. And the > > amount of memory is not easily bounded so existing solutions like > > wrapping slabs in mempools don't work, either. > > > Interesting. The only dirty items are xfs inodes, quota's and > meta-data buffers. We can fixed number of these items and > ensure pushing of data one after the other in the case of crunch. No we can't. > What are the objects of dirty data where the memory is not bounded? e.g. btree (bmbt and alloc bno+cnt) buffers may need to be read from disk during delayed allocation. Seeing as there is no guarantee that the memory the buffers use will be released after the I/O is completed we don't provide the guarantee mempools require (i.e allocations always being freed a short while later so the system always makes progress). Yes, we can say it is bounded for a single allocation, but cleaning an inode may require an unbound number of allocations (think single block fragmentations).... And then when you consider write back of thousands of dirty inodes at a time that all require mulitple allocations, the memory required by the delalloc process for inodes can effectively be considered unbounded. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 00:57:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 00:57:45 -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=-1.0 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no 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 m7B7vfmx028250 for ; Mon, 11 Aug 2008 00:57:42 -0700 X-ASG-Debug-ID: 1218441537-2f7c01000000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 23B6FF253C3 for ; Mon, 11 Aug 2008 00:58:57 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 5IEkDZcj8JAtSzXD for ; Mon, 11 Aug 2008 00:58:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF6On0h5LAMb/2dsb2JhbACodw X-IronPort-AV: E=Sophos;i="4.31,341,1215354600"; d="scan'208";a="179145680" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 11 Aug 2008 17:28:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSSIp-0000ZY-FY; Mon, 11 Aug 2008 17:58:55 +1000 Date: Mon, 11 Aug 2008 17:58:55 +1000 From: Dave Chinner To: Bhagi rathi Cc: Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080811075855.GI24344@disturbed> Mail-Followup-To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218441538 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0049 1.0000 -1.9890 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.49 X-Barracuda-Spam-Status: No, SCORE=-0.49 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2330 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17457 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 08, 2008 at 10:46:56AM +0530, Bhagi rathi wrote: > > Are we safe that we fixed all these real problems by looking > > into possible allocations that will enter into file-system? The > > problem with trace buffers is telling us to clean this code path. > > > > By the way, I browse the source code from lxr.linux.no. > > If I have to browse the latest xfs source code with linux > > kernel that is used at SGI, how can I do that? > > > > Any pointers on this? I wish to setup my own xfs development enviroment > and details on this will be helpful. Well, you could look at the XFS home page and follow the links to: Or for just the kernel source you can use the master branch of the XFS git tree at: git://oss.sgi.com:8090/xfs/xfs-2.6.git master Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 01:06:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 01:06:24 -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.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B86HGb030026 for ; Mon, 11 Aug 2008 01:06:18 -0700 Received: from [134.15.251.3] (melb-sw-corp-251-3.corp.sgi.com [134.15.251.3]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA11935; Mon, 11 Aug 2008 18:07:29 +1000 Message-ID: <489FF32E.9030805@sgi.com> Date: Mon, 11 Aug 2008 18:07:10 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Bhagi rathi CC: Lachlan McIlroy , xfs@oss.sgi.com Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17458 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Bhagi rathi wrote: > On Thu, Aug 7, 2008 at 11:13 PM, Bhagi rathi wrote: >> By the way, I browse the source code from lxr.linux.no. >> If I have to browse the latest xfs source code with linux >> kernel that is used at SGI, how can I do that? >> > > Any pointers on this? I wish to setup my own xfs development enviroment > and details on this will be helpful. We maintain a CVS tree of xfs-dev on oss. It's slightly different to mainline linux as it contains patches to include kdb and dmapi. From the web page: Set the CVSROOT environment variable. $ export CVSROOT=':pserver:cvs@oss.sgi.com:/cvs' (for sh, bash, ksh, or similar shells) $ setenv CVSROOT :pserver:cvs@oss.sgi.com:/cvs (for csh or tcsh shells) Login to the CVS server (this only needs to be done ONCE, not every time you access CVS). $ cvs login (the password is "cvs") Now grab the XFS source tree(s) of interest: $ cvs checkout linux-2.6-xfs $ cvs checkout xfs-cmds Subsequently, you can checkout new code using: $ cvs update -d From owner-xfs@oss.sgi.com Mon Aug 11 02:10:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 02:10:31 -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=-1.0 required=5.0 tests=AWL,BAYES_20,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7B9ASFe005415 for ; Mon, 11 Aug 2008 02:10:29 -0700 X-ASG-Debug-ID: 1218445903-14e700ea0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from out-mta1.ai270.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1326C19AFC12 for ; Mon, 11 Aug 2008 02:11:43 -0700 (PDT) Received: from out-mta1.ai270.net (out-mta2.ai270.net [83.244.130.25]) by cuda.sgi.com with ESMTP id Xkd64EENwfQKUM1f for ; Mon, 11 Aug 2008 02:11:43 -0700 (PDT) Received: from [83.244.130.7] (helo=out-filter2.ai270.net) by out-mta1.ai270.net with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KSTRH-000MsC-Db for xfs@oss.sgi.com; Mon, 11 Aug 2008 10:11:43 +0100 Received: from [83.244.130.53] (helo=intmail.ai270.net) by out-filter2.ai270.net with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1KSTQN-000OA7-RN for xfs@oss.sgi.com; Mon, 11 Aug 2008 10:12:02 +0100 Received: from [89.145.204.18] (helo=[192.168.1.34]) by intmail.ai270.net with esmtp (Exim 4.66 (FreeBSD)) (envelope-from ) id 1KSTQ4-000LSB-N2 for xfs@oss.sgi.com; Mon, 11 Aug 2008 10:10:28 +0100 Message-ID: <48A001FF.8030701@advantage-interactive.com> Date: Mon, 11 Aug 2008 10:10:23 +0100 From: Asfand Yar Qazi User-Agent: Thunderbird 2.0.0.14 (X11/20080519) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_quota: Getting back disk space usage of a single directory Subject: xfs_quota: Getting back disk space usage of a single directory X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: out-mta2.ai270.net[83.244.130.25] X-Barracuda-Start-Time: 1218445905 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0560 1.0000 -1.6621 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.66 X-Barracuda-Spam-Status: No, SCORE=-1.66 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.2335 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17459 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: asfand_yar.qazi@advantage-interactive.com Precedence: bulk X-list: xfs Hi, If I have an XFS mount that contains many directories, each one project-quotaed, how can I use xfs_quota to get back the amount of quota used by just one directory? I know I can use xfs_quota -x -c quot -p /blah to get back quota usages for all projects in that mount, but I want to get back just one. Thanks -- Regards, Asfand Yar Qazi Developer, Advantage Interactive Ltd. From owner-xfs@oss.sgi.com Mon Aug 11 02:38:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 02:38:23 -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=-0.8 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7B9cIch009793 for ; Mon, 11 Aug 2008 02:38:20 -0700 Received: from [134.15.251.5] (melb-sw-corp-251-5.corp.sgi.com [134.15.251.5]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id TAA13288; Mon, 11 Aug 2008 19:39:30 +1000 Message-ID: <48A008C3.7060603@sgi.com> Date: Mon, 11 Aug 2008 19:39:15 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080811075855.GI24344@disturbed> In-Reply-To: <20080811075855.GI24344@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17460 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Reply in verbatim below ... Dave Chinner wrote: > On Fri, Aug 08, 2008 at 10:46:56AM +0530, Bhagi rathi wrote: >>> Are we safe that we fixed all these real problems by looking >>> into possible allocations that will enter into file-system? The >>> problem with trace buffers is telling us to clean this code path. >>> >>> By the way, I browse the source code from lxr.linux.no. >>> If I have to browse the latest xfs source code with linux >>> kernel that is used at SGI, how can I do that? >>> >> Any pointers on this? I wish to setup my own xfs development enviroment >> and details on this will be helpful. > > Well, you could look at the XFS home page and follow the links to: where? Did this URL get edited out (as seems to be happening lately) or did you neglect to paste it in? > > Or for just the kernel source you can use the master branch > of the XFS git tree at: > > git://oss.sgi.com:8090/xfs/xfs-2.6.git master > > Cheers, > > Dave. -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Aug 11 02:49:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 02:49:56 -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=-1.0 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no 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 m7B9nsnC011962 for ; Mon, 11 Aug 2008 02:49:54 -0700 X-ASG-Debug-ID: 1218448269-247000060000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3BA8BF2581A for ; Mon, 11 Aug 2008 02:51:10 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id II96VMcPPuxP49v7 for ; Mon, 11 Aug 2008 02:51:10 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMSmn0h5LAMb/2dsb2JhbACpPQ X-IronPort-AV: E=Sophos;i="4.31,341,1215354600"; d="scan'208";a="179231723" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 11 Aug 2008 19:21:08 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSU3P-00034X-4g; Mon, 11 Aug 2008 19:51:07 +1000 Date: Mon, 11 Aug 2008 19:51:07 +1000 From: Dave Chinner To: Mark Goodwin Cc: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Message-ID: <20080811095107.GE6119@disturbed> Mail-Followup-To: Mark Goodwin , Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080811075855.GI24344@disturbed> <48A008C3.7060603@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A008C3.7060603@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218448271 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4888 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.50 X-Barracuda-Spam-Status: No, SCORE=1.50 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2338 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17461 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 11, 2008 at 07:39:15PM +1000, Mark Goodwin wrote: > Reply in verbatim below ... > > Dave Chinner wrote: >> On Fri, Aug 08, 2008 at 10:46:56AM +0530, Bhagi rathi wrote: >>>> Are we safe that we fixed all these real problems by looking >>>> into possible allocations that will enter into file-system? The >>>> problem with trace buffers is telling us to clean this code path. >>>> >>>> By the way, I browse the source code from lxr.linux.no. >>>> If I have to browse the latest xfs source code with linux >>>> kernel that is used at SGI, how can I do that? >>>> >>> Any pointers on this? I wish to setup my own xfs development enviroment >>> and details on this will be helpful. >> >> Well, you could look at the XFS home page and follow the links to: > > where? Did this URL get edited out (as seems to be happening lately) > or did you neglect to paste it in? Nope, the url got removed. it pointed to (using the same trick as last time): oss.sgi.com/projects/xfs/source.html >> Or for just the kernel source you can use the master branch >> of the XFS git tree at: >> >> git://oss.sgi.com:8090/xfs/xfs-2.6.git master Note that this one didn't, but barracuda thought it was a http URI and gave a nasty warning about it: | X-Barracuda-Spam-Status: No, SCORE=-0.49 using per-user scores of TAG_LEVEL=2.0 | QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT | X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2330 | Rule breakdown below | pts rule name description | ---- ---------------------- -------------------------------------------------- | 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP Given that I can send URLs to myself, to lkml, friends, etc and they work, this points to something specific to the XFS mailing list.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 03:14:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 03:14:31 -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.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7BAERlD015070 for ; Mon, 11 Aug 2008 03:14:27 -0700 Received: from [134.15.251.5] (melb-sw-corp-251-5.corp.sgi.com [134.15.251.5]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id UAA13960; Mon, 11 Aug 2008 20:15:41 +1000 Message-ID: <48A01140.3070306@sgi.com> Date: Mon, 11 Aug 2008 20:15:28 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: trev , "Kevin G. Snow" CC: xfs-oss Subject: [Fwd: [nfsv4] AD review: draft-ietf-nfsv4-rpcsec-gss-v2-03] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17462 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Trev, Kevin, whomever ... has anyone changed anything recently regarding filtering in-line URLs posted to the xfs@oss list? Thanks -- Mark -------- Original Message -------- Subject: [nfsv4] AD review: draft-ietf-nfsv4-rpcsec-gss-v2-03 Date: Mon, 11 Aug 2008 13:05:34 +0300 From: Lars Eggert To: NFSv4 Section 1, paragraph 0: > RPCSEC_GSS version 2 (RPCSEC_GSSv2) is the same as RPCSEC_GSS version > 1 (RPCSEC_GSSv1) except that support for channel bindings has been > added. I'd be good to add a citation to [2] for RPCSEC_GSSv1 and RFC5056 for "channel bindings." We can do that with an RFC Editor Note - send me one. Section 7., paragraph 1: > The security considerations are the same as [2]. This document is all about applying a security mechanism (channel bindings) to [2]. Surely this raises new security considerations? If not, please explain why not - this is surely something the security directorate will want to know. _______________________________________________ nfsv4 mailing list nfsv4@ietf.org https://www.ietf.org/mailman/listinfo/nfsv4 -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Aug 11 03:19:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 03:19:53 -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.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7BAJotP015956 for ; Mon, 11 Aug 2008 03:19:51 -0700 Received: from [134.15.251.5] (melb-sw-corp-251-5.corp.sgi.com [134.15.251.5]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id UAA14117; Mon, 11 Aug 2008 20:21:03 +1000 Message-ID: <48A0127F.3030405@sgi.com> Date: Mon, 11 Aug 2008 20:20:47 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: markgw@sgi.com CC: trev , "Kevin G. Snow" , xfs-oss Subject: Re: [Fwd: [nfsv4] AD review: draft-ietf-nfsv4-rpcsec-gss-v2-03] References: <48A01140.3070306@sgi.com> In-Reply-To: <48A01140.3070306@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17463 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs whoops - fwd'd the wrong message - ignore. Mark Goodwin wrote: > > Trev, Kevin, whomever ... has anyone changed anything recently > regarding filtering in-line URLs posted to the xfs@oss list? > > Thanks > -- Mark > > -------- Original Message -------- > Subject: [nfsv4] AD review: draft-ietf-nfsv4-rpcsec-gss-v2-03 > Date: Mon, 11 Aug 2008 13:05:34 +0300 > From: Lars Eggert > To: NFSv4 > > Section 1, paragraph 0: >> RPCSEC_GSS version 2 (RPCSEC_GSSv2) is the same as RPCSEC_GSS > version >> 1 (RPCSEC_GSSv1) except that support for channel bindings has been >> added. > > I'd be good to add a citation to [2] for RPCSEC_GSSv1 and RFC5056 for > "channel bindings." We can do that with an RFC Editor Note - send me > one. > > > Section 7., paragraph 1: >> The security considerations are the same as [2]. > > This document is all about applying a security mechanism (channel > bindings) to [2]. Surely this raises new security considerations? > If not, please explain why not - this is surely something the > security > directorate will want to know. > > _______________________________________________ > nfsv4 mailing list > nfsv4@ietf.org > https://www.ietf.org/mailman/listinfo/nfsv4 > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Aug 11 03:21:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 03:21:06 -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=-0.8 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7BAL1wc016393 for ; Mon, 11 Aug 2008 03:21:02 -0700 Received: from [134.15.251.5] (melb-sw-corp-251-5.corp.sgi.com [134.15.251.5]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id UAA14171; Mon, 11 Aug 2008 20:22:15 +1000 Message-ID: <48A012CA.3040709@sgi.com> Date: Mon, 11 Aug 2008 20:22:02 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: trev , "Kevin G. Snow" CC: xfs-oss Subject: [Fwd: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17464 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs fwd. previous fwd was for the wrong message, sorry. Earlier question applies to the following message: Trev, Kevin, whomever ... has anyone changed anything recently regarding filtering in-line URLs posted to the xfs@oss list? Thanks -- Mark -------- Original Message -------- Subject: Re: TAKE 981498 - Use KM_NOFS for debug trace buffers Date: Mon, 11 Aug 2008 19:51:07 +1000 From: Dave Chinner To: Mark Goodwin CC: Bhagi rathi , Lachlan McIlroy , xfs@oss.sgi.com References: <20080806061553.A8D8958C52A4@chook.melbourne.sgi.com> <20080806201957.GQ21635@disturbed> <20080811075855.GI24344@disturbed> <48A008C3.7060603@sgi.com> On Mon, Aug 11, 2008 at 07:39:15PM +1000, Mark Goodwin wrote: > Reply in verbatim below ... > > Dave Chinner wrote: >> On Fri, Aug 08, 2008 at 10:46:56AM +0530, Bhagi rathi wrote: >>>> Are we safe that we fixed all these real problems by looking >>>> into possible allocations that will enter into file-system? The >>>> problem with trace buffers is telling us to clean this code path. >>>> >>>> By the way, I browse the source code from lxr.linux.no. >>>> If I have to browse the latest xfs source code with linux >>>> kernel that is used at SGI, how can I do that? >>>> >>> Any pointers on this? I wish to setup my own xfs development enviroment >>> and details on this will be helpful. >> >> Well, you could look at the XFS home page and follow the links to: > > where? Did this URL get edited out (as seems to be happening lately) > or did you neglect to paste it in? Nope, the url got removed. it pointed to (using the same trick as last time): oss.sgi.com/projects/xfs/source.html >> Or for just the kernel source you can use the master branch >> of the XFS git tree at: >> >> git://oss.sgi.com:8090/xfs/xfs-2.6.git master Note that this one didn't, but barracuda thought it was a http URI and gave a nasty warning about it: | X-Barracuda-Spam-Status: No, SCORE=-0.49 using per-user scores of TAG_LEVEL=2.0 | QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT | X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2330 | Rule breakdown below | pts rule name description | ---- ---------------------- -------------------------------------------------- | 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP Given that I can send URLs to myself, to lkml, friends, etc and they work, this points to something specific to the XFS mailing list.... Cheers, Dave. -- Dave Chinner david@fromorbit.com -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Aug 11 05:07:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 05:08:02 -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 m7BC7sOi000970 for ; Mon, 11 Aug 2008 05:07:55 -0700 X-ASG-Debug-ID: 1218456550-166900850000-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 4835D11FB061; Mon, 11 Aug 2008 05:09:11 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Gm3XINcXDyi8pXee; Mon, 11 Aug 2008 05:09:11 -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 m7BC93IF015754 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 11 Aug 2008 14:09:03 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7BC90uf015748; Mon, 11 Aug 2008 14:09:00 +0200 Date: Mon, 11 Aug 2008 14:09:00 +0200 From: Christoph Hellwig To: Donald Douwsma Cc: xfs@oss.sgi.com, jasper@amiton.co.nz X-ASG-Orig-Subj: Re: [PATCH] stop rejecting options in remount Subject: Re: [PATCH] stop rejecting options in remount Message-ID: <20080811120900.GB15553@lst.de> References: <20080809195159.GA8562@lst.de> <489FB537.70001@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489FB537.70001@sgi.com> 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: 1218456552 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0148 1.0000 -1.9247 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 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.2346 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17465 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 11, 2008 at 01:42:47PM +1000, Donald Douwsma wrote: > > We should sill issue a warning that the option was ignored. It's not as > obvious as refusing the mount but will allow some kind of triage if > strange behavior results. I was wondering about this and decided to revert to the previous behaviour for now. If you feel strongly we can keep the warning. From owner-xfs@oss.sgi.com Mon Aug 11 05:10:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 05:10:07 -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 (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 m7BCA4WI001484 for ; Mon, 11 Aug 2008 05:10:04 -0700 X-ASG-Debug-ID: 1218456680-6dbb023e0000-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 487C8380CEC; Mon, 11 Aug 2008 05:11:20 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id yp90qD4k6COPnpxs; Mon, 11 Aug 2008 05:11:20 -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 m7BCBIIF015838 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 11 Aug 2008 14:11:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7BCBIoN015836; Mon, 11 Aug 2008 14:11:18 +0200 Date: Mon, 11 Aug 2008 14:11:18 +0200 From: Christoph Hellwig To: Timothy Shimmin Cc: xfs@oss.sgi.com, jasper@amiton.co.nz X-ASG-Orig-Subj: Re: [PATCH] stop rejecting options in remount Subject: Re: [PATCH] stop rejecting options in remount Message-ID: <20080811121118.GC15553@lst.de> References: <20080809195159.GA8562@lst.de> <489FB537.70001@sgi.com> <489FC4B1.5040402@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489FC4B1.5040402@sgi.com> 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: 1218456681 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.2347 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17466 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 11, 2008 at 02:48:49PM +1000, Timothy Shimmin wrote: > >> + /* > >> + * Logically we would return an error here to prevent > >> + * users from believing they might have changed > >> + * mount options using remount which can't be changed. > >> + * > >> + * But unfortunately mount(8) adds all options from > >> + * mtab and fstab to the mount arguments in some > >> + * cases so we can't blindly reject options. > >> + * > >> + * The workaround for that behaviour will be to > >> + * check for each specified option whether it actually > >> + * is a change compared to the status quo and if yes > >> + * silently ignore it or otherwise reject the remount > >> + * and tell the user about the reason. > >> + */ > >> +#if 0 > >> printk(KERN_INFO > >> "XFS: mount option \"%s\" not supported for remount\n", p); > >> return -EINVAL; > >> +#else > >> + return 0; > >> +#endif > I don't follow the 3rd paragraph of the comment above. > The current workaround looks like to always let the options through > (ignoring the unallowed changed ones), > and a better fix would be to compare what the requested opts are with > the current opts and for the changed one's see if they are allowed > on remount. Yes, that's what I wanted to say with the third paragraph :) I'll send an updated version with a better worded comment once we have concensus on wether to warn or not. From owner-xfs@oss.sgi.com Mon Aug 11 05:19:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 05:20:00 -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=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no 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 m7BCJvWv003161 for ; Mon, 11 Aug 2008 05:19:58 -0700 X-ASG-Debug-ID: 1218457271-1caa00390000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gw1.outgw.tn (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 72000380D7A for ; Mon, 11 Aug 2008 05:21:12 -0700 (PDT) Received: from gw1.outgw.tn (gw1.outgw.tn [193.95.97.183]) by cuda.sgi.com with ESMTP id TuYAG2RcNmGNBinL for ; Mon, 11 Aug 2008 05:21:12 -0700 (PDT) Received: from MS-129.tn (unknown [193.95.118.61]) by gw1.outgw.tn (Postfix) with ESMTP id B5173E780A3 for ; Mon, 11 Aug 2008 14:21:09 +0200 (CEST) Received: from tounes-18.ati.tn (unverified) by MS-129.tn (Content Technologies SMTPRS 4.3.19) with ESMTP id for ; Mon, 11 Aug 2008 14:21:52 +0200 Received: from smtp.rnu.tn (smtp.rnu.tn [193.95.32.173]) by tounes-18.ati.tn (Postfix) with ESMTP id 00F27108811B for ; Mon, 11 Aug 2008 14:21:09 +0200 (CEST) Received: from localhost (rnu.tn [127.0.0.1]) by smtp.rnu.tn (Postfix) with ESMTP id F0D2FCB390 for ; Mon, 11 Aug 2008 13:54:46 +0200 (CEST) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at rnu.tn Received: from smtp.rnu.tn ([127.0.0.1]) by localhost (smtp.rnu.tn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1h-UbWGXrDsS for ; Mon, 11 Aug 2008 13:54:46 +0200 (CEST) Received: from standard (unknown [196.203.137.24]) by smtp.rnu.tn (Postfix) with ESMTP id 6D705CB389 for ; Mon, 11 Aug 2008 13:54:46 +0200 (CEST) From: "International Conference SETIT 2009" X-ASG-Orig-Subj: Fifth International Conference SETIT 2009 Subject: Fifth International Conference SETIT 2009 To: linux-xfs@oss.sgi.com MIME-Version: 1.0 Date: Mon, 11 Aug 2008 14:21:08 +0200 Message-ID: <2008811.396710,598013923611111@setit.rnu.tn> X-Barracuda-Connect: gw1.outgw.tn[193.95.97.183] X-Barracuda-Start-Time: 1218457273 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5272 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2347 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 4954 X-archive-position: 17467 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: contact@setit.rnu.tn Precedence: bulk X-list: xfs =20 SETIT 2009=20 The Fifth International Conference Sciences of Electronic, Technologies of = Information and Telecommunications SETIT2009 is technically co-sponsored by= IEEE. It will be held from 22 to 26 March 2009 in Hammamet, Tunisia.=20 You can find more details in:=20 http://www.setit.rnu.tn=20 =20=20=20=20=20=20=20=20=20 The paper submission can be done on-line at : http://www.setit.rnu.tn/submission=20 Your propositions are welcome (they can be made either in French or in Engl= ish).=20 Accepted Papers will be published in the Conference Proceedings, as a Book= Chapter with the ISBN: 978-9973-0-0122-1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TUNIS AIR, the Official carrier for the Conference, accords to the particip= ants and their accompaniers a reduction of 50% to the plane tickets.=20 We are waiting for seeing you in Tunisia in SETIT 2009.=20 Best Regards=20 Mohamed Salim BOUHLEL=20 General Co-Chair, SETIT 2009=20 Director of Sfax high institute of electronics and communication (Sfax Univ= ersity)=20=20 Head of Research Unit: Sciences & Technologies of Image and Telecommunicati= ons;=20 BP 261 3038 SFAX TUNISIA=20 GSM +216 20 200005=20 ********************************************* *****************************= *****=20 This email is sent out to all those on the SETIT 2009 database. If you want= to be removed from this database, please send an email to unsubscribe.seti= t@ gmail.com with subject Unsubscribe. ********************************************************* *****************= ***** SETIT 2009 Fifth International Conference Sciences of Electronics, Technologies of Inf= ormation and Telecommunications Technically co-sponsored IEEE=20 Hammamet, Tunisia, March 22-26, 2009 http://www.setit.rnu.tn/ =20 =3D=3D SETIT 2009 PRESENTATION =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D SETIT 2009 has the ambition to promote a technological reference frame, to = give answers and original innovating ideas and to contribute to a common la= nguage around the information processing and the telecommunications. This c= onference will allow, on one hand, to share experience, to make a state of = the art of the theory, research, telecommunication applications and the Inf= ormation processing. On the other hand, Setit will present future innovatio= ns. =3D=3D TOPICS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The topics of this conference are voluntarily opened in order to support th= e participation of many teams (researchers, teachers, engineers, industrial= ists and students). A broad place will be reserved for the new ideas, with = not yet succeeded work, original work positioning clearly compared to what = exists. Here a non exhaustive list of the topics: Electronic=20 Systems on chip=20 Electronic integration=20 Radiofrequence circuits and systems=20 Telecommunications=92 circuits and systems=20 Image and Video=20 Image compression and coding=20 Image processing technology=20 Cryptology and watermarking=20 Image 3D=20 Multimedia=20 Management and diffusion of multimedia applications=20 Multimedia data base=20 Documents modelisation and interpretation=20 Telecommunication=92s computer science=20 Telecommunications and Networks=20 Telecommunications=20 Networks=20 Communication protocoles=20 Algorithms=96architecture adequation=20 Transmission technics Signal Processing=20 Statistical analysis=20 Speech processing=20 Speech compression and coding=20 Information Processing=20 Information fusion=20 Neuronal networks and fuzzy logic=20 Rationing methods=20 Data mining=20 =3D=3D IMPORTANT DATES =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Paper submission: September 30, 2008 Notification of acceptance: November 30, 2008 Final manuscript due: December 31, 2008 Main conference : March 22-26, 2009 =3D=3D CONFERENCE'S PLACE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 Hammamet is a town in Tunisia. Due to its beaches it is a popular destinati= on for swimming and water sports, it was the first tourist destination in Tunisia.It is located in the south = east of the northern peninsula of Cap Bon in the Governorate of Nabeul.=20 The reported number of inhabitants varies from 20,000 to 70,000 and the pop= ulation quadruples due to tourists in the summer.=20 [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Aug 11 05:25:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 05:25:26 -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=-1.9 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 m7BCPM6L004082 for ; Mon, 11 Aug 2008 05:25:22 -0700 X-ASG-Debug-ID: 1218457598-710802d90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.stepping-stone.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8945B380DB1 for ; Mon, 11 Aug 2008 05:26:38 -0700 (PDT) Received: from smtp.stepping-stone.ch (smtp.stepping-stone.ch [193.58.255.135]) by cuda.sgi.com with ESMTP id glUMb79ik7Df5YXZ for ; Mon, 11 Aug 2008 05:26:38 -0700 (PDT) Received: from localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) by smtp.stepping-stone.ch (Postfix) with ESMTP id 756F3760566; Mon, 11 Aug 2008 14:26:37 +0200 (CEST) Received: from smtp.stepping-stone.ch ([10.59.255.135]) by localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) (amavisd-new, port 10024) with LMTP id 07154-01-24; Mon, 11 Aug 2008 14:26:33 +0200 (CEST) Received: from [192.168.1.201] (unknown [212.103.65.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by smtp.stepping-stone.ch (Postfix) with ESMTP id 4D3517683C3; Mon, 11 Aug 2008 14:26:33 +0200 (CEST) Message-ID: <48A02FF6.70703@stepping-stone.ch> Date: Mon, 11 Aug 2008 14:26:30 +0200 From: Christian Affolter User-Agent: Thunderbird 2.0.0.16 (X11/20080805) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Corruption of in-memory data detected - on heavy hard linking Subject: Re: Corruption of in-memory data detected - on heavy hard linking References: <48876D03.8010804@stepping-stone.ch> <20080725052051.GA26367@infradead.org> <489732B2.7000201@stepping-stone.ch> <20080805001952.GI6119@disturbed> In-Reply-To: <20080805001952.GI6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at stepping-stone.ch X-Barracuda-Connect: smtp.stepping-stone.ch[193.58.255.135] X-Barracuda-Start-Time: 1218457599 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.2347 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 17468 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: c.affolter@stepping-stone.ch Precedence: bulk X-list: xfs Hi Dave >>> On Wed, Jul 23, 2008 at 07:40:19PM +0200, Christian Affolter wrote: >>>> Kernel-Error: >>>> Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1163 >>>> of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf >>>> Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 >>> 2.6.24 is pretty old. Did you try with a recent kernel? We had some >>> fixes for in-core memory corruption although I don't remember one in >>> this area. >> I finally found the time to update the kernel to a recent 2.6.26 version. >> >> Unfortunately the problem still exists: >> Filesystem "dm-3": XFS internal error xfs_trans_cancel at line 1163 of >> file fs/xfs/xfs_trans.c. Caller 0xffffffff803a6672 >> Pid: 12584, comm: cp Not tainted 2.6.26-gentoo #1 > > Ok, what we need is the following. First, try to reproduce the > problem on a small filesystem (say a few GB). Once you've reproduced > the problem, unmount and remount the filesystem to get the log > replayed, then take a xfs_metadump image of the filesystem. Put the > metadump image somewhere that can be downloaded (ftp/web site) and > let us know where it is. Please excuse the delay, it took some time to reproduce the issue with newly generated nonsensitive data... However while looking at the meta dump (with the help of the strings command), a lot of non-existing file names appears. Non-existing in the sense of not present on this device, they may exist on other devices, but they definitely were never on the dumped device (the device was filled with /dev/zero before creating the xfs filesystem). Therefor I'm a bit scared to place the dump publicly on the internet, might it be possible to put it somewhere with user/pw protection and hand the credentials to you privately? On the other hand maybe I misunderstood the intention/working of xfs_metadump... The dump was taken as follow: xfs_metadump -g /dev/sdc2 /var/tmp/xfs_sdc2_meta.dump > If this is anything like the previous problem I found and fixed, > then it will be a corner-case bug that is only triggered by a > specific layout of free space and we need the filesystem image > to be able to work out exactly what corner case is broken.... > >> Before the shutdown happens the copy command receives a >> "No space left on device" error: >> cp: cannot create regular file `[file name snipped': No space left on device >> cp: cannot create regular file `[file name snipped]': Input/output error >> >> Although the device has more than 50% free space as well as free inodes. > > It will be an AG that is out of space, not the entire filesystem. > > Cheers, > > Dave. Many thanks for your help! Chris From owner-xfs@oss.sgi.com Mon Aug 11 07:07:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 07:07:38 -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 m7BE7Xpn012085 for ; Mon, 11 Aug 2008 07:07:35 -0700 X-ASG-Debug-ID: 1218463730-6e7201160000-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 F20923816D1 for ; Mon, 11 Aug 2008 07:08:50 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id lv30zn8H9LyslKIa for ; Mon, 11 Aug 2008 07:08:50 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KSY4o-0003ON-3k; Mon, 11 Aug 2008 14:08:50 +0000 Date: Mon, 11 Aug 2008 10:08:50 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Message-ID: <20080811140850.GA12521@infradead.org> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> 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: 1218463730 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.2355 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17469 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 Wed, Jul 23, 2008 at 10:41:09AM +1000, Dave Chinner wrote: > The list of all inodes on a mount is superfluous. We can traverse > all inodes now by walking the per-AG inode radix trees without > needing a separate list. This enables us to remove a bunch of > complex list traversal code and remove another two pointers from > the xfs_inode. > > Also, by replacing the sync traversal with an ascending inode > number traversal, we will issue better inode I/O patterns for > writeback triggered by xfssyncd or unmount. Any plans to send an updated version for the current tree and including the xfsidbg fixups? From owner-xfs@oss.sgi.com Mon Aug 11 09:38:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 09:38:51 -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 m7BGcLkB024791 for ; Mon, 11 Aug 2008 09:38:23 -0700 X-ASG-Debug-ID: 1218472777-293f00c50000-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 95AC0381BB4 for ; Mon, 11 Aug 2008 09:39:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id CkfskiuL5EB7HDx0 for ; Mon, 11 Aug 2008 09:39:37 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KSaQj-0005tF-JM; Mon, 11 Aug 2008 16:39:37 +0000 Date: Mon, 11 Aug 2008 12:39:37 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080811163937.GA13472@infradead.org> References: <1216558002-838-1-git-send-email-david@fromorbit.com> <20080721075449.GB6692@infradead.org> <20080721110814.GC6761@disturbed> <20080721115228.GA14077@infradead.org> <20080721120440.GE6761@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721120440.GE6761@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: 1218472778 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: 1.77 X-Barracuda-Spam-Status: No, SCORE=1.77 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RATWARE_EFROM X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2364 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 3.79 RATWARE_EFROM Bulk email fingerprint (envfrom) found X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17470 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 Mon, Jul 21, 2008 at 10:04:40PM +1000, Dave Chinner wrote: > > Indeed. The patch looks good but a little description like the one above > > in the commit message would be nice. > > Updated patch below. Missing the needed xfsidbg changes. Updated version below: Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-08-11 13:02:32.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-08-11 13:36:50.000000000 -0300 @@ -230,7 +230,6 @@ typedef struct xfs_inode { unsigned short i_flags; /* see defined flags below */ unsigned char i_update_core; /* timestamps/size is dirty */ unsigned char i_update_size; /* di_size field is dirty */ - unsigned int i_gen; /* generation count */ unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ Index: linux-2.6-xfs/fs/xfs/xfs_rename.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2008-08-11 13:02:32.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2008-08-11 13:36:50.000000000 -0300 @@ -367,19 +367,11 @@ xfs_rename( &first_block, &free_list, spaceres); if (error) goto abort_return; - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Update the generation counts on all the directory inodes - * that we're modifying. - */ - src_dp->i_gen++; + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE); - - if (new_parent) { - target_dp->i_gen++; + if (new_parent) xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE); - } /* * If this is a synchronous mount, make sure that the Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-08-11 13:02:32.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-08-11 13:36:50.000000000 -0300 @@ -1625,8 +1625,6 @@ xfs_create( xfs_trans_set_sync(tp); } - dp->i_gen++; - /* * Attach the dquot(s) to the inodes and modify them incore. * These ids of the inode couldn't have changed since the new @@ -1985,13 +1983,6 @@ xfs_remove( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory generation count on the parent - * directory so that other can know that it has changed. - */ - dp->i_gen++; - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); - if (is_dir) { /* * Drop the link from ip's "..". @@ -2009,8 +2000,8 @@ xfs_remove( } else { /* * When removing a non-directory we need to log the parent - * inode here for the i_gen update. For a directory this is - * done implicitly by the xfs_droplink call for the ".." entry. + * inode here. For a directory this is done implicitly + * by the xfs_droplink call for the ".." entry. */ xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); } @@ -2170,7 +2161,6 @@ xfs_link( if (error) goto abort_return; xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - tdp->i_gen++; xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); error = xfs_bumplink(tp, sip); @@ -2347,18 +2337,10 @@ xfs_mkdir( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - error = xfs_dir_init(tp, cdp, dp); if (error) goto error2; - cdp->i_gen = 1; error = xfs_bumplink(tp, dp); if (error) goto error2; @@ -2645,13 +2627,6 @@ xfs_symlink( xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - - /* * If this is a synchronous mount, make sure that the * symlink transaction goes to disk before returning to * the user. Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-08-11 13:02:32.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-08-11 13:36:50.000000000 -0300 @@ -3633,7 +3633,6 @@ xfs_prdinode_incore(xfs_icdinode_t *dip) xfs_fmtformat((xfs_dinode_fmt_t)dip->di_aformat), dip->di_dmevmask, dip->di_dmstate); printflags(dip->di_flags, diflags, "flags"); - kdb_printf("gen 0x%x\n", dip->di_gen); } #ifdef XFS_RW_TRACE @@ -6385,11 +6384,8 @@ xfsidbg_xnode(xfs_inode_t *ip) kdb_printf("\n"); kdb_printf("update_core %d update size %d\n", (int)(ip->i_update_core), (int) ip->i_update_size); - kdb_printf("gen 0x%x delayed blks %d", - ip->i_gen, - ip->i_delayed_blks); - kdb_printf("size %lld\n", - ip->i_size); + kdb_printf("delayed blks %d size %lld\n", + ip->i_delayed_blks, ip->i_size); #ifdef XFS_INODE_TRACE qprintf(" trace 0x%p\n", ip->i_trace); From owner-xfs@oss.sgi.com Mon Aug 11 12:30:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 12:30:53 -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,J_CHICKENPOX_47 autolearn=no 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 m7BJUfau006120 for ; Mon, 11 Aug 2008 12:30:43 -0700 X-ASG-Debug-ID: 1218483109-2b7d01de0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1405E3828F9 for ; Mon, 11 Aug 2008 12:31:49 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id 8y1g5cHpZ9xlGVVa for ; Mon, 11 Aug 2008 12:31:49 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7BJVmck005937; Mon, 11 Aug 2008 12:31:48 -0700 Message-ID: <48A093A7.40606@tlinx.org> Date: Mon, 11 Aug 2008 12:31:51 -0700 From: Linda Walsh User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: LKML , xfs-oss X-ASG-Orig-Subj: Lock debugging noise or real problem? Subject: Lock debugging noise or real problem? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218483113 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2371 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17471 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs On July 24, I upgraded my kernel from 2.6.24.2 (uptimes in months) to 2.6.26 and haven't had a real stable system since. I've built & tried the intermediate 2.6.25.12 but it didn't seem to be more stable. I also turned on lock correctness -- since the crashes have involved the machine hanging with no output to indicate what's going on -- though one time I noticed a HANG CHECK timer go off -- but that only happened once -- and it didn't hang at that point (did hours later, but don't know if related). I had my warning log split out from the other messages, so it may be hiding something useful from one of the other logs, but there is a bunch of "noise" relating to locking and program crashing recorded in the log. I interspersed the boot messages in the log so I could try to determine a pattern. There are a few other weird messages, but none consistent -- clocksource unstable (which also saw when I got the TIMER HANG CHECK), squid's restart messages seem to be going into 'warn' as well as occasional warnings about it taking a long time to respond... I don't think theya re related, but they are a bit odd at times... Most of these seem to be related to XFS related problems -- but I'm not sure how many of the messages are red-herrings. A few of the XFS messages around the 8th or 9th got serious as two or three partitions were unable to be mounted -- xfs couldn't mount or recover them automatically, and I had to run xfs_repair and throw away the log (-L). I should note that some automatic operations occur in the 2-3am hours -- cron.dailies seem go go off in that time frame, and system backup jobs start at 2:30 -- so some of the errors happen during disk-using processes like xfs_fsr and xfs_dump. I have smartd running on all the disks, a few of the disks...are spouting random noise but no hard errors. /dev/hde is where "/home" dirs are located. /dev/hdf also gave some errors -- but its one of the newer disks and is a second-volume that's used to store backups (only spins up during backups or restoring)... Is there anyway to eliminate the red-herring disk errors in XFS? They are really helping obscure what are real messages and what are not...(presuming any are not...(?))... This is a trimmed version of my Warn log (with boot indicators) since the problems started. I'm also unsure why some user-level processes seem to be dumping trace-backs periodically, including: cifsopslock xfs_fsr (a few) sort imaps (a few) mount (several) --- the mount dumps might be related to the xfs problems caused by the previous hard hang... Any hints at how to help narrow this down would be helpeful.... There could be more than one problem, since going back to my previouos stable kernel (2.6.24.2) still resulted in a crash, though not as quickly... I wish the darn hangs would leave more traces! Console locked up...no output no key input...just wedged (no pings...etc)... Thanks much for any help... These are all "Vanilla" kernels configged for the specific hardware of the machine (a 2xP-III) and cross compiled on an x86_64 machine. tnx, -linda boot-080417.1055:<5>Linux version 2.6.24.2-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #5 SMP Fri Feb 15 17:55:46 PST 2008 boot-080606.0751:<5>Linux version 2.6.24.2-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #5 SMP Fri Feb 15 17:55:46 PST 2008 boot-080723.1515:<5>Linux version 2.6.24.2-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #5 SMP Fri Feb 15 17:55:46 PST 2008 boot-080724.1832:<5>Linux version 2.6.26-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Tue Jul 22 11:29:39 PDT 2008 boot-080725.0823:<5>Linux version 2.6.26-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Tue Jul 22 11:29:39 PDT 2008 --- Jul 25 18:21:28 kern: Clocksource tsc unstable (delta = 571817442154 ns) Jul 25 18:21:28 kern: Modules linked in: uhci_hcd Jul 25 18:21:28 kern: Jul 25 18:21:28 kern: Pid: 183, comm: cifsoplockd Not tainted (2.6.26-ish #2) Jul 25 18:21:28 kern: EIP: 0060:[] EFLAGS: 00000286 CPU: 1 Jul 25 18:21:28 kern: EIP is at _spin_unlock_irqrestore+0x7/0x10 Jul 25 18:21:28 kern: EAX: b05a8d00 EBX: efb13f54 ECX: b05a8d00 EDX: 00000286 Jul 25 18:21:28 kern: ESI: 00000000 EDI: b01eaa90 EBP: efb13f24 ESP: efb13f24 Jul 25 18:21:28 kern: DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Jul 25 18:21:28 kern: CR0: 8005003b CR2: a7a2c000 CR3: 37c10000 CR4: 000006d0 Jul 25 18:21:28 kern: DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 Jul 25 18:21:28 kern: DR6: ffff0ff0 DR7: 00000400 Jul 25 18:21:28 kern: [] try_to_del_timer_sync+0x4a/0x60 Jul 25 18:21:28 kern: [] del_timer_sync+0x11/0x20 Jul 25 18:21:28 kern: [] schedule_timeout+0x4f/0xc0 Jul 25 18:21:28 kern: [] ? process_timeout+0x0/0x10 Jul 25 18:21:28 kern: [] ? schedule_timeout+0x43/0xc0 Jul 25 18:21:28 kern: [] cifs_oplock_thread+0x15e/0x230 Jul 25 18:21:28 kern: [] ? complete+0x46/0x60 Jul 25 18:21:28 kern: [] ? cifs_oplock_thread+0x0/0x230 Jul 25 18:21:28 kern: [] kthread+0x42/0x70 Jul 25 18:21:28 kern: [] ? kthread+0x0/0x70 Jul 25 18:21:28 kern: [] kernel_thread_helper+0x7/0x18 Jul 25 18:21:28 kern: ======================= --- boot-080726.2021:<5>Linux version 2.6.26-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Tue Jul 22 11:29:39 PDT 2008 --- Jul 27 03:21:30 Ish squid[2124]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Jul 28 02:10:38 kern: Jul 28 02:10:38 kern: ======================================================= Jul 28 02:10:38 kern: [ INFO: possible circular locking dependency detected ] Jul 28 02:10:38 kern: 2.6.24.2-ish #5 Jul 28 02:10:38 kern: ------------------------------------------------------- Jul 28 02:10:38 kern: xfs_fsr/17758 is trying to acquire lock: Jul 28 02:10:38 kern: (&(&ip->i_lock)->mr_lock/2){----}, at: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:38 kern: Jul 28 02:10:38 kern: but task is already holding lock: Jul 28 02:10:38 kern: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:38 kern: Jul 28 02:10:38 kern: which lock already depends on the new lock. Jul 28 02:10:38 kern: Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: the existing dependency chain (in reverse order) is: Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: -> #1 (&(&ip->i_iolock)->mr_lock/3){--..}: Jul 28 02:10:39 kern: [] __lock_acquire+0xc0b/0x10b0 Jul 28 02:10:39 kern: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: [] lock_acquire+0x61/0x80 Jul 28 02:10:39 kern: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: [] down_write_nested+0x38/0x60 Jul 28 02:10:39 kern: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: [] xfs_lock_inodes+0x112/0x160 Jul 28 02:10:39 kern: [] xfs_swap_extents+0x96/0x5c0 Jul 28 02:10:39 kern: [] trace_hardirqs_on+0xaf/0x160 Jul 28 02:10:39 kern: [] __lock_acquire+0x52c/0x10b0 Jul 28 02:10:39 kern: [] __vn_revalidate+0x47/0x80 Jul 28 02:10:39 kern: [] xfs_swapext+0x13b/0x160 Jul 28 02:10:39 kern: [] xfs_ioctl+0x521/0x750 Jul 28 02:10:39 kern: [] trace_hardirqs_on+0xaf/0x160 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x30/0x70 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x0/0x70 Jul 28 02:10:39 kern: [] do_ioctl+0x2b/0x90 Jul 28 02:10:39 kern: [] vfs_ioctl+0x231/0x2b0 Jul 28 02:10:39 kern: [] sys_ioctl+0x3d/0x70 Jul 28 02:10:39 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 28 02:10:39 kern: [] 0xffffffff Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: -> #0 (&(&ip->i_lock)->mr_lock/2){----}: Jul 28 02:10:39 kern: [] print_circular_bug_entry+0x40/0x50 Jul 28 02:10:39 kern: [] __lock_acquire+0xa2d/0x10b0 Jul 28 02:10:39 kern: [] lock_acquire+0x61/0x80 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] down_write_nested+0x38/0x60 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] xfs_lock_inodes+0x112/0x160 Jul 28 02:10:39 kern: [] xfs_swap_extents+0x358/0x5c0 Jul 28 02:10:39 kern: [] __vn_revalidate+0x47/0x80 Jul 28 02:10:39 kern: [] xfs_swapext+0x13b/0x160 Jul 28 02:10:39 kern: [] xfs_ioctl+0x521/0x750 Jul 28 02:10:39 kern: [] trace_hardirqs_on+0xaf/0x160 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x30/0x70 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x0/0x70 Jul 28 02:10:39 kern: [] do_ioctl+0x2b/0x90 Jul 28 02:10:39 kern: [] vfs_ioctl+0x231/0x2b0 Jul 28 02:10:39 kern: [] sys_ioctl+0x3d/0x70 Jul 28 02:10:39 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 28 02:10:39 kern: [] 0xffffffff Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: other info that might help us debug this: Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: 2 locks held by xfs_fsr/17758: Jul 28 02:10:39 kern: #0: (&(&ip->i_iolock)->mr_lock/2){--..}, at: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: #1: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: stack backtrace: Jul 28 02:10:39 kern: Pid: 17758, comm: xfs_fsr Not tainted 2.6.24.2-ish #5 Jul 28 02:10:39 kern: [] print_circular_bug_tail+0x7a/0x90 Jul 28 02:10:39 kern: [] __lock_acquire+0xa2d/0x10b0 Jul 28 02:10:39 kern: [] lock_acquire+0x61/0x80 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] down_write_nested+0x38/0x60 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] xfs_ilock+0x6d/0xb0 Jul 28 02:10:39 kern: [] xfs_lock_inodes+0x112/0x160 Jul 28 02:10:39 kern: [] xfs_swap_extents+0x358/0x5c0 Jul 28 02:10:39 kern: [] __vn_revalidate+0x47/0x80 Jul 28 02:10:39 kern: [] xfs_swapext+0x13b/0x160 Jul 28 02:10:39 kern: [] xfs_ioctl+0x521/0x750 Jul 28 02:10:39 kern: [] trace_hardirqs_on+0xaf/0x160 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x30/0x70 Jul 28 02:10:39 kern: [] xfs_file_ioctl_invis+0x0/0x70 Jul 28 02:10:39 kern: [] do_ioctl+0x2b/0x90 Jul 28 02:10:39 kern: [] vfs_ioctl+0x231/0x2b0 Jul 28 02:10:39 kern: [] sys_ioctl+0x3d/0x70 Jul 28 02:10:39 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 28 02:10:39 kern: ======================= --- boot-080728.0555:<5>Linux version 2.6.24.2-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #5 SMP Fri Feb 15 17:55:46 PST 2008 --- Jul 28 07:18:52 Ish squid[2124]: WARNING: Median response time is 41553 milliseconds Jul 28 12:53:55 Ish xinetd[1949]: Exiting... Jul 28 12:53:55 Ish apcupsd[1915]: apcupsd exiting, signal 15 Jul 28 12:53:56 Ish apcupsd[1915]: apcupsd shutdown succeeded Jul 28 12:56:15 Ish squid[2184]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Jul 28 16:55:20 Ish squid[2184]: WARNING: Median response time is 79423 milliseconds Jul 28 16:56:20 Ish squid[2184]: WARNING: Median response time is 79423 milliseconds Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: ======================================================= Jul 29 02:07:29 kern: [ INFO: possible circular locking dependency detected ] Jul 29 02:07:29 kern: 2.6.25.12-ish #2 Jul 29 02:07:29 kern: ------------------------------------------------------- Jul 29 02:07:29 kern: imapds/26747 is trying to acquire lock: Jul 29 02:07:29 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: but task is already holding lock: Jul 29 02:07:29 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: which lock already depends on the new lock. Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: the existing dependency chain (in reverse order) is: Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Jul 29 02:07:29 kern: [] __lock_acquire+0xb3d/0xf90 Jul 29 02:07:29 kern: [] lock_acquire+0x60/0x80 Jul 29 02:07:29 kern: [] down_write_nested+0x46/0x70 Jul 29 02:07:29 kern: [] xfs_ilock+0x97/0xb0 Jul 29 02:07:29 kern: [] xfs_ireclaim+0x30/0x70 Jul 29 02:07:29 kern: [] xfs_finish_reclaim+0x4f/0x180 Jul 29 02:07:29 kern: [] xfs_reclaim+0xe7/0xf0 Jul 29 02:07:29 kern: [] xfs_fs_clear_inode+0xa8/0xe0 Jul 29 02:07:29 kern: [] clear_inode+0x79/0x100 Jul 29 02:07:29 kern: [] dispose_list+0x27/0xf0 Jul 29 02:07:29 kern: [] shrink_icache_memory+0x182/0x250 Jul 29 02:07:29 kern: [] shrink_slab+0x10b/0x170 Jul 29 02:07:29 kern: [] kswapd+0x2ee/0x460 Jul 29 02:07:29 kern: [] kthread+0x42/0x70 Jul 29 02:07:29 kern: [] kernel_thread_helper+0x7/0x10 Jul 29 02:07:29 kern: [] 0xffffffff Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: -> #0 (iprune_mutex){--..}: Jul 29 02:07:29 kern: [] __lock_acquire+0x967/0xf90 Jul 29 02:07:29 kern: [] lock_acquire+0x60/0x80 Jul 29 02:07:29 kern: [] mutex_lock_nested+0x9d/0x270 Jul 29 02:07:29 kern: [] shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: [] shrink_slab+0x10b/0x170 Jul 29 02:07:29 kern: [] try_to_free_pages+0x14e/0x210 Jul 29 02:07:29 kern: [] __alloc_pages+0x138/0x350 Jul 29 02:07:29 kern: [] __do_page_cache_readahead+0x13b/0x240 Jul 29 02:07:29 kern: [] ondemand_readahead+0xc1/0x180 Jul 29 02:07:29 kern: [] page_cache_async_readahead+0x62/0x80 Jul 29 02:07:29 kern: [] generic_file_aio_read+0x28c/0x5c0 Jul 29 02:07:29 kern: [] xfs_read+0x133/0x2b0 Jul 29 02:07:29 kern: [] xfs_file_aio_read+0x5c/0x70 Jul 29 02:07:29 kern: [] do_sync_read+0xcd/0x110 Jul 29 02:07:29 kern: [] vfs_read+0x94/0x130 Jul 29 02:07:29 kern: [] sys_read+0x3d/0x70 Jul 29 02:07:29 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:07:29 kern: [] 0xffffffff Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: other info that might help us debug this: Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: 2 locks held by imapds/26747: Jul 29 02:07:29 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 29 02:07:29 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 Jul 29 02:07:29 kern: Jul 29 02:07:29 kern: stack backtrace: Jul 29 02:07:29 kern: Pid: 26747, comm: imapds Not tainted 2.6.25.12-ish #2 Jul 29 02:07:29 kern: [] print_circular_bug_tail+0x6f/0x80 Jul 29 02:07:29 kern: [] __lock_acquire+0x967/0xf90 Jul 29 02:07:29 kern: [] ? cfq_add_rq_rb+0x61/0x90 Jul 29 02:07:29 kern: [] ? __lock_acquire+0x14c/0xf90 Jul 29 02:07:29 kern: [] lock_acquire+0x60/0x80 Jul 29 02:07:29 kern: [] ? shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: [] mutex_lock_nested+0x9d/0x270 Jul 29 02:07:29 kern: [] ? shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: [] ? shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: [] shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: [] shrink_slab+0x10b/0x170 Jul 29 02:07:29 kern: [] try_to_free_pages+0x14e/0x210 Jul 29 02:07:29 kern: [] ? isolate_pages_global+0x0/0x60 Jul 29 02:07:29 kern: [] __alloc_pages+0x138/0x350 Jul 29 02:07:29 kern: [] ? __lock_acquire+0x4bd/0xf90 Jul 29 02:07:29 kern: [] __do_page_cache_readahead+0x13b/0x240 Jul 29 02:07:29 kern: [] ? __do_page_cache_readahead+0xad/0x240 Jul 29 02:07:29 kern: [] ondemand_readahead+0xc1/0x180 Jul 29 02:07:29 kern: [] page_cache_async_readahead+0x62/0x80 Jul 29 02:07:29 kern: [] generic_file_aio_read+0x28c/0x5c0 Jul 29 02:07:29 kern: [] ? down_read_nested+0x46/0x60 Jul 29 02:07:29 kern: [] xfs_read+0x133/0x2b0 Jul 29 02:07:29 kern: [] xfs_file_aio_read+0x5c/0x70 Jul 29 02:07:29 kern: [] do_sync_read+0xcd/0x110 Jul 29 02:07:29 kern: [] ? autoremove_wake_function+0x0/0x40 Jul 29 02:07:29 kern: [] ? trace_hardirqs_on+0xa0/0x120 Jul 29 02:07:29 kern: [] ? mutex_unlock+0x8/0x10 Jul 29 02:07:29 kern: [] vfs_read+0x94/0x130 Jul 29 02:07:29 kern: [] ? vfs_llseek+0x3c/0x50 Jul 29 02:07:29 kern: [] ? do_sync_read+0x0/0x110 Jul 29 02:07:29 kern: [] sys_read+0x3d/0x70 Jul 29 02:07:29 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:07:29 kern: ======================= Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d9bc3b28 00200046 db454000 c06a4180 c06a4180 c06a4180 00000001 00000002 Jul 29 02:45:59 kern: 7ffc6e9b 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 db454000 db454248 Jul 29 02:45:59 kern: c181a180 00000001 d9bc2000 e307f900 00000000 00000004 00000000 00200046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_ialloc_read_agi+0x7a/0x130 Jul 29 02:45:59 kern: [] xfs_ialloc_ag_select+0x1ef/0x2f0 Jul 29 02:45:59 kern: [] ? ip_output+0x45/0x50 Jul 29 02:45:59 kern: [] xfs_dialloc+0x2d4/0x860 Jul 29 02:45:59 kern: [] ? xfs_iext_bno_to_ext+0x99/0x1a0 Jul 29 02:45:59 kern: [] ? xfs_bmap_search_multi_extents+0x6f/0xf0 Jul 29 02:45:59 kern: [] xfs_ialloc+0x56/0x5b0 Jul 29 02:45:59 kern: [] ? xlog_grant_log_space+0x227/0x260 Jul 29 02:45:59 kern: [] xfs_dir_ialloc+0x6c/0x2a0 Jul 29 02:45:59 kern: [] ? down_write_nested+0x46/0x70 Jul 29 02:45:59 kern: [] ? xfs_ilock+0x6e/0xb0 Jul 29 02:45:59 kern: [] xfs_create+0x2ba/0x460 Jul 29 02:45:59 kern: [] xfs_vn_mknod+0x17f/0x2c0 Jul 29 02:45:59 kern: [] ? xfs_vn_create+0x0/0x20 Jul 29 02:45:59 kern: [] xfs_vn_create+0x12/0x20 Jul 29 02:45:59 kern: [] vfs_create+0x83/0xc0 Jul 29 02:45:59 kern: [] open_namei+0x55f/0x680 Jul 29 02:45:59 kern: [] ? vfs_lstat_fd+0x1e/0x50 Jul 29 02:45:59 kern: [] do_filp_open+0x2c/0x50 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] ? get_unused_fd_flags+0xb5/0xd0 Jul 29 02:45:59 kern: [] do_sys_open+0x49/0xe0 Jul 29 02:45:59 kern: [] sys_open+0x29/0x40 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: db43de6c 00200046 db43de44 db43df14 f2831015 00000002 00000001 00000000 Jul 29 02:45:59 kern: 7ffc91db 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d23b8000 d23b8248 Jul 29 02:45:59 kern: c181a180 00000001 db43c000 f7666480 f2831000 00000004 00000000 f7aef0c0 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] mutex_lock_nested+0xf2/0x270 Jul 29 02:45:59 kern: [] ? open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] ? open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] ? vfs_lstat_fd+0x1e/0x50 Jul 29 02:45:59 kern: [] do_filp_open+0x2c/0x50 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] ? get_unused_fd_flags+0xb5/0xd0 Jul 29 02:45:59 kern: [] do_sys_open+0x49/0xe0 Jul 29 02:45:59 kern: [] sys_open+0x29/0x40 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d9bc3b28 00200046 db454000 c06a4180 c06a4180 c06a4180 00000001 00000002 Jul 29 02:45:59 kern: 7ffc6e9b 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 db454000 db454248 Jul 29 02:45:59 kern: c181a180 00000001 d9bc2000 e307f900 00000000 00000004 00000000 00200046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_ialloc_read_agi+0x7a/0x130 Jul 29 02:45:59 kern: [] xfs_ialloc_ag_select+0x1ef/0x2f0 Jul 29 02:45:59 kern: [] ? ip_output+0x45/0x50 Jul 29 02:45:59 kern: [] xfs_dialloc+0x2d4/0x860 Jul 29 02:45:59 kern: [] ? xfs_iext_bno_to_ext+0x99/0x1a0 Jul 29 02:45:59 kern: [] ? xfs_bmap_search_multi_extents+0x6f/0xf0 Jul 29 02:45:59 kern: [] xfs_ialloc+0x56/0x5b0 Jul 29 02:45:59 kern: [] ? xlog_grant_log_space+0x227/0x260 Jul 29 02:45:59 kern: [] xfs_dir_ialloc+0x6c/0x2a0 Jul 29 02:45:59 kern: [] ? down_write_nested+0x46/0x70 Jul 29 02:45:59 kern: [] ? xfs_ilock+0x6e/0xb0 Jul 29 02:45:59 kern: [] xfs_create+0x2ba/0x460 Jul 29 02:45:59 kern: [] xfs_vn_mknod+0x17f/0x2c0 Jul 29 02:45:59 kern: [] ? xfs_vn_create+0x0/0x20 Jul 29 02:45:59 kern: [] xfs_vn_create+0x12/0x20 Jul 29 02:45:59 kern: [] vfs_create+0x83/0xc0 Jul 29 02:45:59 kern: [] open_namei+0x55f/0x680 Jul 29 02:45:59 kern: [] ? vfs_lstat_fd+0x1e/0x50 Jul 29 02:45:59 kern: [] do_filp_open+0x2c/0x50 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] ? get_unused_fd_flags+0xb5/0xd0 Jul 29 02:45:59 kern: [] do_sys_open+0x49/0xe0 Jul 29 02:45:59 kern: [] sys_open+0x29/0x40 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: db43de6c 00200046 db43de44 db43df14 f2831015 00000002 00000001 00000000 Jul 29 02:45:59 kern: 7ffc91db 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d23b8000 d23b8248 Jul 29 02:45:59 kern: c181a180 00000001 db43c000 f7666480 f2831000 00000004 00000000 f7aef0c0 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] mutex_lock_nested+0xf2/0x270 Jul 29 02:45:59 kern: [] ? open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] ? open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] open_namei+0xf0/0x680 Jul 29 02:45:59 kern: [] ? vfs_lstat_fd+0x1e/0x50 Jul 29 02:45:59 kern: [] do_filp_open+0x2c/0x50 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] ? get_unused_fd_flags+0xb5/0xd0 Jul 29 02:45:59 kern: [] do_sys_open+0x49/0xe0 Jul 29 02:45:59 kern: [] sys_open+0x29/0x40 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: d22edd64 00000046 d2280000 d22edd40 c04d821c 00000002 00000001 00000002 Jul 29 02:45:59 kern: 80046ee9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 d2280000 d2280248 Jul 29 02:45:59 kern: c181a180 00000001 d22ec000 e307f240 00000000 00000000 00000000 00000046 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? tcp_transmit_skb+0x3fc/0x770 Jul 29 02:45:59 kern: [] __down+0x88/0xf0 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] __down_failed+0xa/0x10 Jul 29 02:45:59 kern: [] ? generic_unplug_device+0x23/0x30 Jul 29 02:45:59 kern: [] xfs_buf_lock+0x4c/0x50 Jul 29 02:45:59 kern: [] _xfs_buf_find+0xfc/0x1f0 Jul 29 02:45:59 kern: [] ? kmem_zone_alloc+0x55/0xb0 Jul 29 02:45:59 kern: [] xfs_buf_get_flags+0x58/0x140 Jul 29 02:45:59 kern: [] xfs_buf_read_flags+0x1d/0x90 Jul 29 02:45:59 kern: [] xfs_trans_read_buf+0x224/0x340 Jul 29 02:45:59 kern: [] xfs_iunlink+0x9e/0x210 Jul 29 02:45:59 kern: [] ? xfs_trans_log_inode+0x1f/0x50 Jul 29 02:45:59 kern: [] xfs_droplink+0x4e/0x60 Jul 29 02:45:59 kern: [] xfs_remove+0x28e/0x3a0 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] xfs_vn_unlink+0x21/0x50 Jul 29 02:45:59 kern: [] ? xfs_vn_unlink+0x0/0x50 Jul 29 02:45:59 kern: [] vfs_unlink+0x6a/0xd0 Jul 29 02:45:59 kern: [] do_unlinkat+0xc1/0x150 Jul 29 02:45:59 kern: [] sys_unlink+0x10/0x20 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 kern: f6763df8 00200046 00000001 c1811180 00e557a4 00000000 00000001 f7c5a000 Jul 29 02:45:59 kern: 7ffbeeb9 00002e4a c06a0fa0 c06a4180 c06a4180 c06a4180 f65ac000 f65ac248 Jul 29 02:45:59 kern: c181a180 00000001 f6762000 f669dd80 f6763e94 00000002 00000000 00000000 Jul 29 02:45:59 kern: Call Trace: Jul 29 02:45:59 kern: [] ? default_wake_function+0xb/0x10 Jul 29 02:45:59 kern: [] schedule_timeout+0x75/0xc0 Jul 29 02:45:59 kern: [] wait_for_common+0x88/0x150 Jul 29 02:45:59 kern: [] ? default_wake_function+0x0/0x10 Jul 29 02:45:59 kern: [] wait_for_completion+0x12/0x20 Jul 29 02:45:59 kern: [] call_usermodehelper_exec+0x9d/0xb0 Jul 29 02:45:59 kern: [] ? call_usermodehelper_setup+0x4a/0x80 Jul 29 02:45:59 kern: [] request_module+0x98/0xe0 Jul 29 02:45:59 kern: [] ? _spin_unlock+0x1d/0x20 Jul 29 02:45:59 kern: [] __sock_create+0x1af/0x1e0 Jul 29 02:45:59 kern: [] sock_create+0x3a/0x50 Jul 29 02:45:59 kern: [] sys_socket+0x1b/0x50 Jul 29 02:45:59 kern: [] sys_socketcall+0x24f/0x260 Jul 29 02:45:59 kern: [] ? sysenter_past_esp+0x9a/0xa5 Jul 29 02:45:59 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 29 02:45:59 kern: ======================= Jul 29 02:45:59 kern: INFO: lockdep is turned off. Jul 29 02:45:59 Ish sendmail[23107]: m6T9jxUp023107: collect: premature EOM: unexpected close Jul 29 06:25:53 kern: Clocksource tsc unstable (delta = -90402575 ns) Jul 29 16:38:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:39:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:40:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:41:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:42:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:43:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds Jul 29 16:44:05 Ish squid[2184]: WARNING: Median response time is 83828 milliseconds --- boot-080729.1937:<5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Jul 30 02:37:59 Ish squid[2255]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Jul 30 07:39:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:40:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:41:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:42:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:43:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:44:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:45:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 07:46:05 Ish squid[2255]: WARNING: Median response time is 43858 milliseconds Jul 30 16:51:15 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds Jul 30 16:52:15 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds Jul 30 16:53:15 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds Jul 30 16:54:15 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds Jul 30 16:55:15 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: ======================================================= Jul 31 02:13:19 kern: [ INFO: possible circular locking dependency detected ] Jul 31 02:13:19 kern: 2.6.25.12-ish #2 Jul 31 02:13:19 kern: ------------------------------------------------------- Jul 31 02:13:19 kern: xfs_fsr/12232 is trying to acquire lock: Jul 31 02:13:19 kern: (&mm->mmap_sem){----}, at: [] dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: but task is already holding lock: Jul 31 02:13:19 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: which lock already depends on the new lock. Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: the existing dependency chain (in reverse order) is: Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Jul 31 02:13:19 kern: [] __lock_acquire+0xb3d/0xf90 Jul 31 02:13:19 kern: [] lock_acquire+0x60/0x80 Jul 31 02:13:19 kern: [] down_write_nested+0x46/0x70 Jul 31 02:13:19 kern: [] xfs_ilock+0x97/0xb0 Jul 31 02:13:19 kern: [] xfs_free_eofblocks+0x211/0x2b0 Jul 31 02:13:19 kern: [] xfs_release+0x1ad/0x200 Jul 31 02:13:19 kern: [] xfs_file_release+0xe/0x20 Jul 31 02:13:19 kern: [] __fput+0xbb/0x180 Jul 31 02:13:19 kern: [] fput+0x19/0x20 Jul 31 02:13:19 kern: [] remove_vma+0x3c/0x50 Jul 31 02:13:19 kern: [] do_munmap+0x18c/0x1f0 Jul 31 02:13:19 kern: [] sys_munmap+0x30/0x50 Jul 31 02:13:19 kern: [] syscall_call+0x7/0xb Jul 31 02:13:19 kern: [] 0xffffffff Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: -> #0 (&mm->mmap_sem){----}: Jul 31 02:13:19 kern: [] __lock_acquire+0x967/0xf90 Jul 31 02:13:19 kern: [] lock_acquire+0x60/0x80 Jul 31 02:13:19 kern: [] down_read+0x3f/0x60 Jul 31 02:13:19 kern: [] dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: [] __blockdev_direct_IO+0x404/0xd00 Jul 31 02:13:19 kern: [] xfs_vm_direct_IO+0xfc/0x110 Jul 31 02:13:19 kern: [] generic_file_direct_IO+0xba/0x150 Jul 31 02:13:19 kern: [] generic_file_direct_write+0x59/0x160 Jul 31 02:13:19 kern: [] xfs_write+0x331/0x7f0 Jul 31 02:13:19 kern: [] xfs_file_aio_write+0x5e/0x70 Jul 31 02:13:19 kern: [] do_sync_write+0xcd/0x110 Jul 31 02:13:19 kern: [] vfs_write+0x96/0x130 Jul 31 02:13:19 kern: [] sys_write+0x3d/0x70 Jul 31 02:13:19 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 31 02:13:19 kern: [] 0xffffffff Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: other info that might help us debug this: Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: 1 lock held by xfs_fsr/12232: Jul 31 02:13:19 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 31 02:13:19 kern: Jul 31 02:13:19 kern: stack backtrace: Jul 31 02:13:19 kern: Pid: 12232, comm: xfs_fsr Not tainted 2.6.25.12-ish #2 Jul 31 02:13:19 kern: [] print_circular_bug_tail+0x6f/0x80 Jul 31 02:13:19 kern: [] __lock_acquire+0x967/0xf90 Jul 31 02:13:19 kern: [] ? __lock_acquire+0x4bd/0xf90 Jul 31 02:13:19 kern: [] lock_acquire+0x60/0x80 Jul 31 02:13:19 kern: [] ? dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: [] down_read+0x3f/0x60 Jul 31 02:13:19 kern: [] ? dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: [] dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: [] ? __spin_lock_init+0x32/0x60 Jul 31 02:13:19 kern: [] __blockdev_direct_IO+0x404/0xd00 Jul 31 02:13:19 kern: [] ? kmem_cache_alloc+0x8a/0xb0 Jul 31 02:13:19 kern: [] ? trace_hardirqs_on+0xa0/0x120 Jul 31 02:13:19 kern: [] ? __lock_acquire+0x4bd/0xf90 Jul 31 02:13:19 kern: [] xfs_vm_direct_IO+0xfc/0x110 Jul 31 02:13:19 kern: [] ? xfs_get_blocks_direct+0x0/0x30 Jul 31 02:13:19 kern: [] ? xfs_end_io_direct+0x0/0xa0 Jul 31 02:13:19 kern: [] generic_file_direct_IO+0xba/0x150 Jul 31 02:13:19 kern: [] generic_file_direct_write+0x59/0x160 Jul 31 02:13:19 kern: [] xfs_write+0x331/0x7f0 Jul 31 02:13:19 kern: [] xfs_file_aio_write+0x5e/0x70 Jul 31 02:13:19 kern: [] do_sync_write+0xcd/0x110 Jul 31 02:13:19 kern: [] ? autoremove_wake_function+0x0/0x40 Jul 31 02:13:19 kern: [] ? _spin_unlock+0x1d/0x20 Jul 31 02:13:19 kern: [] vfs_write+0x96/0x130 Jul 31 02:13:19 kern: [] ? do_sync_write+0x0/0x110 Jul 31 02:13:19 kern: [] sys_write+0x3d/0x70 Jul 31 02:13:19 kern: [] sysenter_past_esp+0x5f/0xa5 Jul 31 02:13:19 kern: ======================= Jul 31 14:31:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 14:32:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 14:33:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 14:34:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 14:35:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 14:36:39 Ish squid[2255]: WARNING: Median response time is 24218 milliseconds Jul 31 17:20:42 Ish squid[2255]: WARNING: Median response time is 30056 milliseconds --- boot-080731.1934:<5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 1 02:12:57 kern: hde: dma_intr: status=0xd0 { Busy } Aug 1 02:12:57 kern: ide: failed opcode was: unknown Aug 1 02:13:02 kern: hde: dma_intr: status=0xd0 { Busy } Aug 1 02:13:02 kern: ide: failed opcode was: unknown Aug 1 02:13:04 kern: hde: dma_intr: status=0xd0 { Busy } Aug 1 02:13:04 kern: ide: failed opcode was: unknown Aug 1 02:13:47 kern: hdf: dma_timer_expiry: dma status == 0x61 Aug 1 02:13:57 kern: hdf: DMA timeout error Aug 1 02:13:57 kern: hdf: dma timeout error: status=0x3a { DeviceFault SeekComplete DataRequest Index } Aug 1 02:13:57 kern: ide: failed opcode was: unknown Aug 1 02:13:57 kern: pdc202xx_new: Primary channel reset. Aug 1 02:13:57 kern: ide2: reset: success Aug 1 02:17:16 kern: hdf: dma_timer_expiry: dma status == 0x41 Aug 1 02:18:15 kern: hdf: DMA timeout error Aug 1 02:18:15 kern: hdf: dma timeout error: status=0x80 { Busy } Aug 1 02:18:15 kern: ide: failed opcode was: unknown Aug 1 02:18:15 kern: pdc202xx_new: Primary channel reset. Aug 1 02:18:15 kern: Clocksource tsc unstable (delta = 46870588625 ns) Aug 1 02:18:20 kern: ide2: reset: success Aug 1 02:35:04 Ish squid[2190]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... --- boot-080801.1916:<5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 1 17:30:21 Ish squid[2190]: WARNING: Median response time is 63997 milliseconds Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: ======================================================= Aug 2 02:04:51 kern: [ INFO: possible circular locking dependency detected ] Aug 2 02:04:51 kern: 2.6.25.12-ish #2 Aug 2 02:04:51 kern: ------------------------------------------------------- Aug 2 02:04:51 kern: sort/24453 is trying to acquire lock: Aug 2 02:04:51 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: but task is already holding lock: Aug 2 02:04:51 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x97/0xb0 Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: which lock already depends on the new lock. Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: the existing dependency chain (in reverse order) is: Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Aug 2 02:04:51 kern: [] __lock_acquire+0xb3d/0xf90 Aug 2 02:04:51 kern: [] lock_acquire+0x60/0x80 Aug 2 02:04:51 kern: [] down_write_nested+0x46/0x70 Aug 2 02:04:51 kern: [] xfs_ilock+0x97/0xb0 Aug 2 02:04:51 kern: [] xfs_ireclaim+0x30/0x70 Aug 2 02:04:51 kern: [] xfs_finish_reclaim+0x4f/0x180 Aug 2 02:04:51 kern: [] xfs_reclaim+0xe7/0xf0 Aug 2 02:04:51 kern: [] xfs_fs_clear_inode+0xa8/0xe0 Aug 2 02:04:51 kern: [] clear_inode+0x79/0x100 Aug 2 02:04:51 kern: [] dispose_list+0x27/0xf0 Aug 2 02:04:51 kern: [] shrink_icache_memory+0x182/0x250 Aug 2 02:04:51 kern: [] shrink_slab+0x10b/0x170 Aug 2 02:04:51 kern: [] kswapd+0x2ee/0x460 Aug 2 02:04:51 kern: [] kthread+0x42/0x70 Aug 2 02:04:51 kern: [] kernel_thread_helper+0x7/0x10 Aug 2 02:04:51 kern: [] 0xffffffff Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: -> #0 (iprune_mutex){--..}: Aug 2 02:04:51 kern: [] __lock_acquire+0x967/0xf90 Aug 2 02:04:51 kern: [] lock_acquire+0x60/0x80 Aug 2 02:04:51 kern: [] mutex_lock_nested+0x9d/0x270 Aug 2 02:04:51 kern: [] shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: [] shrink_slab+0x10b/0x170 Aug 2 02:04:51 kern: [] try_to_free_pages+0x14e/0x210 Aug 2 02:04:51 kern: [] __alloc_pages+0x138/0x350 Aug 2 02:04:51 kern: [] __grab_cache_page+0x71/0xb0 Aug 2 02:04:51 kern: [] block_write_begin+0x70/0xe0 Aug 2 02:04:51 kern: [] xfs_vm_write_begin+0x43/0x50 Aug 2 02:04:51 kern: [] generic_file_buffered_write+0xf4/0x5b0 Aug 2 02:04:51 kern: [] xfs_write+0x720/0x7f0 Aug 2 02:04:51 kern: [] xfs_file_aio_write+0x5e/0x70 Aug 2 02:04:51 kern: [] do_sync_write+0xcd/0x110 Aug 2 02:04:51 kern: [] vfs_write+0x96/0x130 Aug 2 02:04:51 kern: [] sys_write+0x3d/0x70 Aug 2 02:04:51 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 2 02:04:51 kern: [] 0xffffffff Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: other info that might help us debug this: Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: 3 locks held by sort/24453: Aug 2 02:04:51 kern: #0: (&sb->s_type->i_mutex_key#3){--..}, at: [] xfs_write+0x39f/0x7f0 Aug 2 02:04:51 kern: #1: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x97/0xb0 Aug 2 02:04:51 kern: #2: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 Aug 2 02:04:51 kern: Aug 2 02:04:51 kern: stack backtrace: Aug 2 02:04:51 kern: Pid: 24453, comm: sort Not tainted 2.6.25.12-ish #2 Aug 2 02:04:51 kern: [] print_circular_bug_tail+0x6f/0x80 Aug 2 02:04:51 kern: [] __lock_acquire+0x967/0xf90 Aug 2 02:04:51 kern: [] lock_acquire+0x60/0x80 Aug 2 02:04:51 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: [] mutex_lock_nested+0x9d/0x270 Aug 2 02:04:51 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: [] ? prune_dcache+0x108/0x1a0 Aug 2 02:04:51 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: [] shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: [] shrink_slab+0x10b/0x170 Aug 2 02:04:51 kern: [] try_to_free_pages+0x14e/0x210 Aug 2 02:04:51 kern: [] ? isolate_pages_global+0x0/0x60 Aug 2 02:04:51 kern: [] __alloc_pages+0x138/0x350 Aug 2 02:04:51 kern: [] ? trace_hardirqs_on+0xa0/0x120 Aug 2 02:04:51 kern: [] __grab_cache_page+0x71/0xb0 Aug 2 02:04:51 kern: [] block_write_begin+0x70/0xe0 Aug 2 02:04:51 kern: [] xfs_vm_write_begin+0x43/0x50 Aug 2 02:04:51 kern: [] ? xfs_get_blocks+0x0/0x30 Aug 2 02:04:51 kern: [] generic_file_buffered_write+0xf4/0x5b0 Aug 2 02:04:51 kern: [] ? xfs_ilock+0x6e/0xb0 Aug 2 02:04:51 kern: [] xfs_write+0x720/0x7f0 Aug 2 02:04:51 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 2 02:04:51 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 2 02:04:51 kern: [] xfs_file_aio_write+0x5e/0x70 Aug 2 02:04:51 kern: [] do_sync_write+0xcd/0x110 Aug 2 02:04:51 kern: [] ? autoremove_wake_function+0x0/0x40 Aug 2 02:04:51 kern: [] ? _spin_unlock+0x1d/0x20 Aug 2 02:04:51 kern: [] vfs_write+0x96/0x130 Aug 2 02:04:51 kern: [] ? do_sync_write+0x0/0x110 Aug 2 02:04:51 kern: [] sys_write+0x3d/0x70 Aug 2 02:04:51 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 2 02:04:51 kern: ======================= Aug 2 02:16:50 Ish squid[2243]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: ======================================================= Aug 3 02:11:17 kern: [ INFO: possible circular locking dependency detected ] Aug 3 02:11:17 kern: 2.6.25.12-ish #2 Aug 3 02:11:17 kern: ------------------------------------------------------- Aug 3 02:11:17 kern: xfs_fsr/4455 is trying to acquire lock: Aug 3 02:11:17 kern: (&mm->mmap_sem){----}, at: [] dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: but task is already holding lock: Aug 3 02:11:17 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: which lock already depends on the new lock. Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: the existing dependency chain (in reverse order) is: Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: -> #2 (&(&ip->i_iolock)->mr_lock){----}: Aug 3 02:11:17 kern: [] __lock_acquire+0xb3d/0xf90 Aug 3 02:11:17 kern: [] lock_acquire+0x60/0x80 Aug 3 02:11:17 kern: [] down_write_nested+0x46/0x70 Aug 3 02:11:17 kern: [] xfs_ilock+0x97/0xb0 Aug 3 02:11:17 kern: [] xfs_ireclaim+0x30/0x70 Aug 3 02:11:17 kern: [] xfs_finish_reclaim+0x4f/0x180 Aug 3 02:11:17 kern: [] xfs_reclaim+0xe7/0xf0 Aug 3 02:11:17 kern: [] xfs_fs_clear_inode+0xa8/0xe0 Aug 3 02:11:17 kern: [] clear_inode+0x79/0x100 Aug 3 02:11:17 kern: [] dispose_list+0x27/0xf0 Aug 3 02:11:17 kern: [] shrink_icache_memory+0x182/0x250 Aug 3 02:11:17 kern: [] shrink_slab+0x10b/0x170 Aug 3 02:11:17 kern: [] kswapd+0x2ee/0x460 Aug 3 02:11:17 kern: [] kthread+0x42/0x70 Aug 3 02:11:17 kern: [] kernel_thread_helper+0x7/0x10 Aug 3 02:11:17 kern: [] 0xffffffff Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: -> #1 (iprune_mutex){--..}: Aug 3 02:11:17 kern: [] __lock_acquire+0xb3d/0xf90 Aug 3 02:11:17 kern: [] lock_acquire+0x60/0x80 Aug 3 02:11:17 kern: [] mutex_lock_nested+0x9d/0x270 Aug 3 02:11:17 kern: [] shrink_icache_memory+0x62/0x250 Aug 3 02:11:17 kern: [] shrink_slab+0x10b/0x170 Aug 3 02:11:17 kern: [] try_to_free_pages+0x14e/0x210 Aug 3 02:11:17 kern: [] __alloc_pages+0x138/0x350 Aug 3 02:11:17 kern: [] handle_mm_fault+0x1fd/0x5d0 Aug 3 02:11:17 kern: [] do_page_fault+0x10e/0x650 Aug 3 02:11:17 kern: [] error_code+0x72/0x78 Aug 3 02:11:17 kern: [] 0xffffffff Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: -> #0 (&mm->mmap_sem){----}: Aug 3 02:11:17 kern: [] __lock_acquire+0x967/0xf90 Aug 3 02:11:17 kern: [] lock_acquire+0x60/0x80 Aug 3 02:11:17 kern: [] down_read+0x3f/0x60 Aug 3 02:11:17 kern: [] dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: [] __blockdev_direct_IO+0x404/0xd00 Aug 3 02:11:17 kern: [] xfs_vm_direct_IO+0xfc/0x110 Aug 3 02:11:17 kern: [] generic_file_direct_IO+0xba/0x150 Aug 3 02:11:17 kern: [] generic_file_direct_write+0x59/0x160 Aug 3 02:11:17 kern: [] xfs_write+0x331/0x7f0 Aug 3 02:11:17 kern: [] xfs_file_aio_write+0x5e/0x70 Aug 3 02:11:17 kern: [] do_sync_write+0xcd/0x110 Aug 3 02:11:17 kern: [] vfs_write+0x96/0x130 Aug 3 02:11:17 kern: [] sys_write+0x3d/0x70 Aug 3 02:11:17 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 3 02:11:17 kern: [] 0xffffffff Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: other info that might help us debug this: Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: 1 lock held by xfs_fsr/4455: Aug 3 02:11:17 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 3 02:11:17 kern: Aug 3 02:11:17 kern: stack backtrace: Aug 3 02:11:17 kern: Pid: 4455, comm: xfs_fsr Not tainted 2.6.25.12-ish #2 Aug 3 02:11:17 kern: [] print_circular_bug_tail+0x6f/0x80 Aug 3 02:11:17 kern: [] ? print_circular_bug_entry+0x43/0x50 Aug 3 02:11:17 kern: [] __lock_acquire+0x967/0xf90 Aug 3 02:11:17 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 3 02:11:17 kern: [] lock_acquire+0x60/0x80 Aug 3 02:11:17 kern: [] ? dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: [] down_read+0x3f/0x60 Aug 3 02:11:17 kern: [] ? dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: [] dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: [] ? __spin_lock_init+0x32/0x60 Aug 3 02:11:17 kern: [] __blockdev_direct_IO+0x404/0xd00 Aug 3 02:11:17 kern: [] ? kmem_cache_alloc+0x8a/0xb0 Aug 3 02:11:17 kern: [] ? trace_hardirqs_on+0xa0/0x120 Aug 3 02:11:17 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 3 02:11:17 kern: [] xfs_vm_direct_IO+0xfc/0x110 Aug 3 02:11:17 kern: [] ? xfs_get_blocks_direct+0x0/0x30 Aug 3 02:11:17 kern: [] ? xfs_end_io_direct+0x0/0xa0 Aug 3 02:11:17 kern: [] generic_file_direct_IO+0xba/0x150 Aug 3 02:11:17 kern: [] generic_file_direct_write+0x59/0x160 Aug 3 02:11:17 kern: [] xfs_write+0x331/0x7f0 Aug 3 02:11:17 kern: [] xfs_file_aio_write+0x5e/0x70 Aug 3 02:11:17 kern: [] do_sync_write+0xcd/0x110 Aug 3 02:11:17 kern: [] ? autoremove_wake_function+0x0/0x40 Aug 3 02:11:17 kern: [] ? _spin_unlock+0x1d/0x20 Aug 3 02:11:17 kern: [] vfs_write+0x96/0x130 Aug 3 02:11:17 kern: [] ? do_sync_write+0x0/0x110 Aug 3 02:11:17 kern: [] sys_write+0x3d/0x70 Aug 3 02:11:17 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 3 02:11:17 kern: ======================= Aug 3 18:58:35 Ish squid[2243]: WARNING: Median response time is 83828 milliseconds --- boot-080804.1917:<5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 5 02:17:42 Ish squid[2158]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: ======================================================= Aug 5 02:32:13 kern: [ INFO: possible circular locking dependency detected ] Aug 5 02:32:13 kern: 2.6.25.12-ish #2 Aug 5 02:32:13 kern: ------------------------------------------------------- Aug 5 02:32:13 kern: imapds/2051 is trying to acquire lock: Aug 5 02:32:13 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: but task is already holding lock: Aug 5 02:32:13 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: which lock already depends on the new lock. Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: the existing dependency chain (in reverse order) is: Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Aug 5 02:32:13 kern: [] __lock_acquire+0xb3d/0xf90 Aug 5 02:32:13 kern: [] lock_acquire+0x60/0x80 Aug 5 02:32:13 kern: [] down_write_nested+0x46/0x70 Aug 5 02:32:13 kern: [] xfs_ilock+0x97/0xb0 Aug 5 02:32:13 kern: [] xfs_ireclaim+0x30/0x70 Aug 5 02:32:13 kern: [] xfs_finish_reclaim+0x4f/0x180 Aug 5 02:32:13 kern: [] xfs_reclaim+0xe7/0xf0 Aug 5 02:32:13 kern: [] xfs_fs_clear_inode+0xa8/0xe0 Aug 5 02:32:13 kern: [] clear_inode+0x79/0x100 Aug 5 02:32:13 kern: [] dispose_list+0x27/0xf0 Aug 5 02:32:13 kern: [] shrink_icache_memory+0x182/0x250 Aug 5 02:32:13 kern: [] shrink_slab+0x10b/0x170 Aug 5 02:32:13 kern: [] kswapd+0x2ee/0x460 Aug 5 02:32:13 kern: [] kthread+0x42/0x70 Aug 5 02:32:13 kern: [] kernel_thread_helper+0x7/0x10 Aug 5 02:32:13 kern: [] 0xffffffff Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: -> #0 (iprune_mutex){--..}: Aug 5 02:32:13 kern: [] __lock_acquire+0x967/0xf90 Aug 5 02:32:13 kern: [] lock_acquire+0x60/0x80 Aug 5 02:32:13 kern: [] mutex_lock_nested+0x9d/0x270 Aug 5 02:32:13 kern: [] shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: [] shrink_slab+0x10b/0x170 Aug 5 02:32:13 kern: [] try_to_free_pages+0x14e/0x210 Aug 5 02:32:13 kern: [] __alloc_pages+0x138/0x350 Aug 5 02:32:13 kern: [] __do_page_cache_readahead+0x13b/0x240 Aug 5 02:32:13 kern: [] ondemand_readahead+0xc1/0x180 Aug 5 02:32:13 kern: [] page_cache_async_readahead+0x62/0x80 Aug 5 02:32:13 kern: [] generic_file_aio_read+0x28c/0x5c0 Aug 5 02:32:13 kern: [] xfs_read+0x133/0x2b0 Aug 5 02:32:13 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 5 02:32:13 kern: [] do_sync_read+0xcd/0x110 Aug 5 02:32:13 kern: [] vfs_read+0x94/0x130 Aug 5 02:32:13 kern: [] sys_read+0x3d/0x70 Aug 5 02:32:13 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 5 02:32:13 kern: [] 0xffffffff Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: other info that might help us debug this: Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: 2 locks held by imapds/2051: Aug 5 02:32:13 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 5 02:32:13 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: stack backtrace: Aug 5 02:32:13 kern: Pid: 2051, comm: imapds Not tainted 2.6.25.12-ish #2 Aug 5 02:32:13 kern: [] print_circular_bug_tail+0x6f/0x80 Aug 5 02:32:13 kern: [] __lock_acquire+0x967/0xf90 Aug 5 02:32:13 kern: [] ? __lock_acquire+0x14c/0xf90 Aug 5 02:32:13 kern: [] lock_acquire+0x60/0x80 Aug 5 02:32:13 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: [] mutex_lock_nested+0x9d/0x270 Aug 5 02:32:13 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: [] shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: [] shrink_slab+0x10b/0x170 Aug 5 02:32:13 kern: [] try_to_free_pages+0x14e/0x210 Aug 5 02:32:13 kern: [] ? isolate_pages_global+0x0/0x60 Aug 5 02:32:13 kern: [] __alloc_pages+0x138/0x350 Aug 5 02:32:13 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 5 02:32:13 kern: [] __do_page_cache_readahead+0x13b/0x240 Aug 5 02:32:13 kern: [] ? __do_page_cache_readahead+0xad/0x240 Aug 5 02:32:13 kern: [] ondemand_readahead+0xc1/0x180 Aug 5 02:32:13 kern: [] page_cache_async_readahead+0x62/0x80 Aug 5 02:32:13 kern: [] generic_file_aio_read+0x28c/0x5c0 Aug 5 02:32:13 kern: [] ? down_read_nested+0x46/0x60 Aug 5 02:32:13 kern: [] xfs_read+0x133/0x2b0 Aug 5 02:32:13 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 5 02:32:13 kern: [] do_sync_read+0xcd/0x110 Aug 5 02:32:13 kern: [] ? autoremove_wake_function+0x0/0x40 Aug 5 02:32:13 kern: [] ? trace_hardirqs_on+0xa0/0x120 Aug 5 02:32:13 kern: [] ? mutex_unlock+0x8/0x10 Aug 5 02:32:13 kern: [] vfs_read+0x94/0x130 Aug 5 02:32:13 kern: [] ? vfs_llseek+0x3c/0x50 Aug 5 02:32:13 kern: [] ? do_sync_read+0x0/0x110 Aug 5 02:32:13 kern: [] sys_read+0x3d/0x70 Aug 5 02:32:13 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 5 02:32:13 kern: ======================= Aug 5 13:38:55 Ish squid[2158]: WARNING: Median response time is 67547 milliseconds --- boot-080805.1947:<5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 6 02:10:34 kern: hde: dma_intr: status=0xd0 { Busy } Aug 6 02:10:34 kern: ide: failed opcode was: unknown Aug 6 02:10:34 kern: pdc202xx_new: Primary channel reset. Aug 6 02:10:59 kern: ide2: reset: success Aug 6 02:11:04 kern: hde: task_out_intr: status=0x58 { DriveReady SeekComplete DataRequest } Aug 6 02:11:04 kern: ide: failed opcode was: unknown Aug 6 02:11:04 kern: pdc202xx_new: Primary channel reset. Aug 6 02:11:04 kern: ide2: reset: success Aug 6 02:11:09 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:11:09 kern: ide: failed opcode was: unknown Aug 6 02:11:47 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:11:47 kern: ide: failed opcode was: unknown Aug 6 02:11:47 kern: pdc202xx_new: Primary channel reset. Aug 6 02:11:50 kern: ide2: reset: success Aug 6 02:12:30 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:12:30 kern: ide: failed opcode was: unknown Aug 6 02:12:30 kern: pdc202xx_new: Primary channel reset. Aug 6 02:12:42 kern: ide2: reset: success Aug 6 02:14:43 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:14:43 kern: ide: failed opcode was: unknown Aug 6 02:14:43 kern: pdc202xx_new: Primary channel reset. Aug 6 02:14:55 kern: ide2: reset: success Aug 6 02:15:49 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:15:49 kern: ide: failed opcode was: unknown Aug 6 02:15:49 kern: pdc202xx_new: Primary channel reset. Aug 6 02:15:53 kern: ide2: reset: success Aug 6 02:15:59 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:15:59 kern: ide: failed opcode was: unknown Aug 6 02:15:59 kern: pdc202xx_new: Primary channel reset. Aug 6 02:16:03 kern: ide2: reset: success Aug 6 02:18:27 kern: hde: task_in_intr: status=0xd0 { Busy } Aug 6 02:18:27 kern: ide: failed opcode was: unknown Aug 6 02:18:27 kern: pdc202xx_new: Primary channel reset. Aug 6 02:18:32 kern: ide2: reset: success Aug 6 02:29:07 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:07 kern: ide: failed opcode was: unknown Aug 6 02:29:09 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:09 kern: ide: failed opcode was: unknown Aug 6 02:29:14 kern: hde: task_out_intr: status=0x58 { DriveReady SeekComplete DataRequest } Aug 6 02:29:14 kern: ide: failed opcode was: unknown Aug 6 02:29:49 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:49 kern: ide: failed opcode was: unknown Aug 6 02:29:49 kern: hde: task_out_intr: status=0x58 { DriveReady SeekComplete DataRequest } Aug 6 02:29:49 kern: ide: failed opcode was: unknown Aug 6 02:29:49 kern: pdc202xx_new: Primary channel reset. Aug 6 02:29:49 kern: ide2: reset: success Aug 6 02:29:49 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:49 kern: ide: failed opcode was: unknown Aug 6 02:29:50 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:50 kern: ide: failed opcode was: unknown Aug 6 02:29:50 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:29:50 kern: ide: failed opcode was: unknown Aug 6 02:30:42 kern: hdf: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:30:42 kern: ide: failed opcode was: unknown Aug 6 02:30:42 kern: hdf: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:30:42 kern: ide: failed opcode was: unknown Aug 6 02:33:51 kern: hde: task_out_intr: status=0x50 { DriveReady SeekComplete } Aug 6 02:33:51 kern: ide: failed opcode was: unknown Aug 6 02:47:30 Ish squid[2181]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Aug 6 02:49:37 kern: Pid: 2304, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:49:37 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:49:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:49:37 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:49:37 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:49:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:49:37 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:49:37 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:49:37 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:49:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:49:37 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:49:37 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:49:37 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:49:37 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:49:37 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:49:37 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:49:37 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:49:37 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:49:37 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:49:37 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:49:37 kern: [] xfs_mount+0x335/0x370 Aug 6 02:49:37 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:49:37 kern: [] snprintf+0x1f/0x30 Aug 6 02:49:37 kern: [] disk_name+0xb2/0xc0 Aug 6 02:49:37 kern: [] strlcpy+0x20/0x60 Aug 6 02:49:37 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:49:37 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:49:37 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:49:37 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:49:37 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:49:37 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:49:37 kern: [] do_mount+0x4eb/0x690 Aug 6 02:49:37 kern: [] __lock_acquire+0x52c/0x10b0 Aug 6 02:49:37 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:49:37 kern: [] _read_unlock_irq+0x20/0x30 Aug 6 02:49:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:49:37 kern: [] find_lock_page+0x25/0xa0 Aug 6 02:49:37 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:49:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:49:37 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:49:37 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:49:37 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:49:37 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:49:37 kern: [] sys_mount+0x77/0xc0 Aug 6 02:49:37 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:49:37 kern: ======================= Aug 6 02:49:37 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:49:37 kern: XFS: log mount failed Aug 6 02:50:18 kern: Pid: 2333, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:18 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:18 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:18 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:18 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:50:18 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:18 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:50:18 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:50:18 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:50:18 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:18 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:18 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:50:18 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:50:18 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:50:18 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:50:18 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:50:18 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:50:18 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:18 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:50:18 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:50:18 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:50:18 kern: [] xfs_mount+0x335/0x370 Aug 6 02:50:18 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:50:18 kern: [] snprintf+0x1f/0x30 Aug 6 02:50:18 kern: [] disk_name+0xb2/0xc0 Aug 6 02:50:18 kern: [] strlcpy+0x20/0x60 Aug 6 02:50:18 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:50:18 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:50:18 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:50:18 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:50:18 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:50:18 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:50:18 kern: [] do_mount+0x4eb/0x690 Aug 6 02:50:18 kern: [] __lock_acquire+0x52c/0x10b0 Aug 6 02:50:18 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:18 kern: [] _read_unlock_irq+0x20/0x30 Aug 6 02:50:18 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:18 kern: [] find_lock_page+0x25/0xa0 Aug 6 02:50:18 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:50:18 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:18 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:50:18 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:50:18 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:50:18 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:50:18 kern: [] sys_mount+0x77/0xc0 Aug 6 02:50:18 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:50:18 kern: ======================= Aug 6 02:50:18 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:18 kern: XFS: log mount failed Aug 6 02:50:26 kern: Pid: 2335, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:26 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:26 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:26 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:26 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:50:26 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:26 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:50:26 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:50:26 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:50:26 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:26 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:50:26 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:50:26 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:50:26 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:50:26 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:50:26 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:50:26 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:26 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:50:26 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:50:26 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:50:26 kern: [] xfs_mount+0x335/0x370 Aug 6 02:50:26 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:50:26 kern: [] snprintf+0x1f/0x30 Aug 6 02:50:26 kern: [] disk_name+0xb2/0xc0 Aug 6 02:50:26 kern: [] strlcpy+0x20/0x60 Aug 6 02:50:26 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:50:26 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:50:26 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:50:26 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:50:26 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:50:26 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:50:26 kern: [] do_mount+0x4eb/0x690 Aug 6 02:50:26 kern: [] __lock_acquire+0x52c/0x10b0 Aug 6 02:50:26 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:26 kern: [] _read_unlock_irq+0x20/0x30 Aug 6 02:50:26 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:26 kern: [] find_lock_page+0x25/0xa0 Aug 6 02:50:26 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:50:26 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:26 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:50:26 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:50:26 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:50:26 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:50:26 kern: [] sys_mount+0x77/0xc0 Aug 6 02:50:26 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:50:26 kern: ======================= Aug 6 02:50:26 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:26 kern: XFS: log mount failed Aug 6 02:50:37 kern: Pid: 2340, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:37 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:37 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:37 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:50:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:37 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:50:37 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:50:37 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:50:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:37 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:50:37 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:50:37 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:50:37 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:50:37 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:50:37 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:50:37 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:37 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:50:37 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:50:37 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:50:37 kern: [] xfs_mount+0x335/0x370 Aug 6 02:50:37 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:50:37 kern: [] snprintf+0x1f/0x30 Aug 6 02:50:37 kern: [] disk_name+0xb2/0xc0 Aug 6 02:50:37 kern: [] strlcpy+0x20/0x60 Aug 6 02:50:37 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:50:37 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:50:37 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:50:37 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:50:37 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:50:37 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:50:37 kern: [] do_mount+0x4eb/0x690 Aug 6 02:50:37 kern: [] __lock_acquire+0x52c/0x10b0 Aug 6 02:50:37 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:37 kern: [] _read_unlock_irq+0x20/0x30 Aug 6 02:50:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:37 kern: [] find_lock_page+0x25/0xa0 Aug 6 02:50:37 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:50:37 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:37 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:50:37 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:50:37 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:50:37 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:50:37 kern: [] sys_mount+0x77/0xc0 Aug 6 02:50:37 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:50:37 kern: ======================= Aug 6 02:50:37 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:37 kern: XFS: log mount failed Aug 6 02:50:55 kern: Pid: 2342, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:55 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:55 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:55 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:55 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:50:55 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:55 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:50:55 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:50:55 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:50:55 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:55 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:55 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:50:55 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:50:55 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:50:55 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:50:55 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:50:55 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:50:55 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:50:55 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:50:55 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:50:55 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:50:55 kern: [] xfs_mount+0x335/0x370 Aug 6 02:50:55 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:50:55 kern: [] snprintf+0x1f/0x30 Aug 6 02:50:55 kern: [] disk_name+0xb2/0xc0 Aug 6 02:50:55 kern: [] strlcpy+0x20/0x60 Aug 6 02:50:55 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:50:55 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:50:55 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:50:55 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:50:55 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:50:55 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:50:55 kern: [] do_mount+0x4eb/0x690 Aug 6 02:50:55 kern: [] mntput_no_expire+0x13/0x60 Aug 6 02:50:55 kern: [] link_path_walk+0x65/0xc0 Aug 6 02:50:55 kern: [] call_rcu+0x55/0x70 Aug 6 02:50:55 kern: [] kmem_cache_free+0xa7/0xe0 Aug 6 02:50:55 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:50:55 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:50:55 kern: [] __user_walk_fd+0x49/0x60 Aug 6 02:50:55 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:50:55 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:50:55 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:50:55 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:50:55 kern: [] sys_mount+0x77/0xc0 Aug 6 02:50:55 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:50:55 kern: ======================= Aug 6 02:50:55 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:55 kern: XFS: log mount failed Aug 6 02:51:07 kern: Pid: 2346, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:51:07 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:51:07 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:51:07 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:51:07 kern: [] xlog_recover_insert_item_frontq+0x13/0x20 Aug 6 02:51:07 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:51:07 kern: [] xlog_recover_commit_trans+0x3f/0x50 Aug 6 02:51:07 kern: [] xlog_recover_process_data+0x1a5/0x220 Aug 6 02:51:07 kern: [] xlog_do_recovery_pass+0x90e/0x9d0 Aug 6 02:51:07 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:51:07 kern: [] wake_up_klogd+0x3b/0x40 Aug 6 02:51:07 kern: [] xlog_do_log_recovery+0x7a/0xb0 Aug 6 02:51:07 kern: [] xlog_do_recover+0x29/0x130 Aug 6 02:51:07 kern: [] xlog_recover+0x9d/0xc0 Aug 6 02:51:07 kern: [] xfs_log_mount+0xa2/0x160 Aug 6 02:51:07 kern: [] xfs_mountfs+0x89b/0xdc0 Aug 6 02:51:07 kern: [] mark_held_locks+0x38/0x70 Aug 6 02:51:07 kern: [] lockdep_init_map+0x3d/0x4c0 Aug 6 02:51:07 kern: [] __spin_lock_init+0x32/0x60 Aug 6 02:51:07 kern: [] xfs_mru_cache_create+0x13a/0x150 Aug 6 02:51:07 kern: [] xfs_mount+0x335/0x370 Aug 6 02:51:07 kern: [] xfs_fs_fill_super+0xba/0x210 Aug 6 02:51:07 kern: [] snprintf+0x1f/0x30 Aug 6 02:51:07 kern: [] disk_name+0xb2/0xc0 Aug 6 02:51:07 kern: [] strlcpy+0x20/0x60 Aug 6 02:51:07 kern: [] get_sb_bdev+0x105/0x130 Aug 6 02:51:07 kern: [] alloc_vfsmnt+0x92/0xd0 Aug 6 02:51:07 kern: [] xfs_fs_get_sb+0x21/0x30 Aug 6 02:51:07 kern: [] xfs_fs_fill_super+0x0/0x210 Aug 6 02:51:07 kern: [] vfs_kern_mount+0x37/0x90 Aug 6 02:51:07 kern: [] do_kern_mount+0x3d/0xe0 Aug 6 02:51:07 kern: [] do_mount+0x4eb/0x690 Aug 6 02:51:07 kern: [] handle_mm_fault+0x267/0x580 Aug 6 02:51:07 kern: [] _spin_unlock+0x14/0x20 Aug 6 02:51:07 kern: [] get_page_from_freelist+0x299/0x440 Aug 6 02:51:07 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 6 02:51:07 kern: [] __alloc_pages+0x60/0x380 Aug 6 02:51:07 kern: [] kmem_cache_alloc+0x9b/0xc0 Aug 6 02:51:07 kern: [] __get_free_pages+0x4f/0x60 Aug 6 02:51:07 kern: [] copy_mount_options+0x43/0x130 Aug 6 02:51:07 kern: [] sys_mount+0x77/0xc0 Aug 6 02:51:07 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 6 02:51:07 kern: ======================= Aug 6 02:51:07 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:51:07 kern: XFS: log mount failed Aug 6 12:41:04 kern: XFS: failed to read RT inodes Aug 6 21:51:37 Ish mountd[13571]: could not open /var/lib/nfs/xtab for locking Aug 6 22:00:29 Ish mountd[13572]: could not open /var/lib/nfs/rmtab for locking Aug 6 22:00:41 Ish last message repeated 5 times Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: ======================================================= Aug 7 02:09:48 kern: [ INFO: possible circular locking dependency detected ] Aug 7 02:09:48 kern: 2.6.24.2-ish #5 Aug 7 02:09:48 kern: ------------------------------------------------------- Aug 7 02:09:48 kern: imapds/17962 is trying to acquire lock: Aug 7 02:09:48 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: but task is already holding lock: Aug 7 02:09:48 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5b/0xb0 Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: which lock already depends on the new lock. Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: the existing dependency chain (in reverse order) is: Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Aug 7 02:09:48 kern: [] __lock_acquire+0xc0b/0x10b0 Aug 7 02:09:48 kern: [] xfs_ilock+0x97/0xb0 Aug 7 02:09:48 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 7 02:09:48 kern: [] lock_acquire+0x61/0x80 Aug 7 02:09:48 kern: [] xfs_ilock+0x97/0xb0 Aug 7 02:09:48 kern: [] down_write_nested+0x38/0x60 Aug 7 02:09:48 kern: [] xfs_ilock+0x97/0xb0 Aug 7 02:09:48 kern: [] xfs_ilock+0x97/0xb0 Aug 7 02:09:48 kern: [] xfs_ireclaim+0x2e/0x70 Aug 7 02:09:48 kern: [] xfs_finish_reclaim+0x53/0x1b0 Aug 7 02:09:48 kern: [] xfs_fs_clear_inode+0xaf/0xe0 Aug 7 02:09:48 kern: [] clear_inode+0x61/0x100 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x7d/0x250 Aug 7 02:09:48 kern: [] dispose_list+0x1a/0xe0 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x18b/0x250 Aug 7 02:09:48 kern: [] shrink_slab+0x117/0x170 Aug 7 02:09:48 kern: [] kswapd+0x30b/0x4a0 Aug 7 02:09:48 kern: [] autoremove_wake_function+0x0/0x40 Aug 7 02:09:48 kern: [] kswapd+0x0/0x4a0 Aug 7 02:09:48 kern: [] kthread+0x42/0x70 Aug 7 02:09:48 kern: [] kthread+0x0/0x70 Aug 7 02:09:48 kern: [] kernel_thread_helper+0x7/0x10 Aug 7 02:09:48 kern: [] 0xffffffff Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: -> #0 (iprune_mutex){--..}: Aug 7 02:09:48 kern: [] print_circular_bug_entry+0x40/0x50 Aug 7 02:09:48 kern: [] __lock_acquire+0xa2d/0x10b0 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] lock_acquire+0x61/0x80 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] mutex_lock_nested+0x7f/0x2c0 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] shrink_slab+0x26/0x170 Aug 7 02:09:48 kern: [] shrink_slab+0x117/0x170 Aug 7 02:09:48 kern: [] try_to_free_pages+0x172/0x250 Aug 7 02:09:48 kern: [] __alloc_pages+0x159/0x380 Aug 7 02:09:48 kern: [] __do_page_cache_readahead+0x148/0x260 Aug 7 02:09:48 kern: [] __do_page_cache_readahead+0xbd/0x260 Aug 7 02:09:48 kern: [] do_generic_mapping_read+0x174/0x460 Aug 7 02:09:48 kern: [] file_read_actor+0x0/0x120 Aug 7 02:09:48 kern: [] generic_file_aio_read+0x116/0x1b0 Aug 7 02:09:48 kern: [] file_read_actor+0x0/0x120 Aug 7 02:09:48 kern: [] xfs_read+0x13f/0x2e0 Aug 7 02:09:48 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 7 02:09:48 kern: [] do_sync_read+0xc7/0x110 Aug 7 02:09:48 kern: [] generic_file_llseek+0x31/0xc0 Aug 7 02:09:48 kern: [] autoremove_wake_function+0x0/0x40 Aug 7 02:09:48 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 7 02:09:48 kern: [] do_sync_read+0x0/0x110 Aug 7 02:09:48 kern: [] vfs_read+0x9d/0x130 Aug 7 02:09:48 kern: [] sys_read+0x41/0x70 Aug 7 02:09:48 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 7 02:09:48 kern: [] 0xffffffff Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: other info that might help us debug this: Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: 2 locks held by imapds/17962: Aug 7 02:09:48 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5b/0xb0 Aug 7 02:09:48 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x26/0x170 Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: stack backtrace: Aug 7 02:09:48 kern: Pid: 17962, comm: imapds Not tainted 2.6.24.2-ish #5 Aug 7 02:09:48 kern: [] print_circular_bug_tail+0x7a/0x90 Aug 7 02:09:48 kern: [] __lock_acquire+0xa2d/0x10b0 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] lock_acquire+0x61/0x80 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] mutex_lock_nested+0x7f/0x2c0 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: [] shrink_slab+0x26/0x170 Aug 7 02:09:48 kern: [] shrink_slab+0x117/0x170 Aug 7 02:09:48 kern: [] try_to_free_pages+0x172/0x250 Aug 7 02:09:48 kern: [] __alloc_pages+0x159/0x380 Aug 7 02:09:48 kern: [] __do_page_cache_readahead+0x148/0x260 Aug 7 02:09:48 kern: [] __do_page_cache_readahead+0xbd/0x260 Aug 7 02:09:48 kern: [] do_generic_mapping_read+0x174/0x460 Aug 7 02:09:48 kern: [] file_read_actor+0x0/0x120 Aug 7 02:09:48 kern: [] generic_file_aio_read+0x116/0x1b0 Aug 7 02:09:48 kern: [] file_read_actor+0x0/0x120 Aug 7 02:09:48 kern: [] xfs_read+0x13f/0x2e0 Aug 7 02:09:48 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 7 02:09:48 kern: [] do_sync_read+0xc7/0x110 Aug 7 02:09:48 kern: [] generic_file_llseek+0x31/0xc0 Aug 7 02:09:48 kern: [] autoremove_wake_function+0x0/0x40 Aug 7 02:09:48 kern: [] trace_hardirqs_on+0xaf/0x160 Aug 7 02:09:48 kern: [] do_sync_read+0x0/0x110 Aug 7 02:09:48 kern: [] vfs_read+0x9d/0x130 Aug 7 02:09:48 kern: [] sys_read+0x41/0x70 Aug 7 02:09:48 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 7 02:09:48 kern: ======================= Aug 8 01:35:07 Ish squid[2181]: WARNING: Median response time is 54429 milliseconds Aug 8 01:36:07 Ish squid[2181]: WARNING: Median response time is 43858 milliseconds Aug 8 01:37:07 Ish squid[2181]: WARNING: Median response time is 41553 milliseconds Aug 8 01:38:07 Ish squid[2181]: WARNING: Median response time is 41553 milliseconds Aug 8 17:34:20 Ish squid[2181]: WARNING: Median response time is 341160 milliseconds Aug 8 17:35:20 Ish squid[2181]: WARNING: Median response time is 341160 milliseconds Aug 8 17:36:20 Ish squid[2181]: WARNING: Median response time is 341160 milliseconds Aug 8 17:37:20 Ish squid[2181]: WARNING: Median response time is 341160 milliseconds Aug 8 17:38:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:39:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:40:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:41:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:42:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:43:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:44:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds Aug 8 17:45:20 Ish squid[2181]: WARNING: Median response time is 221513 milliseconds --- boot-080809.1930:<5>Linux version 2.6.24.2-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #5 SMP Fri Feb 15 17:55:46 PST 2008 --- Aug 9 02:44:52 kern: Clocksource tsc unstable (delta = 9374169734 ns) Aug 9 02:59:05 kern: XFS: bad magic number Aug 9 02:59:05 kern: XFS: SB validate failed Aug 9 02:59:09 kern: XFS: bad magic number Aug 9 02:59:09 kern: XFS: SB validate failed --- <5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 10 02:30:48 Ish squid[2152]: Starting Squid Cache version 3.0.PRE6 for i686-pc-linux-gnu... Aug 10 15:14:03 Ish squid[2152]: WARNING: Median response time is 46290 milliseconds Aug 10 17:50:06 Ish squid[2152]: WARNING: Median response time is 83828 milliseconds Aug 10 17:51:06 Ish squid[2152]: WARNING: Median response time is 136268 milliseconds Aug 10 19:00:07 Ish squid[2152]: WARNING: Median response time is 88478 milliseconds Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: ======================================================= Aug 11 02:04:56 kern: [ INFO: possible circular locking dependency detected ] Aug 11 02:04:56 kern: 2.6.25.12-ish #2 Aug 11 02:04:56 kern: ------------------------------------------------------- Aug 11 02:04:56 kern: imapds/31560 is trying to acquire lock: Aug 11 02:04:56 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: but task is already holding lock: Aug 11 02:04:56 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: which lock already depends on the new lock. Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: the existing dependency chain (in reverse order) is: Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: -> #1 (&(&ip->i_iolock)->mr_lock){----}: Aug 11 02:04:56 kern: [] __lock_acquire+0xb3d/0xf90 Aug 11 02:04:56 kern: [] lock_acquire+0x60/0x80 Aug 11 02:04:56 kern: [] down_write_nested+0x46/0x70 Aug 11 02:04:56 kern: [] xfs_ilock+0x97/0xb0 Aug 11 02:04:56 kern: [] xfs_ireclaim+0x30/0x70 Aug 11 02:04:56 kern: [] xfs_finish_reclaim+0x4f/0x180 Aug 11 02:04:56 kern: [] xfs_reclaim+0xe7/0xf0 Aug 11 02:04:56 kern: [] xfs_fs_clear_inode+0xa8/0xe0 Aug 11 02:04:56 kern: [] clear_inode+0x79/0x100 Aug 11 02:04:56 kern: [] dispose_list+0x27/0xf0 Aug 11 02:04:56 kern: [] shrink_icache_memory+0x182/0x250 Aug 11 02:04:56 kern: [] shrink_slab+0x10b/0x170 Aug 11 02:04:56 kern: [] kswapd+0x2ee/0x460 Aug 11 02:04:56 kern: [] kthread+0x42/0x70 Aug 11 02:04:56 kern: [] kernel_thread_helper+0x7/0x10 Aug 11 02:04:56 kern: [] 0xffffffff Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: -> #0 (iprune_mutex){--..}: Aug 11 02:04:56 kern: [] __lock_acquire+0x967/0xf90 Aug 11 02:04:56 kern: [] lock_acquire+0x60/0x80 Aug 11 02:04:56 kern: [] mutex_lock_nested+0x9d/0x270 Aug 11 02:04:56 kern: [] shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: [] shrink_slab+0x10b/0x170 Aug 11 02:04:56 kern: [] try_to_free_pages+0x14e/0x210 Aug 11 02:04:56 kern: [] __alloc_pages+0x138/0x350 Aug 11 02:04:56 kern: [] __do_page_cache_readahead+0x13b/0x240 Aug 11 02:04:56 kern: [] ondemand_readahead+0xc1/0x180 Aug 11 02:04:56 kern: [] page_cache_async_readahead+0x62/0x80 Aug 11 02:04:56 kern: [] generic_file_aio_read+0x28c/0x5c0 Aug 11 02:04:56 kern: [] xfs_read+0x133/0x2b0 Aug 11 02:04:56 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 11 02:04:56 kern: [] do_sync_read+0xcd/0x110 Aug 11 02:04:56 kern: [] vfs_read+0x94/0x130 Aug 11 02:04:56 kern: [] sys_read+0x3d/0x70 Aug 11 02:04:56 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 11 02:04:56 kern: [] 0xffffffff Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: other info that might help us debug this: Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: 2 locks held by imapds/31560: Aug 11 02:04:56 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 11 02:04:56 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: stack backtrace: Aug 11 02:04:56 kern: Pid: 31560, comm: imapds Not tainted 2.6.25.12-ish #2 Aug 11 02:04:56 kern: [] print_circular_bug_tail+0x6f/0x80 Aug 11 02:04:56 kern: [] __lock_acquire+0x967/0xf90 Aug 11 02:04:56 kern: [] ? __lock_acquire+0x14c/0xf90 Aug 11 02:04:56 kern: [] lock_acquire+0x60/0x80 Aug 11 02:04:56 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: [] mutex_lock_nested+0x9d/0x270 Aug 11 02:04:56 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: [] ? shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: [] shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: [] shrink_slab+0x10b/0x170 Aug 11 02:04:56 kern: [] try_to_free_pages+0x14e/0x210 Aug 11 02:04:56 kern: [] ? isolate_pages_global+0x0/0x60 Aug 11 02:04:56 kern: [] __alloc_pages+0x138/0x350 Aug 11 02:04:56 kern: [] ? __lock_acquire+0x4bd/0xf90 Aug 11 02:04:56 kern: [] __do_page_cache_readahead+0x13b/0x240 Aug 11 02:04:56 kern: [] ? __do_page_cache_readahead+0xad/0x240 Aug 11 02:04:56 kern: [] ondemand_readahead+0xc1/0x180 Aug 11 02:04:56 kern: [] page_cache_async_readahead+0x62/0x80 Aug 11 02:04:56 kern: [] generic_file_aio_read+0x28c/0x5c0 Aug 11 02:04:56 kern: [] ? down_read_nested+0x46/0x60 Aug 11 02:04:56 kern: [] xfs_read+0x133/0x2b0 Aug 11 02:04:56 kern: [] xfs_file_aio_read+0x5c/0x70 Aug 11 02:04:56 kern: [] do_sync_read+0xcd/0x110 Aug 11 02:04:56 kern: [] ? autoremove_wake_function+0x0/0x40 Aug 11 02:04:56 kern: [] ? trace_hardirqs_on+0xa0/0x120 Aug 11 02:04:56 kern: [] ? mutex_unlock+0x8/0x10 Aug 11 02:04:56 kern: [] vfs_read+0x94/0x130 Aug 11 02:04:56 kern: [] ? vfs_llseek+0x3c/0x50 Aug 11 02:04:56 kern: [] ? do_sync_read+0x0/0x110 Aug 11 02:04:56 kern: [] sys_read+0x3d/0x70 Aug 11 02:04:56 kern: [] sysenter_past_esp+0x5f/0xa5 Aug 11 02:04:56 kern: ======================= From owner-xfs@oss.sgi.com Mon Aug 11 13:09:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 13:09:11 -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=-1.9 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 m7BK989I008953 for ; Mon, 11 Aug 2008 13:09:08 -0700 X-ASG-Debug-ID: 1218485424-3e3902bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A85E9F2A96B for ; Mon, 11 Aug 2008 13:10:24 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id YYw76YyjcybwAxzL for ; Mon, 11 Aug 2008 13:10:24 -0700 (PDT) Received: from Liberator.local (dsl-dynamic-209-50-31-17.inebraska.com [209.50.31.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5FF70AC358E; Mon, 11 Aug 2008 15:10:22 -0500 (CDT) Message-ID: <48A09CA9.9080705@sandeen.net> Date: Mon, 11 Aug 2008 15:10:17 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Linda Walsh CC: LKML , xfs-oss X-ASG-Orig-Subj: Re: Lock debugging noise or real problem? Subject: Re: Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> In-Reply-To: <48A093A7.40606@tlinx.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1218485424 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.2380 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17472 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Linda Walsh wrote: > This is a trimmed version of my Warn log (with boot indicators) since > the problems started. I'm also unsure why some user-level processes seem > to be dumping trace-backs periodically, including: > > cifsopslock > xfs_fsr (a few) the explanation for xfs_fsr, at least, is the same as the last time you brought it up ;) http://lkml.org/lkml/2008/2/12/86 -Eric From owner-xfs@oss.sgi.com Mon Aug 11 16:44:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 16:44:58 -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=-1.8 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 m7BNisD4024621 for ; Mon, 11 Aug 2008 16:44:55 -0700 X-ASG-Debug-ID: 1218498370-3e83039d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice2.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 077BA383C3C for ; Mon, 11 Aug 2008 16:46:10 -0700 (PDT) Received: from postoffice2.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id DQHRjJZfUflgPzxY for ; Mon, 11 Aug 2008 16:46:10 -0700 (PDT) Received: from postoffice.aconex.com (localhost [127.0.0.1]) by postoffice2.aconex.com (Spam Firewall) with ESMTP id 8872D4EF58D; Tue, 12 Aug 2008 09:46:04 +1000 (EST) Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.3.1]) by postoffice2.aconex.com with ESMTP id k9IZg1nBYmGjLS7i; Tue, 12 Aug 2008 09:46:04 +1000 (EST) Received: from [192.168.5.24] (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 7C64692C2FF; Tue, 12 Aug 2008 09:46:04 +1000 (EST) X-ASG-Orig-Subj: Re: xfs_quota: Getting back disk space usage of a single directory Subject: Re: xfs_quota: Getting back disk space usage of a single directory From: Nathan Scott To: Asfand Yar Qazi Cc: xfs@oss.sgi.com In-Reply-To: <48A001FF.8030701@advantage-interactive.com> References: <48A001FF.8030701@advantage-interactive.com> Content-Type: text/plain Date: Tue, 12 Aug 2008 09:44:28 +1000 Message-Id: <1218498268.4794.3.camel@verge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1218498372 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 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.02, rules version 3.0.83689 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17473 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Mon, 2008-08-11 at 10:10 +0100, Asfand Yar Qazi wrote: > > > > > Hi, > > If I have an XFS mount that contains many directories, each one > project-quotaed, how can I use xfs_quota to get back the amount of > quota used by just one directory? Your question doesnt actually make sense... I assume you mean: - you have recursively set different project IDs on multiple top level directories - you would like to know space used by just one directory tree (project)? > I know I can use xfs_quota -x -c quot -p /blah to get back quota > usages > for all projects in that mount, but I want to get back just one. Definately don't use the "quot" command, that simply bulkstats the entire filesystem and reports on space used. Use the "quota" or "report" commands with the particular directory tree (project) you are interested in. cheers. -- Nathan From owner-xfs@oss.sgi.com Mon Aug 11 16:51:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 16:51:34 -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 (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 m7BNpVuL025222 for ; Mon, 11 Aug 2008 16:51:31 -0700 X-ASG-Debug-ID: 1218498767-20ea00490000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ED76112F334A for ; Mon, 11 Aug 2008 16:52:48 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id F7xgDsO4Khasqw8k for ; Mon, 11 Aug 2008 16:52:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANxroEh5LAMb/2dsb2JhbACtDA X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179720144" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 09:22:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KShBs-0004eq-I8; Tue, 12 Aug 2008 09:52:44 +1000 Date: Tue, 12 Aug 2008 09:52:44 +1000 From: Dave Chinner To: Christian Affolter Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Corruption of in-memory data detected - on heavy hard linking Subject: Re: Corruption of in-memory data detected - on heavy hard linking Message-ID: <20080811235244.GF6119@disturbed> Mail-Followup-To: Christian Affolter , xfs@oss.sgi.com References: <48876D03.8010804@stepping-stone.ch> <20080725052051.GA26367@infradead.org> <489732B2.7000201@stepping-stone.ch> <20080805001952.GI6119@disturbed> <48A02FF6.70703@stepping-stone.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <48A02FF6.70703@stepping-stone.ch> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218498768 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.2394 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17474 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 11, 2008 at 02:26:30PM +0200, Christian Affolter wrote: > Hi Dave > >>>> On Wed, Jul 23, 2008 at 07:40:19PM +0200, Christian Affolter wrote: >>>>> Kernel-Error: >>>>> Filesystem "sdc1": XFS internal error xfs_trans_cancel at line >>>>> 1163 of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf >>>>> Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 >>>> 2.6.24 is pretty old. Did you try with a recent kernel? We had some >>>> fixes for in-core memory corruption although I don't remember one in >>>> this area. >>> I finally found the time to update the kernel to a recent 2.6.26 version. >>> >>> Unfortunately the problem still exists: >>> Filesystem "dm-3": XFS internal error xfs_trans_cancel at line 1163 >>> of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a6672 >>> Pid: 12584, comm: cp Not tainted 2.6.26-gentoo #1 >> >> Ok, what we need is the following. First, try to reproduce the >> problem on a small filesystem (say a few GB). Once you've reproduced >> the problem, unmount and remount the filesystem to get the log >> replayed, then take a xfs_metadump image of the filesystem. Put the >> metadump image somewhere that can be downloaded (ftp/web site) and >> let us know where it is. > Please excuse the delay, it took some time to reproduce the issue with > newly generated nonsensitive data... You probably didn't need to do that. from the man page: By default, xfs_metadump obfuscates most file (regular file, directory and symbolic link) names and extended attribute names to allow the dumps to be sent without revealing confi†dential information. Extended attribute values are zeroed and no data is copied. The only exceptions are file or attribute names that are 4 or less characters in length. Also file names that span extents (this can only occur with the mkfs.xfs(8) options where -n size > -b size) are not obfuscated. Names between 5 and 8 characters in length inclusively are partially obfuscated. > However while looking at the meta dump (with the help of the strings > command), a lot of non-existing file names appears. Non-existing in the > sense of not present on this device, they may exist on other devices, > but they definitely were never on the dumped device (the device was > filled with /dev/zero before creating the xfs filesystem). That's the obfuscation. > Therefor I'm a bit scared to place the dump publicly on the internet, > might it be possible to put it somewhere with user/pw protection and > hand the credentials to you privately? Sure. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 17:18:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 17:18:46 -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 m7C0IgLc027160 for ; Mon, 11 Aug 2008 17:18:44 -0700 X-ASG-Debug-ID: 1218500398-1258001c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 911A9383AE4 for ; Mon, 11 Aug 2008 17:19:58 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id G6QYVQ1Mr0DRyCzL for ; Mon, 11 Aug 2008 17:19:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOdyoEh5LAMb/2dsb2JhbACtFA X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179741964" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 09:49:57 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KShcB-0005Gg-Qe; Tue, 12 Aug 2008 10:19:55 +1000 Date: Tue, 12 Aug 2008 10:19:55 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Message-ID: <20080812001955.GG6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216773673-3620-1-git-send-email-david@fromorbit.com> <20080811140850.GA12521@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080811140850.GA12521@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218500399 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0032 1.0000 -2.0002 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.00 X-Barracuda-Spam-Status: No, SCORE=-2.00 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.02, rules version 3.0.83693 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17475 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 11, 2008 at 10:08:50AM -0400, Christoph Hellwig wrote: > On Wed, Jul 23, 2008 at 10:41:09AM +1000, Dave Chinner wrote: > > The list of all inodes on a mount is superfluous. We can traverse > > all inodes now by walking the per-AG inode radix trees without > > needing a separate list. This enables us to remove a bunch of > > complex list traversal code and remove another two pointers from > > the xfs_inode. > > > > Also, by replacing the sync traversal with an ascending inode > > number traversal, we will issue better inode I/O patterns for > > writeback triggered by xfssyncd or unmount. > > Any plans to send an updated version for the current tree and including > the xfsidbg fixups? Sure, I've been waiting for the git tree to get updated with all the patch I had previously sent. I've been away for the past few days, so it hasn't happened yet. As to the xfsidbg changes, as I've said before the XFS git trees do not have that file in it nor do I use kdb at all anymore. It means I have to convert complex patch series to a CVS tree to create a idbg patches that I can't test or then integrate back into the the git tree. I dislike sending untested patches, especially when they are non-trivial. It also means i can't use the git patch-bomb tools to send them as part of the patch series. Quite frankly, xfsidbg is a PITA to update because it's not in a git tree, and hence I don't update it because I don't need it to develop or debug code.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 17:56:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 17:56:56 -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 (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 m7C0uqA3029388 for ; Mon, 11 Aug 2008 17:56:54 -0700 X-ASG-Debug-ID: 1218502688-20d303c20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3695A124E8FC for ; Mon, 11 Aug 2008 17:58:09 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 5QIWvrheYJ9EDUCm for ; Mon, 11 Aug 2008 17:58:09 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHB9oEh5LAMb/2dsb2JhbACtDA X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179772359" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 10:28:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSiD0-00068E-Uu for xfs@oss.sgi.com; Tue, 12 Aug 2008 10:57:58 +1000 Date: Tue, 12 Aug 2008 10:57:58 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: commit messages wrong in XFS git -master tree.... Subject: commit messages wrong in XFS git -master tree.... Message-ID: <20080812005758.GJ6119@disturbed> Mail-Followup-To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218502690 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2182 1.0000 -0.7332 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.73 X-Barracuda-Spam-Status: No, SCORE=-0.73 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.2398 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17476 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs SGI folks, The commit messages for a couple of patches has been screwed up. The patch series I sent titled: [PATCH 1/3] XFS: Avoid directly referencing the VFS inode [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro Is the one that I've noticed. Patch 2/3 has the commit message for patch 1/3 instead of the correct one. Patch 1/3 has a corrupt version of it's commit message. Can someone please fix this up? And can ppl be more careful when committing patches in future and make sure they get the commit messages correct? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 18:45:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45:19 -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 m7C1jEp9032364 for ; Mon, 11 Aug 2008 18:45:14 -0700 X-ASG-Debug-ID: 1218505587-452c01880001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2C80238428F for ; Mon, 11 Aug 2008 18:46:30 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id MQiv2YtKzObeZUHY for ; Mon, 11 Aug 2008 18:46:30 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811350" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007D8-6t for xfs@oss.sgi.com; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V3 Subject: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V3 Date: Tue, 12 Aug 2008 11:46:05 +1000 Message-Id: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505591 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0495 1.0000 -1.7033 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.70 X-Barracuda-Spam-Status: No, SCORE=-1.70 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.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17478 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The list of all inodes on a mount is superfluous. We can traverse all inodes now by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a bunch of complex list traversal code and remove another two pointers from the xfs_inode. Also, by replacing the sync traversal with an ascending inode number traversal, we will issue better inode I/O patterns for writeback triggered by xfssyncd or unmount. Before we make this change, move all the relevant sync code into it's own file in the linux-2.6/ directory. This aggregates VFS specific sync interfacing in the one file and will allow all the subsequent change history to be associated with this file so it is easy to find in future. From owner-xfs@oss.sgi.com Mon Aug 11 18:45:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45:21 -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 m7C1jHDT032381 for ; Mon, 11 Aug 2008 18:45:17 -0700 X-ASG-Debug-ID: 1218505587-452c01880002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 185DD384293 for ; Mon, 11 Aug 2008 18:46:33 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id auiddXrkFy5CLoEh for ; Mon, 11 Aug 2008 18:46:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811375" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DP-Lp; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 6/6] XFS: remove the mount inode list Subject: [PATCH 6/6] XFS: remove the mount inode list Date: Tue, 12 Aug 2008 11:46:11 +1000 Message-Id: <1218505571-27588-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505594 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.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17479 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Now we've removed all users of the mount inode list, we can kill it. This reduces the size of the xfs_inode by 2 pointers. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 42 +----------------------------------------- fs/xfs/xfs_inode.h | 8 -------- fs/xfs/xfs_mount.c | 5 ----- fs/xfs/xfs_mount.h | 1 - 4 files changed, 1 insertions(+), 55 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 539c2dd..cd442da 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -76,7 +76,6 @@ xfs_iget_core( { struct inode *old_inode; xfs_inode_t *ip; - xfs_inode_t *iq; int error; unsigned long first_index, mask; xfs_perag_t *pag; @@ -260,24 +259,6 @@ finish_inode: write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); - - /* - * Link ip to its mount and thread it on the mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - if ((iq = mp->m_inodes)) { - ASSERT(iq->i_mprev->i_mnext == iq); - ip->i_mprev = iq->i_mprev; - iq->i_mprev->i_mnext = ip; - iq->i_mprev = ip; - ip->i_mnext = iq; - } else { - ip->i_mnext = ip; - ip->i_mprev = ip; - } - mp->m_inodes = ip; - - XFS_MOUNT_IUNLOCK(mp); xfs_put_perag(mp, pag); return_ip: @@ -498,36 +479,15 @@ xfs_iextract( { xfs_mount_t *mp = ip->i_mount; xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); - xfs_inode_t *iq; write_lock(&pag->pag_ici_lock); radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); write_unlock(&pag->pag_ici_lock); xfs_put_perag(mp, pag); - /* - * Remove from mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - ASSERT((ip->i_mnext != NULL) && (ip->i_mprev != NULL)); - iq = ip->i_mnext; - iq->i_mprev = ip->i_mprev; - ip->i_mprev->i_mnext = iq; - - /* - * Fix up the head pointer if it points to the inode being deleted. - */ - if (mp->m_inodes == ip) { - if (ip == iq) { - mp->m_inodes = NULL; - } else { - mp->m_inodes = iq; - } - } - /* Deal with the deleted inodes list */ + XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); - mp->m_ireclaims++; XFS_MOUNT_IUNLOCK(mp); } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 455b1a9..c1ee977 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -192,16 +192,8 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; -typedef struct { - struct xfs_inode *ip_mnext; /* next inode in mount list */ - struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_mount *ip_mount; /* fs mount struct ptr */ -} xfs_iptr_t; - typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_inode *i_mnext; /* next inode in mount list */ - struct xfs_inode *i_mprev; /* ptr to prev inode */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ struct inode *i_vnode; /* vnode backpointer */ diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index d048e3b..512d378 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1307,11 +1307,6 @@ xfs_unmountfs(xfs_mount_t *mp) xfs_freesb(mp); - /* - * All inodes from this mount point should be freed. - */ - ASSERT(mp->m_inodes == NULL); - if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) uuid_table_remove(&mp->m_sb.sb_uuid); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 88eb9e6..3267782 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -248,7 +248,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ spinlock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ uint m_ireclaims; /* count of calls to reclaim*/ -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:45:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45:16 -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 m7C1jD8M032355 for ; Mon, 11 Aug 2008 18:45:13 -0700 X-ASG-Debug-ID: 1218505587-452c01880000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BE9FE38428F for ; Mon, 11 Aug 2008 18:46:28 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id tZ182BFGW9hzSV01 for ; Mon, 11 Aug 2008 18:46:28 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811341" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DF-Cx; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Subject: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Date: Tue, 12 Aug 2008 11:46:08 +1000 Message-Id: <1218505571-27588-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505589 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: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17477 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs xfs_iflush_all() walks the m_inodes list to find inodes that need reclaiming. We already have such a list - the m_del_inodes list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up xfs_finish_reclaim_all() to handle the different flush modes now needed. Originally based on a patch from Christoph Hellwig. Version 3 o rediff against new linux-2.6/xfs_sync.c code Version 2 o revert xfs_syncsub() inode reclaim behaviour back to original code o xfs_quiesce_fs() should use XFS_IFLUSH_DELWRI_ELSE_ASYNC, not XFS_IFLUSH_ASYNC, to prevent change of behaviour. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_sync.c | 2 +- fs/xfs/xfs_inode.c | 35 ----------------------------------- fs/xfs/xfs_inode.h | 3 +-- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 2 +- fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ 6 files changed, 22 insertions(+), 64 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index a51534c..cd82ba5 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -504,7 +504,7 @@ xfs_syncsub( if (flags & (SYNC_ATTR|SYNC_DELWRI)) { if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); else error = xfs_sync_inodes(mp, flags, bypassed); } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5bb638b..ced22e4 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3453,41 +3453,6 @@ corrupt_out: } -/* - * Flush all inactive inodes in mp. - */ -void -xfs_iflush_all( - xfs_mount_t *mp) -{ - xfs_inode_t *ip; - - again: - XFS_MOUNT_ILOCK(mp); - ip = mp->m_inodes; - if (ip == NULL) - goto out; - - do { - /* Make sure we skip markers inserted by sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - if (!VFS_I(ip)) { - XFS_MOUNT_IUNLOCK(mp); - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); - goto again; - } - - ASSERT(vn_count(VFS_I(ip)) == 0); - - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - out: - XFS_MOUNT_IUNLOCK(mp); -} #ifdef XFS_ILOCK_TRACE ktrace_t *xfs_ilock_trace_buf; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 5717244..455b1a9 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -489,7 +489,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); -int xfs_finish_reclaim_all(struct xfs_mount *, int); +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); /* * xfs_inode.c prototypes. @@ -527,7 +527,6 @@ void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); void xfs_lock_inodes(xfs_inode_t **, int, uint); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6b43507..d048e3b 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1261,7 +1261,7 @@ xfs_unmountfs(xfs_mount_t *mp) * need to force the log first. */ xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); - xfs_iflush_all(mp); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index c5ade9c..b390b8f 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -66,7 +66,7 @@ xfs_quiesce_fs( int count = 0, pincount; xfs_flush_buftarg(mp->m_ddev_targp, 0); - xfs_finish_reclaim_all(mp, 0); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); /* This loop must run at least twice. * The first instance of the loop will flush diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 7b967c0..1c654ba 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2911,36 +2911,30 @@ xfs_finish_reclaim( } int -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) +xfs_finish_reclaim_all( + xfs_mount_t *mp, + int noblock, + int mode) { - int purged; xfs_inode_t *ip, *n; - int done = 0; - while (!done) { - purged = 0; - XFS_MOUNT_ILOCK(mp); - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { - if (noblock) { - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) - continue; - if (xfs_ipincount(ip) || - !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - continue; - } +restart: + XFS_MOUNT_ILOCK(mp); + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { + if (noblock) { + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) + continue; + if (xfs_ipincount(ip) || + !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + continue; } - XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); - purged = 1; - break; } - - done = !purged; + XFS_MOUNT_IUNLOCK(mp); + if (xfs_finish_reclaim(ip, noblock, mode)) + delay(1); + goto restart; } - XFS_MOUNT_IUNLOCK(mp); return 0; } -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:45:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45:23 -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,J_CHICKENPOX_62 autolearn=no 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 m7C1jK9T032418 for ; Mon, 11 Aug 2008 18:45:20 -0700 X-ASG-Debug-ID: 1218505587-452c01880003-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D83F2384295 for ; Mon, 11 Aug 2008 18:46:34 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id KzH45ge0wQBgFxbK for ; Mon, 11 Aug 2008 18:46:34 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811344" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DI-Ed; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Subject: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Date: Tue, 12 Aug 2008 11:46:09 +1000 Message-Id: <1218505571-27588-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505595 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.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17481 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Update xfs_sync_inodes to walk the inode radix tree cache to find dirty inodes. This removes a huge bunch of nasty, messy code for traversing the mount inode list safely and removes another user of the mount inode list. Version 3 o rediff against new linux-2.6/xfs_sync.c code Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_sync.c | 361 ++++++++++++------------------------------- 1 files changed, 101 insertions(+), 260 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index cd82ba5..53d85ec 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -121,356 +121,197 @@ xfs_sync( } /* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * + * Sync all the inodes in the given AG according to the + * direction given by the flags. */ -int -xfs_sync_inodes( +STATIC int +xfs_sync_inodes_ag( xfs_mount_t *mp, + int ag, int flags, - int *bypassed) + int *bypassed) { xfs_inode_t *ip = NULL; struct inode *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + xfs_perag_t *pag = &mp->m_perag[ag]; + boolean_t vnode_refed = B_FALSE; + int nr_found; + int first_index = 0; + int error = 0; + int last_error = 0; + int fflag = XFS_B_ASYNC; + int lock_flags = XFS_ILOCK_SHARED; - fflag = XFS_B_ASYNC; /* default is don't wait */ if (flags & SYNC_DELWRI) fflag = XFS_B_DELWRI; if (flags & SYNC_WAIT) fflag = 0; /* synchronous overrides all */ - base_lock_flags = XFS_ILOCK_SHARED; if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { /* * We need the I/O lock if we're going to call any of * the flush/inval routines. */ - base_lock_flags |= XFS_IOLOCK_SHARED; + lock_flags |= XFS_IOLOCK_SHARED; } - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; - do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; - /* - * There were no inodes in the list, just break out - * of the loop. + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. */ - if (ip == NULL) { - break; - } + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } - vp = VFS_I(ip); + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. + * skip inodes in reclaim. Let xfs_syncsub do that for + * us so we don't need to worry. */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } + vp = VFS_I(ip); + if (!vp) { + read_unlock(&pag->pag_ici_lock); continue; } + /* bad inodes are dealt with elsewhere */ if (VN_BAD(vp)) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } + /* nothing to sync during shutdown */ if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); + read_unlock(&pag->pag_ici_lock); return 0; } /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. + * The inode lock here actually coordinates with the almost + * spurious inode lock in xfs_ireclaim() to prevent the vnode + * we handle here without a reference from being freed while we + * reference it. If we lock the inode while it's on the mount + * list here, then the spurious inode lock in xfs_ireclaim() + * after the inode is pulled from the mount list will sleep + * until we release it here. This keeps the vnode from being + * freed while we reference it. */ if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); + if (!vp) continue; - } - - IPOINTER_INSERT(ip, mp); xfs_ilock(ip, lock_flags); ASSERT(vp == VFS_I(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; + } else { + /* safe to unlock here as we have a reference */ + read_unlock(&pag->pag_ici_lock); } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - /* * If we have to flush data or wait for I/O completion * we need to drop the ilock that we currently hold. * If we need to drop the lock, insert a marker if we * have not already done so. */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } + if (flags & SYNC_CLOSE) { xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, FI_REMAPF); + else + error = xfs_flushinval_pages(ip, 0, -1, + FI_REMAPF); + /* wait for I/O on freeze */ if (flags & SYNC_IOWAIT) vn_iowait(ip); xfs_ilock(ip, XFS_ILOCK_SHARED); } - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); + if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + if ((flags & SYNC_ATTR) && !xfs_inode_clean(ip)) { if (flags & SYNC_WAIT) { xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + else + xfs_ifunlock(ip); } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + else + xfs_ifunlock(ip); } else if (bypassed) { (*bypassed)++; } } - if (lock_flags != 0) { + if (lock_flags) xfs_iunlock(ip, lock_flags); - } if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - IRELE(ip); - vnode_refed = B_FALSE; } - if (error) { + if (error) last_error = error; - } - /* * bail out if the filesystem is corrupted. */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); + if (error == EFSCORRUPTED) return XFS_ERROR(error); - } - - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } - - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; + } while (nr_found); - } while (ip != mp->m_inodes); + return last_error; +} - XFS_MOUNT_IUNLOCK(mp); +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error; + int last_error; + int i; - ASSERT(ipointer_in == B_FALSE); + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; - kmem_free(ipointer); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + error = xfs_sync_inodes_ag(mp, i, flags, bypassed); + if (error) + last_error = error; + if (error == EFSCORRUPTED) + break; + } return XFS_ERROR(last_error); } -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:45:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45:23 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7C1jJpT032403 for ; Mon, 11 Aug 2008 18:45:19 -0700 X-ASG-Debug-ID: 1218505589-79c8004a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6B45719C1C62 for ; Mon, 11 Aug 2008 18:46:30 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id OWG8HD07W7cdAKeA for ; Mon, 11 Aug 2008 18:46:30 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811345" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DD-B9; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Subject: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Date: Tue, 12 Aug 2008 11:46:07 +1000 Message-Id: <1218505571-27588-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505594 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: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17480 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Move all the xfssyncd code to the new xfs_sync.c file. This places it closer to the actual code that it interacts with, rather than just being associated with high level VFS code. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 151 +-------------------------------------- fs/xfs/linux-2.6/xfs_super.h | 3 - fs/xfs/linux-2.6/xfs_sync.c | 163 ++++++++++++++++++++++++++++++++++++++++++ fs/xfs/linux-2.6/xfs_sync.h | 55 ++++++++++++++ fs/xfs/linux-2.6/xfs_vfs.h | 31 -------- fs/xfs/xfs_mount.h | 1 + 6 files changed, 222 insertions(+), 182 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 58c474b..6268b35 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -944,146 +944,6 @@ xfs_fs_clear_inode( ASSERT(XFS_I(inode) == NULL); } -/* - * Enqueue a work item to be picked up by the vfs xfssyncd thread. - * Doing this has two advantages: - * - It saves on stack space, which is tight in certain situations - * - It can be used (with care) as a mechanism to avoid deadlocks. - * Flushing while allocating in a full filesystem requires both. - */ -STATIC void -xfs_syncd_queue_work( - struct xfs_mount *mp, - void *data, - void (*syncer)(struct xfs_mount *, void *)) -{ - struct bhv_vfs_sync_work *work; - - work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP); - INIT_LIST_HEAD(&work->w_list); - work->w_syncer = syncer; - work->w_data = data; - work->w_mount = mp; - spin_lock(&mp->m_sync_lock); - list_add_tail(&work->w_list, &mp->m_sync_list); - spin_unlock(&mp->m_sync_lock); - wake_up_process(mp->m_sync_task); -} - -/* - * Flush delayed allocate data, attempting to free up reserved space - * from existing allocations. At this point a new allocation attempt - * has failed with ENOSPC and we are in the process of scratching our - * heads, looking about for more room... - */ -STATIC void -xfs_flush_inode_work( - struct xfs_mount *mp, - void *arg) -{ - struct inode *inode = arg; - filemap_flush(inode->i_mapping); - iput(inode); -} - -void -xfs_flush_inode( - xfs_inode_t *ip) -{ - struct inode *inode = VFS_I(ip); - - igrab(inode); - xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); - delay(msecs_to_jiffies(500)); -} - -/* - * This is the "bigger hammer" version of xfs_flush_inode_work... - * (IOW, "If at first you don't succeed, use a Bigger Hammer"). - */ -STATIC void -xfs_flush_device_work( - struct xfs_mount *mp, - void *arg) -{ - struct inode *inode = arg; - sync_blockdev(mp->m_super->s_bdev); - iput(inode); -} - -void -xfs_flush_device( - xfs_inode_t *ip) -{ - struct inode *inode = VFS_I(ip); - - igrab(inode); - xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); - delay(msecs_to_jiffies(500)); - xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); -} - -STATIC void -xfs_sync_worker( - struct xfs_mount *mp, - void *unused) -{ - int error; - - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) - error = xfs_sync(mp, SYNC_FSDATA | SYNC_BDFLUSH | SYNC_ATTR); - mp->m_sync_seq++; - wake_up(&mp->m_wait_single_sync_task); -} - -STATIC int -xfssyncd( - void *arg) -{ - struct xfs_mount *mp = arg; - long timeleft; - bhv_vfs_sync_work_t *work, *n; - LIST_HEAD (tmp); - - set_freezable(); - timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); - for (;;) { - timeleft = schedule_timeout_interruptible(timeleft); - /* swsusp */ - try_to_freeze(); - if (kthread_should_stop() && list_empty(&mp->m_sync_list)) - break; - - spin_lock(&mp->m_sync_lock); - /* - * We can get woken by laptop mode, to do a sync - - * that's the (only!) case where the list would be - * empty with time remaining. - */ - if (!timeleft || list_empty(&mp->m_sync_list)) { - if (!timeleft) - timeleft = xfs_syncd_centisecs * - msecs_to_jiffies(10); - INIT_LIST_HEAD(&mp->m_sync_work.w_list); - list_add_tail(&mp->m_sync_work.w_list, - &mp->m_sync_list); - } - list_for_each_entry_safe(work, n, &mp->m_sync_list, w_list) - list_move(&work->w_list, &tmp); - spin_unlock(&mp->m_sync_lock); - - list_for_each_entry_safe(work, n, &tmp, w_list) { - (*work->w_syncer)(mp, work->w_data); - list_del(&work->w_list); - if (work == &mp->m_sync_work) - continue; - kmem_free(work); - } - } - - return 0; -} - STATIC void xfs_free_fsname( struct xfs_mount *mp) @@ -1102,8 +962,7 @@ xfs_fs_put_super( int unmount_event_flags = 0; int error; - kthread_stop(mp->m_sync_task); - + xfs_syncd_stop(mp); xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); #ifdef HAVE_DMAPI @@ -1754,13 +1613,9 @@ xfs_fs_fill_super( goto fail_vnrele; } - mp->m_sync_work.w_syncer = xfs_sync_worker; - mp->m_sync_work.w_mount = mp; - mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); - if (IS_ERR(mp->m_sync_task)) { - error = -PTR_ERR(mp->m_sync_task); + error = xfs_syncd_init(mp); + if (error) goto fail_vnrele; - } xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h index fe2ef4e..56dc48a 100644 --- a/fs/xfs/linux-2.6/xfs_super.h +++ b/fs/xfs/linux-2.6/xfs_super.h @@ -101,9 +101,6 @@ struct block_device; extern __uint64_t xfs_max_file_offset(unsigned int); -extern void xfs_flush_inode(struct xfs_inode *); -extern void xfs_flush_device(struct xfs_inode *); - extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); extern const struct export_operations xfs_export_operations; diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index c765eb2..a51534c 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -44,6 +44,9 @@ #include "xfs_inode_item.h" #include "xfs_rw.h" +#include +#include + /* * xfs_sync flushes any pending I/O to file system vfsp. * @@ -603,3 +606,163 @@ xfs_syncsub( return XFS_ERROR(last_error); } + +/* + * Enqueue a work item to be picked up by the vfs xfssyncd thread. + * Doing this has two advantages: + * - It saves on stack space, which is tight in certain situations + * - It can be used (with care) as a mechanism to avoid deadlocks. + * Flushing while allocating in a full filesystem requires both. + */ +STATIC void +xfs_syncd_queue_work( + struct xfs_mount *mp, + void *data, + void (*syncer)(struct xfs_mount *, void *)) +{ + struct bhv_vfs_sync_work *work; + + work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP); + INIT_LIST_HEAD(&work->w_list); + work->w_syncer = syncer; + work->w_data = data; + work->w_mount = mp; + spin_lock(&mp->m_sync_lock); + list_add_tail(&work->w_list, &mp->m_sync_list); + spin_unlock(&mp->m_sync_lock); + wake_up_process(mp->m_sync_task); +} + +/* + * Flush delayed allocate data, attempting to free up reserved space + * from existing allocations. At this point a new allocation attempt + * has failed with ENOSPC and we are in the process of scratching our + * heads, looking about for more room... + */ +STATIC void +xfs_flush_inode_work( + struct xfs_mount *mp, + void *arg) +{ + struct inode *inode = arg; + filemap_flush(inode->i_mapping); + iput(inode); +} + +void +xfs_flush_inode( + xfs_inode_t *ip) +{ + struct inode *inode = VFS_I(ip); + + igrab(inode); + xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); + delay(msecs_to_jiffies(500)); +} + +/* + * This is the "bigger hammer" version of xfs_flush_inode_work... + * (IOW, "If at first you don't succeed, use a Bigger Hammer"). + */ +STATIC void +xfs_flush_device_work( + struct xfs_mount *mp, + void *arg) +{ + struct inode *inode = arg; + sync_blockdev(mp->m_super->s_bdev); + iput(inode); +} + +void +xfs_flush_device( + xfs_inode_t *ip) +{ + struct inode *inode = VFS_I(ip); + + igrab(inode); + xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); + delay(msecs_to_jiffies(500)); + xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); +} + +STATIC void +xfs_sync_worker( + struct xfs_mount *mp, + void *unused) +{ + int error; + + if (!(mp->m_flags & XFS_MOUNT_RDONLY)) + error = xfs_sync(mp, SYNC_FSDATA | SYNC_BDFLUSH | SYNC_ATTR); + mp->m_sync_seq++; + wake_up(&mp->m_wait_single_sync_task); +} + +STATIC int +xfssyncd( + void *arg) +{ + struct xfs_mount *mp = arg; + long timeleft; + bhv_vfs_sync_work_t *work, *n; + LIST_HEAD (tmp); + + set_freezable(); + timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); + for (;;) { + timeleft = schedule_timeout_interruptible(timeleft); + /* swsusp */ + try_to_freeze(); + if (kthread_should_stop() && list_empty(&mp->m_sync_list)) + break; + + spin_lock(&mp->m_sync_lock); + /* + * We can get woken by laptop mode, to do a sync - + * that's the (only!) case where the list would be + * empty with time remaining. + */ + if (!timeleft || list_empty(&mp->m_sync_list)) { + if (!timeleft) + timeleft = xfs_syncd_centisecs * + msecs_to_jiffies(10); + INIT_LIST_HEAD(&mp->m_sync_work.w_list); + list_add_tail(&mp->m_sync_work.w_list, + &mp->m_sync_list); + } + list_for_each_entry_safe(work, n, &mp->m_sync_list, w_list) + list_move(&work->w_list, &tmp); + spin_unlock(&mp->m_sync_lock); + + list_for_each_entry_safe(work, n, &tmp, w_list) { + (*work->w_syncer)(mp, work->w_data); + list_del(&work->w_list); + if (work == &mp->m_sync_work) + continue; + kmem_free(work); + } + } + + return 0; +} + +int +xfs_syncd_init( + struct xfs_mount *mp) +{ + mp->m_sync_work.w_syncer = xfs_sync_worker; + mp->m_sync_work.w_mount = mp; + mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); + if (IS_ERR(mp->m_sync_task)) + return -PTR_ERR(mp->m_sync_task); + return 0; +} + +void +xfs_syncd_stop( + struct xfs_mount *mp) +{ + kthread_stop(mp->m_sync_task); +} + diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h index ac513d7..1825b19 100644 --- a/fs/xfs/linux-2.6/xfs_sync.h +++ b/fs/xfs/linux-2.6/xfs_sync.h @@ -1,6 +1,61 @@ +/* + * Copyright (c) 2000-2006 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef XFS_SYNC_H #define XFS_SYNC_H 1 +struct xfs_mount; + +typedef struct bhv_vfs_sync_work { + struct list_head w_list; + struct xfs_mount *w_mount; + void *w_data; /* syncer routine argument */ + void (*w_syncer)(struct xfs_mount *, void *); +} bhv_vfs_sync_work_t; + +#define SYNC_ATTR 0x0001 /* sync attributes */ +#define SYNC_CLOSE 0x0002 /* close file system down */ +#define SYNC_DELWRI 0x0004 /* look at delayed writes */ +#define SYNC_WAIT 0x0008 /* wait for i/o to complete */ +#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ +#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ +#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ +#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ +#define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */ + +/* + * When remounting a filesystem read-only or freezing the filesystem, + * we have two phases to execute. This first phase is syncing the data + * before we quiesce the fielsystem, and the second is flushing all the + * inodes out after we've waited for all the transactions created by + * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE + * to ensure that the inodes are written to their location on disk + * rather than just existing in transactions in the log. This means + * after a quiesce there is no log replay required to write the inodes + * to disk (this is the main difference between a sync and a quiesce). + */ +#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) +#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT) + +int xfs_syncd_init(struct xfs_mount *mp); +void xfs_syncd_stop(struct xfs_mount *mp); + int xfs_sync(struct xfs_mount *mp, int flags); +void xfs_flush_inode(struct xfs_inode *ip); +void xfs_flush_device(struct xfs_inode *ip); #endif diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index 7e60c77..0ab60bc 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h @@ -33,37 +33,6 @@ struct xfs_mount_args; typedef struct kstatfs bhv_statvfs_t; -typedef struct bhv_vfs_sync_work { - struct list_head w_list; - struct xfs_mount *w_mount; - void *w_data; /* syncer routine argument */ - void (*w_syncer)(struct xfs_mount *, void *); -} bhv_vfs_sync_work_t; - -#define SYNC_ATTR 0x0001 /* sync attributes */ -#define SYNC_CLOSE 0x0002 /* close file system down */ -#define SYNC_DELWRI 0x0004 /* look at delayed writes */ -#define SYNC_WAIT 0x0008 /* wait for i/o to complete */ -#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ -#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ -#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ -#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ -#define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */ - -/* - * When remounting a filesystem read-only or freezing the filesystem, - * we have two phases to execute. This first phase is syncing the data - * before we quiesce the fielsystem, and the second is flushing all the - * inodes out after we've waited for all the transactions created by - * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE - * to ensure that the inodes are written to their location on disk - * rather than just existing in transactions in the log. This means - * after a quiesce there is no log replay required to write the inodes - * to disk (this is the main difference between a sync and a quiesce). - */ -#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) -#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT) - #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ #define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */ diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 6482005..88eb9e6 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -18,6 +18,7 @@ #ifndef __XFS_MOUNT_H__ #define __XFS_MOUNT_H__ +#include "xfs_sync.h" typedef struct xfs_trans_reservations { uint tr_write; /* extent alloc trans */ -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:45:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:45: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,J_CHICKENPOX_62, J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7C1jOeo032499 for ; Mon, 11 Aug 2008 18:45:24 -0700 X-ASG-Debug-ID: 1218505589-79c8004a0001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 778F319C1C62 for ; Mon, 11 Aug 2008 18:46:34 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 9ZjBKoqpGRV7SG4X for ; Mon, 11 Aug 2008 18:46:34 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811373" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DA-96; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/6] XFS: move sync code to its own file Subject: [PATCH 1/6] XFS: move sync code to its own file Date: Tue, 12 Aug 2008 11:46:06 +1000 Message-Id: <1218505571-27588-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505597 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: -0.47 X-Barracuda-Spam-Status: No, SCORE=-0.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M, BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.83697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17482 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The sync code in XFS is spread around several files. While it used to make sense to have such a distribution, the code about to be cleaned up and so centralising it in one spot as the first step mackes sense. Signed-off-by: Dave Chinner --- fs/xfs/Makefile | 1 + fs/xfs/linux-2.6/xfs_super.c | 1 + fs/xfs/linux-2.6/xfs_sync.c | 605 ++++++++++++++++++++++++++++++++++++++++++ fs/xfs/linux-2.6/xfs_sync.h | 6 + fs/xfs/xfs_vfsops.c | 562 +-------------------------------------- fs/xfs/xfs_vfsops.h | 1 - 6 files changed, 615 insertions(+), 561 deletions(-) create mode 100644 fs/xfs/linux-2.6/xfs_sync.c create mode 100644 fs/xfs/linux-2.6/xfs_sync.h diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 737c9a4..f42ea60 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -106,6 +106,7 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \ xfs_iops.o \ xfs_lrw.o \ xfs_super.o \ + xfs_sync.o \ xfs_vnode.o \ xfs_xattr.o) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index f90d0d8..58c474b 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -58,6 +58,7 @@ #include "xfs_extfree_item.h" #include "xfs_mru_cache.h" #include "xfs_inode_item.h" +#include "xfs_sync.h" #include #include diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c new file mode 100644 index 0000000..c765eb2 --- /dev/null +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -0,0 +1,605 @@ +/* + * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_types.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_inode.h" +#include "xfs_dinode.h" +#include "xfs_error.h" +#include "xfs_mru_cache.h" +#include "xfs_filestream.h" +#include "xfs_vnodeops.h" +#include "xfs_utils.h" +#include "xfs_buf_item.h" +#include "xfs_inode_item.h" +#include "xfs_rw.h" + +/* + * xfs_sync flushes any pending I/O to file system vfsp. + * + * This routine is called by vfs_sync() to make sure that things make it + * out to disk eventually, on sync() system calls to flush out everything, + * and when the file system is unmounted. For the vfs_sync() case, all + * we really need to do is sync out the log to make all of our meta-data + * updates permanent (except for timestamps). For calls from pflushd(), + * dirty pages are kept moving by calling pdflush() on the inodes + * containing them. We also flush the inodes that we can lock without + * sleeping and the superblock if we can lock it without sleeping from + * vfs_sync() so that items at the tail of the log are always moving out. + * + * Flags: + * SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want + * to sleep if we can help it. All we really need + * to do is ensure that the log is synced at least + * periodically. We also push the inodes and + * superblock if we can lock them without sleeping + * and they are not pinned. + * SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not + * set, then we really want to lock each inode and flush + * it. + * SYNC_WAIT - All the flushes that take place in this call should + * be synchronous. + * SYNC_DELWRI - This tells us to push dirty pages associated with + * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to + * determine if they should be flushed sync, async, or + * delwri. + * SYNC_CLOSE - This flag is passed when the system is being + * unmounted. We should sync and invalidate everything. + * SYNC_FSDATA - This indicates that the caller would like to make + * sure the superblock is safe on disk. We can ensure + * this by simply making sure the log gets flushed + * if SYNC_BDFLUSH is set, and by actually writing it + * out otherwise. + * SYNC_IOWAIT - The caller wants us to wait for all data I/O to complete + * before we return (including direct I/O). Forms the drain + * side of the write barrier needed to safely quiesce the + * filesystem. + * + */ +int +xfs_sync( + xfs_mount_t *mp, + int flags) +{ + int error; + + /* + * Get the Quota Manager to flush the dquots. + * + * If XFS quota support is not enabled or this filesystem + * instance does not use quotas XFS_QM_DQSYNC will always + * return zero. + */ + error = XFS_QM_DQSYNC(mp, flags); + if (error) { + /* + * If we got an IO error, we will be shutting down. + * So, there's nothing more for us to do here. + */ + ASSERT(error != EIO || XFS_FORCED_SHUTDOWN(mp)); + if (XFS_FORCED_SHUTDOWN(mp)) + return XFS_ERROR(error); + } + + if (flags & SYNC_IOWAIT) + xfs_filestream_flush(mp); + + return xfs_syncsub(mp, flags, NULL); +} + +/* + * xfs sync routine for internal use + * + * This routine supports all of the flags defined for the generic vfs_sync + * interface as explained above under xfs_sync. + * + */ +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + xfs_inode_t *ip = NULL; + struct inode *vp = NULL; + int error; + int last_error; + uint64_t fflag; + uint lock_flags; + uint base_lock_flags; + boolean_t mount_locked; + boolean_t vnode_refed; + int preempt; + xfs_iptr_t *ipointer; +#ifdef DEBUG + boolean_t ipointer_in = B_FALSE; + +#define IPOINTER_SET ipointer_in = B_TRUE +#define IPOINTER_CLR ipointer_in = B_FALSE +#else +#define IPOINTER_SET +#define IPOINTER_CLR +#endif + + +/* Insert a marker record into the inode list after inode ip. The list + * must be locked when this is called. After the call the list will no + * longer be locked. + */ +#define IPOINTER_INSERT(ip, mp) { \ + ASSERT(ipointer_in == B_FALSE); \ + ipointer->ip_mnext = ip->i_mnext; \ + ipointer->ip_mprev = ip; \ + ip->i_mnext = (xfs_inode_t *)ipointer; \ + ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ + preempt = 0; \ + XFS_MOUNT_IUNLOCK(mp); \ + mount_locked = B_FALSE; \ + IPOINTER_SET; \ + } + +/* Remove the marker from the inode list. If the marker was the only item + * in the list then there are no remaining inodes and we should zero out + * the whole list. If we are the current head of the list then move the head + * past us. + */ +#define IPOINTER_REMOVE(ip, mp) { \ + ASSERT(ipointer_in == B_TRUE); \ + if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ + ip = ipointer->ip_mnext; \ + ip->i_mprev = ipointer->ip_mprev; \ + ipointer->ip_mprev->i_mnext = ip; \ + if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ + mp->m_inodes = ip; \ + } \ + } else { \ + ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ + mp->m_inodes = NULL; \ + ip = NULL; \ + } \ + IPOINTER_CLR; \ + } + +#define XFS_PREEMPT_MASK 0x7f + + ASSERT(!(flags & SYNC_BDFLUSH)); + + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; + preempt = 0; + + /* Allocate a reference marker */ + ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + + fflag = XFS_B_ASYNC; /* default is don't wait */ + if (flags & SYNC_DELWRI) + fflag = XFS_B_DELWRI; + if (flags & SYNC_WAIT) + fflag = 0; /* synchronous overrides all */ + + base_lock_flags = XFS_ILOCK_SHARED; + if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { + /* + * We need the I/O lock if we're going to call any of + * the flush/inval routines. + */ + base_lock_flags |= XFS_IOLOCK_SHARED; + } + + XFS_MOUNT_ILOCK(mp); + + ip = mp->m_inodes; + + mount_locked = B_TRUE; + vnode_refed = B_FALSE; + + IPOINTER_CLR; + + do { + ASSERT(ipointer_in == B_FALSE); + ASSERT(vnode_refed == B_FALSE); + + lock_flags = base_lock_flags; + + /* + * There were no inodes in the list, just break out + * of the loop. + */ + if (ip == NULL) { + break; + } + + /* + * We found another sync thread marker - skip it + */ + if (ip->i_mount == NULL) { + ip = ip->i_mnext; + continue; + } + + vp = VFS_I(ip); + + /* + * If the vnode is gone then this is being torn down, + * call reclaim if it is flushed, else let regular flush + * code deal with it later in the loop. + */ + + if (vp == NULL) { + /* Skip ones already in reclaim */ + if (ip->i_flags & XFS_IRECLAIM) { + ip = ip->i_mnext; + continue; + } + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { + ip = ip->i_mnext; + } else if ((xfs_ipincount(ip) == 0) && + xfs_iflock_nowait(ip)) { + IPOINTER_INSERT(ip, mp); + + xfs_finish_reclaim(ip, 1, + XFS_IFLUSH_DELWRI_ELSE_ASYNC); + + XFS_MOUNT_ILOCK(mp); + mount_locked = B_TRUE; + IPOINTER_REMOVE(ip, mp); + } else { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + ip = ip->i_mnext; + } + continue; + } + + if (VN_BAD(vp)) { + ip = ip->i_mnext; + continue; + } + + if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { + XFS_MOUNT_IUNLOCK(mp); + kmem_free(ipointer); + return 0; + } + + /* + * Try to lock without sleeping. We're out of order with + * the inode list lock here, so if we fail we need to drop + * the mount lock and try again. If we're called from + * bdflush() here, then don't bother. + * + * The inode lock here actually coordinates with the + * almost spurious inode lock in xfs_ireclaim() to prevent + * the vnode we handle here without a reference from + * being freed while we reference it. If we lock the inode + * while it's on the mount list here, then the spurious inode + * lock in xfs_ireclaim() after the inode is pulled from + * the mount list will sleep until we release it here. + * This keeps the vnode from being freed while we reference + * it. + */ + if (xfs_ilock_nowait(ip, lock_flags) == 0) { + if (vp == NULL) { + ip = ip->i_mnext; + continue; + } + + vp = vn_grab(vp); + if (vp == NULL) { + ip = ip->i_mnext; + continue; + } + + IPOINTER_INSERT(ip, mp); + xfs_ilock(ip, lock_flags); + + ASSERT(vp == VFS_I(ip)); + ASSERT(ip->i_mount == mp); + + vnode_refed = B_TRUE; + } + + /* From here on in the loop we may have a marker record + * in the inode list. + */ + + /* + * If we have to flush data or wait for I/O completion + * we need to drop the ilock that we currently hold. + * If we need to drop the lock, insert a marker if we + * have not already done so. + */ + if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || + ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + xfs_iunlock(ip, XFS_ILOCK_SHARED); + + if (flags & SYNC_CLOSE) { + /* Shutdown case. Flush and invalidate. */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, + FI_REMAPF); + else + error = xfs_flushinval_pages(ip, + 0, -1, FI_REMAPF); + } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + error = xfs_flush_pages(ip, 0, + -1, fflag, FI_NONE); + } + + /* + * When freezing, we need to wait ensure all I/O (including direct + * I/O) is complete to ensure no further data modification can take + * place after this point + */ + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + + if ((flags & SYNC_ATTR) && + (ip->i_update_core || + (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { + if (mount_locked) + IPOINTER_INSERT(ip, mp); + + if (flags & SYNC_WAIT) { + xfs_iflock(ip); + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + + /* + * If we can't acquire the flush lock, then the inode + * is already being flushed so don't bother waiting. + * + * If we can lock it then do a delwri flush so we can + * combine multiple inode flushes in each disk write. + */ + } else if (xfs_iflock_nowait(ip)) { + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + } else if (bypassed) { + (*bypassed)++; + } + } + + if (lock_flags != 0) { + xfs_iunlock(ip, lock_flags); + } + + if (vnode_refed) { + /* + * If we had to take a reference on the vnode + * above, then wait until after we've unlocked + * the inode to release the reference. This is + * because we can be already holding the inode + * lock when IRELE() calls xfs_inactive(). + * + * Make sure to drop the mount lock before calling + * IRELE() so that we don't trip over ourselves if + * we have to go for the mount lock again in the + * inactive code. + */ + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + + IRELE(ip); + + vnode_refed = B_FALSE; + } + + if (error) { + last_error = error; + } + + /* + * bail out if the filesystem is corrupted. + */ + if (error == EFSCORRUPTED) { + if (!mount_locked) { + XFS_MOUNT_ILOCK(mp); + IPOINTER_REMOVE(ip, mp); + } + XFS_MOUNT_IUNLOCK(mp); + ASSERT(ipointer_in == B_FALSE); + kmem_free(ipointer); + return XFS_ERROR(error); + } + + /* Let other threads have a chance at the mount lock + * if we have looped many times without dropping the + * lock. + */ + if ((++preempt & XFS_PREEMPT_MASK) == 0) { + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + } + + if (mount_locked == B_FALSE) { + XFS_MOUNT_ILOCK(mp); + mount_locked = B_TRUE; + IPOINTER_REMOVE(ip, mp); + continue; + } + + ASSERT(ipointer_in == B_FALSE); + ip = ip->i_mnext; + + } while (ip != mp->m_inodes); + + XFS_MOUNT_IUNLOCK(mp); + + ASSERT(ipointer_in == B_FALSE); + + kmem_free(ipointer); + return XFS_ERROR(last_error); +} + +/* + * xfs sync routine for internal use + * + * This routine supports all of the flags defined for the generic vfs_sync + * interface as explained above under xfs_sync. + * + */ +int +xfs_syncsub( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error = 0; + int last_error = 0; + uint log_flags = XFS_LOG_FORCE; + xfs_buf_t *bp; + xfs_buf_log_item_t *bip; + + /* + * Sync out the log. This ensures that the log is periodically + * flushed even if there is not enough activity to fill it up. + */ + if (flags & SYNC_WAIT) + log_flags |= XFS_LOG_SYNC; + + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + + if (flags & (SYNC_ATTR|SYNC_DELWRI)) { + if (flags & SYNC_BDFLUSH) + xfs_finish_reclaim_all(mp, 1); + else + error = xfs_sync_inodes(mp, flags, bypassed); + } + + /* + * Flushing out dirty data above probably generated more + * log activity, so if this isn't vfs_sync() then flush + * the log again. + */ + if (flags & SYNC_DELWRI) { + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + } + + if (flags & SYNC_FSDATA) { + /* + * If this is vfs_sync() then only sync the superblock + * if we can lock it without sleeping and it is not pinned. + */ + if (flags & SYNC_BDFLUSH) { + bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); + if (bp != NULL) { + bip = XFS_BUF_FSPRIVATE(bp,xfs_buf_log_item_t*); + if ((bip != NULL) && + xfs_buf_item_dirty(bip)) { + if (!(XFS_BUF_ISPINNED(bp))) { + XFS_BUF_ASYNC(bp); + error = xfs_bwrite(mp, bp); + } else { + xfs_buf_relse(bp); + } + } else { + xfs_buf_relse(bp); + } + } + } else { + bp = xfs_getsb(mp, 0); + /* + * If the buffer is pinned then push on the log so + * we won't get stuck waiting in the write for + * someone, maybe ourselves, to flush the log. + * Even though we just pushed the log above, we + * did not have the superblock buffer locked at + * that point so it can become pinned in between + * there and here. + */ + if (XFS_BUF_ISPINNED(bp)) + xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); + if (flags & SYNC_WAIT) + XFS_BUF_UNASYNC(bp); + else + XFS_BUF_ASYNC(bp); + error = xfs_bwrite(mp, bp); + } + if (error) { + last_error = error; + } + } + + /* + * Now check to see if the log needs a "dummy" transaction. + */ + if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { + xfs_trans_t *tp; + xfs_inode_t *ip; + + /* + * Put a dummy transaction in the log to tell + * recovery that all others are OK. + */ + tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); + if ((error = xfs_trans_reserve(tp, 0, + XFS_ICHANGE_LOG_RES(mp), + 0, 0, 0))) { + xfs_trans_cancel(tp, 0); + return error; + } + + ip = mp->m_rootip; + xfs_ilock(ip, XFS_ILOCK_EXCL); + + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_ihold(tp, ip); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + error = xfs_trans_commit(tp, 0); + xfs_iunlock(ip, XFS_ILOCK_EXCL); + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + } + + /* + * When shutting down, we need to insure that the AIL is pushed + * to disk or the filesystem can appear corrupt from the PROM. + */ + if ((flags & (SYNC_CLOSE|SYNC_WAIT)) == (SYNC_CLOSE|SYNC_WAIT)) { + XFS_bflush(mp->m_ddev_targp); + if (mp->m_rtdev_targp) { + XFS_bflush(mp->m_rtdev_targp); + } + } + + return XFS_ERROR(last_error); +} diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h new file mode 100644 index 0000000..ac513d7 --- /dev/null +++ b/fs/xfs/linux-2.6/xfs_sync.h @@ -0,0 +1,6 @@ +#ifndef XFS_SYNC_H +#define XFS_SYNC_H 1 + +int xfs_sync(struct xfs_mount *mp, int flags); + +#endif diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 439dd39..c5ade9c 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -56,6 +56,7 @@ #include "xfs_vnodeops.h" #include "xfs_vfsops.h" #include "xfs_utils.h" +#include "xfs_sync.h" STATIC void @@ -75,7 +76,7 @@ xfs_quiesce_fs( * we can write the unmount record. */ do { - xfs_syncsub(mp, SYNC_INODE_QUIESCE, NULL); + xfs_sync(mp, SYNC_INODE_QUIESCE); pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); if (!pincount) { delay(50); @@ -196,562 +197,3 @@ fscorrupt_out2: return XFS_ERROR(EFSCORRUPTED); } -/* - * xfs_sync flushes any pending I/O to file system vfsp. - * - * This routine is called by vfs_sync() to make sure that things make it - * out to disk eventually, on sync() system calls to flush out everything, - * and when the file system is unmounted. For the vfs_sync() case, all - * we really need to do is sync out the log to make all of our meta-data - * updates permanent (except for timestamps). For calls from pflushd(), - * dirty pages are kept moving by calling pdflush() on the inodes - * containing them. We also flush the inodes that we can lock without - * sleeping and the superblock if we can lock it without sleeping from - * vfs_sync() so that items at the tail of the log are always moving out. - * - * Flags: - * SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want - * to sleep if we can help it. All we really need - * to do is ensure that the log is synced at least - * periodically. We also push the inodes and - * superblock if we can lock them without sleeping - * and they are not pinned. - * SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not - * set, then we really want to lock each inode and flush - * it. - * SYNC_WAIT - All the flushes that take place in this call should - * be synchronous. - * SYNC_DELWRI - This tells us to push dirty pages associated with - * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to - * determine if they should be flushed sync, async, or - * delwri. - * SYNC_CLOSE - This flag is passed when the system is being - * unmounted. We should sync and invalidate everything. - * SYNC_FSDATA - This indicates that the caller would like to make - * sure the superblock is safe on disk. We can ensure - * this by simply making sure the log gets flushed - * if SYNC_BDFLUSH is set, and by actually writing it - * out otherwise. - * SYNC_IOWAIT - The caller wants us to wait for all data I/O to complete - * before we return (including direct I/O). Forms the drain - * side of the write barrier needed to safely quiesce the - * filesystem. - * - */ -int -xfs_sync( - xfs_mount_t *mp, - int flags) -{ - int error; - - /* - * Get the Quota Manager to flush the dquots. - * - * If XFS quota support is not enabled or this filesystem - * instance does not use quotas XFS_QM_DQSYNC will always - * return zero. - */ - error = XFS_QM_DQSYNC(mp, flags); - if (error) { - /* - * If we got an IO error, we will be shutting down. - * So, there's nothing more for us to do here. - */ - ASSERT(error != EIO || XFS_FORCED_SHUTDOWN(mp)); - if (XFS_FORCED_SHUTDOWN(mp)) - return XFS_ERROR(error); - } - - if (flags & SYNC_IOWAIT) - xfs_filestream_flush(mp); - - return xfs_syncsub(mp, flags, NULL); -} - -/* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * - */ -int -xfs_sync_inodes( - xfs_mount_t *mp, - int flags, - int *bypassed) -{ - xfs_inode_t *ip = NULL; - struct inode *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); - - fflag = XFS_B_ASYNC; /* default is don't wait */ - if (flags & SYNC_DELWRI) - fflag = XFS_B_DELWRI; - if (flags & SYNC_WAIT) - fflag = 0; /* synchronous overrides all */ - - base_lock_flags = XFS_ILOCK_SHARED; - if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { - /* - * We need the I/O lock if we're going to call any of - * the flush/inval routines. - */ - base_lock_flags |= XFS_IOLOCK_SHARED; - } - - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; - - do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; - - /* - * There were no inodes in the list, just break out - * of the loop. - */ - if (ip == NULL) { - break; - } - - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = VFS_I(ip); - - /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. - */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } - continue; - } - - if (VN_BAD(vp)) { - ip = ip->i_mnext; - continue; - } - - if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); - return 0; - } - - /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. - */ - if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - - IPOINTER_INSERT(ip, mp); - xfs_ilock(ip, lock_flags); - - ASSERT(vp == VFS_I(ip)); - ASSERT(ip->i_mount == mp); - - vnode_refed = B_TRUE; - } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - - /* - * If we have to flush data or wait for I/O completion - * we need to drop the ilock that we currently hold. - * If we need to drop the lock, insert a marker if we - * have not already done so. - */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ - if (flags & SYNC_IOWAIT) - vn_iowait(ip); - - xfs_ilock(ip, XFS_ILOCK_SHARED); - } - - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); - - if (flags & SYNC_WAIT) { - xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ - } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); - } else if (bypassed) { - (*bypassed)++; - } - } - - if (lock_flags != 0) { - xfs_iunlock(ip, lock_flags); - } - - if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - - IRELE(ip); - - vnode_refed = B_FALSE; - } - - if (error) { - last_error = error; - } - - /* - * bail out if the filesystem is corrupted. - */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); - return XFS_ERROR(error); - } - - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } - - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } - - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; - - } while (ip != mp->m_inodes); - - XFS_MOUNT_IUNLOCK(mp); - - ASSERT(ipointer_in == B_FALSE); - - kmem_free(ipointer); - return XFS_ERROR(last_error); -} - -/* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * - */ -int -xfs_syncsub( - xfs_mount_t *mp, - int flags, - int *bypassed) -{ - int error = 0; - int last_error = 0; - uint log_flags = XFS_LOG_FORCE; - xfs_buf_t *bp; - xfs_buf_log_item_t *bip; - - /* - * Sync out the log. This ensures that the log is periodically - * flushed even if there is not enough activity to fill it up. - */ - if (flags & SYNC_WAIT) - log_flags |= XFS_LOG_SYNC; - - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - - if (flags & (SYNC_ATTR|SYNC_DELWRI)) { - if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); - else - error = xfs_sync_inodes(mp, flags, bypassed); - } - - /* - * Flushing out dirty data above probably generated more - * log activity, so if this isn't vfs_sync() then flush - * the log again. - */ - if (flags & SYNC_DELWRI) { - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - } - - if (flags & SYNC_FSDATA) { - /* - * If this is vfs_sync() then only sync the superblock - * if we can lock it without sleeping and it is not pinned. - */ - if (flags & SYNC_BDFLUSH) { - bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); - if (bp != NULL) { - bip = XFS_BUF_FSPRIVATE(bp,xfs_buf_log_item_t*); - if ((bip != NULL) && - xfs_buf_item_dirty(bip)) { - if (!(XFS_BUF_ISPINNED(bp))) { - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } else { - xfs_buf_relse(bp); - } - } else { - xfs_buf_relse(bp); - } - } - } else { - bp = xfs_getsb(mp, 0); - /* - * If the buffer is pinned then push on the log so - * we won't get stuck waiting in the write for - * someone, maybe ourselves, to flush the log. - * Even though we just pushed the log above, we - * did not have the superblock buffer locked at - * that point so it can become pinned in between - * there and here. - */ - if (XFS_BUF_ISPINNED(bp)) - xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); - if (flags & SYNC_WAIT) - XFS_BUF_UNASYNC(bp); - else - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } - if (error) { - last_error = error; - } - } - - /* - * Now check to see if the log needs a "dummy" transaction. - */ - if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { - xfs_trans_t *tp; - xfs_inode_t *ip; - - /* - * Put a dummy transaction in the log to tell - * recovery that all others are OK. - */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); - if ((error = xfs_trans_reserve(tp, 0, - XFS_ICHANGE_LOG_RES(mp), - 0, 0, 0))) { - xfs_trans_cancel(tp, 0); - return error; - } - - ip = mp->m_rootip; - xfs_ilock(ip, XFS_ILOCK_EXCL); - - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); - xfs_trans_ihold(tp, ip); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = xfs_trans_commit(tp, 0); - xfs_iunlock(ip, XFS_ILOCK_EXCL); - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - } - - /* - * When shutting down, we need to insure that the AIL is pushed - * to disk or the filesystem can appear corrupt from the PROM. - */ - if ((flags & (SYNC_CLOSE|SYNC_WAIT)) == (SYNC_CLOSE|SYNC_WAIT)) { - XFS_bflush(mp->m_ddev_targp); - if (mp->m_rtdev_targp) { - XFS_bflush(mp->m_rtdev_targp); - } - } - - return XFS_ERROR(last_error); -} diff --git a/fs/xfs/xfs_vfsops.h b/fs/xfs/xfs_vfsops.h index a74b050..6701d0e 100644 --- a/fs/xfs/xfs_vfsops.h +++ b/fs/xfs/xfs_vfsops.h @@ -8,7 +8,6 @@ struct kstatfs; struct xfs_mount; struct xfs_mount_args; -int xfs_sync(struct xfs_mount *mp, int flags); void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, int lnnum); void xfs_attr_quiesce(struct xfs_mount *mp); -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:51:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:51:37 -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 m7C1pYdB002536 for ; Mon, 11 Aug 2008 18:51:34 -0700 X-ASG-Debug-ID: 1218505968-452c01cd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7DDB1384045 for ; Mon, 11 Aug 2008 18:52:48 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id r1iToiRHTFUCnDjH for ; Mon, 11 Aug 2008 18:52:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179817322" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:22:46 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSj41-0007s0-VE; Tue, 12 Aug 2008 11:52:45 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] XFS: factor xfs_iget_core() into hit and miss cases Subject: [PATCH] XFS: factor xfs_iget_core() into hit and miss cases Date: Tue, 12 Aug 2008 11:52:45 +1000 Message-Id: <1218505965-30229-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218505970 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.02, rules version 3.0.83699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17483 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs There are really two cases in xfs_iget_core(). The first is the cache hit case, the second is the miss case. They share very little code, and hence can easily be factored out into separate functions. This makes the code much easier to understand and subsequently modify. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 347 +++++++++++++++++++++++++++++------------------------ 1 files changed, 191 insertions(+), 156 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index cd442da..640ce29 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -40,161 +40,119 @@ #include "xfs_utils.h" /* - * Look up an inode by number in the given file system. - * The inode is looked up in the cache held in each AG. - * If the inode is found in the cache, attach it to the provided - * vnode. - * - * If it is not in core, read it in from the file system's device, - * add it to the cache and attach the provided vnode. - * - * The inode is locked according to the value of the lock_flags parameter. - * This flag parameter indicates how and if the inode's IO lock and inode lock - * should be taken. - * - * mp -- the mount point structure for the current file system. It points - * to the inode hash table. - * tp -- a pointer to the current transaction if there is one. This is - * simply passed through to the xfs_iread() call. - * ino -- the number of the inode desired. This is the unique identifier - * within the file system for the inode being requested. - * lock_flags -- flags indicating how to lock the inode. See the comment - * for xfs_ilock() for a list of valid values. - * bno -- the block number starting the buffer containing the inode, - * if known (as by bulkstat), else 0. + * Check the validity of the inode we just found it the cache */ -STATIC int -xfs_iget_core( - struct inode *inode, - xfs_mount_t *mp, - xfs_trans_t *tp, - xfs_ino_t ino, - uint flags, - uint lock_flags, - xfs_inode_t **ipp, - xfs_daddr_t bno) +static int +xfs_iget_cache_hit( + struct inode *inode, + struct xfs_perag *pag, + struct xfs_inode *ip, + int flags, + int lock_flags) __releases(pag->pag_ici_lock) { - struct inode *old_inode; - xfs_inode_t *ip; - int error; - unsigned long first_index, mask; - xfs_perag_t *pag; - xfs_agino_t agino; - - /* the radix tree exists only in inode capable AGs */ - if (XFS_INO_TO_AGNO(mp, ino) >= mp->m_maxagi) - return EINVAL; - - /* get the perag structure and ensure that it's inode capable */ - pag = xfs_get_perag(mp, ino); - if (!pag->pagi_inodeok) - return EINVAL; - ASSERT(pag->pag_ici_init); - agino = XFS_INO_TO_AGINO(mp, ino); + struct xfs_mount *mp = ip->i_mount; + struct inode *old_inode; + int error = 0; -again: - read_lock(&pag->pag_ici_lock); - ip = radix_tree_lookup(&pag->pag_ici_root, agino); + /* + * If INEW is set this inode is being set up + * Pause and try again. + */ + if (xfs_iflags_test(ip, XFS_INEW)) { + error = EAGAIN; + XFS_STATS_INC(xs_ig_frecycle); + goto out_error; + } - if (ip != NULL) { + old_inode = ip->i_vnode; + if (old_inode == NULL) { /* - * If INEW is set this inode is being set up + * If IRECLAIM is set this inode is + * on its way out of the system, * we need to pause and try again. */ - if (xfs_iflags_test(ip, XFS_INEW)) { - read_unlock(&pag->pag_ici_lock); - delay(1); + if (xfs_iflags_test(ip, XFS_IRECLAIM)) { + error = EAGAIN; XFS_STATS_INC(xs_ig_frecycle); + goto out_error; + } + ASSERT(xfs_iflags_test(ip, XFS_IRECLAIMABLE)); - goto again; + /* + * If lookup is racing with unlink, then we + * should return an error immediately so we + * don't remove it from the reclaim list and + * potentially leak the inode. + */ + if ((ip->i_d.di_mode == 0) && + !(flags & XFS_IGET_CREATE)) { + error = ENOENT; + goto out_error; } + xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); + + xfs_iflags_clear(ip, XFS_IRECLAIMABLE); + read_unlock(&pag->pag_ici_lock); + + XFS_MOUNT_ILOCK(mp); + list_del_init(&ip->i_reclaim); + XFS_MOUNT_IUNLOCK(mp); - old_inode = ip->i_vnode; - if (old_inode == NULL) { - /* - * If IRECLAIM is set this inode is - * on its way out of the system, - * we need to pause and try again. - */ - if (xfs_iflags_test(ip, XFS_IRECLAIM)) { - read_unlock(&pag->pag_ici_lock); - delay(1); - XFS_STATS_INC(xs_ig_frecycle); - - goto again; - } - ASSERT(xfs_iflags_test(ip, XFS_IRECLAIMABLE)); - - /* - * If lookup is racing with unlink, then we - * should return an error immediately so we - * don't remove it from the reclaim list and - * potentially leak the inode. - */ - if ((ip->i_d.di_mode == 0) && - !(flags & XFS_IGET_CREATE)) { - read_unlock(&pag->pag_ici_lock); - xfs_put_perag(mp, pag); - return ENOENT; - } - - xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); - - XFS_STATS_INC(xs_ig_found); - xfs_iflags_clear(ip, XFS_IRECLAIMABLE); - read_unlock(&pag->pag_ici_lock); - - XFS_MOUNT_ILOCK(mp); - list_del_init(&ip->i_reclaim); - XFS_MOUNT_IUNLOCK(mp); - - goto finish_inode; - - } else if (inode != old_inode) { - /* The inode is being torn down, pause and - * try again. - */ - if (old_inode->i_state & (I_FREEING | I_CLEAR)) { - read_unlock(&pag->pag_ici_lock); - delay(1); - XFS_STATS_INC(xs_ig_frecycle); - - goto again; - } + } else if (inode != old_inode) { + /* The inode is being torn down, pause and + * try again. + */ + if (old_inode->i_state & (I_FREEING | I_CLEAR)) { + error = EAGAIN; + XFS_STATS_INC(xs_ig_frecycle); + goto out_error; + } /* Chances are the other vnode (the one in the inode) is being torn * down right now, and we landed on top of it. Question is, what do * we do? Unhook the old inode and hook up the new one? */ - cmn_err(CE_PANIC, - "xfs_iget_core: ambiguous vns: vp/0x%p, invp/0x%p", - old_inode, inode); - } - - /* - * Inode cache hit - */ + cmn_err(CE_PANIC, + "xfs_iget_core: ambiguous vns: vp/0x%p, invp/0x%p", + old_inode, inode); + } else { read_unlock(&pag->pag_ici_lock); - XFS_STATS_INC(xs_ig_found); + } -finish_inode: - if (ip->i_d.di_mode == 0 && !(flags & XFS_IGET_CREATE)) { - xfs_put_perag(mp, pag); - return ENOENT; - } + if (ip->i_d.di_mode == 0 && !(flags & XFS_IGET_CREATE)) { + error = ENOENT; + goto out; + } - if (lock_flags != 0) - xfs_ilock(ip, lock_flags); + if (lock_flags != 0) + xfs_ilock(ip, lock_flags); - xfs_iflags_clear(ip, XFS_ISTALE); - xfs_itrace_exit_tag(ip, "xfs_iget.found"); - goto return_ip; - } + xfs_iflags_clear(ip, XFS_ISTALE); + xfs_itrace_exit_tag(ip, "xfs_iget.found"); + XFS_STATS_INC(xs_ig_found); + return 0; - /* - * Inode cache miss - */ +out_error: read_unlock(&pag->pag_ici_lock); - XFS_STATS_INC(xs_ig_missed); +out: + return error; +} + + +static int +xfs_iget_cache_miss( + struct xfs_mount *mp, + struct xfs_perag *pag, + xfs_trans_t *tp, + xfs_ino_t ino, + struct xfs_inode **ipp, + xfs_daddr_t bno, + int flags, + int lock_flags) +{ + struct xfs_inode *ip; + int error; + unsigned long first_index, mask; + xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ino); /* * Read the disk inode attributes into a new inode structure and get @@ -202,14 +160,11 @@ finish_inode: */ error = xfs_iread(mp, tp, ino, &ip, bno, (flags & XFS_IGET_BULKSTAT) ? XFS_IMAP_BULKSTAT : 0); - if (error) { - xfs_put_perag(mp, pag); + if (error) return error; - } xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); - mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, "xfsino", ip->i_ino); mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); @@ -221,9 +176,8 @@ finish_inode: xfs_ilock(ip, lock_flags); if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { - xfs_idestroy(ip); - xfs_put_perag(mp, pag); - return ENOENT; + error = ENOENT; + goto out_destroy; } /* @@ -231,37 +185,110 @@ finish_inode: * write spinlock. */ if (radix_tree_preload(GFP_KERNEL)) { - xfs_idestroy(ip); - delay(1); - goto again; + error = EAGAIN; + goto out_destroy; } mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); first_index = agino & mask; write_lock(&pag->pag_ici_lock); - /* - * insert the new inode - */ + + /* insert the new inode */ error = radix_tree_insert(&pag->pag_ici_root, agino, ip); if (unlikely(error)) { - BUG_ON(error != -EEXIST); - write_unlock(&pag->pag_ici_lock); - radix_tree_preload_end(); - xfs_idestroy(ip); + WARN_ON(error != -EEXIST); XFS_STATS_INC(xs_ig_dup); - goto again; + error = EAGAIN; + goto out_unlock; } - /* - * These values _must_ be set before releasing the radix tree lock! - */ + /* These values _must_ be set before releasing the radix tree lock! */ ip->i_udquot = ip->i_gdquot = NULL; xfs_iflags_set(ip, XFS_INEW); write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); + *ipp = ip; + return 0; + +out_unlock: + write_unlock(&pag->pag_ici_lock); + radix_tree_preload_end(); +out_destroy: + xfs_idestroy(ip); + return error; +} + +/* + * Look up an inode by number in the given file system. + * The inode is looked up in the cache held in each AG. + * If the inode is found in the cache, attach it to the provided + * vnode. + * + * If it is not in core, read it in from the file system's device, + * add it to the cache and attach the provided vnode. + * + * The inode is locked according to the value of the lock_flags parameter. + * This flag parameter indicates how and if the inode's IO lock and inode lock + * should be taken. + * + * mp -- the mount point structure for the current file system. It points + * to the inode hash table. + * tp -- a pointer to the current transaction if there is one. This is + * simply passed through to the xfs_iread() call. + * ino -- the number of the inode desired. This is the unique identifier + * within the file system for the inode being requested. + * lock_flags -- flags indicating how to lock the inode. See the comment + * for xfs_ilock() for a list of valid values. + * bno -- the block number starting the buffer containing the inode, + * if known (as by bulkstat), else 0. + */ +STATIC int +xfs_iget_core( + struct inode *inode, + xfs_mount_t *mp, + xfs_trans_t *tp, + xfs_ino_t ino, + uint flags, + uint lock_flags, + xfs_inode_t **ipp, + xfs_daddr_t bno) +{ + xfs_inode_t *ip; + int error; + xfs_perag_t *pag; + xfs_agino_t agino; + + /* the radix tree exists only in inode capable AGs */ + if (XFS_INO_TO_AGNO(mp, ino) >= mp->m_maxagi) + return EINVAL; + + /* get the perag structure and ensure that it's inode capable */ + pag = xfs_get_perag(mp, ino); + if (!pag->pagi_inodeok) + return EINVAL; + ASSERT(pag->pag_ici_init); + agino = XFS_INO_TO_AGINO(mp, ino); + +again: + error = 0; + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, agino); + + if (ip) { + error = xfs_iget_cache_hit(inode, pag, ip, flags, lock_flags); + if (error) + goto out_error_or_again; + } else { + read_unlock(&pag->pag_ici_lock); + XFS_STATS_INC(xs_ig_missed); + + error = xfs_iget_cache_miss(mp, pag, tp, ino, &ip, bno, + flags, lock_flags); + if (error) + goto out_error_or_again; + } xfs_put_perag(mp, pag); - return_ip: ASSERT(ip->i_df.if_ext_max == XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); @@ -281,6 +308,14 @@ finish_inode: if (ip->i_d.di_mode != 0) xfs_setup_inode(ip); return 0; + +out_error_or_again: + if (error == EAGAIN) { + delay(1); + goto again; + } + xfs_put_perag(mp, pag); + return error; } -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:53:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:54:01 -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 m7C1rsvl003089 for ; Mon, 11 Aug 2008 18:53:56 -0700 X-ASG-Debug-ID: 1218506110-5b6100250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 042A0384054 for ; Mon, 11 Aug 2008 18:55:11 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 0p8jNVL6RBMr7oBf for ; Mon, 11 Aug 2008 18:55:11 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179819325" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:25:10 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSj6K-0007vK-41; Tue, 12 Aug 2008 11:55:08 +1000 Date: Tue, 12 Aug 2008 11:55:08 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: Sven Geggus , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Ooops in Kernel 2.6.26.2 Subject: Re: Ooops in Kernel 2.6.26.2 Message-ID: <20080812015508.GM6119@disturbed> Mail-Followup-To: Lachlan McIlroy , Sven Geggus , xfs@oss.sgi.com References: <20080808180938.GA3760@diesel.geggus.net> <489FECCD.6050703@sgi.com> <489FF0EE.5040607@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489FF0EE.5040607@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218506112 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0183 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.02, rules version 3.0.83699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17484 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 11, 2008 at 05:57:34PM +1000, Lachlan McIlroy wrote: > The ticket allocation code got reworked in 2.6.26 and we now free > tickets whereas before we used to cache them so the use-after-free > went undetected. > > This patch should do the trick. > > --- a/fs/xfs/xfs_log.c 2008-08-11 17:47:18.000000000 +1000 > +++ b/fs/xfs/xfs_log.c 2008-08-11 17:53:24.000000000 +1000 > @@ -336,15 +364,12 @@ xfs_log_done(xfs_mount_t *mp, > } else { > xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); > xlog_regrant_reserve_log_space(log, ticket); > - } > - > - /* If this ticket was a permanent reservation and we aren't > - * trying to release it, reset the inited flags; so next time > - * we write, a start record will be written out. > - */ > - if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) && > - (flags & XFS_LOG_REL_PERM_RESERV) == 0) > + /* If this ticket was a permanent reservation and we aren't > + * trying to release it, reset the inited flags; so next time > + * we write, a start record will be written out. > + */ > ticket->t_flags |= XLOG_TIC_INITED; > + } > > return lsn; > } /* xfs_log_done */ Looks sane, Lachlan. Good catch, though it makes me wonder how we didn't hit it in debug builds with memory poisoning turned on. Compiler optimisation, perhaps? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 11 18:57:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:57:13 -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 (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 m7C1v9xW003580 for ; Mon, 11 Aug 2008 18:57:10 -0700 X-ASG-Debug-ID: 1218506301-0617001a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 68B06F2D103 for ; Mon, 11 Aug 2008 18:58:22 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id uGHQ12B3w2iJxLnI for ; Mon, 11 Aug 2008 18:58:22 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAP2HoEh5LAMb/2dsb2JhbACtCw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179811362" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:16:13 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSixf-0007DL-GG; Tue, 12 Aug 2008 11:46:11 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Subject: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Date: Tue, 12 Aug 2008 11:46:10 +1000 Message-Id: <1218505571-27588-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218506306 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0022 1.0000 -2.0069 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 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.2402 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17485 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Make releasing all inode dquots traverse the per-ag inode radix trees rather than the mount inode list. This removes another user of the mount inode list. Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/quota/xfs_qm_syscalls.c | 125 ++++++++++++++++++--------------------- 1 files changed, 58 insertions(+), 67 deletions(-) diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 1a3b803..d292e55 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1022,101 +1022,92 @@ xfs_qm_export_flags( /* - * Go thru all the inodes in the file system, releasing their dquots. - * Note that the mount structure gets modified to indicate that quotas are off - * AFTER this, in the case of quotaoff. This also gets called from - * xfs_rootumount. + * Release all the dquots on the inodes in an AG. */ -void -xfs_qm_dqrele_all_inodes( - struct xfs_mount *mp, - uint flags) +STATIC void +xfs_qm_dqrele_inodes_ag( + xfs_mount_t *mp, + int ag, + uint flags) { - xfs_inode_t *ip, *topino; - uint ireclaims; - struct inode *vp; - boolean_t vnode_refd; + xfs_inode_t *ip = NULL; + struct inode *vp = NULL; + xfs_perag_t *pag = &mp->m_perag[ag]; + int first_index = 0; + int nr_found; - ASSERT(mp->m_quotainfo); - - XFS_MOUNT_ILOCK(mp); -again: - ip = mp->m_inodes; - if (ip == NULL) { - XFS_MOUNT_IUNLOCK(mp); - return; - } do { - /* Skip markers inserted by xfs_sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + boolean_t vnode_refd = B_FALSE; + + /* + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. + */ + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } + + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + /* Root inode, rbmip and rsumip have associated blocks */ - if (ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { - ASSERT(ip->i_udquot == NULL); - ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; - continue; - } vp = VFS_I(ip); - if (!vp) { + if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } - vnode_refd = B_FALSE; if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; vp = vn_grab(vp); + read_unlock(&pag->pag_ici_lock); if (!vp) - goto again; - - XFS_MOUNT_IUNLOCK(mp); - /* XXX restart limit ? */ - xfs_ilock(ip, XFS_ILOCK_EXCL); + continue; vnode_refd = B_TRUE; + xfs_ilock(ip, XFS_ILOCK_EXCL); } else { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; - XFS_MOUNT_IUNLOCK(mp); + read_unlock(&pag->pag_ici_lock); } - - /* - * We don't keep the mountlock across the dqrele() call, - * since it can take a while.. - */ if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; } - if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { + if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && + ip->i_gdquot) { xfs_qm_dqrele(ip->i_gdquot); ip->i_gdquot = NULL; } xfs_iunlock(ip, XFS_ILOCK_EXCL); - /* - * Wait until we've dropped the ilock and mountlock to - * do the vn_rele. Or be condemned to an eternity in the - * inactive code in hell. - */ if (vnode_refd) IRELE(ip); - XFS_MOUNT_ILOCK(mp); - /* - * If an inode was inserted or removed, we gotta - * start over again. - */ - if (topino != mp->m_inodes || mp->m_ireclaims != ireclaims) { - /* XXX use a sentinel */ - goto again; - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); +} - XFS_MOUNT_IUNLOCK(mp); +/* + * Go thru all the inodes in the file system, releasing their dquots. + * Note that the mount structure gets modified to indicate that quotas are off + * AFTER this, in the case of quotaoff. This also gets called from + * xfs_rootumount. + */ +void +xfs_qm_dqrele_all_inodes( + struct xfs_mount *mp, + uint flags) +{ + int i; + + ASSERT(mp->m_quotainfo); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + xfs_qm_dqrele_inodes_ag(mp, i, flags); + } } /*------------------------------------------------------------------------*/ -- 1.5.6 From owner-xfs@oss.sgi.com Mon Aug 11 18:59:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 18:59:13 -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 (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 m7C1x8it004063 for ; Mon, 11 Aug 2008 18:59:10 -0700 X-ASG-Debug-ID: 1218506423-05e1002e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9D4CBF2D10E for ; Mon, 11 Aug 2008 19:00:24 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id TS7reFCOC0wv900K for ; Mon, 11 Aug 2008 19:00:24 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAICLoEh5LAMb/2dsb2JhbACtBw X-IronPort-AV: E=Sophos;i="4.32,192,1217773800"; d="scan'208";a="179823257" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 11:30:20 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSjBK-00082q-DA for xfs@oss.sgi.com; Tue, 12 Aug 2008 12:00:18 +1000 Date: Tue, 12 Aug 2008 12:00:18 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 7/6] XFS: xfsidbg update for mount inode list Subject: [PATCH 7/6] XFS: xfsidbg update for mount inode list Message-ID: <20080812020018.GN6119@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <1218505571-27588-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218506425 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.2402 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17486 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Kill the idbg users of the mount inode list. Compile tested only. Signed-off-by: Dave Chinner --- fs/xfs/xfsidbg.c | 124 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 48 deletions(-) Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-24 00:20:26.886167169 +1000 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-24 00:20:39.950162171 +1000 @@ -5734,20 +5734,27 @@ xfsidbg_xiclogtrace(xlog_in_core_t *iclo static void xfsidbg_xinodes(xfs_mount_t *mp) { - xfs_inode_t *ip; + int i; kdb_printf("xfs_mount at 0x%p\n", mp); - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); kdb_printf("\n"); xfsidbg_xnode(ip); - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("\nEnd of Inodes\n"); } @@ -5755,23 +5762,30 @@ xfsidbg_xinodes(xfs_mount_t *mp) static void xfsidbg_delayed_blocks(xfs_mount_t *mp) { - xfs_inode_t *ip; unsigned int total = 0; unsigned int icount = 0; + int i; - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); if (ip->i_delayed_blks) { total += ip->i_delayed_blks; icount++; } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("delayed blocks total: %d in %d inodes\n", total, icount); } @@ -5779,21 +5793,28 @@ xfsidbg_delayed_blocks(xfs_mount_t *mp) static void xfsidbg_xinodes_quiesce(xfs_mount_t *mp) { - xfs_inode_t *ip; + int i; kdb_printf("xfs_mount at 0x%p\n", mp); - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); if (!(ip->i_flags & XFS_IQUIESCE)) { kdb_printf("ip 0x%p not quiesced\n", ip); } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("\nEnd of Inodes\n"); } @@ -6319,8 +6340,8 @@ xfsidbg_xmount(xfs_mount_t *mp) mp->m_rtdev_targp ? mp->m_rtdev_targp->bt_dev : 0); kdb_printf("bsize %d agfrotor %d xfs_rotorstep %d agirotor %d\n", mp->m_bsize, mp->m_agfrotor, xfs_rotorstep, mp->m_agirotor); - kdb_printf("inodes 0x%p ilock 0x%p ireclaims 0x%x\n", - mp->m_inodes, &mp->m_ilock, mp->m_ireclaims); + kdb_printf("ilock 0x%p ireclaims 0x%x\n", + &mp->m_ilock, mp->m_ireclaims); kdb_printf("readio_log 0x%x readio_blocks 0x%x ", mp->m_readio_log, mp->m_readio_blocks); kdb_printf("writeio_log 0x%x writeio_blocks 0x%x\n", @@ -6409,11 +6430,7 @@ xfsidbg_xnode(xfs_inode_t *ip) NULL }; - kdb_printf("mount 0x%p mnext 0x%p mprev 0x%p vnode 0x%p \n", - ip->i_mount, - ip->i_mnext, - ip->i_mprev, - XFS_ITOV_NULL(ip)); + kdb_printf("mount 0x%p vnode 0x%p \n", ip->i_mount, XFS_ITOV_NULL(ip)); kdb_printf("dev %x ino %s\n", ip->i_mount->m_ddev_targp->bt_dev, xfs_fmtino(ip->i_ino, ip->i_mount)); @@ -6614,22 +6631,33 @@ xfsidbg_xqm_dquot(xfs_dquot_t *dqp) static void xfsidbg_xqm_dqattached_inos(xfs_mount_t *mp) { - xfs_inode_t *ip; - int n = 0; + int i, n = 0; - ip = mp->m_inodes; - do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; + kdb_printf("xfs_mount at 0x%p\n", mp); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) continue; - } - if (ip->i_udquot || ip->i_gdquot) { - n++; - kdb_printf("inode = 0x%p, ino %d: udq 0x%p, gdq 0x%p\n", - ip, (int)ip->i_ino, ip->i_udquot, ip->i_gdquot); - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + do { + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + if (ip->i_udquot || ip->i_gdquot) { + n++; + kdb_printf("inode = 0x%p, ino %d: udq 0x%p, gdq 0x%p\n", + ip, (int)ip->i_ino, ip->i_udquot, ip->i_gdquot); + } + kdb_printf("\n"); + xfsidbg_xnode(ip); + } while (nr_found); + } kdb_printf("\nNumber of inodes with dquots attached: %d\n", n); } From owner-xfs@oss.sgi.com Mon Aug 11 19:32:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 19:32:38 -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.6 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 m7C2WVgB006258 for ; Mon, 11 Aug 2008 19:32:32 -0700 X-ASG-Debug-ID: 1218508424-4fc4016b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A4B313841D7 for ; Mon, 11 Aug 2008 19:33:44 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id C8fVtCBMFs0eAQjq for ; Mon, 11 Aug 2008 19:33:44 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7C2Xg5s025457; Mon, 11 Aug 2008 19:33:43 -0700 Message-ID: <48A0F686.2090700@tlinx.org> Date: Mon, 11 Aug 2008 19:33:42 -0700 From: Linda Walsh User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Eric Sandeen CC: LKML , xfs-oss X-ASG-Orig-Subj: Re: Lock debugging noise or real problem? Subject: Re: Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> In-Reply-To: <48A09CA9.9080705@sandeen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218508425 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.83701 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17487 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs Eric Sandeen wrote: > the explanation for xfs_fsr, at least, is the same as the last time you > brought it up ;) > http://lkml.org/lkml/2008/2/12/86 > -Eric > --- Ah...Looks like the 1st xfs_fsr prob is the same as the one 6 months ago...(sorry) xfs_ilock & xfs_ilock But... the 3 imapds and the sort process were all 4 holding xfs_ilock & shrink_icache_memory And the other two xfs_fsr's were holding different locks than the 6-month-ago bug: dio_get_page & xfs_ilock Are these the same as well? I.e. looks like 3 possibly different probs: #1 (same as 6 months ago)... #2 (3)imapds & sort: holding xfs_ilock & shrink_icache #3 xfs_fsr with two different locks: dio_get_page & xfs_ilock (clipped output below...) ---------------- (#0) Cause unknown...why dump? --- Jul 25 18:21:28 kern: Clocksource tsc unstable (delta = 571817442154 ns) Jul 25 18:21:28 kern: Modules linked in: uhci_hcd Jul 25 18:21:28 kern: Jul 25 18:21:28 kern: Pid: 183, comm: cifsoplockd Not tainted (2.6.26-ish #2) Jul 25 18:21:28 kern: EIP: 0060:[] EFLAGS: 00000286 CPU: 1 Jul 25 18:21:28 kern: EIP is at _spin_unlock_irqrestore+0x7/0x10 Jul 25 18:21:28 kern: EAX: b05a8d00 EBX: efb13f54 ECX: b05a8d00 EDX: 00000286 Jul 25 18:21:28 kern: ESI: 00000000 EDI: b01eaa90 EBP: efb13f24 ESP: efb13f24 Jul 25 18:21:28 kern: DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Jul 25 18:21:28 kern: CR0: 8005003b CR2: a7a2c000 CR3: 37c10000 CR4: 000006d0 Jul 25 18:21:28 kern: DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 Jul 25 18:21:28 kern: DR6: ffff0ff0 DR7: 00000400 Jul 25 18:21:28 kern: [] try_to_del_timer_sync+0x4a/0x60 Jul 25 18:21:28 kern: [] del_timer_sync+0x11/0x20 Jul 25 18:21:28 kern: [] schedule_timeout+0x4f/0xc0 Jul 25 18:21:28 kern: [] ? process_timeout+0x0/0x10 Jul 25 18:21:28 kern: [] ? schedule_timeout+0x43/0xc0 Jul 25 18:21:28 kern: [] cifs_oplock_thread+0x15e/0x230 Jul 25 18:21:28 kern: [] ? complete+0x46/0x60 Jul 25 18:21:28 kern: [] ? cifs_oplock_thread+0x0/0x230 Jul 25 18:21:28 kern: [] kthread+0x42/0x70 Jul 25 18:21:28 kern: [] ? kthread+0x0/0x70 Jul 25 18:21:28 kern: [] kernel_thread_helper+0x7/0x18 Jul 25 18:21:28 kern: ======================= xfs_fsr#1 (looks like dup of 6-month-old bug).... Jul 28 02:10:38 kern: ======================================================= Jul 28 02:10:38 kern: [ INFO: possible circular locking dependency detected ] Jul 28 02:10:38 kern: 2.6.24.2-ish #5 Jul 28 02:10:38 kern: ------------------------------------------------------- Jul 28 02:10:38 kern: xfs_fsr/17758 is trying to acquire lock: Jul 28 02:10:38 kern: (&(&ip->i_lock)->mr_lock/2){----}, at: []xfs_ilock+0x6d/0xb0 Jul 28 02:10:38 kern: but task is already holding lock: Jul 28 02:10:38 kern: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: other info that might help us debug this: Jul 28 02:10:39 kern: Jul 28 02:10:39 kern: 2 locks held by xfs_fsr/17758: Jul 28 02:10:39 kern: #0: (&(&ip->i_iolock)->mr_lock/2){--..}, at: [] xfs_ilock+0x97/0xb0 Jul 28 02:10:39 kern: #1: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0x97/0xb0 ------------------- #2--imapds - shrink_icache_memory_xfs_ilock Jul 29 02:07:29 kern: ======================================================= Jul 29 02:07:29 kern: [ INFO: possible circular locking dependency detected ] Jul 29 02:07:29 kern: 2.6.25.12-ish #2 Jul 29 02:07:29 kern: ------------------------------------------------------- Jul 29 02:07:29 kern: imapds/26747 is trying to acquire lock: Jul 29 02:07:29 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Jul 29 02:07:29 kern: but task is already holding lock: Jul 29 02:07:29 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 29 02:07:29 kern: other info that might help us debug this: Jul 29 02:07:29 kern Jul 29 02:07:29 kern: 2 locks held by imapds/26747: Jul 29 02:07:29 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 29 02:07:29 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 #3--xfs_fsr -- (doesn't look like previous bug) dio_get_page+xfs_ilock? Jul 31 02:13:19 kern: ======================================================= Jul 31 02:13:19 kern: [ INFO: possible circular locking dependency detected ] Jul 31 02:13:19 kern: 2.6.25.12-ish #2 Jul 31 02:13:19 kern: ------------------------------------------------------- Jul 31 02:13:19 kern: xfs_fsr/12232 is trying to acquire lock: Jul 31 02:13:19 kern: (&mm->mmap_sem){----}, at: [] dio_get_page+0x6a/0x170 Jul 31 02:13:19 kern: but task is already holding lock: Jul 31 02:13:19 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Jul 31 02:13:19 kern: which lock already depends on the new lock. Jul 31 02:13:19 kern: 1 lock held by xfs_fsr/12232: Jul 31 02:13:19 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 #5 -- sort -- shrink_icache_memory & xfs_ilock Aug 2 02:04:51 kern: ======================================================= Aug 2 02:04:51 kern: [ INFO: possible circular locking dependency detected ] Aug 2 02:04:51 kern: 2.6.25.12-ish #2 Aug 2 02:04:51 kern: ------------------------------------------------------- Aug 2 02:04:51 kern: sort/24453 is trying to acquire lock: Aug 2 02:04:51 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 2 02:04:51 kern: but task is already holding lock: Aug 2 02:04:51 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x97/0xb0 Aug 2 02:04:51 kern: other info that might help us debug this: Aug 2 02:04:51 kern: 3 locks held by sort/24453: Aug 2 02:04:51 kern: #0: (&sb->s_type->i_mutex_key#3){--..}, at: [] xfs_write+0x39f/0x7f0 Aug 2 02:04:51 kern: #1: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x97/0xb0 Aug 2 02:04:51 kern: #2: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 #6 xfs_fsr -- dio_get_page+xfs_ilock Aug 3 02:11:17 kern: ======================================================= Aug 3 02:11:17 kern: [ INFO: possible circular locking dependency detected ] Aug 3 02:11:17 kern: 2.6.25.12-ish #2 Aug 3 02:11:17 kern: ------------------------------------------------------- Aug 3 02:11:17 kern: xfs_fsr/4455 is trying to acquire lock: Aug 3 02:11:17 kern: (&mm->mmap_sem){----}, at: [] dio_get_page+0x6a/0x170 Aug 3 02:11:17 kern: but task is already holding lock: Aug 3 02:11:17 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 #7 imapds - shrink_icache_memory + xfs_ilock --- Aug 5 02:32:13 kern: ======================================================= Aug 5 02:32:13 kern: [ INFO: possible circular locking dependency detected ] Aug 5 02:32:13 kern: 2.6.25.12-ish #2 Aug 5 02:32:13 kern: ------------------------------------------------------- Aug 5 02:32:13 kern: imapds/2051 is trying to acquire lock: Aug 5 02:32:13 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 5 02:32:13 kern: but task is already holding lock: Aug 5 02:32:13 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 5 02:32:13 kern: other info that might help us debug this: Aug 5 02:32:13 kern: Aug 5 02:32:13 kern: 2 locks held by imapds/2051: Aug 5 02:32:13 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 5 02:32:13 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 #9 -< mount probs> Aug 6 02:49:37 kern: Pid: 2304, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:49:37 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:49:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:49:37 kern: ======================= Aug 6 02:49:37 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:49:37 kern: XFS: log mount failed Aug 6 02:50:18 kern: Pid: 2333, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:18 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:18 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:18 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:18 kern: ======================= Aug 6 02:50:18 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:18 kern: XFS: log mount failed Aug 6 02:50:26 kern: Pid: 2335, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:26 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:26 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:26 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:26 kern: ======================= Aug 6 02:50:26 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:26 kern: XFS: log mount failed Aug 6 02:50:37 kern: Pid: 2340, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:37 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:37 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:37 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:37 kern: ======================= Aug 6 02:50:37 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:37 kern: XFS: log mount failed Aug 6 02:50:55 kern: Pid: 2342, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:50:55 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:50:55 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:50:55 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:50:55 kern: ======================= Aug 6 02:50:55 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:50:55 kern: XFS: log mount failed Aug 6 02:51:07 kern: Pid: 2346, comm: mount Not tainted 2.6.24.2-ish #5 Aug 6 02:51:07 kern: [] xlog_recover_do_inode_trans+0x695/0x9f0 Aug 6 02:51:07 kern: [] xlog_recover_do_trans+0xbb/0x140 Aug 6 02:51:07 kern: [] xfs_buf_iostart+0x25/0x90 Aug 6 02:51:07 kern: ======================= Aug 6 02:51:07 kern: XFS: log mount/recovery failed: error 117 Aug 6 02:51:07 kern: XFS: log mount failed Aug 6 12:41:04 kern: XFS: failed to read RT inodes Aug 6 21:51:37 Ish mountd[13571]: could not open /var/lib/nfs/xtab for locking Aug 6 22:00:29 Ish mountd[13572]: could not open /var/lib/nfs/rmtab for locking Aug 6 22:00:41 Ish last message repeated 5 times #10 - imapds shrink_icache_memory+xfs_ilock Aug 7 02:09:48 kern: ======================================================= Aug 7 02:09:48 kern: [ INFO: possible circular locking dependency detected ] Aug 7 02:09:48 kern: 2.6.24.2-ish #5 Aug 7 02:09:48 kern: ------------------------------------------------------- Aug 7 02:09:48 kern: imapds/17962 is trying to acquire lock: Aug 7 02:09:48 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x73/0x250 Aug 7 02:09:48 kern: but task is already holding lock: Aug 7 02:09:48 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5b/0xb0 Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: other info that might help us debug this: Aug 7 02:09:48 kern: Aug 7 02:09:48 kern: 2 locks held by imapds/17962: Aug 7 02:09:48 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5b/0xb0 Aug 7 02:09:48 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x26/0x170 #11 -- (previos damage?) Aug 9 02:44:52 kern: Clocksource tsc unstable (delta = 9374169734 ns) Aug 9 02:59:05 kern: XFS: bad magic number Aug 9 02:59:05 kern: XFS: SB validate failed Aug 9 02:59:09 kern: XFS: bad magic number Aug 9 02:59:09 kern: XFS: SB validate failed #12 - shrink_icache_memory & xfs_ilock --- <5>Linux version 2.6.25.12-ish (lw@Ast) (gcc version 4.2.1 (SUSE Linux)) #2 SMP Mon Jul 28 12:51:23 PDT 2008 --- Aug 11 02:04:56 kern: ======================================================= Aug 11 02:04:56 kern: [ INFO: possible circular locking dependency detected ] Aug 11 02:04:56 kern: 2.6.25.12-ish #2 Aug 11 02:04:56 kern: ------------------------------------------------------- Aug 11 02:04:56 kern: imapds/31560 is trying to acquire lock: Aug 11 02:04:56 kern: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x62/0x250 Aug 11 02:04:56 kern: but task is already holding lock: Aug 11 02:04:56 kern: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 11 02:04:56 kern: which lock already depends on the new lock. Aug 11 02:04:56 kern: other info that might help us debug this: Aug 11 02:04:56 kern: Aug 11 02:04:56 kern: 2 locks held by imapds/31560: Aug 11 02:04:56 kern: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x5c/0xb0 Aug 11 02:04:56 kern: #1: (shrinker_rwsem){----}, at: [] shrink_slab+0x24/0x170 From owner-xfs@oss.sgi.com Mon Aug 11 19:47:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 19:47:20 -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.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7C2lGGD007345 for ; Mon, 11 Aug 2008 19:47:17 -0700 X-ASG-Debug-ID: 1218509310-6d43039d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E8FC19B3C80 for ; Mon, 11 Aug 2008 19:48:30 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id AsRf5vNaIsDDXFnB for ; Mon, 11 Aug 2008 19:48:30 -0700 (PDT) Received: from Liberator.local (dsl-dynamic-209-50-31-17.inebraska.com [209.50.31.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 16AA7AC358E; Mon, 11 Aug 2008 21:48:29 -0500 (CDT) Message-ID: <48A0F9FC.1070805@sandeen.net> Date: Mon, 11 Aug 2008 21:48:28 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Linda Walsh CC: LKML , xfs-oss X-ASG-Orig-Subj: Re: Lock debugging noise or real problem? Subject: Re: Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> In-Reply-To: <48A0F686.2090700@tlinx.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1218509311 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.02, rules version 3.0.83701 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17488 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Linda Walsh wrote: > Eric Sandeen wrote: >> the explanation for xfs_fsr, at least, is the same as the last time you >> brought it up ;) >> http://lkml.org/lkml/2008/2/12/86 >> -Eric >> > --- > Ah...Looks like the 1st xfs_fsr prob is the same as the one 6 months > ago...(sorry) > xfs_ilock & xfs_ilock > > But... the 3 imapds and the sort process were all 4 holding > xfs_ilock & shrink_icache_memory > > And the other two xfs_fsr's were holding different locks than the > 6-month-ago bug: > dio_get_page & xfs_ilock > Are these the same as well? > > I.e. looks like 3 possibly different probs: > #1 (same as 6 months ago)... > #2 (3)imapds & sort: holding xfs_ilock & shrink_icache > #3 xfs_fsr with two different locks: dio_get_page & xfs_ilock> http://www.google.com/search?q=xfs_fsr+dio_get_page+lockdep -> http://oss.sgi.com/archives/xfs/2008-01/msg00042.html I haven't looked closely at #2 but there have been so many lockdep reports for xfs, and so many explanations of why they don't always get along, you'll probably be able to find something with some searching. -Eric From owner-xfs@oss.sgi.com Mon Aug 11 20:34:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 20:34:24 -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.6 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 m7C3YBkh014712 for ; Mon, 11 Aug 2008 20:34:11 -0700 X-ASG-Debug-ID: 1218512110-062b01ad0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E03B7F2E40A for ; Mon, 11 Aug 2008 20:35:10 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id gq7X60tq8Ahz2nH2 for ; Mon, 11 Aug 2008 20:35:10 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7C3Z8Oe000561; Mon, 11 Aug 2008 20:35:08 -0700 Message-ID: <48A104EB.6040509@tlinx.org> Date: Mon, 11 Aug 2008 20:35:07 -0700 From: Linda Walsh User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Eric Sandeen CC: LKML , xfs-oss X-ASG-Orig-Subj: Re: Lock debugging noise or real problem? Subject: Re: Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> In-Reply-To: <48A0F9FC.1070805@sandeen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218512110 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0206 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.2410 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17489 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs Eric Sandeen wrote: > I haven't looked closely at #2 but there have been so many lockdep > reports for xfs, and so many explanations of why they don't always get > along, you'll probably be able to find something with some searching. > ---- So in debugging mysterious 'lockups' where I've, at least once, noticed a hangcheck_timer elapse, this lock-checking stuff is just nonsensical? It is very frustrating trying to turn on debug tools in the kernel and get so many false positives. Would it be possible or, perhaps, desirable to eliminate the buggy lock-checks in the xfs code? Meanwhile...back to finding reasons for the semi-random, periodic hanging... ;^/ From owner-xfs@oss.sgi.com Mon Aug 11 21:28:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 21:29:14 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7C4SfhN017801 for ; Mon, 11 Aug 2008 21:28:42 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08236; Tue, 12 Aug 2008 14:29:54 +1000 Message-ID: <48A1134B.9010606@sgi.com> Date: Tue, 12 Aug 2008 14:36:27 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , Sven Geggus , xfs@oss.sgi.com Subject: Re: Ooops in Kernel 2.6.26.2 References: <20080808180938.GA3760@diesel.geggus.net> <489FECCD.6050703@sgi.com> <489FF0EE.5040607@sgi.com> <20080812015508.GM6119@disturbed> In-Reply-To: <20080812015508.GM6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17490 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Mon, Aug 11, 2008 at 05:57:34PM +1000, Lachlan McIlroy wrote: >> The ticket allocation code got reworked in 2.6.26 and we now free >> tickets whereas before we used to cache them so the use-after-free >> went undetected. >> >> This patch should do the trick. >> >> --- a/fs/xfs/xfs_log.c 2008-08-11 17:47:18.000000000 +1000 >> +++ b/fs/xfs/xfs_log.c 2008-08-11 17:53:24.000000000 +1000 >> @@ -336,15 +364,12 @@ xfs_log_done(xfs_mount_t *mp, >> } else { >> xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); >> xlog_regrant_reserve_log_space(log, ticket); >> - } >> - >> - /* If this ticket was a permanent reservation and we aren't >> - * trying to release it, reset the inited flags; so next time >> - * we write, a start record will be written out. >> - */ >> - if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) && >> - (flags & XFS_LOG_REL_PERM_RESERV) == 0) >> + /* If this ticket was a permanent reservation and we aren't >> + * trying to release it, reset the inited flags; so next time >> + * we write, a start record will be written out. >> + */ >> ticket->t_flags |= XLOG_TIC_INITED; >> + } >> >> return lsn; >> } /* xfs_log_done */ > > Looks sane, Lachlan. Good catch, though it makes me wonder how we > didn't hit it in debug builds with memory poisoning turned on. > Compiler optimisation, perhaps? Memory poisoning will only trigger a panic if we use the contents of the freed structure as an address and dereference it. For the code above the compiler will take the contents of 'ticket' (which is still an address) and add the offset of t_flags and then modify the contents at that address (ie modify the poison pattern). I think this panic was caused by the page that contained the freed ticket being unmapped from the kernel - that just comes down to getting the timing right. From owner-xfs@oss.sgi.com Mon Aug 11 21:45:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 21:46:08 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7C4jE8H018975 for ; Mon, 11 Aug 2008 21:45:15 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08618; Tue, 12 Aug 2008 14:46:29 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id B2DE858C52A4; Tue, 12 Aug 2008 14:46:29 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 985525 - Fix use after free in xfs_log_done(). Message-Id: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> Date: Tue, 12 Aug 2008 14:46:29 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17491 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Fix use after free in xfs_log_done(). The ticket allocation code got reworked in 2.6.26 and we now free tickets whereas before we used to cache them so the use-after-free went undetected. Date: Tue Aug 12 14:45:36 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-clean Inspected by: david@fromorbit.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31877a fs/xfs/xfs_log.c - 1.363 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.363&r2=text&tr2=1.362&f=h - Fix use after free in xfs_log_done(). From owner-xfs@oss.sgi.com Mon Aug 11 22:19:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 11 Aug 2008 22:20:19 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7C5JqCJ021117 for ; Mon, 11 Aug 2008 22:19:53 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA09314; Tue, 12 Aug 2008 15:21:07 +1000 Message-ID: <48A11F4C.6000002@sgi.com> Date: Tue, 12 Aug 2008 15:27:40 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [REVIEW] Move memory allocations for log tracing out of the critical path Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17492 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Memory allocations for log->l_grant_trace and iclog->ic_trace are done on demand when the first event is logged. In xlog_state_get_iclog_space() we call xlog_trace_iclog() under a spinlock and allocating memory here can cause us to sleep with a spinlock held and deadlock the system. For the log grant tracing we use KM_NOSLEEP but that means we can lose trace entries. Since there is no locking to serialize the log grant tracing we could race and have multiple allocations and leak memory. So move the allocations to where we initialize the log/iclog structures. Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace since it's not even used. Index: 2.6.x-clean/fs/xfs/xfs_log.c =================================================================== --- 2.6.x-clean.orig/fs/xfs/xfs_log.c +++ 2.6.x-clean/fs/xfs/xfs_log.c @@ -124,16 +124,27 @@ STATIC void xlog_verify_tail_lsn(xlog_t STATIC int xlog_iclogs_empty(xlog_t *log); #if defined(XFS_LOG_TRACE) + +#define XLOG_TRACE_LOGGRANT_SIZE 2048 +#define XLOG_TRACE_ICLOG_SIZE 256 + +void +xlog_trace_loggrant_alloc(xlog_t *log) +{ + log->l_grant_trace = ktrace_alloc(XLOG_TRACE_LOGGRANT_SIZE, KM_NOFS); +} + +void +xlog_trace_loggrant_dealloc(xlog_t *log) +{ + ktrace_free(log->l_grant_trace); +} + void xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) { unsigned long cnts; - if (!log->l_grant_trace) { - log->l_grant_trace = ktrace_alloc(2048, KM_NOSLEEP); - if (!log->l_grant_trace) - return; - } /* ticket counts are 1 byte each */ cnts = ((unsigned long)tic->t_ocnt) | ((unsigned long)tic->t_cnt) << 8; @@ -157,10 +168,20 @@ xlog_trace_loggrant(xlog_t *log, xlog_ti } void +xlog_trace_iclog_alloc(xlog_in_core_t *iclog) +{ + iclog->ic_trace = ktrace_alloc(XLOG_TRACE_ICLOG_SIZE, KM_NOFS); +} + +void +xlog_trace_iclog_dealloc(xlog_in_core_t *iclog) +{ + ktrace_free(iclog->ic_trace); +} + +void xlog_trace_iclog(xlog_in_core_t *iclog, uint state) { - if (!iclog->ic_trace) - iclog->ic_trace = ktrace_alloc(256, KM_NOFS); ktrace_enter(iclog->ic_trace, (void *)((unsigned long)state), (void *)((unsigned long)current_pid()), @@ -170,8 +191,15 @@ xlog_trace_iclog(xlog_in_core_t *iclog, (void *)NULL, (void *)NULL); } #else + +#define xlog_trace_loggrant_alloc(log) +#define xlog_trace_loggrant_dealloc(log) #define xlog_trace_loggrant(log,tic,string) + +#define xlog_trace_iclog_alloc(iclog) +#define xlog_trace_iclog_dealloc(iclog) #define xlog_trace_iclog(iclog,state) + #endif /* XFS_LOG_TRACE */ @@ -1231,6 +1259,7 @@ xlog_alloc_log(xfs_mount_t *mp, spin_lock_init(&log->l_grant_lock); sv_init(&log->l_flush_wait, 0, "flush_wait"); + xlog_trace_loggrant_alloc(log); /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */ ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0); @@ -1285,6 +1314,8 @@ xlog_alloc_log(xfs_mount_t *mp, sv_init(&iclog->ic_force_wait, SV_DEFAULT, "iclog-force"); sv_init(&iclog->ic_write_wait, SV_DEFAULT, "iclog-write"); + xlog_trace_iclog_alloc(iclog); + iclogp = &iclog->ic_next; } *iclogp = log->l_iclog; /* complete ring */ @@ -1565,11 +1596,7 @@ xlog_dealloc_log(xlog_t *log) sv_destroy(&iclog->ic_force_wait); sv_destroy(&iclog->ic_write_wait); xfs_buf_free(iclog->ic_bp); -#ifdef XFS_LOG_TRACE - if (iclog->ic_trace != NULL) { - ktrace_free(iclog->ic_trace); - } -#endif + xlog_trace_iclog_dealloc(iclog); next_iclog = iclog->ic_next; kmem_free(iclog); iclog = next_iclog; @@ -1578,14 +1605,7 @@ xlog_dealloc_log(xlog_t *log) spinlock_destroy(&log->l_grant_lock); xfs_buf_free(log->l_xbuf); -#ifdef XFS_LOG_TRACE - if (log->l_trace != NULL) { - ktrace_free(log->l_trace); - } - if (log->l_grant_trace != NULL) { - ktrace_free(log->l_grant_trace); - } -#endif + xlog_trace_loggrant_dealloc(log); log->l_mp->m_log = NULL; kmem_free(log); } /* xlog_dealloc_log */ Index: 2.6.x-clean/fs/xfs/xfs_log_priv.h =================================================================== --- 2.6.x-clean.orig/fs/xfs/xfs_log_priv.h +++ 2.6.x-clean/fs/xfs/xfs_log_priv.h @@ -448,7 +448,6 @@ typedef struct log { int l_grant_write_bytes; #ifdef XFS_LOG_TRACE - struct ktrace *l_trace; struct ktrace *l_grant_trace; #endif Index: 2.6.x-clean/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-clean.orig/fs/xfs/xfsidbg.c +++ 2.6.x-clean/fs/xfs/xfsidbg.c @@ -5864,7 +5864,7 @@ xfsidbg_xlog(xlog_t *log) (int)BTOBBT(log->l_grant_write_bytes), log->l_grant_write_bytes % BBSIZE); #ifdef XFS_LOG_TRACE - qprintf("trace: 0x%p grant_trace: use xlog value\n", log->l_trace); + qprintf("grant_trace: use xlog value\n"); #endif } /* xfsidbg_xlog */ From owner-xfs@oss.sgi.com Tue Aug 12 01:16:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 01:17:24 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7C8GdCN005439 for ; Tue, 12 Aug 2008 01:16:41 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA12715 for ; Tue, 12 Aug 2008 18:17:56 +1000 Message-ID: <48A148BE.6080406@sgi.com> Date: Tue, 12 Aug 2008 18:24:30 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs@oss.sgi.com Subject: Re: commit messages wrong in XFS git -master tree.... References: <20080812005758.GJ6119@disturbed> In-Reply-To: <20080812005758.GJ6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17493 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Sorry the commits are screwed up - looks like the committer was a little too hasty. To fix these up you do realise this means undoing the mods from ptools, checking them in again and then merging them back into OSS? It's a bit of work for us. How much do you really want these fixed? Dave Chinner wrote: > SGI folks, > > The commit messages for a couple of patches has been screwed > up. The patch series I sent titled: > > [PATCH 1/3] XFS: Avoid directly referencing the VFS inode > [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro > [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro > > Is the one that I've noticed. Patch 2/3 has the commit message > for patch 1/3 instead of the correct one. Patch 1/3 has a corrupt > version of it's commit message. > > Can someone please fix this up? > > And can ppl be more careful when committing patches in future > and make sure they get the commit messages correct? > > Cheers, > > Dave. From owner-xfs@oss.sgi.com Tue Aug 12 01:22:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 01:22:31 -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 m7C8MOFU006002 for ; Tue, 12 Aug 2008 01:22:25 -0700 X-ASG-Debug-ID: 1218529420-118303b10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from knox.decisionsoft.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CF80311FB4F5; Tue, 12 Aug 2008 01:23:40 -0700 (PDT) Received: from knox.decisionsoft.com (knox-be.decisionsoft.com [87.194.172.100]) by cuda.sgi.com with ESMTP id vNfhJgeyEh6M1tmZ; Tue, 12 Aug 2008 01:23:40 -0700 (PDT) Received: from kennet.dsl.local ([10.0.0.11]) by knox.decisionsoft.com with esmtp (Exim 4.63) (envelope-from ) id 1KSpAI-00081f-TF; Tue, 12 Aug 2008 09:23:38 +0100 Message-ID: <48A1488A.2090201@decisionsoft.co.uk> Date: Tue, 12 Aug 2008 09:23:38 +0100 From: Stuart Rowan Reply-To: strr-debian@decisionsoft.co.uk User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: lachlan@sgi.com CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: commit messages wrong in XFS git -master tree.... Subject: Re: commit messages wrong in XFS git -master tree.... References: <20080812005758.GJ6119@disturbed> <48A148BE.6080406@sgi.com> In-Reply-To: <48A148BE.6080406@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 10.0.0.11 X-SA-Exim-Mail-From: strr-debian@decisionsoft.co.uk X-SA-Exim-Scanned: No (on knox.decisionsoft.com); SAEximRunCond expanded to false X-SystemFilter-new-T: not expanding X-SystemFilter-new-S: not expanding X-SystemFilter-new-F: not expanding X-Barracuda-Connect: knox-be.decisionsoft.com[87.194.172.100] X-Barracuda-Start-Time: 1218529421 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0067 1.0000 -1.9775 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.98 X-Barracuda-Spam-Status: No, SCORE=-1.98 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.2428 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17494 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: strr-debian@decisionsoft.co.uk Precedence: bulk X-list: xfs Presumably the tedious process will teach the hasty committer a valuable lesson. Alternatively, how about a more robust TAKE process? :-) My thanks to all of you, at SGI and elsewhere, for the great work; it's been a real pleasure using XFS these last few months on our NFS server. All the best, Stu. Lachlan McIlroy wrote, on 12/08/08 09:24: > Sorry the commits are screwed up - looks like the committer > was a little too hasty. > > To fix these up you do realise this means undoing the mods > from ptools, checking them in again and then merging them back > into OSS? It's a bit of work for us. How much do you really > want these fixed? > > Dave Chinner wrote: >> SGI folks, >> >> The commit messages for a couple of patches has been screwed >> up. The patch series I sent titled: >> >> [PATCH 1/3] XFS: Avoid directly referencing the VFS inode >> [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro >> [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro >> >> Is the one that I've noticed. Patch 2/3 has the commit message >> for patch 1/3 instead of the correct one. Patch 1/3 has a corrupt >> version of it's commit message. >> >> Can someone please fix this up? >> >> And can ppl be more careful when committing patches in future >> and make sure they get the commit messages correct? >> >> Cheers, >> >> Dave. > > From owner-xfs@oss.sgi.com Tue Aug 12 02:03:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 02:03:56 -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 m7C93W40008734 for ; Tue, 12 Aug 2008 02:03:32 -0700 X-ASG-Debug-ID: 1218531888-230101030000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0A7F383D98 for ; Tue, 12 Aug 2008 02:04:49 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id zfGgCtZgPapBR7UE for ; Tue, 12 Aug 2008 02:04:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAO7toEh5LAMb/2dsb2JhbACtEw X-IronPort-AV: E=Sophos;i="4.32,194,1217773800"; d="scan'208";a="180137926" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 12 Aug 2008 18:34:47 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KSpo5-0000Jn-QY; Tue, 12 Aug 2008 19:04:45 +1000 Date: Tue, 12 Aug 2008 19:04:45 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: commit messages wrong in XFS git -master tree.... Subject: Re: commit messages wrong in XFS git -master tree.... Message-ID: <20080812090445.GR6119@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com References: <20080812005758.GJ6119@disturbed> <48A148BE.6080406@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A148BE.6080406@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218531889 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0180 1.0000 -1.9037 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.90 X-Barracuda-Spam-Status: No, SCORE=-1.90 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.2431 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17495 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 12, 2008 at 06:24:30PM +1000, Lachlan McIlroy wrote: > Sorry the commits are screwed up - looks like the committer > was a little too hasty. > > To fix these up you do realise this means undoing the mods > from ptools, checking them in again and then merging them back > into OSS? I don't really care about what is in the ptools tree; I don't see that nor does the rest of the world. > It's a bit of work for us. Sure. But SGI has the power to both screw and unscrew the commit logs. The former has been done - you can decide whether to do the latter... > How much do you really > want these fixed? I'd *like* it to be fixed, but no matter how much noise I make I can't force you to fix it. Quite frankly, I'd prefer that such mistakes are not made in the first place. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 12 12:29:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 12:30:04 -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.6 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 m7CJTML3003333 for ; Tue, 12 Aug 2008 12:29:22 -0700 X-ASG-Debug-ID: 1218569438-366201950000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A6B2F3672B for ; Tue, 12 Aug 2008 12:30:39 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id DrymEiAZbmAaI6Mc for ; Tue, 12 Aug 2008 12:30:39 -0700 (PDT) Received: from [10.0.0.21] (DSL01.83.171.176.99.ip-pool.NEFkom.net [83.171.176.99]) by mail.lichtvoll.de (Postfix) with ESMTP id 538105ADBA for ; Tue, 12 Aug 2008 21:30:37 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/6] XFS: move sync code to its own file Subject: Re: [PATCH 1/6] XFS: move sync code to its own file Date: Tue, 12 Aug 2008 21:30:43 +0200 User-Agent: KMail/1.9.9 References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-2-git-send-email-david@fromorbit.com> (sfid-20080812_090840_316720_415A7D0D) In-Reply-To: <1218505571-27588-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808122130.44241.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1218569439 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.2472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17496 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Dienstag 12 August 2008 schrieb Dave Chinner: > The sync code in XFS is spread around several files. > While it used to make sense to have such a distribution, > the code about to be cleaned up and so centralising it > in one spot as the first step mackes sense. > > Signed-off-by: Dave Chinner A typo and a syntax error in there: s/the code about to be cleaned up/the code is about to be cleaned up s/mackes/makes Can't comment on the code ;) Ciao, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Tue Aug 12 13:52:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 13:52:39 -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.6 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 m7CKqZBY011718 for ; Tue, 12 Aug 2008 13:52:35 -0700 X-ASG-Debug-ID: 1218574431-107602540000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AF225388BB8 for ; Tue, 12 Aug 2008 13:53:52 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id idUMwKYGevSBiPQc for ; Tue, 12 Aug 2008 13:53:52 -0700 (PDT) Received: from [10.0.0.21] (DSL01.83.171.176.99.ip-pool.NEFkom.net [83.171.176.99]) by mail.lichtvoll.de (Postfix) with ESMTP id 868A85ADBA for ; Tue, 12 Aug 2008 22:53:50 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Subject: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Date: Tue, 12 Aug 2008 22:53:57 +0200 User-Agent: KMail/1.9.9 References: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> (sfid-20080812_090830_868736_2FA77162) In-Reply-To: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808122253.57666.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1218574432 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2479 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17497 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Dienstag 12 August 2008 schrieb Lachlan McIlroy: > Fix use after free in xfs_log_done(). > > The ticket allocation code got reworked in 2.6.26 and we now free > tickets whereas before we used to cache them so the use-after-free > went undetected. Is this intended to go to stable tree? How serious is this? I intend to update my laptops to 2.6.26. -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Tue Aug 12 15:27:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 15:28:03 -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.0 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 m7CMRifh020055 for ; Tue, 12 Aug 2008 15:27:44 -0700 X-ASG-Debug-ID: 1218580130-531c03970000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 48C37F3850D for ; Tue, 12 Aug 2008 15:28:50 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id clMEaWSWn9fJEIUn for ; Tue, 12 Aug 2008 15:28:50 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7CMSl6l005427; Tue, 12 Aug 2008 15:28:48 -0700 Message-ID: <48A20E9E.9090100@tlinx.org> Date: Tue, 12 Aug 2008 15:28:46 -0700 From: "Linda A. Walsh" User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: xfs-oss , LKML CC: Eric Sandeen X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> In-Reply-To: <48A0F9FC.1070805@sandeen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218580133 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.2484 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17498 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xfs@tlinx.org Precedence: bulk X-list: xfs Eric Sandeen wrote: > ... Is it also known, (and the same bug) when you get the lock warnings when doing "xfs_restore", as well (dio_get_page and xfs_ilock)... Doesn't give me the warm & fuzzies, but I'm sure you've heard that sentiment plenty of times... The bugs with 'sort', & imap were both with xfs_ilock and shrink_icache_memory. I saw another bug (different prog) with those two locks that was said to be a bug in XFS by Andrew Morton, but he didn't say if it was the same known "harmless" "bug" or if it was more serious. From owner-xfs@oss.sgi.com Tue Aug 12 15:54:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 15:54:34 -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.6 required=5.0 tests=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 m7CMsPja022653 for ; Tue, 12 Aug 2008 15:54:27 -0700 X-ASG-Debug-ID: 1218581741-3fc100fb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tundra.namei.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9667537BC85 for ; Tue, 12 Aug 2008 15:55:41 -0700 (PDT) Received: from tundra.namei.org (tundra.namei.org [65.99.196.166]) by cuda.sgi.com with ESMTP id LqQuizncUAFCfSvx for ; Tue, 12 Aug 2008 15:55:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by tundra.namei.org (8.13.1/8.13.1) with ESMTP id m7CMtAej018086; Tue, 12 Aug 2008 18:55:10 -0400 Date: Wed, 13 Aug 2008 08:55:10 +1000 (EST) From: James Morris To: David Howells cc: Stephen Rothwell , Christoph Hellwig , "David S. Miller" , sfrench@us.ibm.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] CRED: Alter XFS so as to avoid namespace collisions with upcoming COW creds Subject: Re: [PATCH 1/2] CRED: Alter XFS so as to avoid namespace collisions with upcoming COW creds In-Reply-To: <20080812132845.5472.30943.stgit@warthog.procyon.org.uk> Message-ID: References: <20080812132840.5472.25856.stgit@warthog.procyon.org.uk> <20080812132845.5472.30943.stgit@warthog.procyon.org.uk> User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: tundra.namei.org[65.99.196.166] X-Barracuda-Start-Time: 1218581743 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.2485 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17499 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jmorris@namei.org Precedence: bulk X-list: xfs On Tue, 12 Aug 2008, David Howells wrote: > Rename XFS's current_fsuid() and current_fsgid() to avoid collision with > functions of the same name in upcoming COW creds. > > Signed-off-by: David Howells Can we get an acked-by from an XFS maintainer before pushing this to Linus? > --- > > fs/xfs/linux-2.6/xfs_linux.h | 4 ++-- > fs/xfs/xfs_inode.c | 4 ++-- > fs/xfs/xfs_vnodeops.c | 8 ++++---- > 3 files changed, 8 insertions(+), 8 deletions(-) > > > diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h > index 4d45d93..05a2e7e 100644 > --- a/fs/xfs/linux-2.6/xfs_linux.h > +++ b/fs/xfs/linux-2.6/xfs_linux.h > @@ -126,8 +126,8 @@ > > #define current_cpu() (raw_smp_processor_id()) > #define current_pid() (current->pid) > -#define current_fsuid(cred) (current->fsuid) > -#define current_fsgid(cred) (current->fsgid) > +#define this_fsuid(cred) (current->fsuid) > +#define this_fsgid(cred) (current->fsgid) > #define current_test_flags(f) (current->flags & (f)) > #define current_set_flags_nested(sp, f) \ > (*(sp) = current->flags, current->flags |= (f)) > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index bedc661..5e481ae 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -1082,8 +1082,8 @@ xfs_ialloc( > ip->i_d.di_onlink = 0; > ip->i_d.di_nlink = nlink; > ASSERT(ip->i_d.di_nlink == nlink); > - ip->i_d.di_uid = current_fsuid(cr); > - ip->i_d.di_gid = current_fsgid(cr); > + ip->i_d.di_uid = this_fsuid(cr); > + ip->i_d.di_gid = this_fsgid(cr); > ip->i_d.di_projid = prid; > memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); > > diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c > index 76a1166..3dfe8a0 100644 > --- a/fs/xfs/xfs_vnodeops.c > +++ b/fs/xfs/xfs_vnodeops.c > @@ -182,7 +182,7 @@ xfs_setattr( > xfs_ilock(ip, lock_flags); > > /* boolean: are we the file owner? */ > - file_owner = (current_fsuid(credp) == ip->i_d.di_uid); > + file_owner = (this_fsuid(credp) == ip->i_d.di_uid); > > /* > * Change various properties of a file. > @@ -1536,7 +1536,7 @@ xfs_create( > * Make sure that we have allocated dquot(s) on disk. > */ > error = XFS_QM_DQVOPALLOC(mp, dp, > - current_fsuid(credp), current_fsgid(credp), prid, > + this_fsuid(credp), this_fsgid(credp), prid, > XFS_QMOPT_QUOTALL|XFS_QMOPT_INHERIT, &udqp, &gdqp); > if (error) > goto std_return; > @@ -2352,7 +2352,7 @@ xfs_mkdir( > * Make sure that we have allocated dquot(s) on disk. > */ > error = XFS_QM_DQVOPALLOC(mp, dp, > - current_fsuid(credp), current_fsgid(credp), prid, > + this_fsuid(credp), this_fsgid(credp), prid, > XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); > if (error) > goto std_return; > @@ -2578,7 +2578,7 @@ xfs_symlink( > * Make sure that we have allocated dquot(s) on disk. > */ > error = XFS_QM_DQVOPALLOC(mp, dp, > - current_fsuid(credp), current_fsgid(credp), prid, > + this_fsuid(credp), this_fsgid(credp), prid, > XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); > if (error) > goto std_return; > -- James Morris From owner-xfs@oss.sgi.com Tue Aug 12 17:36:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 17:36:46 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7D0afbS000445 for ; Tue, 12 Aug 2008 17:36:42 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA02942; Wed, 13 Aug 2008 10:37:56 +1000 Message-ID: <48A22E71.4020204@sgi.com> Date: Wed, 13 Aug 2008 10:44:33 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com Subject: Re: commit messages wrong in XFS git -master tree.... References: <20080812005758.GJ6119@disturbed> <48A148BE.6080406@sgi.com> <20080812090445.GR6119@disturbed> In-Reply-To: <20080812090445.GR6119@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17500 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Aug 12, 2008 at 06:24:30PM +1000, Lachlan McIlroy wrote: >> Sorry the commits are screwed up - looks like the committer >> was a little too hasty. >> >> To fix these up you do realise this means undoing the mods >> from ptools, checking them in again and then merging them back >> into OSS? > > I don't really care about what is in the ptools tree; I don't > see that nor does the rest of the world. I don't care about the ptools tree either but we have a process here and you should at least understand that. > >> It's a bit of work for us. > > Sure. But SGI has the power to both screw and unscrew the commit > logs. The former has been done - you can decide whether to do the > latter... Yes but the screwing and unscrewing are being done by different people which is pissing me off. We've all screwed up commits from time to time - even you Dave. > >> How much do you really >> want these fixed? > > I'd *like* it to be fixed, but no matter how much noise I make I > can't force you to fix it. Quite frankly, I'd prefer that such > mistakes are not made in the first place. So would I. From owner-xfs@oss.sgi.com Tue Aug 12 17:57:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 17:57:43 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7D0vf7K001856 for ; Tue, 12 Aug 2008 17:57:41 -0700 X-ASG-Debug-ID: 1218589135-5b3f01100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CBE4F19C79BB for ; Tue, 12 Aug 2008 17:58:56 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id gvOveAkWExCRkpPB for ; Tue, 12 Aug 2008 17:58:56 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAO/OoUh5LAMb/2dsb2JhbAC4AYFS X-IronPort-AV: E=Sophos;i="4.32,198,1217773800"; d="scan'208";a="180704784" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 13 Aug 2008 10:28:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KT4hQ-0000Gc-Ox; Wed, 13 Aug 2008 10:58:52 +1000 Date: Wed, 13 Aug 2008 10:58:52 +1000 From: Dave Chinner To: "Linda A. Walsh" Cc: xfs-oss , LKML , Eric Sandeen X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? Message-ID: <20080813005852.GW6119@disturbed> Mail-Followup-To: "Linda A. Walsh" , xfs-oss , LKML , Eric Sandeen References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> <48A20E9E.9090100@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A20E9E.9090100@tlinx.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218589138 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.2494 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17501 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 12, 2008 at 03:28:46PM -0700, Linda A. Walsh wrote: > Eric Sandeen wrote: >> ... > Is it also known, (and the same bug) when you get the lock warnings when > doing > "xfs_restore", as well (dio_get_page and xfs_ilock)... That's the mm code calling fput() with the mmap_sem held. That's a problem in the VM code, which XFS can do nothing about. The normal I/O paths always lock the inode first, then (if a page fault occurs during copyin/out or we need to lock down pages for direct I/O) grab the mmap_sem at that point. This one could deadlock if you are mixing read/write with mmap on the same file in different threads of a multithreaded app. Unlikely, but possible, though it would only hang that app (not the rest of the machine). > The bugs with 'sort', & imap were both with xfs_ilock and > shrink_icache_memory. Once again, a problem with the generic code inverting the normal lock order. This one cannot deadlock, though, because by definition any inode on the unused list is, well, unused and hence we can't be holding a reference to it... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 12 20:10:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 12 Aug 2008 20:10:08 -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 (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 m7D3A2Cl008979 for ; Tue, 12 Aug 2008 20:10:03 -0700 X-ASG-Debug-ID: 1218597078-5eb402ee0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gateway-1237.mvista.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9A9808A1956 for ; Tue, 12 Aug 2008 20:11:19 -0700 (PDT) Received: from gateway-1237.mvista.com (gateway-1237.mvista.com [63.81.120.158]) by cuda.sgi.com with ESMTP id RGqBcHyobZiK1ElY for ; Tue, 12 Aug 2008 20:11:19 -0700 (PDT) Received: from [10.0.10.32] (dhcp32.mvista.com [10.0.10.32]) by hermes.mvista.com (Postfix) with ESMTP id 407671814C; Tue, 12 Aug 2008 20:11:18 -0700 (PDT) X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion From: Daniel Walker To: Dave Chinner Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx In-Reply-To: <1214556284-4160-5-git-send-email-david@fromorbit.com> References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> Content-Type: text/plain Date: Tue, 12 Aug 2008 20:11:17 -0700 Message-Id: <1218597077.6166.15.camel@dhcp32.mvista.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-Barracuda-Connect: gateway-1237.mvista.com[63.81.120.158] X-Barracuda-Start-Time: 1218597079 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.2502 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17502 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dwalker@mvista.com Precedence: bulk X-list: xfs On Fri, 2008-06-27 at 18:44 +1000, Dave Chinner wrote: > Use the new completion flush code to implement the inode > flush lock. Removes one of the final users of semaphores > in the XFS code base. > > Version 2: > o make flock functions static inlines > o use new completion interfaces I was looking over this lock in XFS .. The iflock/ifunlock seem to be very much like mutexes in most of the calling locations. Where the lock happens at the start, and the unlock happens when the function calls bottom out. It seems like a better way to go would be to change from, xfs_ilock(uqp, XFS_ILOCK_EXCL); xfs_iflock(uqp); error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); Where xfs_iflush eventually does the unlock to, xfs_ilock(uqp, XFS_ILOCK_EXCL); xfs_iflock(uqp); error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); xfs_ifunlock(uqp); And remove the unlocking from inside xfs_iflush(). Then use a flag to indicate that the flush is in progress, and a completion/wait_for_completion when another thread needs to wait on the flush to complete if it's an async flush. That seems vastly more complex than your current patch, but I think it will be much cleaner .. Daniel From owner-xfs@oss.sgi.com Wed Aug 13 00:07:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 00:07:20 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7D77FVG026197 for ; Wed, 13 Aug 2008 00:07:16 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA10224; Wed, 13 Aug 2008 17:08:30 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id E367558C52A8; Wed, 13 Aug 2008 17:08:29 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 985584 - Refactor process_dinode_int() in xfs_repair Message-Id: <20080813070829.E367558C52A8@chook.melbourne.sgi.com> Date: Wed, 13 Aug 2008 17:08:29 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17503 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Date: Wed Aug 13 17:07:42 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xcmds-clean Inspected by: chandan@agami.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31887a xfsprogs/repair/dinode.c - 1.30 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/dinode.c.diff?r1=text&tr1=1.30&r2=text&tr2=1.29&f=h xfsprogs/repair/dinode.h - 1.8 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/dinode.h.diff?r1=text&tr1=1.8&r2=text&tr2=1.7&f=h xfsprogs/repair/dino_chunks.c - 1.17 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/dino_chunks.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.16&f=h - Refactor process_dinode_int() From owner-xfs@oss.sgi.com Wed Aug 13 00:49:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 00:49:55 -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 (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 m7D7nj0R000984 for ; Wed, 13 Aug 2008 00:49:48 -0700 X-ASG-Debug-ID: 1218613862-676400160000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3FFFDF39D9B for ; Wed, 13 Aug 2008 00:51:02 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id WpGVLmSyMaZBr0P3 for ; Wed, 13 Aug 2008 00:51:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANwtokh5LAMb/2dsb2JhbAC3CoFV X-IronPort-AV: E=Sophos;i="4.32,200,1217773800"; d="scan'208";a="181031853" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 13 Aug 2008 17:20:58 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTB8D-0004nO-GR; Wed, 13 Aug 2008 17:50:57 +1000 Date: Wed, 13 Aug 2008 17:50:57 +1000 From: Dave Chinner To: Daniel Walker Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Message-ID: <20080813075057.GZ6119@disturbed> Mail-Followup-To: Daniel Walker , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> <1218597077.6166.15.camel@dhcp32.mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1218597077.6166.15.camel@dhcp32.mvista.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218613863 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.2520 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17504 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 12, 2008 at 08:11:17PM -0700, Daniel Walker wrote: > On Fri, 2008-06-27 at 18:44 +1000, Dave Chinner wrote: > > Use the new completion flush code to implement the inode > > flush lock. Removes one of the final users of semaphores > > in the XFS code base. > > > > Version 2: > > o make flock functions static inlines > > o use new completion interfaces > > I was looking over this lock in XFS .. The iflock/ifunlock seem to be > very much like mutexes in most of the calling locations. Semaphores, not mutexes. The unlock most commonly happens in a different context (i.e. I/O completion). > Where the lock > happens at the start, and the unlock happens when the function calls > bottom out. It seems like a better way to go would be to change from, > > xfs_ilock(uqp, XFS_ILOCK_EXCL); > xfs_iflock(uqp); > error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); > > Where xfs_iflush eventually does the unlock to, > > xfs_ilock(uqp, XFS_ILOCK_EXCL); > xfs_iflock(uqp); > error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); > xfs_ifunlock(uqp); Firstly, sync flushes are rare. Async are common. Right now we have the case where no matter what type of flush is done, the caller does not have to worry about unlocking the flush lock - it will be done as part of the flush. You're suggestion makes that conditional based on whether we did a sync flush or not. So, what happenѕ when you call: xfs_iflush(ip, XFS_IFLUSH_DELWRI_ELSE_SYNC); i.e. xfs_iflush() may do an delayed flush or a sync flush depending on the current state of the inode. The caller has no idea what type of flush was done, so will have no idea whether to unlock or not. > And remove the unlocking from inside xfs_iflush(). Then use a flag to > indicate that the flush is in progress, and a > completion/wait_for_completion when another thread needs to wait on the > flush to complete if it's an async flush. And if it's a delayed flush? If we just wait for completion, we'll have to wait for a long time before the xfsbufd times out the buffer and pushes it to disk. This is important - the log AIL push code does try-locks on the flush lock to determine if the inode is in a delayed write state or not, and does an async buffer push inѕtead of xfs_iflush() to get it to disk immediately. That is, there are three types of inode flushes (sync, async and delwri) and the flush lock is used in different ways to determine what action to take when writing back inodes. There's much more to this 'flush lock' than just locking ;) > That seems vastly more complex than your current patch, but I think it > will be much cleaner .. Doesn't seem that way to me... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 01:10:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 01:10:38 -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=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7D8AX2Q002319 for ; Wed, 13 Aug 2008 01:10:34 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA11542; Wed, 13 Aug 2008 18:11:47 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 8ECE258C52A8; Wed, 13 Aug 2008 18:11:47 +1000 (EST) Date: Wed, 13 Aug 2008 18:11:47 +1000 To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: [GIT PULL] XFS update for 2.6.27-rc4 User-Agent: nail 11.25 7/29/05 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17505 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: Linus Torvalds (1): Linux 2.6.27-rc3 are available in the git repository at: git://oss.sgi.com:8090/xfs/linux-2.6 master Christoph Hellwig (22): [XFS] don't leak m_fsname/m_rtname/m_logname [XFS] Remove vn_from_inode() [XFS] kill vn_to_inode [XFS] remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c [XFS] remove remaining VN_HOLD calls [XFS] implement IHOLD/IRELE directly [XFS] kill INDUCE_IO_ERROR [XFS] kill xfs_lock_dir_and_entry [XFS] remove some easy bhv_vnode_t instances [XFS] kill bhv_vnode_t [XFS] sanitize xfs_initialize_vnode [XFS] small cleanups in xfs_btree.c [XFS] Use the same btree_cur union member for alloc and inobt trees. [XFS] update timestamp in xfs_ialloc manually [XFS] optimize xfs_ichgtime [XFS] stop using file_update_time [XFS] move root inode IRELE into xfs_unmountfs [XFS] cleanup xfs_mountfs [XFS] xfs_unmountfs should return void [XFS] don't call xfs_freesb from xfs_unmountfs [XFS] refactor xfs_mount_free [XFS] use KM_MAYFAIL in xfs_mountfs David Chinner (12): [XFS] Use the generic bitops rather than implementing them ourselves. [XFS] Avoid directly referencing the VFS inode. [XFS] kill shouty XFS_ITOV_NULL macro [XFS] Kill shouty XFS_ITOV() macro [XFS] XFS: Kill xfs_vtoi() [XFS] Use KM_NOFS for incore inode extent tree allocation V2 [XFS] clean up stale references to semaphores [XFS] replace the XFS buf iodone semaphore with a completion [XFS] extend completions to provide XFS object flush requirements [XFS] replace inode flush semaphore with a completion [XFS] replace dquot flush semaphore with a completion [XFS] remove the sema_t from XFS. Eric Sandeen (3): [XFS] remove INT_GET and friends [XFS] convert xfs to use ERR_CAST [XFS] remove shouting-indirection macros from xfs_trans.h Harvey Harrison (1): [XFS] use get_unaligned_* helpers Lachlan McIlroy (4): [XFS] Do not access buffers after dropping reference count [XFS] Fix compile failure in xfs_buf_trace() [XFS] Use KM_NOFS for debug trace buffers [XFS] Fix use after free in xfs_log_done(). Niv Sardi (2): [XFS] Move attr log alloc size calculator to another function. [XFS] Move xfs_attr_rolltrans to xfs_trans_roll Ruben Porras (1): [XFS] Make xfs_bmap_*_count_leaves void. fs/xfs/linux-2.6/sema.h | 52 ----------- fs/xfs/linux-2.6/xfs_aops.c | 3 +- fs/xfs/linux-2.6/xfs_buf.c | 16 ++-- fs/xfs/linux-2.6/xfs_buf.h | 4 +- fs/xfs/linux-2.6/xfs_export.c | 10 +- fs/xfs/linux-2.6/xfs_fs_subr.c | 6 +- fs/xfs/linux-2.6/xfs_ioctl.c | 4 +- fs/xfs/linux-2.6/xfs_iops.c | 192 +++++++++++++++++++++++++--------------- fs/xfs/linux-2.6/xfs_iops.h | 15 +--- fs/xfs/linux-2.6/xfs_linux.h | 4 +- fs/xfs/linux-2.6/xfs_lrw.c | 6 +- fs/xfs/linux-2.6/xfs_super.c | 189 +++++++++++----------------------------- fs/xfs/linux-2.6/xfs_super.h | 3 - fs/xfs/linux-2.6/xfs_vnode.c | 22 +---- fs/xfs/linux-2.6/xfs_vnode.h | 65 +++++--------- fs/xfs/quota/xfs_dquot.c | 38 +++----- fs/xfs/quota/xfs_dquot.h | 29 ++++--- fs/xfs/quota/xfs_dquot_item.c | 8 +- fs/xfs/quota/xfs_qm.c | 14 ++-- fs/xfs/quota/xfs_qm.h | 2 +- fs/xfs/quota/xfs_qm_bhv.c | 7 +- fs/xfs/quota/xfs_qm_syscalls.c | 4 +- fs/xfs/xfs_acl.c | 52 +++++------ fs/xfs/xfs_acl.h | 14 ++-- fs/xfs/xfs_arch.h | 68 -------------- fs/xfs/xfs_attr.c | 110 ++++++++++++++--------- fs/xfs/xfs_attr.h | 1 + fs/xfs/xfs_attr_leaf.c | 75 ++-------------- fs/xfs/xfs_attr_leaf.h | 2 - fs/xfs/xfs_bit.c | 103 --------------------- fs/xfs/xfs_bit.h | 34 ++++++- fs/xfs/xfs_bmap.c | 34 +++----- fs/xfs/xfs_btree.c | 105 ++++++++-------------- fs/xfs/xfs_btree.h | 8 +-- fs/xfs/xfs_buf_item.c | 4 +- fs/xfs/xfs_dfrag.c | 33 ++----- fs/xfs/xfs_error.c | 5 +- fs/xfs/xfs_error.h | 12 +-- fs/xfs/xfs_filestream.c | 2 +- fs/xfs/xfs_ialloc_btree.c | 30 +++--- fs/xfs/xfs_iget.c | 48 ++++------ fs/xfs/xfs_inode.c | 66 +++++++------- fs/xfs/xfs_inode.h | 46 ++++++++-- fs/xfs/xfs_inode_item.c | 11 +-- fs/xfs/xfs_itable.c | 4 +- fs/xfs/xfs_log.c | 86 ++++++++---------- fs/xfs/xfs_log.h | 2 +- fs/xfs/xfs_log_priv.h | 14 ++-- fs/xfs/xfs_log_recover.c | 7 +- fs/xfs/xfs_mount.c | 82 ++++++------------ fs/xfs/xfs_mount.h | 17 +--- fs/xfs/xfs_rtalloc.c | 19 ++--- fs/xfs/xfs_rw.c | 2 +- fs/xfs/xfs_trans.c | 75 ++++++++++++++-- fs/xfs/xfs_trans.h | 12 +--- fs/xfs/xfs_trans_buf.c | 12 ++-- fs/xfs/xfs_trans_item.c | 66 +++++++------- fs/xfs/xfs_utils.c | 4 +- fs/xfs/xfs_utils.h | 3 - fs/xfs/xfs_vfsops.c | 13 ++-- fs/xfs/xfs_vnodeops.c | 190 +++++++++++---------------------------- include/linux/completion.h | 45 +++++++++ 62 files changed, 883 insertions(+), 1326 deletions(-) delete mode 100644 fs/xfs/linux-2.6/sema.h From owner-xfs@oss.sgi.com Wed Aug 13 01:15:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 01:15:25 -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=-1.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7D8FNgZ003029 for ; Wed, 13 Aug 2008 01:15:23 -0700 X-ASG-Debug-ID: 1218615398-51c602030000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DA37D19CBC49; Wed, 13 Aug 2008 01:16:38 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id uQDMdi0NOkHbR7j9; Wed, 13 Aug 2008 01:16:38 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m7D8G78Q030819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Aug 2008 01:16:08 -0700 Received: from y.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m7D8G6nB006672; Wed, 13 Aug 2008 01:16:06 -0700 Date: Wed, 13 Aug 2008 01:16:06 -0700 From: Andrew Morton To: lachlan@sgi.com (Lachlan McIlroy) Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27-rc4 Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 Message-Id: <20080813011606.06f2c2da.akpm@linux-foundation.org> In-Reply-To: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1218615400 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: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2521 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17506 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Wed, 13 Aug 2008 18:11:47 +1000 lachlan@sgi.com (Lachlan McIlroy) wrote: > The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: > Linus Torvalds (1): > Linux 2.6.27-rc3 > > are available in the git repository at: > > git://oss.sgi.com:8090/xfs/linux-2.6 master Who do I have to pay to get rid of these: xfs-use-get_unaligned_-helpers.patch xfs-clean-up-stale-references-to-semaphores.patch xfs-replace-the-xfs-buf-iodone-semaphore-with-a-completion.patch xfs-extend-completions-to-provide-xfs-object-flush-requirements.patch xfs-replace-inode-flush-semaphore-with-a-completion.patch xfs-replace-dquot-flush-semaphore-with-a-completion.patch xfs-remove-the-sema_t-from-xfs.patch and how much? From owner-xfs@oss.sgi.com Wed Aug 13 01:21:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 01:21:56 -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=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7D8LrcX003595 for ; Wed, 13 Aug 2008 01:21:54 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA11970; Wed, 13 Aug 2008 18:23:06 +1000 Message-ID: <48A29B78.4030600@sgi.com> Date: Wed, 13 Aug 2008 18:29:44 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Andrew Morton CC: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> <20080813011606.06f2c2da.akpm@linux-foundation.org> In-Reply-To: <20080813011606.06f2c2da.akpm@linux-foundation.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17507 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Andrew Morton wrote: > On Wed, 13 Aug 2008 18:11:47 +1000 lachlan@sgi.com (Lachlan McIlroy) wrote: > >> The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: >> Linus Torvalds (1): >> Linux 2.6.27-rc3 >> >> are available in the git repository at: >> >> git://oss.sgi.com:8090/xfs/linux-2.6 master > > Who do I have to pay to get rid of these: > > xfs-use-get_unaligned_-helpers.patch > xfs-clean-up-stale-references-to-semaphores.patch > xfs-replace-the-xfs-buf-iodone-semaphore-with-a-completion.patch > xfs-extend-completions-to-provide-xfs-object-flush-requirements.patch > xfs-replace-inode-flush-semaphore-with-a-completion.patch > xfs-replace-dquot-flush-semaphore-with-a-completion.patch > xfs-remove-the-sema_t-from-xfs.patch > > and how much? You can pay me if you like. All of those mods are in this git pull request so they will be in mainline soon enough. > > -- > 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/ > From owner-xfs@oss.sgi.com Wed Aug 13 01:49:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 01:49:31 -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=-1.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7D8nSws005329 for ; Wed, 13 Aug 2008 01:49:28 -0700 X-ASG-Debug-ID: 1218617444-560a03880000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DC3C219D02A5 for ; Wed, 13 Aug 2008 01:50:44 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id KTRTHDqFPg1mDTq2 for ; Wed, 13 Aug 2008 01:50:44 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOw7okh5LAMb/2dsb2JhbAC3L4FV X-IronPort-AV: E=Sophos;i="4.32,200,1217773800"; d="scan'208";a="181067958" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 13 Aug 2008 18:20:43 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTC40-00085w-Ot; Wed, 13 Aug 2008 18:50:40 +1000 Date: Wed, 13 Aug 2008 18:50:40 +1000 From: Dave Chinner To: Andrew Morton Cc: Lachlan McIlroy , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27-rc4 Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 Message-ID: <20080813085040.GB6119@disturbed> Mail-Followup-To: Andrew Morton , Lachlan McIlroy , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> <20080813011606.06f2c2da.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080813011606.06f2c2da.akpm@linux-foundation.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218617445 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: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2521 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17508 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 01:16:06AM -0700, Andrew Morton wrote: > On Wed, 13 Aug 2008 18:11:47 +1000 lachlan@sgi.com (Lachlan McIlroy) wrote: > > > The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: > > Linus Torvalds (1): > > Linux 2.6.27-rc3 > > > > are available in the git repository at: > > > > git://oss.sgi.com:8090/xfs/linux-2.6 master > > Who do I have to pay to get rid of these: > > xfs-use-get_unaligned_-helpers.patch > xfs-clean-up-stale-references-to-semaphores.patch > xfs-replace-the-xfs-buf-iodone-semaphore-with-a-completion.patch > xfs-extend-completions-to-provide-xfs-object-flush-requirements.patch > xfs-replace-inode-flush-semaphore-with-a-completion.patch > xfs-replace-dquot-flush-semaphore-with-a-completion.patch > xfs-remove-the-sema_t-from-xfs.patch > > and how much? They are all in that pull request: | David Chinner (12): ..... | [XFS] clean up stale references to semaphores | [XFS] replace the XFS buf iodone semaphore with a completion | [XFS] extend completions to provide XFS object flush requirements | [XFS] replace inode flush semaphore with a completion | [XFS] replace dquot flush semaphore with a completion | [XFS] remove the sema_t from XFS. ..... | Harvey Harrison (1): | [XFS] use get_unaligned_* helpers So you won't have to pay anyone anything ;) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 02:13:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 02:13:43 -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.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7D9DdLU006940 for ; Wed, 13 Aug 2008 02:13:41 -0700 X-ASG-Debug-ID: 1218618896-2ed3011b0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 723EC19D0660 for ; Wed, 13 Aug 2008 02:14:56 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id b22JgnUeeT1H4xsU for ; Wed, 13 Aug 2008 02:14:56 -0700 (PDT) Received: from shambala.of.teamix.net (blackhole.teamix.net [194.150.191.251]) by mail.lichtvoll.de (Postfix) with ESMTP id D04395AE4E for ; Wed, 13 Aug 2008 11:14:55 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Subject: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Date: Wed, 13 Aug 2008 11:15:02 +0200 User-Agent: KMail/1.9.9 References: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> <200808122253.57666.Martin@lichtvoll.de> (sfid-20080812_225744_709880_4EB8AD8F) In-Reply-To: <200808122253.57666.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808131115.03350.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1218618897 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2521 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17509 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Dienstag 12 August 2008 schrieb Martin Steigerwald: > Am Dienstag 12 August 2008 schrieb Lachlan McIlroy: > > Fix use after free in xfs_log_done(). > > > > The ticket allocation code got reworked in 2.6.26 and we now free > > tickets whereas before we used to cache them so the use-after-free > > went undetected. > > Is this intended to go to stable tree? > > How serious is this? I intend to update my laptops to 2.6.26. Nevermind, I just applied the patch. -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Wed Aug 13 06:55:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 06:55:14 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DDt6lZ026341 for ; Wed, 13 Aug 2008 06:55:07 -0700 X-ASG-Debug-ID: 1218635782-55c7015f0000-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 BE4FB19CA89E for ; Wed, 13 Aug 2008 06:56:22 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id FBny4gU34xoSmZBg for ; Wed, 13 Aug 2008 06:56:22 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGpq-0001HP-46; Wed, 13 Aug 2008 13:56:22 +0000 Date: Wed, 13 Aug 2008 09:56:22 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: factor xfs_iget_core() into hit and miss cases Subject: Re: [PATCH] XFS: factor xfs_iget_core() into hit and miss cases Message-ID: <20080813135622.GA4896@infradead.org> References: <1218505965-30229-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505965-30229-1-git-send-email-david@fromorbit.com> 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: 1218635784 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.2545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17511 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 12, 2008 at 11:52:45AM +1000, Dave Chinner wrote: > There are really two cases in xfs_iget_core(). The first is the > cache hit case, the second is the miss case. They share very little > code, and hence can easily be factored out into separate functions. > This makes the code much easier to understand and subsequently > modify. Looks good. From owner-xfs@oss.sgi.com Wed Aug 13 06:53:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 06:53:36 -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 (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 m7DDrVms026076 for ; Wed, 13 Aug 2008 06:53:32 -0700 X-ASG-Debug-ID: 1218635688-28dc00900000-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 F324C12F5873; Wed, 13 Aug 2008 06:54:48 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id BfsMwT7WJrv0I176; Wed, 13 Aug 2008 06:54:48 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGoK-0000s2-1c; Wed, 13 Aug 2008 13:54:48 +0000 Date: Wed, 13 Aug 2008 09:54:48 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [REVIEW] Move memory allocations for log tracing out of the critical path Subject: Re: [REVIEW] Move memory allocations for log tracing out of the critical path Message-ID: <20080813135447.GA3109@infradead.org> References: <48A11F4C.6000002@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A11F4C.6000002@sgi.com> 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: 1218635688 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.02, rules version 3.0.83838 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17510 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 12, 2008 at 03:27:40PM +1000, Lachlan McIlroy wrote: > Memory allocations for log->l_grant_trace and iclog->ic_trace are done > on demand when the first event is logged. In xlog_state_get_iclog_space() > we call xlog_trace_iclog() under a spinlock and allocating memory here can > cause us to sleep with a spinlock held and deadlock the system. > > For the log grant tracing we use KM_NOSLEEP but that means we can lose > trace entries. Since there is no locking to serialize the log grant > tracing we could race and have multiple allocations and leak memory. > > So move the allocations to where we initialize the log/iclog structures. > Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace > since it's not even used. Looks good to me. From owner-xfs@oss.sgi.com Wed Aug 13 07:00:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:00:17 -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 m7DE0CwL027072 for ; Wed, 13 Aug 2008 07:00:13 -0700 X-ASG-Debug-ID: 1218636090-320c00a00000-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 DCBA038C322 for ; Wed, 13 Aug 2008 07:01:30 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 1No6pK76UOwAqVBi for ; Wed, 13 Aug 2008 07:01:30 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGun-0005rs-Ur; Wed, 13 Aug 2008 14:01:29 +0000 Date: Wed, 13 Aug 2008 10:01:29 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/6] XFS: move sync code to its own file Subject: Re: [PATCH 1/6] XFS: move sync code to its own file Message-ID: <20080813140129.GC4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-2-git-send-email-david@fromorbit.com> 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: 1218636090 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.2541 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17512 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 12, 2008 at 11:46:06AM +1000, Dave Chinner wrote: > The sync code in XFS is spread around several files. > While it used to make sense to have such a distribution, > the code about to be cleaned up and so centralising it > in one spot as the first step mackes sense. Besides the move you also change xfs_quiesce_fs to call xfs_sync instead of xfs_syncsub. This does and additional XFS_QM_DQSYNC and an xfs_filestream_flush. The latter doesn't have any effect because we don't have SYNC_IOWAIT set here, but the former means we are now doing a synchronous quota sync. I don't think that can be harmful, but I'd be better left for a separate and properly documented patch. Otherwise this looks good to me. From owner-xfs@oss.sgi.com Wed Aug 13 07:00:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:00:56 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DE0sbN027382 for ; Wed, 13 Aug 2008 07:00:54 -0700 X-ASG-Debug-ID: 1218636132-5f2a01030000-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 6AD0F19D1642 for ; Wed, 13 Aug 2008 07:02:12 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id zDTdrfi1R1qobvi8 for ; Wed, 13 Aug 2008 07:02:12 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGvU-0007iq-19; Wed, 13 Aug 2008 14:02:12 +0000 Date: Wed, 13 Aug 2008 10:02:12 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Subject: Re: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Message-ID: <20080813140212.GD4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-3-git-send-email-david@fromorbit.com> 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: 1218636132 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.2545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17513 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 12, 2008 at 11:46:07AM +1000, Dave Chinner wrote: > Move all the xfssyncd code to the new xfs_sync.c file. > This places it closer to the actual code that it interacts > with, rather than just being associated with high level > VFS code. Looks good. From owner-xfs@oss.sgi.com Wed Aug 13 07:01:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:01:13 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DE17iA027492 for ; Wed, 13 Aug 2008 07:01:07 -0700 X-ASG-Debug-ID: 1218636145-659b00820000-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 702DA19D1645 for ; Wed, 13 Aug 2008 07:02:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id pCsOzAoU3AL41UWf for ; Wed, 13 Aug 2008 07:02:25 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGvh-00083P-4B; Wed, 13 Aug 2008 14:02:25 +0000 Date: Wed, 13 Aug 2008 10:02:25 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Subject: Re: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Message-ID: <20080813140225.GE4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-4-git-send-email-david@fromorbit.com> 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: 1218636145 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.2545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17514 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 Still looks good :) From owner-xfs@oss.sgi.com Wed Aug 13 07:01:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:01: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.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DE1RhR027766 for ; Wed, 13 Aug 2008 07:01:27 -0700 X-ASG-Debug-ID: 1218636165-5f4201120000-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 52EDA19D1670 for ; Wed, 13 Aug 2008 07:02:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id G8n2Xncj2GlcpyKV for ; Wed, 13 Aug 2008 07:02:45 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGw1-0001nF-0j; Wed, 13 Aug 2008 14:02:45 +0000 Date: Wed, 13 Aug 2008 10:02:45 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Subject: Re: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Message-ID: <20080813140244.GF4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-5-git-send-email-david@fromorbit.com> 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: 1218636165 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.2545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17515 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 Still looks good. From owner-xfs@oss.sgi.com Wed Aug 13 07:01:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:01:50 -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 m7DE1f96027997 for ; Wed, 13 Aug 2008 07:01:42 -0700 X-ASG-Debug-ID: 1218636179-320c00b70000-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 1BDAF38C35F for ; Wed, 13 Aug 2008 07:02:59 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id bAxxD5zHho2VXfPV for ; Wed, 13 Aug 2008 07:02:59 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGwF-0001oC-Hu; Wed, 13 Aug 2008 14:02:59 +0000 Date: Wed, 13 Aug 2008 10:02:59 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Subject: Re: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Message-ID: <20080813140259.GG4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-6-git-send-email-david@fromorbit.com> 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: 1218636180 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.2541 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17516 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 Still looks good. From owner-xfs@oss.sgi.com Wed Aug 13 07:02:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:02:40 -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 (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 m7DE2bAc028740 for ; Wed, 13 Aug 2008 07:02:37 -0700 X-ASG-Debug-ID: 1218636235-2abc00b00000-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 7ABC312F597A for ; Wed, 13 Aug 2008 07:03:55 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 4HRBOn4LL627bBGo for ; Wed, 13 Aug 2008 07:03:55 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGx8-00036o-UA; Wed, 13 Aug 2008 14:03:54 +0000 Date: Wed, 13 Aug 2008 10:03:54 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 6/6] XFS: remove the mount inode list Subject: Re: [PATCH 6/6] XFS: remove the mount inode list Message-ID: <20080813140354.GH4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218505571-27588-7-git-send-email-david@fromorbit.com> 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: 1218636235 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.02, rules version 3.0.83838 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17517 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 Still looks good. From owner-xfs@oss.sgi.com Wed Aug 13 07:02:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 07:03:03 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DE2wTr028934 for ; Wed, 13 Aug 2008 07:02:58 -0700 X-ASG-Debug-ID: 1218636256-5edd01470000-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 47A5419D189A for ; Wed, 13 Aug 2008 07:04:16 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 5IXylTrXVo5xSnR1 for ; Wed, 13 Aug 2008 07:04:16 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTGxU-0003eh-06 for xfs@oss.sgi.com; Wed, 13 Aug 2008 14:04:16 +0000 Date: Wed, 13 Aug 2008 10:04:15 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 7/6] XFS: xfsidbg update for mount inode list Subject: Re: [PATCH 7/6] XFS: xfsidbg update for mount inode list Message-ID: <20080813140415.GI4896@infradead.org> References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <20080812020018.GN6119@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080812020018.GN6119@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: 1218636256 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.2545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17518 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 Looks good. From owner-xfs@oss.sgi.com Wed Aug 13 08:32:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 08:32:53 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DFWkKU006211 for ; Wed, 13 Aug 2008 08:32:48 -0700 X-ASG-Debug-ID: 1218641643-337f02670000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gateway-1237.mvista.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C39B019D23E8 for ; Wed, 13 Aug 2008 08:34:03 -0700 (PDT) Received: from gateway-1237.mvista.com (gateway-1237.mvista.com [63.81.120.158]) by cuda.sgi.com with ESMTP id m4gYIh5qfhm5ZrnC for ; Wed, 13 Aug 2008 08:34:03 -0700 (PDT) Received: from [10.0.4.38] (dwalker.mvista.com [10.0.4.38]) by hermes.mvista.com (Postfix) with ESMTP id 0AAF2181EB; Wed, 13 Aug 2008 08:34:02 -0700 (PDT) X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion From: Daniel Walker To: Dave Chinner Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx In-Reply-To: <20080813075057.GZ6119@disturbed> References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> <1218597077.6166.15.camel@dhcp32.mvista.com> <20080813075057.GZ6119@disturbed> Content-Type: text/plain; charset=utf-8 Date: Wed, 13 Aug 2008 08:34:01 -0700 Message-Id: <1218641641.6166.32.camel@dhcp32.mvista.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 8bit X-Barracuda-Connect: gateway-1237.mvista.com[63.81.120.158] X-Barracuda-Start-Time: 1218641643 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0258 1.0000 -1.8534 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.85 X-Barracuda-Spam-Status: No, SCORE=-1.85 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.2551 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17519 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dwalker@mvista.com Precedence: bulk X-list: xfs On Wed, 2008-08-13 at 17:50 +1000, Dave Chinner wrote: > Right now we have the case where no matter what type of flush > is done, the caller does not have to worry about unlocking > the flush lock - it will be done as part of the flush. You're > suggestion makes that conditional based on whether we did a > sync flush or not. > > So, what happenѕ when you call: > > xfs_iflush(ip, XFS_IFLUSH_DELWRI_ELSE_SYNC); > > i.e. xfs_iflush() may do an delayed flush or a sync flush depending > on the current state of the inode. The caller has no idea what type > of flush was done, so will have no idea whether to unlock or not. You wouldn't base the unlock on what iflush does, you would unconditionally unlock. > > And remove the unlocking from inside xfs_iflush(). Then use a flag to > > indicate that the flush is in progress, and a > > completion/wait_for_completion when another thread needs to wait on the > > flush to complete if it's an async flush. > > And if it's a delayed flush? If we just wait for completion, we'll > have to wait for a long time before the xfsbufd times out the buffer > and pushes it to disk. This is important - the log AIL push code > does try-locks on the flush lock to determine if the inode is in a > delayed write state or not, and does an async buffer push inѕtead > of xfs_iflush() to get it to disk immediately. You wouldn't wait for completion of the flush unless the code really needed to wait. Seems like your indicating that waiting on the flush is rare. > That is, there are three types of inode flushes (sync, async and > delwri) and the flush lock is used in different ways to determine > what action to take when writing back inodes. There's much more to > this 'flush lock' than just locking ;) What I was saying is instead of using the flush lock as an indicator, use some other non-lock based method.. A set of state flags protected by the iflush lock for instance .. Daniel From owner-xfs@oss.sgi.com Wed Aug 13 15:04:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 15:04:58 -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.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7DM4P4d031023 for ; Wed, 13 Aug 2008 15:04:27 -0700 X-ASG-Debug-ID: 1218665141-733d00d50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 57E8419D15B2 for ; Wed, 13 Aug 2008 15:05:42 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id pj4PdFmDDd5hFayC for ; Wed, 13 Aug 2008 15:05:42 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7DM5Eux018105; Wed, 13 Aug 2008 15:05:15 -0700 Message-ID: <48A35A99.1080300@tlinx.org> Date: Wed, 13 Aug 2008 15:05:13 -0700 From: Linda Walsh User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Dave Chinner , xfs-oss CC: LKML , Eric Sandeen X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> <48A20E9E.9090100@tlinx.org> <20080813005852.GW6119@disturbed> In-Reply-To: <20080813005852.GW6119@disturbed> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218665143 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0022 1.0000 -2.0067 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 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.2577 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17520 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xfs@tlinx.org Precedence: bulk X-list: xfs Dave Chinner wrote: > Once again, > "a problem with the generic code inverting the normal lock order". > > This one cannot deadlock, though, because by definition > any inode on the unused list is, well, unused and hence we can't be > holding a reference to it... ---- This is great, maybe...but what do you mean by "generic"? Is this generic in the FS layer such that we'd see this with all FS types? Or is it generic "XFS" code that only happens with various, "application", (user) coded applications that use locking in a correct, but non-standard order? Some of these messages come out of utilities that I wouldn't think would be using kernel-locking, 'explicitly', at all (gnu-sort). If the generic code didn't invert lock orders from the "norm", could these errors be deleted? Is it code that all resides in the kernel and could be made consistent or is it also user-level (or glibc) apps that are using locks in strange, but correct ways? I'd *like* to keep lock provability 'on' -- but I don't want to waste people's time chasing after non-problems and so far I've seen at least 3 different locking sequences that all appear to be harmless. The problem with false positives is that it will either force the user to ignore (or turn off) the validation code, or generate periodic noise when these things arise... Isn't it generally considered pretty 'bad' to generate so many false positives -- or is lock-proving only for for "lock debugging" -- and not to be used except on development or test systems? From owner-xfs@oss.sgi.com Wed Aug 13 15:29:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 15:29:12 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52, J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_65 autolearn=no 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 m7DMT7oj032471 for ; Wed, 13 Aug 2008 15:29:08 -0700 X-ASG-Debug-ID: 1218666622-143700ab0000-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 A425B38F415 for ; Wed, 13 Aug 2008 15:30:23 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id BCRrfAKOQr123omE for ; Wed, 13 Aug 2008 15:30:23 -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 m7DMUNIF015724 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 00:30:23 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7DMUMbh015720 for xfs@oss.sgi.com; Thu, 14 Aug 2008 00:30:22 +0200 Date: Thu, 14 Aug 2008 00:30:22 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [RFC] btree test harness Subject: [RFC] btree test harness Message-ID: <20080813223022.GA15025@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218666624 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: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2577 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17521 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 To excercise the btree code a harness that looks at the corner cases would be helpful, and with the generic btree code it's now possible to implement one. This patch is based on WIP code from Dave Chinner but had to be largely rewritten. The idea is that we have a btree that is there just standalone and not integrated in the rest of the filesystem operation so that we can create worst cases easily without having to work around other parts of the code trying to work against these worst cases. It's done by creating an alloc bno btree lookalike rooted in a fake agf. The patch below is a working version that always does this during mount, so don't apply this on a machine with xfs root. I'm interested in comment about the approach, especially the way it does it's own freelist to avoid having to call in the alloc code and make it even slower. I'd also like some input on how interface to userspace. Doing it during mount but conditional would be one option, the other one an ioctl - in both cases I'd like to be able to specify up to which maxlevel to go as the tests for higher levels can take forever. Index: linux-2.6-xfs/fs/xfs/xfs_btree_test.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_test.c 2008-08-13 19:23:28.000000000 -0300 @@ -0,0 +1,1301 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_types.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_btree_trace.h" +#include "xfs_ialloc.h" +#include "xfs_alloc.h" +#include "xfs_error.h" +#include "xfs_trans_space.h" +#include "xfs_rw.h" + +/* + * Btree test harness. + * + * The idea is we implement a btree not that we can freely excercise + * without the rest of the filesystem involed. It basically mirrors + * the alloc by block number btree, just with a separate root block + * and dummy agf, and a "special" allocator. The allocator here + * just takes over the whole allocation group from a start offset + * and uses a simple bitmap - that way we can stree the btree without + * having to call into the XFS allocator (and this another btree). + * This is of course very dangerous on a real live filesystem, but + * this code shouldn't be used on those anyway. + * + * Initially this is based on the alloc btree code because it is + * the simplest. Ideally this also needs to be expanded to handle + * inode rooted btrees and all the other features of the btrees + * (e.g. longest extent tracking). + * + * The test harness itself is at the bottom of the file. It + * gets invoked in a debug build on XFS initialisation, and + * when it is complete it is never referenced again. + * + * Test harness + * + * The following tests are necessary: + * + * - split test + * - merge test + * - sparse tree test + * - depth test + * + * Ideally the tests should grow and shrink the tree, thereby + * exercising root splitting and merging. + * + * what we need: + * + * - a fake struct xfs_mount + * - a fake struct xfs_trans + * - a fake agf + * - a fake agf struct xfs_buf + * - special cursor init + */ + +/* We need to start a little after 0 to avoid hardcoded assumptions */ +#define XFS_TBT_FIRST_FREE_BLOCK 8 + + +static unsigned long *xfs_tbt_allocmap; +static size_t xfs_tbt_allomap_size; + +STATIC int +xfs_tbt_init_freelist( + struct xfs_mount *mp, + xfs_agnumber_t agno) +{ + struct xfs_buf *agbp; + struct xfs_agf *agf; + int error; + __uint32_t freeblks, startblk; + int i; + + error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); + if (error || agbp == NULL) { + cmn_err(CE_WARN, "xfs_alloc_read_agf failed (%d).\n", error); + return error ? error : ENOMEM; + } + + /* + * See what the largest free space is and used for us. + * + * XXX(hch): this assumes it's clustered at the end.. + */ + agf = XFS_BUF_TO_AGF(agbp); + freeblks = be32_to_cpu(agf->agf_longest); + startblk = be32_to_cpu(agf->agf_length) - freeblks; + xfs_buf_relse(agbp); + + cmn_err(CE_NOTE, "%s: using %d blocks, starting at %d\n", + __func__, freeblks, startblk); + + /* just us a simple bitmap array indexed by blockno */ + xfs_tbt_allomap_size = freeblks / NBBY; + xfs_tbt_allocmap = kmalloc(xfs_tbt_allomap_size, GFP_KERNEL); + if (!xfs_tbt_allocmap) { + cmn_err(CE_WARN, "xfs_tbt_init_freelist: ENOMEM"); + return ENOMEM; + } + + memset(xfs_tbt_allocmap, 0xff, xfs_tbt_allomap_size); /* all free */ + for (i = 0; i < startblk; i++) + clear_bit(i, xfs_tbt_allocmap); /* except for used blocks */ + + return 0; +} + +STATIC void +xfs_tbt_destroy_freelist( + struct xfs_mount *mp) +{ + kfree(xfs_tbt_allocmap); +} + +STATIC int +xfs_tbt_alloc( + xfs_agblock_t *bnop) +{ + xfs_agblock_t bno; + int val; + + bno = find_first_bit(xfs_tbt_allocmap, + xfs_tbt_allomap_size/sizeof(long)); + if (bno >= xfs_tbt_allomap_size/sizeof(long)) { + cmn_err(CE_WARN, "%s: ran out of space\n", __func__); + return ENOSPC; + } + + val = test_and_clear_bit(bno, xfs_tbt_allocmap); + + ASSERT(val); + ASSERT(find_first_bit(xfs_tbt_allocmap, + xfs_tbt_allomap_size/sizeof(long)) > bno); + ASSERT(bno != NULLAGBLOCK); + + *bnop = bno; + return 0; +} + +STATIC int +xfs_tbt_free( + xfs_agblock_t bno) +{ + int val; + + ASSERT(bno <= xfs_tbt_allomap_size); + + val = test_and_set_bit(bno, xfs_tbt_allocmap); + ASSERT(val == 0); + + return 0; +} + +STATIC int +xfs_tbt_alloc_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *start, + union xfs_btree_ptr *new, + int length, + int *stat) +{ + xfs_agblock_t bno; + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + error = xfs_tbt_alloc(&bno); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + new->s = cpu_to_be32(bno); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +} + +STATIC int +xfs_tbt_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + xfs_tbt_free(XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); + return 0; +} + +STATIC struct xfs_btree_cur * +xfs_tbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_btree_cur *new; + + new = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + new->bc_mp = cur->bc_mp; + new->bc_tp = cur->bc_tp; + new->bc_nlevels = cur->bc_nlevels; + new->bc_btnum = XFS_BTNUM_BNO; + new->bc_blocklog = cur->bc_mp->m_sb.sb_blocklog; + + new->bc_ops = cur->bc_ops; + + new->bc_private.a.agbp = cur->bc_private.a.agbp; + new->bc_private.a.agno = cur->bc_private.a.agno; + + return new; +} + +STATIC void +xfs_tbt_set_root( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int inc) +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + int btnum = cur->bc_btnum; + + ASSERT(ptr->s != 0); + + agf->agf_roots[btnum] = ptr->s; + be32_add(&agf->agf_levels[btnum], inc); + cur->bc_mp->m_perag[seqno].pagf_levels[btnum] += inc; + +// xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); +} + +STATIC int +xfs_tbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mnr[level != 0]; +} + +STATIC int +xfs_tbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mxr[level != 0]; +} + +STATIC void +xfs_tbt_init_key_from_rec( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->alloc.ar_startblock = rec->alloc.ar_startblock; + key->alloc.ar_blockcount = rec->alloc.ar_blockcount; +} + +STATIC void +xfs_tbt_init_rec_from_key( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + rec->alloc.ar_startblock = key->alloc.ar_startblock; + rec->alloc.ar_blockcount = key->alloc.ar_blockcount; +} + +STATIC void +xfs_tbt_init_rec_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + rec->alloc.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); + rec->alloc.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); +} + +STATIC void +xfs_tbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); + ASSERT(agf->agf_roots[cur->bc_btnum] != 0); + + ptr->s = agf->agf_roots[cur->bc_btnum]; +} + +STATIC __int64_t +xfs_tbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; + xfs_alloc_key_t *kp = &key->alloc; + + return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; +} + +STATIC int +xfs_tbt_kill_root( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int level, + union xfs_btree_ptr *newroot) +{ + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, killroot); + + /* + * Update the root pointer, decreasing the level by 1 and then + * free the old root. + */ + xfs_tbt_set_root(cur, newroot, -1); + error = xfs_tbt_free_block(cur, bp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + XFS_BTREE_STATS_INC(cur, free); + + xfs_btree_setbuf(cur, level, NULL); + cur->bc_nlevels--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + +#ifdef DEBUG +STATIC int +xfs_tbt_keys_inorder( + struct xfs_btree_cur *cur, + union xfs_btree_key *k1, + union xfs_btree_key *k2) +{ + return be32_to_cpu(k1->alloc.ar_startblock) < + be32_to_cpu(k2->alloc.ar_startblock); +} + +STATIC int +xfs_tbt_recs_inorder( + struct xfs_btree_cur *cur, + union xfs_btree_rec *r1, + union xfs_btree_rec *r2) +{ + return be32_to_cpu(r1->alloc.ar_startblock) + + be32_to_cpu(r1->alloc.ar_blockcount) <= + be32_to_cpu(r2->alloc.ar_startblock); +} +#endif /* DEBUG */ + +#ifdef XFS_BTREE_TRACE +ktrace_t *xfs_tbt_trace_buf; + +STATIC void +xfs_tbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ +#if 0 + ktrace_enter(xfs_tbt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +#endif +} + +STATIC void +xfs_tbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.a.ar_startblock; + *l1 = cur->bc_rec.a.ar_blockcount; +} + +STATIC void +xfs_tbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->alloc.ar_startblock); + *l1 = be32_to_cpu(key->alloc.ar_blockcount); +} + +STATIC void +xfs_tbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->alloc.ar_startblock); + *l1 = be32_to_cpu(rec->alloc.ar_blockcount); + *l2 = 0; +} +#endif /* XFS_BTREE_TRACE */ + +static const struct xfs_btree_ops xfs_tbt_ops = { + .rec_len = sizeof(xfs_alloc_rec_t), + .key_len = sizeof(xfs_alloc_key_t), + + .dup_cursor = xfs_tbt_dup_cursor, + .set_root = xfs_tbt_set_root, + .kill_root = xfs_tbt_kill_root, + .alloc_block = xfs_tbt_alloc_block, + .free_block = xfs_tbt_free_block, + .get_minrecs = xfs_tbt_get_minrecs, + .get_maxrecs = xfs_tbt_get_maxrecs, + .init_key_from_rec = xfs_tbt_init_key_from_rec, + .init_rec_from_key = xfs_tbt_init_rec_from_key, + .init_rec_from_cur = xfs_tbt_init_rec_from_cur, + .init_ptr_from_cur = xfs_tbt_init_ptr_from_cur, + .key_diff = xfs_tbt_key_diff, + +#ifdef DEBUG + .keys_inorder = xfs_tbt_keys_inorder, + .recs_inorder = xfs_tbt_recs_inorder, +#endif + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_tbt_trace_enter, + .trace_cursor = xfs_tbt_trace_cursor, + .trace_key = xfs_tbt_trace_key, + .trace_record = xfs_tbt_trace_record, +#endif +}; + +/* + * Allocate a new allocation btree cursor. + */ +STATIC struct xfs_btree_cur * +xfs_tbt_init_cursor( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + struct xfs_btree_cur *cur; + struct xfs_trans *tp; + int error; + uint resblks; + + resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; + tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE); + tp->t_flags |= XFS_TRANS_RESERVE; + error = xfs_trans_reserve(tp, resblks, + XFS_WRITE_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, + XFS_WRITE_LOG_COUNT); + if (error) { + xfs_trans_cancel(tp, 0); + return NULL; + } + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_mp = mp; + cur->bc_tp = tp; + cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]); + cur->bc_btnum = XFS_BTNUM_BNO; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_tbt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} + +/* + * Lookup the record equal to [bno, len] in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + +/* + * Update the record referred to by cur to the value given + * by [bno, len]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_tbt_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len) /* length of extent */ +{ + union xfs_btree_rec rec; + + rec.alloc.ar_startblock = cpu_to_be32(bno); + rec.alloc.ar_blockcount = cpu_to_be32(len); + return xfs_btree_update(cur, &rec); +} + +/* + * Get the data from the pointed-to record. + */ +STATIC int /* error */ +xfs_tbt_get_rec( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t *bno, /* output: starting block of extent */ + xfs_extlen_t *len, /* output: length of extent */ + int *stat) /* output: success/failure */ +{ + union xfs_btree_rec *rec; + int error; + + error = xfs_btree_get_rec(cur, &rec, stat); + if (!error && *stat == 1) { + *bno = be32_to_cpu(rec->alloc.ar_startblock); + *len = be32_to_cpu(rec->alloc.ar_blockcount); + } + return error; +} + +STATIC int +xfs_tbt_destroy_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_trans *tp = cur->bc_tp; + + xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); + return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); +} + +/* + * Build a full tree of the required depth of single block extents + * separated by a single block. We want discrete reecords to be + * built here. + * + * XXX: we probably want to create larger holes as well to be able + * to do more coverage on left and right merging and splitting. + * However, that is really a function of the specific implementation, + * not the core btree code which + */ +STATIC int +xfs_tbt_build_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels) +{ + struct xfs_btree_cur *cur; + int i; + xfs_agblock_t offset = XFS_TBT_FIRST_FREE_BLOCK; + xfs_extlen_t len = 1; + struct xfs_agf *agf; + int error = 0, error2; + + agf = XFS_BUF_TO_AGF(agbp); + while (be32_to_cpu(agf->agf_levels[0]) < levels) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + + i = 0; + /* Check the extent does not exist */ + error = xfs_tbt_lookup_eq(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + + /* Insert the extent */ + cur->bc_rec.a.ar_startblock = offset; + cur->bc_rec.a.ar_blockcount = len; + i = 0; + error = xfs_btree_insert(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: insert failed at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* keep a count of records in the tree */ + be32_add(&agf->agf_spare0, 1); + +// printk("%s: offset = %lld done\n", __func__, +// (unsigned long long)offset); + + /* move on to new extent */ + offset += 2; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + /* record largest offset added */ + agf->agf_spare1 = cpu_to_be32(offset); + return error; +} + +STATIC int +xfs_tbt_empty_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels) +{ + int error = 0, error2; + int i; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + + agf = XFS_BUF_TO_AGF(agbp); + while (be32_to_cpu(agf->agf_spare0) > 0) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + i = 0; + +// printk("%s: %d\n", __func__, be32_to_cpu(agf->agf_spare0)); + + /* find the extent that spans this offset/len */ + error = xfs_tbt_lookup_ge(cur, XFS_TBT_FIRST_FREE_BLOCK, 1, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, XFS_TBT_FIRST_FREE_BLOCK, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "%s error at offset %u (%d)", + __func__, "xfs_btree_delete", + XFS_TBT_FIRST_FREE_BLOCK, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add(&agf->agf_spare0, -1); +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +/* + * Take a tree and punch alternate blocks out of it until it + * reaches the required depth. The will split records apart. + * + * Hacked out of xfs_tbt_fixup_trees() + */ +STATIC int +xfs_tbt_punch_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels, + int dir) +{ + int error = 0, error2; + int i; + xfs_agblock_t fbno; + xfs_agblock_t nfbno1; + xfs_agblock_t nfbno2; + xfs_extlen_t flen = 0; + xfs_extlen_t nflen1 = 0; + xfs_extlen_t nflen2 = 0; + xfs_agblock_t offset; + xfs_extlen_t len; + xfs_agblock_t delta; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + + agf = XFS_BUF_TO_AGF(agbp); + + switch (dir) { + default: + case 0: /* r to l */ + offset = XFS_TBT_FIRST_FREE_BLOCK + 1; + len = 1; + delta = 2; + break; + case 1: /* l to r */ + offset = be32_to_cpu(agf->agf_spare1) - 3; // why?? + len = 1; + delta = -2; + break; + case 2: /* middle to r/l */ + /* XXX: not implemented yet */ + return 0; + break; + } + +// printk("%s: offset = %lld called\n", __func__, +// (unsigned long long)offset); + + + while (be32_to_cpu(agf->agf_levels[0]) < levels) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + + i = 0; + /* find the extent that spans this offset/len */ + error = xfs_tbt_lookup_le(cur, offset, 1, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &fbno, &flen, &i); + if (error) { + cmn_err(CE_ALERT, "%s: get_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1 && fbno <= offset && flen >= len); + + if (fbno == offset && flen == len) + /* just delete the record under the cursor */ + nfbno1 = nfbno2 = NULLAGBLOCK; + else if (fbno == offset) { + /* punching out left edge */ + nfbno1 = fbno + len; + nflen1 = flen - len; + nfbno2 = NULLAGBLOCK; + } else if (fbno + flen == offset + len) { + /* punching out right edge */ + nfbno1 = fbno; + nflen1 = flen - len; + nfbno2 = NULLAGBLOCK; + } else { + /* punching out left and right edge */ + nfbno1 = fbno; + nflen1 = offset - fbno; + nfbno2 = offset + len; + nflen2 = (fbno + flen) - nfbno2; + } + + if (nfbno1 == NULLAGBLOCK) { +// printk("deleting entry\n"); + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "%s error at offset %u (%d)", + __func__, "xfs_btree_delete", + offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add(&agf->agf_spare0, -1); + } else { + /* + * Update the by-block entry to start later|be shorter. + */ + error = xfs_tbt_update(cur, nfbno1, nflen1); + if (error) { + cmn_err(CE_ALERT, "%s: " + "xfs_btree_update error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + } + if (nfbno2 != NULLAGBLOCK) { +// printk("adding entry\n"); + /* + * Need to add the second entry. Confirm it does not + * exist first + */ + error = xfs_tbt_lookup_eq(cur, nfbno2, nflen2, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "lookup equal error at nfbno2 %u (%d)", + __func__, nfbno2, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + error = xfs_btree_insert(cur, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: insert error at nfbno2 %u (%d)", + __func__, nfbno2, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* keep a count of records in the tree */ + be32_add(&agf->agf_spare0, 1); + } + +// printk("%s: offset = %lld done\n", __func__, +// (unsigned long long)offset); + + /* move on to new extent */ + offset += delta; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +/* + * Take a sparse tree and fill the holes in it until there are + * no holes left. This requires finding the hole and it's adjacent + * extent(s) and updating extents in place and deleting old + * overlapping extents. + * + * XXX: only handles single extent holes in the tree + */ +STATIC int +xfs_tbt_fill_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels, + int dir) +{ + int error = 0, error2; + int i; + xfs_agblock_t lbno; + xfs_agblock_t rbno; + xfs_extlen_t llen = 0; + xfs_extlen_t rlen = 0; + xfs_agblock_t offset; + xfs_extlen_t len; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + int delta; + + agf = XFS_BUF_TO_AGF(agbp); + + switch (dir) { + default: + case 0: /* r to l */ + offset = XFS_TBT_FIRST_FREE_BLOCK + 1; + len = 1; + delta = 2; + break; + case 1: /* l to r */ + offset = be32_to_cpu(agf->agf_spare1) - 3; // why?? + len = 1; + delta = -2; + break; + case 2: /* middle to r/l */ + /* XXX: not implemented yet */ + return 0; + break; + } + +// printk("%s: offset = %lld called\n", __func__, +// (unsigned long long)offset); + + while (be32_to_cpu(agf->agf_spare0) > 1) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; +// printk("%s: agf->agf_spare0 = %d\n", __func__, +// be32_to_cpu(agf->agf_spare0)); + + /* are we in a hole? (should be) */ + error = xfs_tbt_lookup_eq(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: eqlookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + + /* find left neighbour */ + error = xfs_tbt_lookup_le(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: lelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &lbno, &llen, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: leget_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* find right neighbour */ + error = xfs_tbt_lookup_ge(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: gelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &rbno, &rlen, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: geget_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + error = EIO; + if (lbno + llen != offset) { + cmn_err(CE_ALERT, + "%s: left record not correct at %u (%u,%u)", + __func__, offset, lbno, llen); + goto out_error; + } else if (offset + len != rbno) { + cmn_err(CE_ALERT, + "%s: right record not correct at %u (%u,%u)", + __func__, offset, rbno, rlen); + goto out_error; + } + + /* + * fill hole: update one record, delete the other. + * The cursor currently points at the right record, + * so delete it and update the left record. Technically + * this is correct as the index of the left record does + * not change - only it's length + */ + llen = llen + len + rlen; + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: xfs_btree_delete error at offset %u (%d)", + __func__, rbno, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add(&agf->agf_spare0, -1); + + /* find left neighbour (again) */ + error = xfs_tbt_lookup_le(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: lelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* Update the left entry */ + error = xfs_tbt_update(cur, lbno, llen); + if (error) { + cmn_err(CE_ALERT, + "%s: xfs_btree_update error at offset %u (%d)", + __func__, lbno, error); + goto out_error; + } + +// printk("%s: offset = %lld done\n", __func__, +// (unsigned long long)offset); + + /* move on to new extent */ + offset += delta; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +STATIC int +xfs_tbt_init_ag( + struct xfs_mount *mp, + xfs_agnumber_t agno, + xfs_agblock_t *agbnop) +{ + xfs_extlen_t agsize = mp->m_sb.sb_agblocks; + struct xfs_buf *bp; + struct xfs_btree_block *block; + struct xfs_alloc_rec *arec; + xfs_agblock_t agbno; + xfs_agblock_t rbno; + int error; + struct xfs_agf *agf; + + /* Allocate a btree root block */ + error = xfs_tbt_alloc(&rbno); + if (error) { + printk("xfs_tbt_alloc failed\n"); + return error; + } + + bp = xfs_buf_get(mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, rbno), + BTOBB(mp->m_sb.sb_blocksize), 0); + + block = XFS_BUF_TO_BLOCK(bp); + memset(block, 0, mp->m_sb.sb_blocksize); + block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); + block->bb_level = 0; + block->bb_numrecs = cpu_to_be16(1); + block->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); + block->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); + + arec = XFS_BTREE_REC_ADDR(xfs_alloc, block, 1); + arec->ar_startblock = cpu_to_be32(2); // XXX + arec->ar_blockcount = cpu_to_be32(mp->m_sb.sb_agblocks - + be32_to_cpu(arec->ar_startblock)); + + error = xfs_bwrite(mp, bp); + if (error) + return error; + + /* + * AG freelist header block + */ + error = xfs_tbt_alloc(&agbno); + if (error) { + printk("xfs_tbt_alloc failed\n"); + return error; + } + + bp = xfs_buf_get(mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, agbno), + XFS_FSS_TO_BB(mp, 1), 0); + + agf = XFS_BUF_TO_AGF(bp); + memset(agf, 0, mp->m_sb.sb_sectsize); + agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); + agf->agf_versionnum = cpu_to_be32(XFS_AGF_VERSION); + agf->agf_seqno = cpu_to_be32(agno); + agf->agf_length = cpu_to_be32(agsize); + agf->agf_roots[XFS_BTNUM_BNOi] = cpu_to_be32(rbno); // + agf->agf_roots[XFS_BTNUM_CNTi] = cpu_to_be32(rbno); // + agf->agf_levels[XFS_BTNUM_BNOi] = cpu_to_be32(1); + agf->agf_levels[XFS_BTNUM_CNTi] = cpu_to_be32(1); + agf->agf_flfirst = 0; + agf->agf_fllast = cpu_to_be32(XFS_AGFL_SIZE(mp) - 1); + agf->agf_flcount = 0; + agf->agf_freeblks = cpu_to_be32(agsize - 2); // XXX + agf->agf_longest = cpu_to_be32(agsize - 2); // XXX + + error = xfs_bwrite(mp, bp); + if (error) + return error; + + *agbnop = agbno; + return 0; +} + +STATIC int +xfs_tbt_read_agf( + struct xfs_mount *mp, + struct xfs_trans *tp, + xfs_agnumber_t agno, + xfs_agblock_t agbno, + struct xfs_buf **bpp) +{ + int error; + + ASSERT(agno != NULLAGNUMBER); + error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, agbno), + XFS_FSS_TO_BB(mp, 1), 0, bpp); + if (error) + return error; + + ASSERT(*bpp); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + return 0; +} + +int +xfs_tbt_test_all( + struct xfs_mount *mp, + xfs_agnumber_t agno) +{ + struct xfs_buf *agbp = NULL; + int error; + int levels; + xfs_agblock_t agbno; + + error = xfs_tbt_init_freelist(mp, agno); + if (error) { + cmn_err(CE_WARN, "xfs_tbt_init_freelist failed (%d).\n", error); + goto out; + } + + error = xfs_tbt_init_ag(mp, agno, &agbno); + if (error) { + cmn_err(CE_WARN, "xfs_tbt_init_ag failed (%d).\n", error); + goto out_free_freelist; + } + + error = xfs_tbt_read_agf(mp, NULL, agno, agbno, &agbp); + if (error || agbp == NULL) { + cmn_err(CE_WARN, "xfs_alloc_read_agf failed (%d).\n", error); + goto out_free_ag; + } + + /* Start the tests */ + for (levels = 1; levels <= XFS_AG_MAXLEVELS(mp); levels++) { + cmn_err(CE_NOTE, "xfs_tbt_test_all: Testing %d levels", levels); + + error = xfs_tbt_build_sparse_tree(mp, agno, agbp, levels); + if (error) + goto out_free_ag; + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 0 /* left to right */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 0 /* l to r */); + if (error) + goto out_free_ag; + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 1 /* r to l */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 1 /* r to l */); + if (error) + goto out_free_ag; +#ifdef notyet + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 2 /* middle to r/l */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 2 /* middle to r/l */); + if (error) + goto out_free_ag; +#endif + + error = xfs_tbt_empty_sparse_tree(mp, agno, agbp, levels); + if (error) + goto out_free_ag; + + cmn_err(CE_NOTE, + "xfs_tbt_test_all: Tested %d levels OK", levels); + } + + out_free_ag: + xfs_buf_relse(agbp); + out_free_freelist: + xfs_tbt_destroy_freelist(mp); + out: + if (error) { + cmn_err(CE_WARN, + "xfs_tbt_test_all: fail with error %d\n", error); + return error; + } + cmn_err(CE_NOTE, "xfs_tbt_test_all: passed successfully\n"); + return 0; +} + +void +xfs_tbt_test(struct xfs_mount *mp) +{ + xfs_tbt_test_all(mp, 0); +} Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-08-13 18:12:28.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-08-13 18:12:58.000000000 -0300 @@ -84,6 +84,8 @@ xfs-y += xfs_alloc.o \ xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ xfs_dir2_trace.o +xfs-$(CONFIG_XFS_DEBUG) += xfs_btree_test.o + # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ kmem.o \ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-13 18:12:28.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-13 18:12:58.000000000 -0300 @@ -1550,6 +1550,9 @@ xfs_finish_flags( return 0; } +extern void +xfs_tbt_test(struct xfs_mount *mp); + STATIC int xfs_fs_fill_super( struct super_block *sb, @@ -1662,6 +1665,8 @@ xfs_fs_fill_super( kfree(mtpt); xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); + + xfs_tbt_test(mp); return 0; out_filestream_unmount: Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-08-13 18:12:28.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-08-13 19:23:54.000000000 -0300 @@ -94,6 +94,7 @@ xfs_btree_check_sblock( int level, /* level of the btree block */ struct xfs_buf *bp) /* buffer containing block */ { +#if 0 struct xfs_buf *agbp; /* buffer for ag. freespace struct */ struct xfs_agf *agf; /* ag. freespace structure */ xfs_agblock_t agflen; /* native ag. freespace length */ @@ -122,6 +123,7 @@ xfs_btree_check_sblock( cur->bc_mp); return XFS_ERROR(EFSCORRUPTED); } +#endif return 0; } From owner-xfs@oss.sgi.com Wed Aug 13 17:18:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 17:18:36 -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 m7E0IS3d009675 for ; Wed, 13 Aug 2008 17:18:29 -0700 X-ASG-Debug-ID: 1218673185-757500810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7A7D38F563 for ; Wed, 13 Aug 2008 17:19:45 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id xcCs936KJAcLFnHY for ; Wed, 13 Aug 2008 17:19:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAOQVo0h5LAMbiGdsb2JhbACRcwEBAQ8gpHmBVQ X-IronPort-AV: E=Sophos;i="4.32,204,1217773800"; d="scan'208";a="181591993" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 09:49:40 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTQZ0-00055M-MC; Thu, 14 Aug 2008 10:19:38 +1000 Date: Thu, 14 Aug 2008 10:19:38 +1000 From: Dave Chinner To: Daniel Walker Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Message-ID: <20080814001938.GC6119@disturbed> Mail-Followup-To: Daniel Walker , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> <1218597077.6166.15.camel@dhcp32.mvista.com> <20080813075057.GZ6119@disturbed> <1218641641.6166.32.camel@dhcp32.mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1218641641.6166.32.camel@dhcp32.mvista.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218673186 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0114 1.0000 -1.9467 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.95 X-Barracuda-Spam-Status: No, SCORE=-1.95 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.2585 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17522 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 08:34:01AM -0700, Daniel Walker wrote: > On Wed, 2008-08-13 at 17:50 +1000, Dave Chinner wrote: > > > Right now we have the case where no matter what type of flush > > is done, the caller does not have to worry about unlocking > > the flush lock - it will be done as part of the flush. You're > > suggestion makes that conditional based on whether we did a > > sync flush or not. > > > > So, what happenѕ when you call: > > > > xfs_iflush(ip, XFS_IFLUSH_DELWRI_ELSE_SYNC); > > > > i.e. xfs_iflush() may do an delayed flush or a sync flush depending > > on the current state of the inode. The caller has no idea what type > > of flush was done, so will have no idea whether to unlock or not. > > You wouldn't base the unlock on what iflush does, you would > unconditionally unlock. It's not really a flush lock at that point - it's a state lock. We've already got one of those, and a set of state flags that it protects. Basically you're suggesting that we keep external state to the completion that tracks whether a completion is in progress or not. You can't use a mutex like you suggested to protect state because you can't hold it while doing a wait_for_completion() and then use it to clear the state flag before calling complete(). We can use the internal inode state flags and lock to keep track of this. i.e: xfs_iflock( xfs_inode_t *ip) { xfs_iflags_set(ip, XFS_IFLUSH_INPROGRESS); wait_for_completion(ip->i_flush_wq); } xfs_iflock_nowait( xfs_inode_t *ip) { if (xfs_iflags_test(ip, XFS_IFLUSH_INPROGRESS)) return 1; xfs_iflags_set(ip, XFS_IFLUSH_INPROGRESS); wait_for_completion(ip->i_flush_wq); return 0; } xfs_ifunlock( xfs_inode_t *ip) { xfs_iflags_clear(ip, XFS_IFLUSH_INPROGRESS); complete(ip->i_flush_wq); } *However*, given that we already have this exact state in the completion itself, I see little reason for adding the additional locking overhead and the complexity of race conditions of keeping this state coherent with the completion. Modifying the completion API slightly to export this state is the simplest, easiest solution to the problem.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 17:39:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 17:39:51 -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 m7E0dm9q010800 for ; Wed, 13 Aug 2008 17:39:48 -0700 X-ASG-Debug-ID: 1218674464-4538037e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 731BC38FFA6 for ; Wed, 13 Aug 2008 17:41:04 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 1AFrH6Ew7D93M3B4 for ; Wed, 13 Aug 2008 17:41:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAGcZo0h5LAMbiGdsb2JhbACRcwEBAQ8gpHGBVQ X-IronPort-AV: E=Sophos;i="4.32,204,1217773800"; d="scan'208";a="181607977" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 10:11:02 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTQth-0005Xl-6I; Thu, 14 Aug 2008 10:41:01 +1000 Date: Thu, 14 Aug 2008 10:41:01 +1000 From: Dave Chinner To: Linda Walsh Cc: xfs-oss , LKML , Eric Sandeen X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? Message-ID: <20080814004101.GE6119@disturbed> Mail-Followup-To: Linda Walsh , xfs-oss , LKML , Eric Sandeen References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> <48A20E9E.9090100@tlinx.org> <20080813005852.GW6119@disturbed> <48A35A99.1080300@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A35A99.1080300@tlinx.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218674466 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.2585 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17523 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 03:05:13PM -0700, Linda Walsh wrote: > Dave Chinner wrote: >> Once again, >> "a problem with the generic code inverting the normal lock order". >> >> This one cannot deadlock, though, because by definition >> any inode on the unused list is, well, unused and hence we can't be >> holding a reference to it... > ---- > > This is great, maybe...but what do you mean by "generic"? generic code == non-filesystem specific kernel code that interfaces with the filesystem code. > Is this generic in the FS layer such that we'd see > this with all FS types? Any filesystem that does memory allocation with the same type of lock held that it might take when reclaiming a inode. This is a problem where we go: XFS: lock inode XFS: allocate memory VM: free some memory VM: shrink slab VM: prune inode cache (takes iprune_mutex) XFS: lock inode i.e. the VM recurses back into the filesystem and lockdep sees a different lock ordering. > I'd *like* to keep lock provability 'on' -- but I don't want > to waste people's time chasing after non-problems and so far I've > seen at least 3 different locking sequences that all appear to be > harmless. > > The problem with false positives is that it will either force > the user to ignore (or turn off) the validation code, or generate > periodic noise when these things arise... Basically we've been told by the lockdep folk that the best way to avoid these false positives is to effectively turn off lockdep for all places where the inode is locked in the inode reclaim path. That means lockdep would be mostly useless for XFS - I'd prefer to get false positives reported than miss a rare case where it's really telling the truth. I've asked the lockdep ppl to treat stuff like memory reclaim and the iprune_mutex specially because of this recursive calling nature of memory reclaim, but so far nothing has happened.... FWIW, I think that recent changes have resulted in the xfs_fsr case (swap_extents) being annotated properly so that one should go away. > Isn't it generally considered pretty 'bad' to generate so many > false positives -- or is lock-proving only for for "lock debugging" -- > and not to be used except on development or test systems? Well, any debugging code is really designed for test and dev systems, not for production systems..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 17:57:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 17:57:19 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7E0vG3c011874 for ; Wed, 13 Aug 2008 17:57:16 -0700 X-ASG-Debug-ID: 1218675512-4d8d00080000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6BB9F19D5226 for ; Wed, 13 Aug 2008 17:58:33 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id Ikdn4KFERzkeagVG for ; Wed, 13 Aug 2008 17:58:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAG8go0h5LAMbiGdsb2JhbACRcwEBAQ8gpGiBVQ X-IronPort-AV: E=Sophos;i="4.32,204,1217773800"; d="scan'208";a="181624100" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 10:28:06 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTRA3-0005v5-Fo; Thu, 14 Aug 2008 10:57:55 +1000 Date: Thu, 14 Aug 2008 10:57:55 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [RFC] btree test harness Subject: Re: [RFC] btree test harness Message-ID: <20080814005755.GF6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080813223022.GA15025@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080813223022.GA15025@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218675514 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0933 1.0000 -1.4331 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.43 X-Barracuda-Spam-Status: No, SCORE=-1.43 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.2588 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17524 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 12:30:22AM +0200, Christoph Hellwig wrote: > To excercise the btree code a harness that looks at the corner cases > would be helpful, and with the generic btree code it's now possible > to implement one. This patch is based on WIP code from Dave Chinner > but had to be largely rewritten. > > The idea is that we have a btree that is there just standalone and > not integrated in the rest of the filesystem operation so that we > can create worst cases easily without having to work around other > parts of the code trying to work against these worst cases. It's done > by creating an alloc bno btree lookalike rooted in a fake agf. > > The patch below is a working version that always does this during > mount, so don't apply this on a machine with xfs root. > > I'm interested in comment about the approach, especially the way it > does it's own freelist to avoid having to call in the alloc code > and make it even slower. I'll have a closer look in a while. It's just a bitmap array, right? > I'd also like some input on how interface to userspace. Doing it during > mount but conditional would be one option, the other one an ioctl - > in both cases I'd like to be able to specify up to which maxlevel to go > as the tests for higher levels can take forever. I was thinking of a couple of approaches when I started on this harness: - similar to RCU torture tests, the btree test harness is run on XFS intialisation if config'd in. Requires faking a struct xfs_mount, though, and isn't configurable. - ioctl interface to run each test operation individually, and hook that up to an xfsqa test that used a sparse loopback mounted filesytem to exercise AG sizes up to 1TB. I think the second approach allows us to test btrees on demand on arbitrary disposable filesystems. It would also allow us to easily extend the test harness over time - a new xfsqa test group could be added so that each test can be written as a standalone test so that we can easily isolate regressions. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 17:59:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 17:59:38 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7E0xYgw012299 for ; Wed, 13 Aug 2008 17:59:35 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA04005; Thu, 14 Aug 2008 11:00:48 +1000 Message-ID: <48A38550.4030102@sgi.com> Date: Thu, 14 Aug 2008 11:07:28 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Martin Steigerwald CC: linux-xfs@oss.sgi.com Subject: Re: TAKE 985525 - Fix use after free in xfs_log_done(). References: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> <200808122253.57666.Martin@lichtvoll.de> (sfid-20080812_225744_709880_4EB8AD8F) <200808131115.03350.Martin@lichtvoll.de> In-Reply-To: <200808131115.03350.Martin@lichtvoll.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17525 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Martin Steigerwald wrote: > Am Dienstag 12 August 2008 schrieb Martin Steigerwald: >> Am Dienstag 12 August 2008 schrieb Lachlan McIlroy: >>> Fix use after free in xfs_log_done(). >>> >>> The ticket allocation code got reworked in 2.6.26 and we now free >>> tickets whereas before we used to cache them so the use-after-free >>> went undetected. >> Is this intended to go to stable tree? >> >> How serious is this? I intend to update my laptops to 2.6.26. > > Nevermind, I just applied the patch. > Okay. We've only seen this bug once and I'm surprised it happened at all so I wouldn't consider it a serious problem. From owner-xfs@oss.sgi.com Wed Aug 13 18:03:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 18:03:11 -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.1 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 m7E138Lv012786 for ; Wed, 13 Aug 2008 18:03:08 -0700 X-ASG-Debug-ID: 1218675864-094403c00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6CD17F40B86 for ; Wed, 13 Aug 2008 18:04:24 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id Jy1oCtorvGiGP0WM for ; Wed, 13 Aug 2008 18:04:24 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m7E14H4m020690; Wed, 13 Aug 2008 18:04:17 -0700 Message-ID: <48A38490.7090604@tlinx.org> Date: Wed, 13 Aug 2008 18:04:16 -0700 From: Linda Walsh User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: xfs-oss , LKML , Eric Sandeen , Dave Chinner X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> <48A20E9E.9090100@tlinx.org> <20080813005852.GW6119@disturbed> <48A35A99.1080300@tlinx.org> <20080814004101.GE6119@disturbed> In-Reply-To: <20080814004101.GE6119@disturbed> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1218675866 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0075 1.0000 -1.9722 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 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.2587 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17526 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xfs@tlinx.org Precedence: bulk X-list: xfs Dave Chinner wrote: > I've asked the lockdep ppl to treat stuff like memory reclaim and > the iprune_mutex specially because of this recursive calling nature > of memory reclaim, but so far nothing has happened.... --- So it's really a kernel bug, not an XFS bug...(?) > FWIW, I think that recent changes have resulted in the xfs_fsr case > (swap_extents) being annotated properly so that one should go > away. --- If it was limited to xfs_fsr, that'd be tolerable -- but its cropping up in random user-level-apps (imaps, sort, et al). > Well, any debugging code is really designed for test and dev systems, > not for production systems..... --- The lock-correctness code is described as a feature to provide "provability". It's not called "debugging" and I don't regard that as "debugging" -- but something that any production system that wants operational integrity over a minor 'speed hit', would "theoretically" want. If it is "debug" code, it should be labeled as such -- but code that can mathematically guarantee that parts of the kernel operate correctly seems like a _reliability_ feature, not a debugging feature. Thanks for the insight -- very appreciated. linda From owner-xfs@oss.sgi.com Wed Aug 13 18:59:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 19:00:02 -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 (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 m7E1xvZQ015297 for ; Wed, 13 Aug 2008 18:59:58 -0700 X-ASG-Debug-ID: 1218679274-44b802cf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 50211F3EEB6 for ; Wed, 13 Aug 2008 19:01:14 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id aXpshMnNt8HjNH9E for ; Wed, 13 Aug 2008 19:01:14 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAIAuo0h5LAMbiGdsb2JhbACRcwEBAQ8gpCmBVQ X-IronPort-AV: E=Sophos;i="4.32,204,1217773800"; d="scan'208";a="181693684" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 11:31:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTS9H-0008Kw-OD; Thu, 14 Aug 2008 12:01:11 +1000 Date: Thu, 14 Aug 2008 12:01:11 +1000 From: Dave Chinner To: Linda Walsh Cc: xfs-oss , LKML , Eric Sandeen X-ASG-Orig-Subj: Re: XFS Lock debugging noise or real problem? Subject: Re: XFS Lock debugging noise or real problem? Message-ID: <20080814020111.GG6119@disturbed> Mail-Followup-To: Linda Walsh , xfs-oss , LKML , Eric Sandeen References: <48A093A7.40606@tlinx.org> <48A09CA9.9080705@sandeen.net> <48A0F686.2090700@tlinx.org> <48A0F9FC.1070805@sandeen.net> <48A20E9E.9090100@tlinx.org> <20080813005852.GW6119@disturbed> <48A35A99.1080300@tlinx.org> <20080814004101.GE6119@disturbed> <48A38490.7090604@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A38490.7090604@tlinx.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218679275 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: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC2_0001 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2591 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 BSF_SC2_0001 BODY: custom rule SC2_0001 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17527 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 06:04:16PM -0700, Linda Walsh wrote: > Dave Chinner wrote: >> I've asked the lockdep ppl to treat stuff like memory reclaim and >> the iprune_mutex specially because of this recursive calling nature >> of memory reclaim, but so far nothing has happened.... > --- > So it's really a kernel bug, not an XFS bug...(?) > > >> FWIW, I think that recent changes have resulted in the xfs_fsr case >> (swap_extents) being annotated properly so that one should go >> away. > --- > If it was limited to xfs_fsr, that'd be tolerable -- but its > cropping up in random user-level-apps (imaps, sort, et al). None of those applications use the swap extents code in XFS, so if they are reporting problems related to xfs_fsr, then it's the xfs_fsr locking that is triggering these later problems. Fixing the swap extents lock annotations should make them go away. >> Well, any debugging code is really designed for test and dev systems, >> not for production systems..... > --- > The lock-correctness code is described as a feature to provide > "provability". It's not called "debugging" and I don't regard that as > "debugging" -- but something that any production system that wants > operational integrity over a minor 'speed hit', would "theoretically" > want. > > If it is "debug" code, it should be labeled as such -- but > code that can mathematically guarantee that parts of the kernel operate > correctly seems like a _reliability_ feature, not a debugging feature. Ummm - that option is described as: "Lock debugging: prove locking correctness" And from the help text in the menuconfig: Symbol: PROVE_LOCKING [=n] Prompt: Lock debugging: prove locking correctness Defined at lib/Kconfig.debug:292 Depends on: DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT Location: -> Kernel hacking Selects: LOCKDEP && DEBUG_SPINLOCK && DEBUG_MUTEXES && DEBUG_LOCK_ALLOC Looks like it's well labelled as a debug option to me.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 19:09:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 19:09:16 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7E298rK016060 for ; Wed, 13 Aug 2008 19:09:13 -0700 X-ASG-Debug-ID: 1218679826-4d8d034e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gateway-1237.mvista.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BDA1F19D60F8 for ; Wed, 13 Aug 2008 19:10:26 -0700 (PDT) Received: from gateway-1237.mvista.com (gateway-1237.mvista.com [63.81.120.158]) by cuda.sgi.com with ESMTP id GpN1XZuTK0b5oNzg for ; Wed, 13 Aug 2008 19:10:26 -0700 (PDT) Received: from [10.0.4.38] (dwalker.mvista.com [10.0.4.38]) by hermes.mvista.com (Postfix) with ESMTP id 16AF118342; Wed, 13 Aug 2008 19:10:24 -0700 (PDT) X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion From: Daniel Walker To: Dave Chinner Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx In-Reply-To: <20080814001938.GC6119@disturbed> References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> <1218597077.6166.15.camel@dhcp32.mvista.com> <20080813075057.GZ6119@disturbed> <1218641641.6166.32.camel@dhcp32.mvista.com> <20080814001938.GC6119@disturbed> Content-Type: text/plain Date: Wed, 13 Aug 2008 18:34:49 -0700 Message-Id: <1218677690.6166.51.camel@dhcp32.mvista.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-Barracuda-Connect: gateway-1237.mvista.com[63.81.120.158] X-Barracuda-Start-Time: 1218679826 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.2592 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17528 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dwalker@mvista.com Precedence: bulk X-list: xfs On Thu, 2008-08-14 at 10:19 +1000, Dave Chinner wrote: > *However*, given that we already have this exact state in the > completion itself, I see little reason for adding the additional > locking overhead and the complexity of race conditions of keeping > this state coherent with the completion. Modifying the completion > API slightly to export this state is the simplest, easiest solution > to the problem.... > I'm not suggesting anything concrete at this point, I'm just thinking about it. If you assume that most of the time your doing async flushing, you wouldn't often need to do blocking on the completion .. Another way of doing it would be drop the completion most of the time, and just use the flag. Then in the rare case that a function needs to block make a stack local completion, pass it as a pointer inside the xfs_inode_t, if it's non-null when the write is finished you would complete(). Daniel From owner-xfs@oss.sgi.com Wed Aug 13 19:29:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 19:29:46 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7E2TgIE017152 for ; Wed, 13 Aug 2008 19:29:43 -0700 X-ASG-Debug-ID: 1218681059-669103100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C73F419D5EB3 for ; Wed, 13 Aug 2008 19:30:59 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id IDVgC892oJh0HMU5 for ; Wed, 13 Aug 2008 19:30:59 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAIc1o0h5LAMbiGdsb2JhbACRcwEBAQ8gpAOBVQ X-IronPort-AV: E=Sophos;i="4.32,205,1217773800"; d="scan'208";a="181718684" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 12:00:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTSc2-0001IP-Ek; Thu, 14 Aug 2008 12:30:54 +1000 Date: Thu, 14 Aug 2008 12:30:54 +1000 From: Dave Chinner To: Daniel Walker Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx X-ASG-Orig-Subj: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: Re: [PATCH 4/6] Replace inode flush semaphore with a completion Message-ID: <20080814023054.GH6119@disturbed> Mail-Followup-To: Daniel Walker , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, matthew@wil.cx References: <1214556284-4160-1-git-send-email-david@fromorbit.com> <1214556284-4160-5-git-send-email-david@fromorbit.com> <1218597077.6166.15.camel@dhcp32.mvista.com> <20080813075057.GZ6119@disturbed> <1218641641.6166.32.camel@dhcp32.mvista.com> <20080814001938.GC6119@disturbed> <1218677690.6166.51.camel@dhcp32.mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218677690.6166.51.camel@dhcp32.mvista.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218681060 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.2594 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17529 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 06:34:49PM -0700, Daniel Walker wrote: > On Thu, 2008-08-14 at 10:19 +1000, Dave Chinner wrote: > > *However*, given that we already have this exact state in the > > completion itself, I see little reason for adding the additional > > locking overhead and the complexity of race conditions of keeping > > this state coherent with the completion. Modifying the completion > > API slightly to export this state is the simplest, easiest solution > > to the problem.... > > > > I'm not suggesting anything concrete at this point, I'm just thinking > about it. > > If you assume that most of the time your doing async flushing, you > wouldn't often need to do blocking on the completion .. Another way of > doing it would be drop the completion most of the time, and just use the > flag. I don't think that will work, either - the internal completion counter must stay in sync so there must be a wait_for_completion() call for every complete() call. If we make the wait_for_completion() conditional, then we have to do the same thing for the complete() call, and that introduces complexity and potential races because the external flag and the completion cannot be updated atomically.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 22:05:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 22:05:49 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7E55fbQ028394 for ; Wed, 13 Aug 2008 22:05:44 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA08120; Thu, 14 Aug 2008 15:06:57 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 310A058C52A8; Thu, 14 Aug 2008 15:06:57 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 983738 - Move memory allocations for log tracing out of the critical path Message-Id: <20080814050657.310A058C52A8@chook.melbourne.sgi.com> Date: Thu, 14 Aug 2008 15:06:57 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17530 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Move memory allocations for log tracing out of the critical path Memory allocations for log->l_grant_trace and iclog->ic_trace are done on demand when the first event is logged. In xlog_state_get_iclog_space() we call xlog_trace_iclog() under a spinlock and allocating memory here can cause us to sleep with a spinlock held and deadlock the system. For the log grant tracing we use KM_NOSLEEP but that means we can lose trace entries. Since there is no locking to serialize the log grant tracing we could race and have multiple allocations and leak memory. So move the allocations to where we initialize the log/iclog structures. Use KM_NOFS to avoid recursing into the filesystem and drop log->l_trace since it's not even used. Date: Thu Aug 14 15:06:10 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-clean Inspected by: hch Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31896a fs/xfs/xfsidbg.c - 1.361 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.361&r2=text&tr2=1.360&f=h fs/xfs/xfs_log.c - 1.364 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.364&r2=text&tr2=1.363&f=h fs/xfs/xfs_log_priv.h - 1.134 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_priv.h.diff?r1=text&tr1=1.134&r2=text&tr2=1.133&f=h - Move memory allocations for log tracing out of the critical path From owner-xfs@oss.sgi.com Wed Aug 13 23:13:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:13:55 -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 (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 m7E6DooM031762 for ; Wed, 13 Aug 2008 23:13:51 -0700 X-ASG-Debug-ID: 1218694507-29de00fb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 11553F419D1 for ; Wed, 13 Aug 2008 23:15:07 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 7gMOo9PYH09GOm6B for ; Wed, 13 Aug 2008 23:15:07 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAAhqo0h5LAMbiGdsb2JhbACReAEBAQ8goxqBVQ X-IronPort-AV: E=Sophos;i="4.32,206,1217773800"; d="scan'208";a="181894734" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 15:45:05 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTW6y-0007Rt-0w; Thu, 14 Aug 2008 16:15:04 +1000 Date: Thu, 14 Aug 2008 16:15:03 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/6] XFS: move sync code to its own file Subject: Re: [PATCH 1/6] XFS: move sync code to its own file Message-ID: <20080814061503.GI6119@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218505571-27588-1-git-send-email-david@fromorbit.com> <1218505571-27588-2-git-send-email-david@fromorbit.com> <20080813140129.GC4896@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080813140129.GC4896@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218694509 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0084 1.0000 -1.9663 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 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.2609 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17531 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 13, 2008 at 10:01:29AM -0400, Christoph Hellwig wrote: > On Tue, Aug 12, 2008 at 11:46:06AM +1000, Dave Chinner wrote: > > The sync code in XFS is spread around several files. > > While it used to make sense to have such a distribution, > > the code about to be cleaned up and so centralising it > > in one spot as the first step mackes sense. > > Besides the move you also change xfs_quiesce_fs to call xfs_sync instead > of xfs_syncsub. This does and additional XFS_QM_DQSYNC and an > xfs_filestream_flush. The latter doesn't have any effect because we > don't have SYNC_IOWAIT set here, but the former means we are now doing > a synchronous quota sync. I don't think that can be harmful, but I'd be > better left for a separate and properly documented patch. Ok, I'll export xfs_syncsub() as well (which I was trying to avoid) and revert that change.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 13 23:43:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:04 -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 (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 m7E6hmoG000881 for ; Wed, 13 Aug 2008 23:43:48 -0700 X-ASG-Debug-ID: 1218696304-536500100001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8F85FF4201B for ; Wed, 13 Aug 2008 23:45:05 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id FIoYyS4YxvCdJzFN for ; Wed, 13 Aug 2008 23:45:05 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917025" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002n6-Hw for xfs@oss.sgi.com; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V4 Subject: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V4 Date: Thu, 14 Aug 2008 16:44:53 +1000 Message-Id: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696306 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2536 1.0000 -0.5579 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.56 X-Barracuda-Spam-Status: No, SCORE=-0.56 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.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17535 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The list of all inodes on a mount is superfluous. We can traverse all inodes now by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a bunch of complex list traversal code and remove another two pointers from the xfs_inode. Also, by replacing the sync traversal with an ascending inode number traversal, we will issue better inode I/O patterns for writeback triggered by xfssyncd or unmount. Before we make this change, move all the relevant sync code into it's own file in the linux-2.6/ directory. This aggregates VFS specific sync interfacing in the one file and will allow all the subsequent change history to be associated with this file so it is easy to find in future. Version 4: o revert xfs_syncsub -> xfs_sync change in xfs_quiesce_fs and rediff patch series From owner-xfs@oss.sgi.com Wed Aug 13 23:43:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:02 -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 (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 m7E6hnWN000903 for ; Wed, 13 Aug 2008 23:43:49 -0700 X-ASG-Debug-ID: 1218696304-4cc300640001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F116BF42022 for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id Ht7HUpBN8AIKC7ea for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917058" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:02 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002nJ-TQ; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Subject: [PATCH 5/6] XFS: Traverse inode trees when releasing dquots V2 Date: Thu, 14 Aug 2008 16:44:58 +1000 Message-Id: <1218696299-10572-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696307 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0041 1.0000 -1.9944 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.99 X-Barracuda-Spam-Status: No, SCORE=-1.99 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.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17534 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Make releasing all inode dquots traverse the per-ag inode radix trees rather than the mount inode list. This removes another user of the mount inode list. Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/quota/xfs_qm_syscalls.c | 125 ++++++++++++++++++--------------------- 1 files changed, 58 insertions(+), 67 deletions(-) diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 1a3b803..d292e55 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1022,101 +1022,92 @@ xfs_qm_export_flags( /* - * Go thru all the inodes in the file system, releasing their dquots. - * Note that the mount structure gets modified to indicate that quotas are off - * AFTER this, in the case of quotaoff. This also gets called from - * xfs_rootumount. + * Release all the dquots on the inodes in an AG. */ -void -xfs_qm_dqrele_all_inodes( - struct xfs_mount *mp, - uint flags) +STATIC void +xfs_qm_dqrele_inodes_ag( + xfs_mount_t *mp, + int ag, + uint flags) { - xfs_inode_t *ip, *topino; - uint ireclaims; - struct inode *vp; - boolean_t vnode_refd; + xfs_inode_t *ip = NULL; + struct inode *vp = NULL; + xfs_perag_t *pag = &mp->m_perag[ag]; + int first_index = 0; + int nr_found; - ASSERT(mp->m_quotainfo); - - XFS_MOUNT_ILOCK(mp); -again: - ip = mp->m_inodes; - if (ip == NULL) { - XFS_MOUNT_IUNLOCK(mp); - return; - } do { - /* Skip markers inserted by xfs_sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + boolean_t vnode_refd = B_FALSE; + + /* + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. + */ + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } + + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + /* Root inode, rbmip and rsumip have associated blocks */ - if (ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { - ASSERT(ip->i_udquot == NULL); - ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; - continue; - } vp = VFS_I(ip); - if (!vp) { + if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } - vnode_refd = B_FALSE; if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; vp = vn_grab(vp); + read_unlock(&pag->pag_ici_lock); if (!vp) - goto again; - - XFS_MOUNT_IUNLOCK(mp); - /* XXX restart limit ? */ - xfs_ilock(ip, XFS_ILOCK_EXCL); + continue; vnode_refd = B_TRUE; + xfs_ilock(ip, XFS_ILOCK_EXCL); } else { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; - XFS_MOUNT_IUNLOCK(mp); + read_unlock(&pag->pag_ici_lock); } - - /* - * We don't keep the mountlock across the dqrele() call, - * since it can take a while.. - */ if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; } - if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { + if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && + ip->i_gdquot) { xfs_qm_dqrele(ip->i_gdquot); ip->i_gdquot = NULL; } xfs_iunlock(ip, XFS_ILOCK_EXCL); - /* - * Wait until we've dropped the ilock and mountlock to - * do the vn_rele. Or be condemned to an eternity in the - * inactive code in hell. - */ if (vnode_refd) IRELE(ip); - XFS_MOUNT_ILOCK(mp); - /* - * If an inode was inserted or removed, we gotta - * start over again. - */ - if (topino != mp->m_inodes || mp->m_ireclaims != ireclaims) { - /* XXX use a sentinel */ - goto again; - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); +} - XFS_MOUNT_IUNLOCK(mp); +/* + * Go thru all the inodes in the file system, releasing their dquots. + * Note that the mount structure gets modified to indicate that quotas are off + * AFTER this, in the case of quotaoff. This also gets called from + * xfs_rootumount. + */ +void +xfs_qm_dqrele_all_inodes( + struct xfs_mount *mp, + uint flags) +{ + int i; + + ASSERT(mp->m_quotainfo); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + xfs_qm_dqrele_inodes_ag(mp, i, flags); + } } /*------------------------------------------------------------------------*/ -- 1.5.6 From owner-xfs@oss.sgi.com Wed Aug 13 23:43:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:14 -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 m7E6hopJ000905 for ; Wed, 13 Aug 2008 23:43:50 -0700 X-ASG-Debug-ID: 1218696306-712c030d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3CF17391BFB for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id mHvd6efP2QVwq3Zi for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917027" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002nM-VF; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 6/6] XFS: remove the mount inode list Subject: [PATCH 6/6] XFS: remove the mount inode list Date: Thu, 14 Aug 2008 16:44:59 +1000 Message-Id: <1218696299-10572-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696308 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.2609 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17538 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Now we've removed all users of the mount inode list, we can kill it. This reduces the size of the xfs_inode by 2 pointers. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 42 +----------------------------------------- fs/xfs/xfs_inode.h | 8 -------- fs/xfs/xfs_mount.c | 5 ----- fs/xfs/xfs_mount.h | 1 - 4 files changed, 1 insertions(+), 55 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 539c2dd..cd442da 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -76,7 +76,6 @@ xfs_iget_core( { struct inode *old_inode; xfs_inode_t *ip; - xfs_inode_t *iq; int error; unsigned long first_index, mask; xfs_perag_t *pag; @@ -260,24 +259,6 @@ finish_inode: write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); - - /* - * Link ip to its mount and thread it on the mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - if ((iq = mp->m_inodes)) { - ASSERT(iq->i_mprev->i_mnext == iq); - ip->i_mprev = iq->i_mprev; - iq->i_mprev->i_mnext = ip; - iq->i_mprev = ip; - ip->i_mnext = iq; - } else { - ip->i_mnext = ip; - ip->i_mprev = ip; - } - mp->m_inodes = ip; - - XFS_MOUNT_IUNLOCK(mp); xfs_put_perag(mp, pag); return_ip: @@ -498,36 +479,15 @@ xfs_iextract( { xfs_mount_t *mp = ip->i_mount; xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); - xfs_inode_t *iq; write_lock(&pag->pag_ici_lock); radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); write_unlock(&pag->pag_ici_lock); xfs_put_perag(mp, pag); - /* - * Remove from mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - ASSERT((ip->i_mnext != NULL) && (ip->i_mprev != NULL)); - iq = ip->i_mnext; - iq->i_mprev = ip->i_mprev; - ip->i_mprev->i_mnext = iq; - - /* - * Fix up the head pointer if it points to the inode being deleted. - */ - if (mp->m_inodes == ip) { - if (ip == iq) { - mp->m_inodes = NULL; - } else { - mp->m_inodes = iq; - } - } - /* Deal with the deleted inodes list */ + XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); - mp->m_ireclaims++; XFS_MOUNT_IUNLOCK(mp); } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 455b1a9..c1ee977 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -192,16 +192,8 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; -typedef struct { - struct xfs_inode *ip_mnext; /* next inode in mount list */ - struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_mount *ip_mount; /* fs mount struct ptr */ -} xfs_iptr_t; - typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_inode *i_mnext; /* next inode in mount list */ - struct xfs_inode *i_mprev; /* ptr to prev inode */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ struct inode *i_vnode; /* vnode backpointer */ diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index d048e3b..512d378 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1307,11 +1307,6 @@ xfs_unmountfs(xfs_mount_t *mp) xfs_freesb(mp); - /* - * All inodes from this mount point should be freed. - */ - ASSERT(mp->m_inodes == NULL); - if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) uuid_table_remove(&mp->m_sb.sb_uuid); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 88eb9e6..3267782 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -248,7 +248,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ spinlock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ uint m_ireclaims; /* count of calls to reclaim*/ -- 1.5.6 From owner-xfs@oss.sgi.com Wed Aug 13 23:43:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:01 -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,J_CHICKENPOX_62 autolearn=no 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 m7E6hml4000893 for ; Wed, 13 Aug 2008 23:43:48 -0700 X-ASG-Debug-ID: 1218696304-4cc300640000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AD550F42021 for ; Wed, 13 Aug 2008 23:45:05 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 1ZAr5xmt1Flg7JOA for ; Wed, 13 Aug 2008 23:45:05 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917019" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002nG-Re; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Subject: [PATCH 4/6] XFS: Use the inode tree for finding dirty inodes V2 Date: Thu, 14 Aug 2008 16:44:57 +1000 Message-Id: <1218696299-10572-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696306 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.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17533 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Update xfs_sync_inodes to walk the inode radix tree cache to find dirty inodes. This removes a huge bunch of nasty, messy code for traversing the mount inode list safely and removes another user of the mount inode list. Version 3 o rediff against new linux-2.6/xfs_sync.c code Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_sync.c | 361 ++++++++++++------------------------------- 1 files changed, 101 insertions(+), 260 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index cd82ba5..53d85ec 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -121,356 +121,197 @@ xfs_sync( } /* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * + * Sync all the inodes in the given AG according to the + * direction given by the flags. */ -int -xfs_sync_inodes( +STATIC int +xfs_sync_inodes_ag( xfs_mount_t *mp, + int ag, int flags, - int *bypassed) + int *bypassed) { xfs_inode_t *ip = NULL; struct inode *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + xfs_perag_t *pag = &mp->m_perag[ag]; + boolean_t vnode_refed = B_FALSE; + int nr_found; + int first_index = 0; + int error = 0; + int last_error = 0; + int fflag = XFS_B_ASYNC; + int lock_flags = XFS_ILOCK_SHARED; - fflag = XFS_B_ASYNC; /* default is don't wait */ if (flags & SYNC_DELWRI) fflag = XFS_B_DELWRI; if (flags & SYNC_WAIT) fflag = 0; /* synchronous overrides all */ - base_lock_flags = XFS_ILOCK_SHARED; if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { /* * We need the I/O lock if we're going to call any of * the flush/inval routines. */ - base_lock_flags |= XFS_IOLOCK_SHARED; + lock_flags |= XFS_IOLOCK_SHARED; } - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; - do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; - /* - * There were no inodes in the list, just break out - * of the loop. + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. */ - if (ip == NULL) { - break; - } + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } - vp = VFS_I(ip); + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. + * skip inodes in reclaim. Let xfs_syncsub do that for + * us so we don't need to worry. */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } + vp = VFS_I(ip); + if (!vp) { + read_unlock(&pag->pag_ici_lock); continue; } + /* bad inodes are dealt with elsewhere */ if (VN_BAD(vp)) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } + /* nothing to sync during shutdown */ if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); + read_unlock(&pag->pag_ici_lock); return 0; } /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. + * The inode lock here actually coordinates with the almost + * spurious inode lock in xfs_ireclaim() to prevent the vnode + * we handle here without a reference from being freed while we + * reference it. If we lock the inode while it's on the mount + * list here, then the spurious inode lock in xfs_ireclaim() + * after the inode is pulled from the mount list will sleep + * until we release it here. This keeps the vnode from being + * freed while we reference it. */ if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); + if (!vp) continue; - } - - IPOINTER_INSERT(ip, mp); xfs_ilock(ip, lock_flags); ASSERT(vp == VFS_I(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; + } else { + /* safe to unlock here as we have a reference */ + read_unlock(&pag->pag_ici_lock); } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - /* * If we have to flush data or wait for I/O completion * we need to drop the ilock that we currently hold. * If we need to drop the lock, insert a marker if we * have not already done so. */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } + if (flags & SYNC_CLOSE) { xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, FI_REMAPF); + else + error = xfs_flushinval_pages(ip, 0, -1, + FI_REMAPF); + /* wait for I/O on freeze */ if (flags & SYNC_IOWAIT) vn_iowait(ip); xfs_ilock(ip, XFS_ILOCK_SHARED); } - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); + if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + if ((flags & SYNC_ATTR) && !xfs_inode_clean(ip)) { if (flags & SYNC_WAIT) { xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + else + xfs_ifunlock(ip); } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + else + xfs_ifunlock(ip); } else if (bypassed) { (*bypassed)++; } } - if (lock_flags != 0) { + if (lock_flags) xfs_iunlock(ip, lock_flags); - } if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - IRELE(ip); - vnode_refed = B_FALSE; } - if (error) { + if (error) last_error = error; - } - /* * bail out if the filesystem is corrupted. */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); + if (error == EFSCORRUPTED) return XFS_ERROR(error); - } - - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } - - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; + } while (nr_found); - } while (ip != mp->m_inodes); + return last_error; +} - XFS_MOUNT_IUNLOCK(mp); +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error; + int last_error; + int i; - ASSERT(ipointer_in == B_FALSE); + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; - kmem_free(ipointer); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + error = xfs_sync_inodes_ag(mp, i, flags, bypassed); + if (error) + last_error = error; + if (error == EFSCORRUPTED) + break; + } return XFS_ERROR(last_error); } -- 1.5.6 From owner-xfs@oss.sgi.com Wed Aug 13 23:43:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:06 -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 (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 m7E6hpj4000917 for ; Wed, 13 Aug 2008 23:43:51 -0700 X-ASG-Debug-ID: 1218696304-536500100002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BFBBFF42022 for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id B0U5idEsdi7wehaz for ; Wed, 13 Aug 2008 23:45:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917030" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002nB-Nh; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Subject: [PATCH 2/6] XFS: move xfssyncd code to xfs_sync.c Date: Thu, 14 Aug 2008 16:44:55 +1000 Message-Id: <1218696299-10572-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696308 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: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17536 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Move all the xfssyncd code to the new xfs_sync.c file. This places it closer to the actual code that it interacts with, rather than just being associated with high level VFS code. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 151 +-------------------------------------- fs/xfs/linux-2.6/xfs_super.h | 3 - fs/xfs/linux-2.6/xfs_sync.c | 163 ++++++++++++++++++++++++++++++++++++++++++ fs/xfs/linux-2.6/xfs_sync.h | 56 ++++++++++++++ fs/xfs/linux-2.6/xfs_vfs.h | 31 -------- fs/xfs/xfs_mount.h | 1 + 6 files changed, 223 insertions(+), 182 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 58c474b..6268b35 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -944,146 +944,6 @@ xfs_fs_clear_inode( ASSERT(XFS_I(inode) == NULL); } -/* - * Enqueue a work item to be picked up by the vfs xfssyncd thread. - * Doing this has two advantages: - * - It saves on stack space, which is tight in certain situations - * - It can be used (with care) as a mechanism to avoid deadlocks. - * Flushing while allocating in a full filesystem requires both. - */ -STATIC void -xfs_syncd_queue_work( - struct xfs_mount *mp, - void *data, - void (*syncer)(struct xfs_mount *, void *)) -{ - struct bhv_vfs_sync_work *work; - - work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP); - INIT_LIST_HEAD(&work->w_list); - work->w_syncer = syncer; - work->w_data = data; - work->w_mount = mp; - spin_lock(&mp->m_sync_lock); - list_add_tail(&work->w_list, &mp->m_sync_list); - spin_unlock(&mp->m_sync_lock); - wake_up_process(mp->m_sync_task); -} - -/* - * Flush delayed allocate data, attempting to free up reserved space - * from existing allocations. At this point a new allocation attempt - * has failed with ENOSPC and we are in the process of scratching our - * heads, looking about for more room... - */ -STATIC void -xfs_flush_inode_work( - struct xfs_mount *mp, - void *arg) -{ - struct inode *inode = arg; - filemap_flush(inode->i_mapping); - iput(inode); -} - -void -xfs_flush_inode( - xfs_inode_t *ip) -{ - struct inode *inode = VFS_I(ip); - - igrab(inode); - xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); - delay(msecs_to_jiffies(500)); -} - -/* - * This is the "bigger hammer" version of xfs_flush_inode_work... - * (IOW, "If at first you don't succeed, use a Bigger Hammer"). - */ -STATIC void -xfs_flush_device_work( - struct xfs_mount *mp, - void *arg) -{ - struct inode *inode = arg; - sync_blockdev(mp->m_super->s_bdev); - iput(inode); -} - -void -xfs_flush_device( - xfs_inode_t *ip) -{ - struct inode *inode = VFS_I(ip); - - igrab(inode); - xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); - delay(msecs_to_jiffies(500)); - xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); -} - -STATIC void -xfs_sync_worker( - struct xfs_mount *mp, - void *unused) -{ - int error; - - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) - error = xfs_sync(mp, SYNC_FSDATA | SYNC_BDFLUSH | SYNC_ATTR); - mp->m_sync_seq++; - wake_up(&mp->m_wait_single_sync_task); -} - -STATIC int -xfssyncd( - void *arg) -{ - struct xfs_mount *mp = arg; - long timeleft; - bhv_vfs_sync_work_t *work, *n; - LIST_HEAD (tmp); - - set_freezable(); - timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); - for (;;) { - timeleft = schedule_timeout_interruptible(timeleft); - /* swsusp */ - try_to_freeze(); - if (kthread_should_stop() && list_empty(&mp->m_sync_list)) - break; - - spin_lock(&mp->m_sync_lock); - /* - * We can get woken by laptop mode, to do a sync - - * that's the (only!) case where the list would be - * empty with time remaining. - */ - if (!timeleft || list_empty(&mp->m_sync_list)) { - if (!timeleft) - timeleft = xfs_syncd_centisecs * - msecs_to_jiffies(10); - INIT_LIST_HEAD(&mp->m_sync_work.w_list); - list_add_tail(&mp->m_sync_work.w_list, - &mp->m_sync_list); - } - list_for_each_entry_safe(work, n, &mp->m_sync_list, w_list) - list_move(&work->w_list, &tmp); - spin_unlock(&mp->m_sync_lock); - - list_for_each_entry_safe(work, n, &tmp, w_list) { - (*work->w_syncer)(mp, work->w_data); - list_del(&work->w_list); - if (work == &mp->m_sync_work) - continue; - kmem_free(work); - } - } - - return 0; -} - STATIC void xfs_free_fsname( struct xfs_mount *mp) @@ -1102,8 +962,7 @@ xfs_fs_put_super( int unmount_event_flags = 0; int error; - kthread_stop(mp->m_sync_task); - + xfs_syncd_stop(mp); xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); #ifdef HAVE_DMAPI @@ -1754,13 +1613,9 @@ xfs_fs_fill_super( goto fail_vnrele; } - mp->m_sync_work.w_syncer = xfs_sync_worker; - mp->m_sync_work.w_mount = mp; - mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); - if (IS_ERR(mp->m_sync_task)) { - error = -PTR_ERR(mp->m_sync_task); + error = xfs_syncd_init(mp); + if (error) goto fail_vnrele; - } xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h index fe2ef4e..56dc48a 100644 --- a/fs/xfs/linux-2.6/xfs_super.h +++ b/fs/xfs/linux-2.6/xfs_super.h @@ -101,9 +101,6 @@ struct block_device; extern __uint64_t xfs_max_file_offset(unsigned int); -extern void xfs_flush_inode(struct xfs_inode *); -extern void xfs_flush_device(struct xfs_inode *); - extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); extern const struct export_operations xfs_export_operations; diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index c765eb2..a51534c 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -44,6 +44,9 @@ #include "xfs_inode_item.h" #include "xfs_rw.h" +#include +#include + /* * xfs_sync flushes any pending I/O to file system vfsp. * @@ -603,3 +606,163 @@ xfs_syncsub( return XFS_ERROR(last_error); } + +/* + * Enqueue a work item to be picked up by the vfs xfssyncd thread. + * Doing this has two advantages: + * - It saves on stack space, which is tight in certain situations + * - It can be used (with care) as a mechanism to avoid deadlocks. + * Flushing while allocating in a full filesystem requires both. + */ +STATIC void +xfs_syncd_queue_work( + struct xfs_mount *mp, + void *data, + void (*syncer)(struct xfs_mount *, void *)) +{ + struct bhv_vfs_sync_work *work; + + work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP); + INIT_LIST_HEAD(&work->w_list); + work->w_syncer = syncer; + work->w_data = data; + work->w_mount = mp; + spin_lock(&mp->m_sync_lock); + list_add_tail(&work->w_list, &mp->m_sync_list); + spin_unlock(&mp->m_sync_lock); + wake_up_process(mp->m_sync_task); +} + +/* + * Flush delayed allocate data, attempting to free up reserved space + * from existing allocations. At this point a new allocation attempt + * has failed with ENOSPC and we are in the process of scratching our + * heads, looking about for more room... + */ +STATIC void +xfs_flush_inode_work( + struct xfs_mount *mp, + void *arg) +{ + struct inode *inode = arg; + filemap_flush(inode->i_mapping); + iput(inode); +} + +void +xfs_flush_inode( + xfs_inode_t *ip) +{ + struct inode *inode = VFS_I(ip); + + igrab(inode); + xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); + delay(msecs_to_jiffies(500)); +} + +/* + * This is the "bigger hammer" version of xfs_flush_inode_work... + * (IOW, "If at first you don't succeed, use a Bigger Hammer"). + */ +STATIC void +xfs_flush_device_work( + struct xfs_mount *mp, + void *arg) +{ + struct inode *inode = arg; + sync_blockdev(mp->m_super->s_bdev); + iput(inode); +} + +void +xfs_flush_device( + xfs_inode_t *ip) +{ + struct inode *inode = VFS_I(ip); + + igrab(inode); + xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); + delay(msecs_to_jiffies(500)); + xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); +} + +STATIC void +xfs_sync_worker( + struct xfs_mount *mp, + void *unused) +{ + int error; + + if (!(mp->m_flags & XFS_MOUNT_RDONLY)) + error = xfs_sync(mp, SYNC_FSDATA | SYNC_BDFLUSH | SYNC_ATTR); + mp->m_sync_seq++; + wake_up(&mp->m_wait_single_sync_task); +} + +STATIC int +xfssyncd( + void *arg) +{ + struct xfs_mount *mp = arg; + long timeleft; + bhv_vfs_sync_work_t *work, *n; + LIST_HEAD (tmp); + + set_freezable(); + timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); + for (;;) { + timeleft = schedule_timeout_interruptible(timeleft); + /* swsusp */ + try_to_freeze(); + if (kthread_should_stop() && list_empty(&mp->m_sync_list)) + break; + + spin_lock(&mp->m_sync_lock); + /* + * We can get woken by laptop mode, to do a sync - + * that's the (only!) case where the list would be + * empty with time remaining. + */ + if (!timeleft || list_empty(&mp->m_sync_list)) { + if (!timeleft) + timeleft = xfs_syncd_centisecs * + msecs_to_jiffies(10); + INIT_LIST_HEAD(&mp->m_sync_work.w_list); + list_add_tail(&mp->m_sync_work.w_list, + &mp->m_sync_list); + } + list_for_each_entry_safe(work, n, &mp->m_sync_list, w_list) + list_move(&work->w_list, &tmp); + spin_unlock(&mp->m_sync_lock); + + list_for_each_entry_safe(work, n, &tmp, w_list) { + (*work->w_syncer)(mp, work->w_data); + list_del(&work->w_list); + if (work == &mp->m_sync_work) + continue; + kmem_free(work); + } + } + + return 0; +} + +int +xfs_syncd_init( + struct xfs_mount *mp) +{ + mp->m_sync_work.w_syncer = xfs_sync_worker; + mp->m_sync_work.w_mount = mp; + mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); + if (IS_ERR(mp->m_sync_task)) + return -PTR_ERR(mp->m_sync_task); + return 0; +} + +void +xfs_syncd_stop( + struct xfs_mount *mp) +{ + kthread_stop(mp->m_sync_task); +} + diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h index f4c3b1e..3746d15 100644 --- a/fs/xfs/linux-2.6/xfs_sync.h +++ b/fs/xfs/linux-2.6/xfs_sync.h @@ -1,7 +1,63 @@ +/* + * Copyright (c) 2000-2006 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef XFS_SYNC_H #define XFS_SYNC_H 1 +struct xfs_mount; + +typedef struct bhv_vfs_sync_work { + struct list_head w_list; + struct xfs_mount *w_mount; + void *w_data; /* syncer routine argument */ + void (*w_syncer)(struct xfs_mount *, void *); +} bhv_vfs_sync_work_t; + +#define SYNC_ATTR 0x0001 /* sync attributes */ +#define SYNC_CLOSE 0x0002 /* close file system down */ +#define SYNC_DELWRI 0x0004 /* look at delayed writes */ +#define SYNC_WAIT 0x0008 /* wait for i/o to complete */ +#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ +#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ +#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ +#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ +#define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */ + +/* + * When remounting a filesystem read-only or freezing the filesystem, + * we have two phases to execute. This first phase is syncing the data + * before we quiesce the fielsystem, and the second is flushing all the + * inodes out after we've waited for all the transactions created by + * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE + * to ensure that the inodes are written to their location on disk + * rather than just existing in transactions in the log. This means + * after a quiesce there is no log replay required to write the inodes + * to disk (this is the main difference between a sync and a quiesce). + */ +#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) +#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT) + +int xfs_syncd_init(struct xfs_mount *mp); +void xfs_syncd_stop(struct xfs_mount *mp); + int xfs_sync(struct xfs_mount *mp, int flags); int xfs_syncsub(struct xfs_mount *mp, int flags, int *bypassed); +void xfs_flush_inode(struct xfs_inode *ip); +void xfs_flush_device(struct xfs_inode *ip); + #endif diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index 7e60c77..0ab60bc 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h @@ -33,37 +33,6 @@ struct xfs_mount_args; typedef struct kstatfs bhv_statvfs_t; -typedef struct bhv_vfs_sync_work { - struct list_head w_list; - struct xfs_mount *w_mount; - void *w_data; /* syncer routine argument */ - void (*w_syncer)(struct xfs_mount *, void *); -} bhv_vfs_sync_work_t; - -#define SYNC_ATTR 0x0001 /* sync attributes */ -#define SYNC_CLOSE 0x0002 /* close file system down */ -#define SYNC_DELWRI 0x0004 /* look at delayed writes */ -#define SYNC_WAIT 0x0008 /* wait for i/o to complete */ -#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ -#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ -#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ -#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ -#define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */ - -/* - * When remounting a filesystem read-only or freezing the filesystem, - * we have two phases to execute. This first phase is syncing the data - * before we quiesce the fielsystem, and the second is flushing all the - * inodes out after we've waited for all the transactions created by - * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE - * to ensure that the inodes are written to their location on disk - * rather than just existing in transactions in the log. This means - * after a quiesce there is no log replay required to write the inodes - * to disk (this is the main difference between a sync and a quiesce). - */ -#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) -#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT) - #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ #define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */ diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 6482005..88eb9e6 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -18,6 +18,7 @@ #ifndef __XFS_MOUNT_H__ #define __XFS_MOUNT_H__ +#include "xfs_sync.h" typedef struct xfs_trans_reservations { uint tr_write; /* extent alloc trans */ -- 1.5.6 From owner-xfs@oss.sgi.com Wed Aug 13 23:43:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:43:59 -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 (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 m7E6hlU7000872 for ; Wed, 13 Aug 2008 23:43:47 -0700 X-ASG-Debug-ID: 1218696304-536500100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A5341F4201B for ; Wed, 13 Aug 2008 23:45:04 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id QnM8C4yqCyAPYq1s for ; Wed, 13 Aug 2008 23:45:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8goxOBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917020" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002nD-Px; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Subject: [PATCH 3/6] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Date: Thu, 14 Aug 2008 16:44:56 +1000 Message-Id: <1218696299-10572-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696305 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: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17532 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs xfs_iflush_all() walks the m_inodes list to find inodes that need reclaiming. We already have such a list - the m_del_inodes list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up xfs_finish_reclaim_all() to handle the different flush modes now needed. Originally based on a patch from Christoph Hellwig. Version 3 o rediff against new linux-2.6/xfs_sync.c code Version 2 o revert xfs_syncsub() inode reclaim behaviour back to original code o xfs_quiesce_fs() should use XFS_IFLUSH_DELWRI_ELSE_ASYNC, not XFS_IFLUSH_ASYNC, to prevent change of behaviour. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_sync.c | 2 +- fs/xfs/xfs_inode.c | 35 ----------------------------------- fs/xfs/xfs_inode.h | 3 +-- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 2 +- fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ 6 files changed, 22 insertions(+), 64 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index a51534c..cd82ba5 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -504,7 +504,7 @@ xfs_syncsub( if (flags & (SYNC_ATTR|SYNC_DELWRI)) { if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); else error = xfs_sync_inodes(mp, flags, bypassed); } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5bb638b..ced22e4 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3453,41 +3453,6 @@ corrupt_out: } -/* - * Flush all inactive inodes in mp. - */ -void -xfs_iflush_all( - xfs_mount_t *mp) -{ - xfs_inode_t *ip; - - again: - XFS_MOUNT_ILOCK(mp); - ip = mp->m_inodes; - if (ip == NULL) - goto out; - - do { - /* Make sure we skip markers inserted by sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - if (!VFS_I(ip)) { - XFS_MOUNT_IUNLOCK(mp); - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); - goto again; - } - - ASSERT(vn_count(VFS_I(ip)) == 0); - - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - out: - XFS_MOUNT_IUNLOCK(mp); -} #ifdef XFS_ILOCK_TRACE ktrace_t *xfs_ilock_trace_buf; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 5717244..455b1a9 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -489,7 +489,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); -int xfs_finish_reclaim_all(struct xfs_mount *, int); +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); /* * xfs_inode.c prototypes. @@ -527,7 +527,6 @@ void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); void xfs_lock_inodes(xfs_inode_t **, int, uint); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6b43507..d048e3b 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1261,7 +1261,7 @@ xfs_unmountfs(xfs_mount_t *mp) * need to force the log first. */ xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); - xfs_iflush_all(mp); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 01e274b..0c5ee5e 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -66,7 +66,7 @@ xfs_quiesce_fs( int count = 0, pincount; xfs_flush_buftarg(mp->m_ddev_targp, 0); - xfs_finish_reclaim_all(mp, 0); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); /* This loop must run at least twice. * The first instance of the loop will flush diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 7b967c0..1c654ba 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2911,36 +2911,30 @@ xfs_finish_reclaim( } int -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) +xfs_finish_reclaim_all( + xfs_mount_t *mp, + int noblock, + int mode) { - int purged; xfs_inode_t *ip, *n; - int done = 0; - while (!done) { - purged = 0; - XFS_MOUNT_ILOCK(mp); - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { - if (noblock) { - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) - continue; - if (xfs_ipincount(ip) || - !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - continue; - } +restart: + XFS_MOUNT_ILOCK(mp); + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { + if (noblock) { + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) + continue; + if (xfs_ipincount(ip) || + !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + continue; } - XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); - purged = 1; - break; } - - done = !purged; + XFS_MOUNT_IUNLOCK(mp); + if (xfs_finish_reclaim(ip, noblock, mode)) + delay(1); + goto restart; } - XFS_MOUNT_IUNLOCK(mp); return 0; } -- 1.5.6 From owner-xfs@oss.sgi.com Wed Aug 13 23:43:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 13 Aug 2008 23:44:12 -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,J_CHICKENPOX_62, J_CHICKENPOX_65 autolearn=no 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 m7E6hrFa000934 for ; Wed, 13 Aug 2008 23:43:53 -0700 X-ASG-Debug-ID: 1218696304-4cc300640002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 44712F42022 for ; Wed, 13 Aug 2008 23:45:08 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id zJIgPgbfnk9vEbN7 for ; Wed, 13 Aug 2008 23:45:08 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDAEtxo0h5LAMbiGdsb2JhbACReAEBAQ8gnDGGYoFV X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181917026" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:15:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTWZv-0002n8-Lu; Thu, 14 Aug 2008 16:44:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/6] XFS: move sync code to its own file Subject: [PATCH 1/6] XFS: move sync code to its own file Date: Thu, 14 Aug 2008 16:44:54 +1000 Message-Id: <1218696299-10572-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218696310 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: -0.47 X-Barracuda-Spam-Status: No, SCORE=-0.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M, BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2611 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17537 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The sync code in XFS is spread around several files. While it used to make sense to have such a distribution, the code is about to be cleaned up and so centralising it in one spot as the first step makes sense. Signed-off-by: Dave Chinner --- fs/xfs/Makefile | 1 + fs/xfs/linux-2.6/xfs_super.c | 1 + fs/xfs/linux-2.6/xfs_sync.c | 605 ++++++++++++++++++++++++++++++++++++++++++ fs/xfs/linux-2.6/xfs_sync.h | 7 + fs/xfs/xfs_vfsops.c | 560 +-------------------------------------- fs/xfs/xfs_vfsops.h | 1 - 6 files changed, 615 insertions(+), 560 deletions(-) create mode 100644 fs/xfs/linux-2.6/xfs_sync.c create mode 100644 fs/xfs/linux-2.6/xfs_sync.h diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 737c9a4..f42ea60 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -106,6 +106,7 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \ xfs_iops.o \ xfs_lrw.o \ xfs_super.o \ + xfs_sync.o \ xfs_vnode.o \ xfs_xattr.o) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index f90d0d8..58c474b 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -58,6 +58,7 @@ #include "xfs_extfree_item.h" #include "xfs_mru_cache.h" #include "xfs_inode_item.h" +#include "xfs_sync.h" #include #include diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c new file mode 100644 index 0000000..c765eb2 --- /dev/null +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -0,0 +1,605 @@ +/* + * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_types.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_inode.h" +#include "xfs_dinode.h" +#include "xfs_error.h" +#include "xfs_mru_cache.h" +#include "xfs_filestream.h" +#include "xfs_vnodeops.h" +#include "xfs_utils.h" +#include "xfs_buf_item.h" +#include "xfs_inode_item.h" +#include "xfs_rw.h" + +/* + * xfs_sync flushes any pending I/O to file system vfsp. + * + * This routine is called by vfs_sync() to make sure that things make it + * out to disk eventually, on sync() system calls to flush out everything, + * and when the file system is unmounted. For the vfs_sync() case, all + * we really need to do is sync out the log to make all of our meta-data + * updates permanent (except for timestamps). For calls from pflushd(), + * dirty pages are kept moving by calling pdflush() on the inodes + * containing them. We also flush the inodes that we can lock without + * sleeping and the superblock if we can lock it without sleeping from + * vfs_sync() so that items at the tail of the log are always moving out. + * + * Flags: + * SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want + * to sleep if we can help it. All we really need + * to do is ensure that the log is synced at least + * periodically. We also push the inodes and + * superblock if we can lock them without sleeping + * and they are not pinned. + * SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not + * set, then we really want to lock each inode and flush + * it. + * SYNC_WAIT - All the flushes that take place in this call should + * be synchronous. + * SYNC_DELWRI - This tells us to push dirty pages associated with + * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to + * determine if they should be flushed sync, async, or + * delwri. + * SYNC_CLOSE - This flag is passed when the system is being + * unmounted. We should sync and invalidate everything. + * SYNC_FSDATA - This indicates that the caller would like to make + * sure the superblock is safe on disk. We can ensure + * this by simply making sure the log gets flushed + * if SYNC_BDFLUSH is set, and by actually writing it + * out otherwise. + * SYNC_IOWAIT - The caller wants us to wait for all data I/O to complete + * before we return (including direct I/O). Forms the drain + * side of the write barrier needed to safely quiesce the + * filesystem. + * + */ +int +xfs_sync( + xfs_mount_t *mp, + int flags) +{ + int error; + + /* + * Get the Quota Manager to flush the dquots. + * + * If XFS quota support is not enabled or this filesystem + * instance does not use quotas XFS_QM_DQSYNC will always + * return zero. + */ + error = XFS_QM_DQSYNC(mp, flags); + if (error) { + /* + * If we got an IO error, we will be shutting down. + * So, there's nothing more for us to do here. + */ + ASSERT(error != EIO || XFS_FORCED_SHUTDOWN(mp)); + if (XFS_FORCED_SHUTDOWN(mp)) + return XFS_ERROR(error); + } + + if (flags & SYNC_IOWAIT) + xfs_filestream_flush(mp); + + return xfs_syncsub(mp, flags, NULL); +} + +/* + * xfs sync routine for internal use + * + * This routine supports all of the flags defined for the generic vfs_sync + * interface as explained above under xfs_sync. + * + */ +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + xfs_inode_t *ip = NULL; + struct inode *vp = NULL; + int error; + int last_error; + uint64_t fflag; + uint lock_flags; + uint base_lock_flags; + boolean_t mount_locked; + boolean_t vnode_refed; + int preempt; + xfs_iptr_t *ipointer; +#ifdef DEBUG + boolean_t ipointer_in = B_FALSE; + +#define IPOINTER_SET ipointer_in = B_TRUE +#define IPOINTER_CLR ipointer_in = B_FALSE +#else +#define IPOINTER_SET +#define IPOINTER_CLR +#endif + + +/* Insert a marker record into the inode list after inode ip. The list + * must be locked when this is called. After the call the list will no + * longer be locked. + */ +#define IPOINTER_INSERT(ip, mp) { \ + ASSERT(ipointer_in == B_FALSE); \ + ipointer->ip_mnext = ip->i_mnext; \ + ipointer->ip_mprev = ip; \ + ip->i_mnext = (xfs_inode_t *)ipointer; \ + ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ + preempt = 0; \ + XFS_MOUNT_IUNLOCK(mp); \ + mount_locked = B_FALSE; \ + IPOINTER_SET; \ + } + +/* Remove the marker from the inode list. If the marker was the only item + * in the list then there are no remaining inodes and we should zero out + * the whole list. If we are the current head of the list then move the head + * past us. + */ +#define IPOINTER_REMOVE(ip, mp) { \ + ASSERT(ipointer_in == B_TRUE); \ + if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ + ip = ipointer->ip_mnext; \ + ip->i_mprev = ipointer->ip_mprev; \ + ipointer->ip_mprev->i_mnext = ip; \ + if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ + mp->m_inodes = ip; \ + } \ + } else { \ + ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ + mp->m_inodes = NULL; \ + ip = NULL; \ + } \ + IPOINTER_CLR; \ + } + +#define XFS_PREEMPT_MASK 0x7f + + ASSERT(!(flags & SYNC_BDFLUSH)); + + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; + preempt = 0; + + /* Allocate a reference marker */ + ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + + fflag = XFS_B_ASYNC; /* default is don't wait */ + if (flags & SYNC_DELWRI) + fflag = XFS_B_DELWRI; + if (flags & SYNC_WAIT) + fflag = 0; /* synchronous overrides all */ + + base_lock_flags = XFS_ILOCK_SHARED; + if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { + /* + * We need the I/O lock if we're going to call any of + * the flush/inval routines. + */ + base_lock_flags |= XFS_IOLOCK_SHARED; + } + + XFS_MOUNT_ILOCK(mp); + + ip = mp->m_inodes; + + mount_locked = B_TRUE; + vnode_refed = B_FALSE; + + IPOINTER_CLR; + + do { + ASSERT(ipointer_in == B_FALSE); + ASSERT(vnode_refed == B_FALSE); + + lock_flags = base_lock_flags; + + /* + * There were no inodes in the list, just break out + * of the loop. + */ + if (ip == NULL) { + break; + } + + /* + * We found another sync thread marker - skip it + */ + if (ip->i_mount == NULL) { + ip = ip->i_mnext; + continue; + } + + vp = VFS_I(ip); + + /* + * If the vnode is gone then this is being torn down, + * call reclaim if it is flushed, else let regular flush + * code deal with it later in the loop. + */ + + if (vp == NULL) { + /* Skip ones already in reclaim */ + if (ip->i_flags & XFS_IRECLAIM) { + ip = ip->i_mnext; + continue; + } + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { + ip = ip->i_mnext; + } else if ((xfs_ipincount(ip) == 0) && + xfs_iflock_nowait(ip)) { + IPOINTER_INSERT(ip, mp); + + xfs_finish_reclaim(ip, 1, + XFS_IFLUSH_DELWRI_ELSE_ASYNC); + + XFS_MOUNT_ILOCK(mp); + mount_locked = B_TRUE; + IPOINTER_REMOVE(ip, mp); + } else { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + ip = ip->i_mnext; + } + continue; + } + + if (VN_BAD(vp)) { + ip = ip->i_mnext; + continue; + } + + if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { + XFS_MOUNT_IUNLOCK(mp); + kmem_free(ipointer); + return 0; + } + + /* + * Try to lock without sleeping. We're out of order with + * the inode list lock here, so if we fail we need to drop + * the mount lock and try again. If we're called from + * bdflush() here, then don't bother. + * + * The inode lock here actually coordinates with the + * almost spurious inode lock in xfs_ireclaim() to prevent + * the vnode we handle here without a reference from + * being freed while we reference it. If we lock the inode + * while it's on the mount list here, then the spurious inode + * lock in xfs_ireclaim() after the inode is pulled from + * the mount list will sleep until we release it here. + * This keeps the vnode from being freed while we reference + * it. + */ + if (xfs_ilock_nowait(ip, lock_flags) == 0) { + if (vp == NULL) { + ip = ip->i_mnext; + continue; + } + + vp = vn_grab(vp); + if (vp == NULL) { + ip = ip->i_mnext; + continue; + } + + IPOINTER_INSERT(ip, mp); + xfs_ilock(ip, lock_flags); + + ASSERT(vp == VFS_I(ip)); + ASSERT(ip->i_mount == mp); + + vnode_refed = B_TRUE; + } + + /* From here on in the loop we may have a marker record + * in the inode list. + */ + + /* + * If we have to flush data or wait for I/O completion + * we need to drop the ilock that we currently hold. + * If we need to drop the lock, insert a marker if we + * have not already done so. + */ + if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || + ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + xfs_iunlock(ip, XFS_ILOCK_SHARED); + + if (flags & SYNC_CLOSE) { + /* Shutdown case. Flush and invalidate. */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, + FI_REMAPF); + else + error = xfs_flushinval_pages(ip, + 0, -1, FI_REMAPF); + } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + error = xfs_flush_pages(ip, 0, + -1, fflag, FI_NONE); + } + + /* + * When freezing, we need to wait ensure all I/O (including direct + * I/O) is complete to ensure no further data modification can take + * place after this point + */ + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + + if ((flags & SYNC_ATTR) && + (ip->i_update_core || + (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { + if (mount_locked) + IPOINTER_INSERT(ip, mp); + + if (flags & SYNC_WAIT) { + xfs_iflock(ip); + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + + /* + * If we can't acquire the flush lock, then the inode + * is already being flushed so don't bother waiting. + * + * If we can lock it then do a delwri flush so we can + * combine multiple inode flushes in each disk write. + */ + } else if (xfs_iflock_nowait(ip)) { + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + } else if (bypassed) { + (*bypassed)++; + } + } + + if (lock_flags != 0) { + xfs_iunlock(ip, lock_flags); + } + + if (vnode_refed) { + /* + * If we had to take a reference on the vnode + * above, then wait until after we've unlocked + * the inode to release the reference. This is + * because we can be already holding the inode + * lock when IRELE() calls xfs_inactive(). + * + * Make sure to drop the mount lock before calling + * IRELE() so that we don't trip over ourselves if + * we have to go for the mount lock again in the + * inactive code. + */ + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + + IRELE(ip); + + vnode_refed = B_FALSE; + } + + if (error) { + last_error = error; + } + + /* + * bail out if the filesystem is corrupted. + */ + if (error == EFSCORRUPTED) { + if (!mount_locked) { + XFS_MOUNT_ILOCK(mp); + IPOINTER_REMOVE(ip, mp); + } + XFS_MOUNT_IUNLOCK(mp); + ASSERT(ipointer_in == B_FALSE); + kmem_free(ipointer); + return XFS_ERROR(error); + } + + /* Let other threads have a chance at the mount lock + * if we have looped many times without dropping the + * lock. + */ + if ((++preempt & XFS_PREEMPT_MASK) == 0) { + if (mount_locked) { + IPOINTER_INSERT(ip, mp); + } + } + + if (mount_locked == B_FALSE) { + XFS_MOUNT_ILOCK(mp); + mount_locked = B_TRUE; + IPOINTER_REMOVE(ip, mp); + continue; + } + + ASSERT(ipointer_in == B_FALSE); + ip = ip->i_mnext; + + } while (ip != mp->m_inodes); + + XFS_MOUNT_IUNLOCK(mp); + + ASSERT(ipointer_in == B_FALSE); + + kmem_free(ipointer); + return XFS_ERROR(last_error); +} + +/* + * xfs sync routine for internal use + * + * This routine supports all of the flags defined for the generic vfs_sync + * interface as explained above under xfs_sync. + * + */ +int +xfs_syncsub( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error = 0; + int last_error = 0; + uint log_flags = XFS_LOG_FORCE; + xfs_buf_t *bp; + xfs_buf_log_item_t *bip; + + /* + * Sync out the log. This ensures that the log is periodically + * flushed even if there is not enough activity to fill it up. + */ + if (flags & SYNC_WAIT) + log_flags |= XFS_LOG_SYNC; + + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + + if (flags & (SYNC_ATTR|SYNC_DELWRI)) { + if (flags & SYNC_BDFLUSH) + xfs_finish_reclaim_all(mp, 1); + else + error = xfs_sync_inodes(mp, flags, bypassed); + } + + /* + * Flushing out dirty data above probably generated more + * log activity, so if this isn't vfs_sync() then flush + * the log again. + */ + if (flags & SYNC_DELWRI) { + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + } + + if (flags & SYNC_FSDATA) { + /* + * If this is vfs_sync() then only sync the superblock + * if we can lock it without sleeping and it is not pinned. + */ + if (flags & SYNC_BDFLUSH) { + bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); + if (bp != NULL) { + bip = XFS_BUF_FSPRIVATE(bp,xfs_buf_log_item_t*); + if ((bip != NULL) && + xfs_buf_item_dirty(bip)) { + if (!(XFS_BUF_ISPINNED(bp))) { + XFS_BUF_ASYNC(bp); + error = xfs_bwrite(mp, bp); + } else { + xfs_buf_relse(bp); + } + } else { + xfs_buf_relse(bp); + } + } + } else { + bp = xfs_getsb(mp, 0); + /* + * If the buffer is pinned then push on the log so + * we won't get stuck waiting in the write for + * someone, maybe ourselves, to flush the log. + * Even though we just pushed the log above, we + * did not have the superblock buffer locked at + * that point so it can become pinned in between + * there and here. + */ + if (XFS_BUF_ISPINNED(bp)) + xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); + if (flags & SYNC_WAIT) + XFS_BUF_UNASYNC(bp); + else + XFS_BUF_ASYNC(bp); + error = xfs_bwrite(mp, bp); + } + if (error) { + last_error = error; + } + } + + /* + * Now check to see if the log needs a "dummy" transaction. + */ + if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { + xfs_trans_t *tp; + xfs_inode_t *ip; + + /* + * Put a dummy transaction in the log to tell + * recovery that all others are OK. + */ + tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); + if ((error = xfs_trans_reserve(tp, 0, + XFS_ICHANGE_LOG_RES(mp), + 0, 0, 0))) { + xfs_trans_cancel(tp, 0); + return error; + } + + ip = mp->m_rootip; + xfs_ilock(ip, XFS_ILOCK_EXCL); + + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_ihold(tp, ip); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + error = xfs_trans_commit(tp, 0); + xfs_iunlock(ip, XFS_ILOCK_EXCL); + xfs_log_force(mp, (xfs_lsn_t)0, log_flags); + } + + /* + * When shutting down, we need to insure that the AIL is pushed + * to disk or the filesystem can appear corrupt from the PROM. + */ + if ((flags & (SYNC_CLOSE|SYNC_WAIT)) == (SYNC_CLOSE|SYNC_WAIT)) { + XFS_bflush(mp->m_ddev_targp); + if (mp->m_rtdev_targp) { + XFS_bflush(mp->m_rtdev_targp); + } + } + + return XFS_ERROR(last_error); +} diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h new file mode 100644 index 0000000..f4c3b1e --- /dev/null +++ b/fs/xfs/linux-2.6/xfs_sync.h @@ -0,0 +1,7 @@ +#ifndef XFS_SYNC_H +#define XFS_SYNC_H 1 + +int xfs_sync(struct xfs_mount *mp, int flags); +int xfs_syncsub(struct xfs_mount *mp, int flags, int *bypassed); + +#endif diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 439dd39..01e274b 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -56,6 +56,7 @@ #include "xfs_vnodeops.h" #include "xfs_vfsops.h" #include "xfs_utils.h" +#include "xfs_sync.h" STATIC void @@ -196,562 +197,3 @@ fscorrupt_out2: return XFS_ERROR(EFSCORRUPTED); } -/* - * xfs_sync flushes any pending I/O to file system vfsp. - * - * This routine is called by vfs_sync() to make sure that things make it - * out to disk eventually, on sync() system calls to flush out everything, - * and when the file system is unmounted. For the vfs_sync() case, all - * we really need to do is sync out the log to make all of our meta-data - * updates permanent (except for timestamps). For calls from pflushd(), - * dirty pages are kept moving by calling pdflush() on the inodes - * containing them. We also flush the inodes that we can lock without - * sleeping and the superblock if we can lock it without sleeping from - * vfs_sync() so that items at the tail of the log are always moving out. - * - * Flags: - * SYNC_BDFLUSH - We're being called from vfs_sync() so we don't want - * to sleep if we can help it. All we really need - * to do is ensure that the log is synced at least - * periodically. We also push the inodes and - * superblock if we can lock them without sleeping - * and they are not pinned. - * SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not - * set, then we really want to lock each inode and flush - * it. - * SYNC_WAIT - All the flushes that take place in this call should - * be synchronous. - * SYNC_DELWRI - This tells us to push dirty pages associated with - * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to - * determine if they should be flushed sync, async, or - * delwri. - * SYNC_CLOSE - This flag is passed when the system is being - * unmounted. We should sync and invalidate everything. - * SYNC_FSDATA - This indicates that the caller would like to make - * sure the superblock is safe on disk. We can ensure - * this by simply making sure the log gets flushed - * if SYNC_BDFLUSH is set, and by actually writing it - * out otherwise. - * SYNC_IOWAIT - The caller wants us to wait for all data I/O to complete - * before we return (including direct I/O). Forms the drain - * side of the write barrier needed to safely quiesce the - * filesystem. - * - */ -int -xfs_sync( - xfs_mount_t *mp, - int flags) -{ - int error; - - /* - * Get the Quota Manager to flush the dquots. - * - * If XFS quota support is not enabled or this filesystem - * instance does not use quotas XFS_QM_DQSYNC will always - * return zero. - */ - error = XFS_QM_DQSYNC(mp, flags); - if (error) { - /* - * If we got an IO error, we will be shutting down. - * So, there's nothing more for us to do here. - */ - ASSERT(error != EIO || XFS_FORCED_SHUTDOWN(mp)); - if (XFS_FORCED_SHUTDOWN(mp)) - return XFS_ERROR(error); - } - - if (flags & SYNC_IOWAIT) - xfs_filestream_flush(mp); - - return xfs_syncsub(mp, flags, NULL); -} - -/* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * - */ -int -xfs_sync_inodes( - xfs_mount_t *mp, - int flags, - int *bypassed) -{ - xfs_inode_t *ip = NULL; - struct inode *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); - - fflag = XFS_B_ASYNC; /* default is don't wait */ - if (flags & SYNC_DELWRI) - fflag = XFS_B_DELWRI; - if (flags & SYNC_WAIT) - fflag = 0; /* synchronous overrides all */ - - base_lock_flags = XFS_ILOCK_SHARED; - if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { - /* - * We need the I/O lock if we're going to call any of - * the flush/inval routines. - */ - base_lock_flags |= XFS_IOLOCK_SHARED; - } - - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; - - do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; - - /* - * There were no inodes in the list, just break out - * of the loop. - */ - if (ip == NULL) { - break; - } - - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = VFS_I(ip); - - /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. - */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } - continue; - } - - if (VN_BAD(vp)) { - ip = ip->i_mnext; - continue; - } - - if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); - return 0; - } - - /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. - */ - if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - - IPOINTER_INSERT(ip, mp); - xfs_ilock(ip, lock_flags); - - ASSERT(vp == VFS_I(ip)); - ASSERT(ip->i_mount == mp); - - vnode_refed = B_TRUE; - } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - - /* - * If we have to flush data or wait for I/O completion - * we need to drop the ilock that we currently hold. - * If we need to drop the lock, insert a marker if we - * have not already done so. - */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ - if (flags & SYNC_IOWAIT) - vn_iowait(ip); - - xfs_ilock(ip, XFS_ILOCK_SHARED); - } - - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); - - if (flags & SYNC_WAIT) { - xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ - } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); - } else if (bypassed) { - (*bypassed)++; - } - } - - if (lock_flags != 0) { - xfs_iunlock(ip, lock_flags); - } - - if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - - IRELE(ip); - - vnode_refed = B_FALSE; - } - - if (error) { - last_error = error; - } - - /* - * bail out if the filesystem is corrupted. - */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); - return XFS_ERROR(error); - } - - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } - - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } - - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; - - } while (ip != mp->m_inodes); - - XFS_MOUNT_IUNLOCK(mp); - - ASSERT(ipointer_in == B_FALSE); - - kmem_free(ipointer); - return XFS_ERROR(last_error); -} - -/* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * - */ -int -xfs_syncsub( - xfs_mount_t *mp, - int flags, - int *bypassed) -{ - int error = 0; - int last_error = 0; - uint log_flags = XFS_LOG_FORCE; - xfs_buf_t *bp; - xfs_buf_log_item_t *bip; - - /* - * Sync out the log. This ensures that the log is periodically - * flushed even if there is not enough activity to fill it up. - */ - if (flags & SYNC_WAIT) - log_flags |= XFS_LOG_SYNC; - - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - - if (flags & (SYNC_ATTR|SYNC_DELWRI)) { - if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); - else - error = xfs_sync_inodes(mp, flags, bypassed); - } - - /* - * Flushing out dirty data above probably generated more - * log activity, so if this isn't vfs_sync() then flush - * the log again. - */ - if (flags & SYNC_DELWRI) { - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - } - - if (flags & SYNC_FSDATA) { - /* - * If this is vfs_sync() then only sync the superblock - * if we can lock it without sleeping and it is not pinned. - */ - if (flags & SYNC_BDFLUSH) { - bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); - if (bp != NULL) { - bip = XFS_BUF_FSPRIVATE(bp,xfs_buf_log_item_t*); - if ((bip != NULL) && - xfs_buf_item_dirty(bip)) { - if (!(XFS_BUF_ISPINNED(bp))) { - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } else { - xfs_buf_relse(bp); - } - } else { - xfs_buf_relse(bp); - } - } - } else { - bp = xfs_getsb(mp, 0); - /* - * If the buffer is pinned then push on the log so - * we won't get stuck waiting in the write for - * someone, maybe ourselves, to flush the log. - * Even though we just pushed the log above, we - * did not have the superblock buffer locked at - * that point so it can become pinned in between - * there and here. - */ - if (XFS_BUF_ISPINNED(bp)) - xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); - if (flags & SYNC_WAIT) - XFS_BUF_UNASYNC(bp); - else - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } - if (error) { - last_error = error; - } - } - - /* - * Now check to see if the log needs a "dummy" transaction. - */ - if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { - xfs_trans_t *tp; - xfs_inode_t *ip; - - /* - * Put a dummy transaction in the log to tell - * recovery that all others are OK. - */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); - if ((error = xfs_trans_reserve(tp, 0, - XFS_ICHANGE_LOG_RES(mp), - 0, 0, 0))) { - xfs_trans_cancel(tp, 0); - return error; - } - - ip = mp->m_rootip; - xfs_ilock(ip, XFS_ILOCK_EXCL); - - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); - xfs_trans_ihold(tp, ip); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = xfs_trans_commit(tp, 0); - xfs_iunlock(ip, XFS_ILOCK_EXCL); - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - } - - /* - * When shutting down, we need to insure that the AIL is pushed - * to disk or the filesystem can appear corrupt from the PROM. - */ - if ((flags & (SYNC_CLOSE|SYNC_WAIT)) == (SYNC_CLOSE|SYNC_WAIT)) { - XFS_bflush(mp->m_ddev_targp); - if (mp->m_rtdev_targp) { - XFS_bflush(mp->m_rtdev_targp); - } - } - - return XFS_ERROR(last_error); -} diff --git a/fs/xfs/xfs_vfsops.h b/fs/xfs/xfs_vfsops.h index a74b050..6701d0e 100644 --- a/fs/xfs/xfs_vfsops.h +++ b/fs/xfs/xfs_vfsops.h @@ -8,7 +8,6 @@ struct kstatfs; struct xfs_mount; struct xfs_mount_args; -int xfs_sync(struct xfs_mount *mp, int flags); void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, int lnnum); void xfs_attr_quiesce(struct xfs_mount *mp); -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:41 -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 (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 m7E7DUeW006942 for ; Thu, 14 Aug 2008 00:13:30 -0700 X-ASG-Debug-ID: 1218698086-2cc503980001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0D04AF41E6A for ; Thu, 14 Aug 2008 00:14:48 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id k9JqSOoVPinWzSqV for ; Thu, 14 Aug 2008 00:14:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938239" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vd-Hz; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/7] XFS: track dirty inodes ourselves Subject: [PATCH 1/7] XFS: track dirty inodes ourselves Date: Thu, 14 Aug 2008 17:14:37 +1000 Message-Id: <1218698083-11226-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698089 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0519 1.0000 -1.6881 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.69 X-Barracuda-Spam-Status: No, SCORE=-1.69 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17540 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Allow XFS to track dirty inodes itself. Initially, we effectively re-implement __mark_inode_dirty() to put the inode on the superblock dirty list. This allows us to start using unhashed linux inodes and still allow pdflush to write out dirty inodes - __mark_inode_dirty() specificaly avoids putting unhashed inodes on the superblock dirty list. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 6268b35..a432f1d 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -889,6 +889,32 @@ xfs_fs_inode_init_once( } /* + * The inode has been marked dirty at the VFS. because we are using unhashed + * inodes now, we have to move the inode to the sb->s_dirty_list ourselves as + * the caller will not do it for unhashed inodes. + * + * The use of the inode_lock is purely a temporary step to make this code work + * safely. Ultimately XFS will track all the dirty inode state internally in + * the radix trees, so this lock will disappear. + */ +STATIC void +xfs_fs_dirty_inode( + struct inode *inode) +{ + extern spinlock_t inode_lock; + + if (inode->i_state & I_DIRTY) + return; + + spin_lock(&inode_lock); + if (!(inode->i_state & I_DIRTY)) { + inode->dirtied_when = jiffies; + list_move(&inode->i_list, &inode->i_sb->s_dirty); + } + spin_unlock(&inode_lock); +} + +/* * Attempt to flush the inode, this will actually fail * if the inode is pinned, but we dirty the inode again * at the point when it is unpinned after a log write, @@ -1690,6 +1716,7 @@ xfs_fs_get_sb( static struct super_operations xfs_super_operations = { .alloc_inode = xfs_fs_alloc_inode, .destroy_inode = xfs_fs_destroy_inode, + .dirty_inode = xfs_fs_dirty_inode, .write_inode = xfs_fs_write_inode, .clear_inode = xfs_fs_clear_inode, .put_super = xfs_fs_put_super, -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:48 -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 (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 m7E7DV2f006955 for ; Thu, 14 Aug 2008 00:13:32 -0700 X-ASG-Debug-ID: 1218698086-2cc503980002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06BDFF41E6C for ; Thu, 14 Aug 2008 00:14:49 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id sTTu9Ft2MYmTurtY for ; Thu, 14 Aug 2008 00:14:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938247" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vk-PJ; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Subject: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Date: Thu, 14 Aug 2008 17:14:40 +1000 Message-Id: <1218698083-11226-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698090 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17546 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Once the Linux inode and the XFS inode are combined, we cannot rely on just check if the linux inode exists as a method of determining if it is valid or not. Hence we should always call xfs_mark_inode_dirty_sync() instead as it does the correct checks to determine if the liinux inode is in a valid state or not. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_aops.c | 2 +- fs/xfs/linux-2.6/xfs_iops.c | 4 ++-- fs/xfs/linux-2.6/xfs_super.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index da6ea64..1ce5b75 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -191,7 +191,7 @@ xfs_setfilesize( ip->i_d.di_size = isize; ip->i_update_core = 1; ip->i_update_size = 1; - mark_inode_dirty_sync(ioend->io_inode); + xfs_mark_inode_dirty_sync(ip); } xfs_iunlock(ip, XFS_ILOCK_EXCL); diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index ace56bd..4209975 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -133,7 +133,7 @@ xfs_ichgtime( SYNCHRONIZE(); ip->i_update_core = 1; if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(ip); } /* @@ -178,7 +178,7 @@ xfs_ichgtime_fast( SYNCHRONIZE(); ip->i_update_core = 1; if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(ip); } /* diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index b718146..188057b 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -939,7 +939,7 @@ xfs_fs_write_inode( * it dirty again so we'll try again later. */ if (error) - mark_inode_dirty_sync(inode); + xfs_mark_inode_dirty_sync(XFS_I(inode)); return -error; } -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:35 -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 (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 m7E7DTwZ006933 for ; Thu, 14 Aug 2008 00:13:29 -0700 X-ASG-Debug-ID: 1218698086-2cc503980000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0F328F41E68 for ; Thu, 14 Aug 2008 00:14:47 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 8SGrLaEdPlqJSZ95 for ; Thu, 14 Aug 2008 00:14:47 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938245" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vh-MB; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/7] XFS: Use ->drop_inode to implement writeback of reclaimed inodes Subject: [PATCH 3/7] XFS: Use ->drop_inode to implement writeback of reclaimed inodes Date: Thu, 14 Aug 2008 17:14:39 +1000 Message-Id: <1218698083-11226-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698088 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17539 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs generic_forget_inode() normally writes back dirty inodes before they are reclaimed. however, it only does this for hashed inodes. Hence if we are going to use unhashed inodes we need to implement our own writeback of these inodes. Hook ->drop_inode to replace generic_drop_inode() and allow us to implement the needed inode writeback. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index a432f1d..b718146 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -944,6 +944,36 @@ xfs_fs_write_inode( return -error; } +/* + * Because we are not using hashed inodes, we have to write + * the inode back here before calling into the generic code. + * + * XXX: need to sort something out with the inode lock. + * + * generic_forget_inode() is not exported. + */ +STATIC void +xfs_fs_drop_inode( + struct inode *inode) +{ + extern spinlock_t inode_lock; + + /* this is munged from generic_forget_inode */ + if (inode->i_nlink) { + /* + * remove the inode from the dirty list first so writeback + * can't race with us as we drop the inode lock here. + */ + list_del_init(&inode->i_list); + inode->i_state |= I_WILL_FREE; + spin_unlock(&inode_lock); + write_inode_now(inode, 1); + spin_lock(&inode_lock); + inode->i_state &= ~I_WILL_FREE; + } + generic_drop_inode(inode); +} + STATIC void xfs_fs_clear_inode( struct inode *inode) @@ -1718,6 +1748,7 @@ static struct super_operations xfs_super_operations = { .destroy_inode = xfs_fs_destroy_inode, .dirty_inode = xfs_fs_dirty_inode, .write_inode = xfs_fs_write_inode, + .drop_inode = xfs_fs_drop_inode, .clear_inode = xfs_fs_clear_inode, .put_super = xfs_fs_put_super, .write_super = xfs_fs_write_super, -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:45 -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 (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 m7E7DYJT006980 for ; Thu, 14 Aug 2008 00:13:34 -0700 X-ASG-Debug-ID: 1218698087-29e6037f0001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8863CF41E6D for ; Thu, 14 Aug 2008 00:14:49 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id V1Thh8JP9jT7j8GU for ; Thu, 14 Aug 2008 00:14:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938248" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vf-Jp; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/7] XFS: Use ->set_page_dirty to dirty inodes Subject: [PATCH 2/7] XFS: Use ->set_page_dirty to dirty inodes Date: Thu, 14 Aug 2008 17:14:38 +1000 Message-Id: <1218698083-11226-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698092 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0331 1.0000 -1.8070 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.81 X-Barracuda-Spam-Status: No, SCORE=-1.81 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17544 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs If we use unhashed inodes, then the ->dirty_inode callback will not tell us about pure page dirtying (I_DIRTY_PAGES) events. hence we will miss moving the inode to the superblock dirty list in this case. Hence we need to hook ->set_page_dirty to move the inode to the dirty list so that it will be written back in a timely fashion. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_aops.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index f42f80a..da6ea64 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -1568,11 +1568,41 @@ xfs_vm_invalidatepage( block_invalidatepage(page, offset); } +/* + * The page has been marked dirty by the VM. Because we are using unhashed + * inodes now, we have to move the inode to the sb->s_dirty_list ourselves as + * we will not get a callback through ->dirty_inode() for I_DIRTY_PAGES. + * + * The use of the inode_lock is purely a temporary step to make this code work + * safely. Ultimately XFS will track all the dirty inode state internally in + * the radix trees, so this lock will disappear. + */ +STATIC int +xfs_vm_set_page_dirty( + struct page *page) +{ + extern spinlock_t inode_lock; + struct inode *inode = page->mapping->host; + + if (inode->i_state & I_DIRTY_PAGES) + return __set_page_dirty_buffers(page); + + spin_lock(&inode_lock); + if (!(inode->i_state & I_DIRTY)) { + inode->dirtied_when = jiffies; + list_move(&inode->i_list, &inode->i_sb->s_dirty); + } + inode->i_state |= I_DIRTY_PAGES; + spin_unlock(&inode_lock); + return __set_page_dirty_buffers(page); +} + const struct address_space_operations xfs_address_space_operations = { .readpage = xfs_vm_readpage, .readpages = xfs_vm_readpages, .writepage = xfs_vm_writepage, .writepages = xfs_vm_writepages, + .set_page_dirty = xfs_vm_set_page_dirty, .sync_page = block_sync_page, .releasepage = xfs_vm_releasepage, .invalidatepage = xfs_vm_invalidatepage, -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:45 -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 (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 m7E7DZw5006993 for ; Thu, 14 Aug 2008 00:13:35 -0700 X-ASG-Debug-ID: 1218698086-2cc503980003-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DE90CF41E72 for ; Thu, 14 Aug 2008 00:14:52 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id haZn1uThMZCw17AL for ; Thu, 14 Aug 2008 00:14:52 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938259" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vb-Fq for xfs@oss.sgi.com; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/7] RFC: combine linux and XFS inodes Subject: [PATCH 0/7] RFC: combine linux and XFS inodes Date: Thu, 14 Aug 2008 17:14:36 +1000 Message-Id: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698093 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2729 1.0000 -0.4679 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.47 X-Barracuda-Spam-Status: No, SCORE=-0.47 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17542 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs XFS currently has to deal with two separate inode lifecycles which makes for complexity in inode lookups and reclaim. We also have the problem of not always having a linux inode around when it might be useful to have it. To avoid these lifecycle problems, this series embedѕ the linux inode inside the struct xfs_inode and changes the way we reference to two inodes. We can no longer check for a null linux inode - instead we have to check to see if it is valid or not by checking either the linux inode or xfs inode state flags. While this means that inodes waiting for reclaim use more memory, this is not the commonn state for inodes and the will soon be completely freed so the additional memeory use in this state is only a temporary issue. This combining of the inodes simplifies the inode and reclaim logic, making it possible to do reclaim via radix tree tags (an upcoming patch series) and to be able to use RCU locking on the radix trees. The fact that we don't have a simple mechanism to determine the reclaim state of the inode makes RCU locking very complex, and this complexity is removed by having a combined inode structure. This patch series also changes the way XFS caches inodes. It no longer uses the linux inode cache - instead we rely solely on the XFS inode caches. This avoids the inode_lock in lookups that hit the cache - we should get much better parallelism out of inode lookup than we currently do now. However, this means the linux inodes are unhashed, which means we now need to do our own tracking of dirty state. We do this by hooking ->dirty_inode and ->set_page_dirty to move the inode to the superblock dirty list when appropriate. We also need to hook ->drop_inode to ensure we do writeback of dirty inodes during reclaim. In future, this can be moved entirely into XFS based on radix tree tags to track dirty inodes instead of a separate list. The patch series also makes use of the slab 'init once' feature for the XFS inodes. This means we only need to do partial initialisation of the xfs (and embedded linux inode) whenever we allocate a new inode. In future, we should also be able to cull duplicate fields out of the xfs and linux inodes reducing the overall memory usage of the active inode cache. This provides scope for continuing to reduce the memory footprint of the XFS inode cache. The patch series is based on the -master branch of the git tree, and applies on top of the 'replace mount inode list' patch series, the generation number removal patch and the xfs_iget split-up into hit and miss cases patch. Diffstat for the series is as follows: linux-2.6/xfs_aops.c | 32 ++++++++ linux-2.6/xfs_iops.c | 21 ++++- linux-2.6/xfs_super.c | 123 +++++++++++++++++++++++++++------ linux-2.6/xfs_sync.c | 50 ++++++------- linux-2.6/xfs_vnode.c | 4 - quota/xfs_qm_syscalls.c | 20 +++-- xfs_iget.c | 175 +++++++++--------------------------------------- xfs_inode.c | 110 +++++++++++++++++++++++------- xfs_inode.h | 10 +- xfs_itable.c | 14 +-- xfs_vfsops.c | 1 xfs_vnodeops.c | 13 --- 12 files changed, 326 insertions(+), 247 deletions(-) From owner-xfs@oss.sgi.com Thu Aug 14 00:13:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:43 -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,J_CHICKENPOX_62 autolearn=no 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 m7E7DVkd006952 for ; Thu, 14 Aug 2008 00:13:31 -0700 X-ASG-Debug-ID: 1218698087-29e6037f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 74C84F41E6D for ; Thu, 14 Aug 2008 00:14:48 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id ywgqHwtJaKkqcL8z for ; Thu, 14 Aug 2008 00:14:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938242" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2i-0003Vv-0O; Thu, 14 Aug 2008 17:14:44 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 7/7] XFS: don't use vnodes where unnecessary Subject: [PATCH 7/7] XFS: don't use vnodes where unnecessary Date: Thu, 14 Aug 2008 17:14:43 +1000 Message-Id: <1218698083-11226-8-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698089 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17541 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Not that we have a combined xfs and linux inode, we can clean up the use of linux indoes in several places. We can now check for the xfs inode being in the reclaim state rather than whether the linux inode exists, and we can use the linux inode directly rather than via vnode helpers. Also clean up remaining checks for the vnode being null and replace them with appropriate flag checks. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_sync.c | 50 ++++++++++++++++++++-------------------- fs/xfs/linux-2.6/xfs_vnode.c | 4 +- fs/xfs/quota/xfs_qm_syscalls.c | 20 ++++++++++----- fs/xfs/xfs_vnodeops.c | 11 ++------ 4 files changed, 43 insertions(+), 42 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index 53d85ec..1a04769 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c @@ -131,10 +131,7 @@ xfs_sync_inodes_ag( int flags, int *bypassed) { - xfs_inode_t *ip = NULL; - struct inode *vp = NULL; xfs_perag_t *pag = &mp->m_perag[ag]; - boolean_t vnode_refed = B_FALSE; int nr_found; int first_index = 0; int error = 0; @@ -156,6 +153,10 @@ xfs_sync_inodes_ag( } do { + struct inode *inode; + boolean_t vnode_refed; + xfs_inode_t *ip = NULL; + /* * use a gang lookup to find the next inode in the tree * as the tree is sparse and a gang lookup walks to find @@ -177,14 +178,14 @@ xfs_sync_inodes_ag( * skip inodes in reclaim. Let xfs_syncsub do that for * us so we don't need to worry. */ - vp = VFS_I(ip); - if (!vp) { + if (xfs_iflags_test(ip, (XFS_IRECLAIM|XFS_IRECLAIMABLE))) { read_unlock(&pag->pag_ici_lock); continue; } /* bad inodes are dealt with elsewhere */ - if (VN_BAD(vp)) { + inode = VFS_I(ip); + if (VN_BAD(inode)) { read_unlock(&pag->pag_ici_lock); continue; } @@ -196,30 +197,30 @@ xfs_sync_inodes_ag( } /* - * The inode lock here actually coordinates with the almost - * spurious inode lock in xfs_ireclaim() to prevent the vnode - * we handle here without a reference from being freed while we - * reference it. If we lock the inode while it's on the mount - * list here, then the spurious inode lock in xfs_ireclaim() - * after the inode is pulled from the mount list will sleep - * until we release it here. This keeps the vnode from being - * freed while we reference it. + * If we can't get a reference on the VFS_I, the inode must be + * in reclaim. If we can get the inode lock without blocking, + * it is safe to flush the inode because we hold the tree lock + * and xfs_iextract will block right now. Hence if we lock the + * inode while holding the tree lock, xfs_ireclaim() is + * guaranteed to block on the inode lock we now hold and hence + * it is safe to reference the inode until we drop the inode + * locks completely. */ - if (xfs_ilock_nowait(ip, lock_flags) == 0) { - vp = vn_grab(vp); + vnode_refed = B_FALSE; + inode = igrab(inode); + if (inode) { read_unlock(&pag->pag_ici_lock); - if (!vp) - continue; xfs_ilock(ip, lock_flags); - - ASSERT(vp == VFS_I(ip)); - ASSERT(ip->i_mount == mp); - vnode_refed = B_TRUE; } else { - /* safe to unlock here as we have a reference */ + if (!xfs_ilock_nowait(ip, lock_flags)) { + /* leave it to reclaim */ + read_unlock(&pag->pag_ici_lock); + continue; + } read_unlock(&pag->pag_ici_lock); } + /* * If we have to flush data or wait for I/O completion * we need to drop the ilock that we currently hold. @@ -240,7 +241,7 @@ xfs_sync_inodes_ag( xfs_ilock(ip, XFS_ILOCK_SHARED); } - if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + if ((flags & SYNC_DELWRI) && VN_DIRTY(VFS_I(ip))) { xfs_iunlock(ip, XFS_ILOCK_SHARED); error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); if (flags & SYNC_IOWAIT) @@ -270,7 +271,6 @@ xfs_sync_inodes_ag( if (vnode_refed) { IRELE(ip); - vnode_refed = B_FALSE; } if (error) diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index 5cad327..34030ec 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c @@ -92,8 +92,8 @@ static inline int xfs_icount(struct xfs_inode *ip) { struct inode *vp = VFS_I(ip); - if (vp) - return vn_count(vp); + if (!(inode->i_state & I_CLEAR)) + return atomic_read(&inode->i_count); return -1; } diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index d292e55..bbd7419 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1037,7 +1037,7 @@ xfs_qm_dqrele_inodes_ag( int nr_found; do { - boolean_t vnode_refd = B_FALSE; + boolean_t vnode_refd; /* * use a gang lookup to find the next inode in the tree @@ -1057,23 +1057,29 @@ xfs_qm_dqrele_inodes_ag( first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* Root inode, rbmip and rsumip have associated blocks */ - vp = VFS_I(ip); if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); read_unlock(&pag->pag_ici_lock); continue; } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - vp = vn_grab(vp); + + /* see xfs_sync_inodes_ag for description of locking */ + vnode_refd = B_FALSE; + vp = vn_grab(VFS_I(ip)); + if (vp) { read_unlock(&pag->pag_ici_lock); - if (!vp) - continue; - vnode_refd = B_TRUE; xfs_ilock(ip, XFS_ILOCK_EXCL); + vnode_refd = B_TRUE; } else { + if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) { + /* leave it to reclaim */ + read_unlock(&pag->pag_ici_lock); + continue; + } read_unlock(&pag->pag_ici_lock); } + if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index d36e5bc..ebb6eda 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2801,6 +2801,7 @@ xfs_reclaim( if (!ip->i_update_core && (ip->i_itemp == NULL)) { xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_iflock(ip); + xfs_iflags_set(ip, XFS_IRECLAIMABLE); return xfs_finish_reclaim(ip, 1, XFS_IFLUSH_DELWRI_ELSE_SYNC); } else { xfs_mount_t *mp = ip->i_mount; @@ -2823,10 +2824,6 @@ xfs_finish_reclaim( int sync_mode) { xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); - struct inode *vp = VFS_I(ip); - - if (vp && VN_BAD(vp)) - goto reclaim; /* The hash lock here protects a thread in xfs_iget_core from * racing with us on linking the inode back with a vnode. @@ -2836,7 +2833,7 @@ xfs_finish_reclaim( write_lock(&pag->pag_ici_lock); spin_lock(&ip->i_flags_lock); if (__xfs_iflags_test(ip, XFS_IRECLAIM) || - (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) { + !__xfs_iflags_test(ip, XFS_IRECLAIMABLE)) { spin_unlock(&ip->i_flags_lock); write_unlock(&pag->pag_ici_lock); if (locked) { @@ -2870,15 +2867,13 @@ xfs_finish_reclaim( * In the case of a forced shutdown we rely on xfs_iflush() to * wait for the inode to be unpinned before returning an error. */ - if (xfs_iflush(ip, sync_mode) == 0) { + if (!VN_BAD(VFS_I(ip)) && xfs_iflush(ip, sync_mode) == 0) { /* synchronize with xfs_iflush_done */ xfs_iflock(ip); xfs_ifunlock(ip); } xfs_iunlock(ip, XFS_ILOCK_EXCL); - - reclaim: xfs_ireclaim(ip); return 0; } -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:47 -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,J_CHICKENPOX_62, J_CHICKENPOX_66 autolearn=no 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 m7E7DaJL006998 for ; Thu, 14 Aug 2008 00:13:36 -0700 X-ASG-Debug-ID: 1218698090-03b303450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 51558391E6D for ; Thu, 14 Aug 2008 00:14:52 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id GuVWrwD7CBu2jcR5 for ; Thu, 14 Aug 2008 00:14:52 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938243" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vp-Rb; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Subject: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Date: Thu, 14 Aug 2008 17:14:41 +1000 Message-Id: <1218698083-11226-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698094 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.2612 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17545 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs To avoid having to initialise some fields of the XFS inode on every allocation, we can use the slab init-once feature to initialise them. All we have to guarantee is that when we free the inode, all it's entries are in the initial state. Add asserts where possible to ensure debug kernels check this initial state before freeing and after allocation. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 30 +++++++++++++++++++- fs/xfs/xfs_iget.c | 7 ---- fs/xfs/xfs_inode.c | 63 ++++++++++++++++++++++++++++++++++-------- fs/xfs/xfs_inode.h | 1 + fs/xfs/xfs_itable.c | 14 ++++---- 5 files changed, 88 insertions(+), 27 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 188057b..6529d2b 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -888,6 +888,34 @@ xfs_fs_inode_init_once( inode_init_once((struct inode *)vnode); } + +/* + * Slab object creation initialisation for the XFS inode. + * This covers only the idempotent fields in the XFS inode; + * all other fields need to be initialised on allocation + * from the slab. This avoids the need to repeatedly intialise + * fields in the xfs inode that left in the initialise state + * when freeing the inode. + */ +void +xfs_inode_init_once( + void *inode) +{ + struct xfs_inode *ip = inode; + + memset(ip, 0, sizeof(struct xfs_inode)); + atomic_set(&ip->i_iocount, 0); + atomic_set(&ip->i_pincount, 0); + spin_lock_init(&ip->i_flags_lock); + INIT_LIST_HEAD(&ip->i_reclaim); + init_waitqueue_head(&ip->i_ipin_wait); + initnsema(&ip->i_flock, 1, "xfsfino"); + + mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, + "xfsino", ip->i_ino); + mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); +} + /* * The inode has been marked dirty at the VFS. because we are using unhashed * inodes now, we have to move the inode to the sb->s_dirty_list ourselves as @@ -1924,7 +1952,7 @@ xfs_init_zones(void) xfs_inode_zone = kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode", KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | - KM_ZONE_SPREAD, NULL); + KM_ZONE_SPREAD, xfs_inode_init_once); if (!xfs_inode_zone) goto out_destroy_efi_zone; diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 640ce29..1f539f9 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -165,13 +165,6 @@ xfs_iget_cache_miss( xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); - mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, - "xfsino", ip->i_ino); - mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); - init_waitqueue_head(&ip->i_ipin_wait); - atomic_set(&ip->i_pincount, 0); - initnsema(&ip->i_flock, 1, "xfsfino"); - if (lock_flags) xfs_ilock(ip, lock_flags); diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ced22e4..e2ac32c 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -788,6 +788,48 @@ xfs_dic2xflags( } /* + * Allocate and initialise an xfs_inode. + */ +struct xfs_inode * +xfs_inode_alloc( + struct xfs_mount *mp, + xfs_ino_t ino) +{ + struct xfs_inode *ip; + + /* + * if this didn't occur in transactions, we could use + * KM_MAYFAIL and return NULL here on ENOMEM. Set the + * code up to do this anyway. + */ + ip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP); + if (!ip) + return NULL; + + ASSERT(atomic_read(&ip->i_iocount) == 0); + ASSERT(atomic_read(&ip->i_pincount) == 0); + ASSERT(!spin_is_locked(&ip->i_flags_lock)); + ASSERT(list_empty(&ip->i_reclaim)); + + ip->i_ino = ino; + ip->i_mount = mp; + ip->i_blkno = 0; + ip->i_len = 0; + ip->i_boffset =0; + ip->i_afp = NULL; + memset(&ip->i_df, 0, sizeof(xfs_ifork_t)); + ip->i_flags = 0; + ip->i_update_core = 0; + ip->i_update_size = 0; + ip->i_delayed_blks = 0; + memset(&ip->i_d, 0, sizeof(xfs_icdinode_t)); + ip->i_size = 0; + ip->i_new_size = 0; + + return ip; +} + +/* * Given a mount structure and an inode number, return a pointer * to a newly allocated in-core inode corresponding to the given * inode number. @@ -809,13 +851,9 @@ xfs_iread( xfs_inode_t *ip; int error; - ASSERT(xfs_inode_zone != NULL); - - ip = kmem_zone_zalloc(xfs_inode_zone, KM_SLEEP); - ip->i_ino = ino; - ip->i_mount = mp; - atomic_set(&ip->i_iocount, 0); - spin_lock_init(&ip->i_flags_lock); + ip = xfs_inode_alloc(mp, ino); + if (!ip) + return ENOMEM; /* * Get pointer's to the on-disk inode and the buffer containing it. @@ -911,8 +949,6 @@ xfs_iread( XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); } - INIT_LIST_HEAD(&ip->i_reclaim); - /* * The inode format changed when we moved the link count and * made it 32 bits long. If this is an old format inode, @@ -2624,9 +2660,6 @@ xfs_idestroy( } if (ip->i_afp) xfs_idestroy_fork(ip, XFS_ATTR_FORK); - mrfree(&ip->i_lock); - mrfree(&ip->i_iolock); - freesema(&ip->i_flock); #ifdef XFS_INODE_TRACE ktrace_free(ip->i_trace); @@ -2665,7 +2698,13 @@ xfs_idestroy( spin_unlock(&mp->m_ail_lock); } xfs_inode_item_destroy(ip); + ip->i_itemp = NULL; } + /* asserts to verify all state is correct here */ + ASSERT(atomic_read(&ip->i_iocount) == 0); + ASSERT(atomic_read(&ip->i_pincount) == 0); + ASSERT(!spin_is_locked(&ip->i_flags_lock)); + ASSERT(list_empty(&ip->i_reclaim)); kmem_zone_free(xfs_inode_zone, ip); } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index d97d6ec..d75c820 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -508,6 +508,7 @@ int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, xfs_fsize_t, int, int); int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); +struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); void xfs_idestroy_fork(xfs_inode_t *, int); void xfs_idestroy(xfs_inode_t *); void xfs_idata_realloc(xfs_inode_t *, int, int); diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index cf6754a..4f4c939 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -594,21 +594,21 @@ xfs_bulkstat( /* * Get the inode cluster buffer */ - ASSERT(xfs_inode_zone != NULL); - ip = kmem_zone_zalloc(xfs_inode_zone, - KM_SLEEP); - ip->i_ino = ino; - ip->i_mount = mp; - spin_lock_init(&ip->i_flags_lock); if (bp) xfs_buf_relse(bp); + ip = xfs_inode_alloc(mp, ino); + if (!ip) { + bp = NULL; + rval = ENOMEM; + break; + } error = xfs_itobp(mp, NULL, ip, &dip, &bp, bno, XFS_IMAP_BULKSTAT, XFS_BUF_LOCK); if (!error) clustidx = ip->i_boffset / mp->m_sb.sb_inodesize; - kmem_zone_free(xfs_inode_zone, ip); + xfs_idestroy(ip); if (XFS_TEST_ERROR(error != 0, mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK, XFS_RANDOM_BULKSTAT_READ_CHUNK)) { -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 00:13:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 00:13:45 -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,J_CHICKENPOX_62, J_CHICKENPOX_66 autolearn=no 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 m7E7Db5G007008 for ; Thu, 14 Aug 2008 00:13:37 -0700 X-ASG-Debug-ID: 1218698087-29e6037f0002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C2663F41E72 for ; Thu, 14 Aug 2008 00:14:53 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id RKejmWtwKASlErlR for ; Thu, 14 Aug 2008 00:14:53 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQDACB4o0h5LAMbiGdsb2JhbACReAEBAQ8goxaBVQ X-IronPort-AV: E=Sophos;i="4.32,207,1217773800"; d="scan'208";a="181938244" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 14 Aug 2008 16:44:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTX2h-0003Vr-U8; Thu, 14 Aug 2008 17:14:43 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Subject: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Date: Thu, 14 Aug 2008 17:14:42 +1000 Message-Id: <1218698083-11226-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218698094 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.2613 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17543 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs To avoid issues with different lifecycles of XFS and Linux inodes, embedd the linux inode inside the XFS inode. This means that the linux inode has the same lifecycle as the XFS inode, even when it has been released by the OS. XFS inodes don't live much longer than this (a short stint in reclaim at most), so there isn't significant memory usage penalties here. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_iops.c | 17 +++- fs/xfs/linux-2.6/xfs_super.c | 71 ++++++++---------- fs/xfs/xfs_iget.c | 168 +++++++++--------------------------------- fs/xfs/xfs_inode.c | 47 +++++++++--- fs/xfs/xfs_inode.h | 9 ++- fs/xfs/xfs_vfsops.c | 1 - fs/xfs/xfs_vnodeops.c | 2 - 7 files changed, 122 insertions(+), 193 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 4209975..f3b66e3 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -64,14 +64,14 @@ xfs_synchronize_atime( { struct inode *inode = VFS_I(ip); - if (inode) { + if (!(inode->i_state & I_CLEAR)) { ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; } } /* - * If the linux inode exists, mark it dirty. + * If the linux inode is valid, mark it dirty. * Used when commiting a dirty inode into a transaction so that * the inode will get written back by the linux code */ @@ -81,7 +81,7 @@ xfs_mark_inode_dirty_sync( { struct inode *inode = VFS_I(ip); - if (inode) + if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR))) mark_inode_dirty_sync(inode); } @@ -815,12 +815,21 @@ xfs_diflags_to_iflags( * When reading existing inodes from disk this is called directly * from xfs_iget, when creating a new inode it is called from * xfs_ialloc after setting up the inode. + * + * We are always called with an uninitialised linux inode here. + * We need to initialise the necessary fields and take a reference + * on it. */ void xfs_setup_inode( struct xfs_inode *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = &ip->i_vnode; + + inode->i_ino = ip->i_ino; + inode->i_state = I_NEW|I_LOCK; + inode_used(ip->i_mount->m_super, inode); + ASSERT(atomic_read(&inode->i_count) == 1); inode->i_mode = ip->i_d.di_mode; inode->i_nlink = ip->i_d.di_nlink; diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 6529d2b..071c109 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -71,7 +71,6 @@ static struct quotactl_ops xfs_quotactl_operations; static struct super_operations xfs_super_operations; -static kmem_zone_t *xfs_vnode_zone; static kmem_zone_t *xfs_ioend_zone; mempool_t *xfs_ioend_pool; @@ -866,29 +865,14 @@ xfsaild_stop( } - +/* XXX: development debug only */ STATIC struct inode * xfs_fs_alloc_inode( struct super_block *sb) { - return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); + BUG(); } -STATIC void -xfs_fs_destroy_inode( - struct inode *inode) -{ - kmem_zone_free(xfs_vnode_zone, inode); -} - -STATIC void -xfs_fs_inode_init_once( - void *vnode) -{ - inode_init_once((struct inode *)vnode); -} - - /* * Slab object creation initialisation for the XFS inode. * This covers only the idempotent fields in the XFS inode; @@ -897,13 +881,18 @@ xfs_fs_inode_init_once( * fields in the xfs inode that left in the initialise state * when freeing the inode. */ -void -xfs_inode_init_once( +STATIC void +xfs_fs_inode_init_once( void *inode) { struct xfs_inode *ip = inode; memset(ip, 0, sizeof(struct xfs_inode)); + + /* vfs inode */ + inode_init_once(VFS_I(ip)); + + /* xfs inode */ atomic_set(&ip->i_iocount, 0); atomic_set(&ip->i_pincount, 0); spin_lock_init(&ip->i_flags_lock); @@ -917,6 +906,17 @@ xfs_inode_init_once( } /* + * we need to provide an empty inode free function to prevent + * the generic code from trying to free ouuur combined inode. + */ +STATIC void +xfs_fs_destroy_inode( + struct inode *inode) +{ + return; +} + +/* * The inode has been marked dirty at the VFS. because we are using unhashed * inodes now, we have to move the inode to the sb->s_dirty_list ourselves as * the caller will not do it for unhashed inodes. @@ -931,6 +931,7 @@ xfs_fs_dirty_inode( { extern spinlock_t inode_lock; + BUG_ON(inode->i_state & (I_FREEING|I_CLEAR)); if (inode->i_state & I_DIRTY) return; @@ -986,13 +987,15 @@ xfs_fs_drop_inode( { extern spinlock_t inode_lock; + /* + * remove the inode from the dirty list first so writeback can't race + * with us as writeback uses __iget() which ignores the fact the inode + * might be in reclaim. + */ + list_del_init(&inode->i_list); + /* this is munged from generic_forget_inode */ if (inode->i_nlink) { - /* - * remove the inode from the dirty list first so writeback - * can't race with us as we drop the inode lock here. - */ - list_del_init(&inode->i_list); inode->i_state |= I_WILL_FREE; spin_unlock(&inode_lock); write_inode_now(inode, 1); @@ -1024,8 +1027,6 @@ xfs_fs_clear_inode( if (xfs_reclaim(ip)) panic("%s: cannot reclaim 0x%p\n", __func__, inode); } - - ASSERT(XFS_I(inode) == NULL); } STATIC void @@ -1879,16 +1880,10 @@ xfs_free_trace_bufs(void) STATIC int __init xfs_init_zones(void) { - xfs_vnode_zone = kmem_zone_init_flags(sizeof(struct inode), "xfs_vnode", - KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | - KM_ZONE_SPREAD, - xfs_fs_inode_init_once); - if (!xfs_vnode_zone) - goto out; xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend"); if (!xfs_ioend_zone) - goto out_destroy_vnode_zone; + goto out; xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE, xfs_ioend_zone); @@ -1904,6 +1899,7 @@ xfs_init_zones(void) "xfs_bmap_free_item"); if (!xfs_bmap_free_item_zone) goto out_destroy_log_ticket_zone; + xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t), "xfs_btree_cur"); if (!xfs_btree_cur_zone) @@ -1951,8 +1947,8 @@ xfs_init_zones(void) xfs_inode_zone = kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode", - KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | - KM_ZONE_SPREAD, xfs_inode_init_once); + KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD, + xfs_fs_inode_init_once); if (!xfs_inode_zone) goto out_destroy_efi_zone; @@ -2000,8 +1996,6 @@ xfs_init_zones(void) mempool_destroy(xfs_ioend_pool); out_destroy_ioend_zone: kmem_zone_destroy(xfs_ioend_zone); - out_destroy_vnode_zone: - kmem_zone_destroy(xfs_vnode_zone); out: return -ENOMEM; } @@ -2026,7 +2020,6 @@ xfs_destroy_zones(void) kmem_zone_destroy(xfs_log_ticket_zone); mempool_destroy(xfs_ioend_pool); kmem_zone_destroy(xfs_ioend_zone); - kmem_zone_destroy(xfs_vnode_zone); } diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 1f539f9..d31b021 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -44,77 +44,65 @@ */ static int xfs_iget_cache_hit( - struct inode *inode, struct xfs_perag *pag, struct xfs_inode *ip, int flags, int lock_flags) __releases(pag->pag_ici_lock) { struct xfs_mount *mp = ip->i_mount; - struct inode *old_inode; int error = 0; /* * If INEW is set this inode is being set up + * If IRECLAIM is set this inode is being torn down * Pause and try again. */ - if (xfs_iflags_test(ip, XFS_INEW)) { + if (xfs_iflags_test(ip, (XFS_INEW|XFS_IRECLAIM))) { error = EAGAIN; XFS_STATS_INC(xs_ig_frecycle); goto out_error; } - old_inode = ip->i_vnode; - if (old_inode == NULL) { + /* If IRECLAIMABLE is set, we've torn down the vfs inode part */ + if (xfs_iflags_test(ip, XFS_IRECLAIMABLE)) { + /* - * If IRECLAIM is set this inode is - * on its way out of the system, - * we need to pause and try again. + * If lookup is racing with unlink, then we should return an + * error immediately so we don't remove it from the reclaim + * list and potentially leak the inode. */ - if (xfs_iflags_test(ip, XFS_IRECLAIM)) { - error = EAGAIN; - XFS_STATS_INC(xs_ig_frecycle); + + if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { + error = ENOENT; goto out_error; } - ASSERT(xfs_iflags_test(ip, XFS_IRECLAIMABLE)); + + xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); /* - * If lookup is racing with unlink, then we - * should return an error immediately so we - * don't remove it from the reclaim list and - * potentially leak the inode. + * We need to re-initialise the VFS inode as it has been + * 'freed' by the VFS. Do this here so we can deal with + * errors cleanly, then tag it so it can be set up correctly + * later. */ - if ((ip->i_d.di_mode == 0) && - !(flags & XFS_IGET_CREATE)) { - error = ENOENT; + if (!inode_init_always(mp->m_super, VFS_I(ip))) { + error = ENOMEM; goto out_error; } - xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); - + xfs_iflags_set(ip, XFS_INEW); xfs_iflags_clear(ip, XFS_IRECLAIMABLE); read_unlock(&pag->pag_ici_lock); XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); XFS_MOUNT_IUNLOCK(mp); - - } else if (inode != old_inode) { - /* The inode is being torn down, pause and - * try again. - */ - if (old_inode->i_state & (I_FREEING | I_CLEAR)) { - error = EAGAIN; - XFS_STATS_INC(xs_ig_frecycle); - goto out_error; - } -/* Chances are the other vnode (the one in the inode) is being torn -* down right now, and we landed on top of it. Question is, what do -* we do? Unhook the old inode and hook up the new one? -*/ - cmn_err(CE_PANIC, - "xfs_iget_core: ambiguous vns: vp/0x%p, invp/0x%p", - old_inode, inode); + } else if (!igrab(VFS_I(ip))) { + /* If the VFS inode is being torn down, pause and try again. */ + error = EAGAIN; + XFS_STATS_INC(xs_ig_frecycle); + goto out_error; } else { + /* we've got a live one */ read_unlock(&pag->pag_ici_lock); } @@ -214,11 +202,11 @@ out_destroy: /* * Look up an inode by number in the given file system. * The inode is looked up in the cache held in each AG. - * If the inode is found in the cache, attach it to the provided - * vnode. + * If the inode is found in the cache, initialise the vfs inode + * if necessary. * * If it is not in core, read it in from the file system's device, - * add it to the cache and attach the provided vnode. + * add it to the cache and initialise the vfs inode. * * The inode is locked according to the value of the lock_flags parameter. * This flag parameter indicates how and if the inode's IO lock and inode lock @@ -235,9 +223,8 @@ out_destroy: * bno -- the block number starting the buffer containing the inode, * if known (as by bulkstat), else 0. */ -STATIC int -xfs_iget_core( - struct inode *inode, +int +xfs_iget( xfs_mount_t *mp, xfs_trans_t *tp, xfs_ino_t ino, @@ -268,7 +255,7 @@ again: ip = radix_tree_lookup(&pag->pag_ici_root, agino); if (ip) { - error = xfs_iget_cache_hit(inode, pag, ip, flags, lock_flags); + error = xfs_iget_cache_hit(pag, ip, flags, lock_flags); if (error) goto out_error_or_again; } else { @@ -282,23 +269,17 @@ again: } xfs_put_perag(mp, pag); - ASSERT(ip->i_df.if_ext_max == - XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); - xfs_iflags_set(ip, XFS_IMODIFIED); *ipp = ip; - /* - * Set up the Linux with the Linux inode. - */ - ip->i_vnode = inode; - inode->i_private = ip; - + ASSERT(ip->i_df.if_ext_max == + XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); /* * If we have a real type for an on-disk inode, we can set ops(&unlock) * now. If it's a new inode being created, xfs_ialloc will handle it. */ - if (ip->i_d.di_mode != 0) + //if (ip->i_d.di_mode != 0 || xfs_iflags_test(ip, XFS_INEW)) + if (xfs_iflags_test(ip, XFS_INEW) && ip->i_d.di_mode != 0) xfs_setup_inode(ip); return 0; @@ -313,75 +294,6 @@ out_error_or_again: /* - * The 'normal' internal xfs_iget, if needed it will - * 'allocate', or 'get', the vnode. - */ -int -xfs_iget( - xfs_mount_t *mp, - xfs_trans_t *tp, - xfs_ino_t ino, - uint flags, - uint lock_flags, - xfs_inode_t **ipp, - xfs_daddr_t bno) -{ - struct inode *inode; - xfs_inode_t *ip; - int error; - - XFS_STATS_INC(xs_ig_attempts); - -retry: - inode = iget_locked(mp->m_super, ino); - if (!inode) - /* If we got no inode we are out of memory */ - return ENOMEM; - - if (inode->i_state & I_NEW) { - XFS_STATS_INC(vn_active); - XFS_STATS_INC(vn_alloc); - - error = xfs_iget_core(inode, mp, tp, ino, flags, - lock_flags, ipp, bno); - if (error) { - make_bad_inode(inode); - if (inode->i_state & I_NEW) - unlock_new_inode(inode); - iput(inode); - } - return error; - } - - /* - * If the inode is not fully constructed due to - * filehandle mismatches wait for the inode to go - * away and try again. - * - * iget_locked will call __wait_on_freeing_inode - * to wait for the inode to go away. - */ - if (is_bad_inode(inode)) { - iput(inode); - delay(1); - goto retry; - } - - ip = XFS_I(inode); - if (!ip) { - iput(inode); - delay(1); - goto retry; - } - - if (lock_flags != 0) - xfs_ilock(ip, lock_flags); - XFS_STATS_INC(xs_ig_found); - *ipp = ip; - return 0; -} - -/* * Look for the inode corresponding to the given ino in the hash table. * If it is there and its i_transp pointer matches tp, return it. * Otherwise, return NULL. @@ -482,14 +394,6 @@ xfs_ireclaim(xfs_inode_t *ip) XFS_QM_DQDETACH(ip->i_mount, ip); /* - * Pull our behavior descriptor from the vnode chain. - */ - if (ip->i_vnode) { - ip->i_vnode->i_private = NULL; - ip->i_vnode = NULL; - } - - /* * Free all memory associated with the inode. */ xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index e2ac32c..650af1d 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -811,6 +811,16 @@ xfs_inode_alloc( ASSERT(!spin_is_locked(&ip->i_flags_lock)); ASSERT(list_empty(&ip->i_reclaim)); + /* + * initialise the VFS inode here to get failures + * out of the way early. + */ + if (!inode_init_always(mp->m_super, VFS_I(ip))) { + kmem_zone_free(xfs_inode_zone, ip); + return NULL; + } + + /* initialise the xfs inode */ ip->i_ino = ino; ip->i_mount = mp; ip->i_blkno = 0; @@ -1084,6 +1094,7 @@ xfs_ialloc( xfs_inode_t *ip; uint flags; int error; + int filestreams = 0; /* * Call the space management code to pick @@ -1091,9 +1102,8 @@ xfs_ialloc( */ error = xfs_dialloc(tp, pip ? pip->i_ino : 0, mode, okalloc, ialloc_context, call_again, &ino); - if (error != 0) { + if (error) return error; - } if (*call_again || ino == NULLFSINO) { *ipp = NULL; return 0; @@ -1107,9 +1117,8 @@ xfs_ialloc( */ error = xfs_trans_iget(tp->t_mountp, tp, ino, XFS_IGET_CREATE, XFS_ILOCK_EXCL, &ip); - if (error != 0) { + if (error) return error; - } ASSERT(ip != NULL); ip->i_d.di_mode = (__uint16_t)mode; @@ -1164,7 +1173,6 @@ xfs_ialloc( ip->i_size = 0; ip->i_d.di_nextents = 0; ASSERT(ip->i_d.di_nblocks == 0); - xfs_ichgtime(ip, XFS_ICHGTIME_CHG|XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD); /* * di_gen will have been taken care of in xfs_iread. */ @@ -1184,13 +1192,12 @@ xfs_ialloc( flags |= XFS_ILOG_DEV; break; case S_IFREG: - if (pip && xfs_inode_is_filestream(pip)) { - error = xfs_filestream_associate(pip, ip); - if (error < 0) - return -error; - if (!error) - xfs_iflags_set(ip, XFS_IFILESTREAM); - } + /* + * we can't set up filestreams until after the VFS inode + * is set up properly. + */ + if (pip && xfs_inode_is_filestream(pip)) + filestreams = 1; /* fall through */ case S_IFDIR: if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { @@ -1256,6 +1263,18 @@ xfs_ialloc( /* now that we have an i_mode we can setup inode ops and unlock */ xfs_setup_inode(ip); + /* now we have set up the vfs inode we can set the timestamps */ + xfs_ichgtime(ip, XFS_ICHGTIME_CHG|XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD); + + /* now we have set up the vfs inode we can associate the filestream */ + if (filestreams) { + error = xfs_filestream_associate(pip, ip); + if (error < 0) + return -error; + if (!error) + xfs_iflags_set(ip, XFS_IFILESTREAM); + } + *ipp = ip; return 0; } @@ -2646,6 +2665,10 @@ xfs_idestroy_fork( * It must free the inode itself and any buffers allocated for * if_extents/if_data and if_broot. It must also free the lock * associated with the inode. + * + * Note: because we don't initialise everything on reallocation out + * of the zone, we must ensure we nullify everything correctly before + * freeing the structure. */ void xfs_idestroy( diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index d75c820..807f314 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -196,7 +196,6 @@ typedef struct xfs_inode { /* Inode linking and identification information. */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ - struct inode *i_vnode; /* vnode backpointer */ struct xfs_dquot *i_udquot; /* user dquot */ struct xfs_dquot *i_gdquot; /* group dquot */ @@ -230,6 +229,10 @@ typedef struct xfs_inode { xfs_fsize_t i_size; /* in-memory size */ xfs_fsize_t i_new_size; /* size when write completes */ atomic_t i_iocount; /* outstanding I/O count */ + + /* VFS inode */ + struct inode i_vnode; /* embedded VFS inode */ + /* Trace buffers per inode. */ #ifdef XFS_INODE_TRACE struct ktrace *i_trace; /* general inode trace */ @@ -257,13 +260,13 @@ typedef struct xfs_inode { /* Convert from vfs inode to xfs inode */ static inline struct xfs_inode *XFS_I(struct inode *inode) { - return (struct xfs_inode *)inode->i_private; + return container_of(inode, struct xfs_inode, i_vnode); } /* convert from xfs inode to vfs inode */ static inline struct inode *VFS_I(struct xfs_inode *ip) { - return (struct inode *)ip->i_vnode; + return (struct inode *)&ip->i_vnode; } /* diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 0c5ee5e..e3ba519 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -58,7 +58,6 @@ #include "xfs_utils.h" #include "xfs_sync.h" - STATIC void xfs_quiesce_fs( xfs_mount_t *mp) diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 19831ee..d36e5bc 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2809,8 +2809,6 @@ xfs_reclaim( XFS_MOUNT_ILOCK(mp); spin_lock(&ip->i_flags_lock); __xfs_iflags_set(ip, XFS_IRECLAIMABLE); - VFS_I(ip)->i_private = NULL; - ip->i_vnode = NULL; spin_unlock(&ip->i_flags_lock); list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); XFS_MOUNT_IUNLOCK(mp); -- 1.5.6 From owner-xfs@oss.sgi.com Thu Aug 14 04:20:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 04:20:37 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EBK7Lf031093 for ; Thu, 14 Aug 2008 04:20:08 -0700 X-ASG-Debug-ID: 1218712884-38ab028a0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 679FE19D9395 for ; Thu, 14 Aug 2008 04:21:24 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id 3t0IoUAL7d3XmA59 for ; Thu, 14 Aug 2008 04:21:24 -0700 (PDT) Received: from shambhala.lichtvoll.local (DSL01.83.171.186.232.ip-pool.NEFkom.net [83.171.186.232]) by mail.lichtvoll.de (Postfix) with ESMTP id 57EE25AE1C; Thu, 14 Aug 2008 13:21:22 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com, lachlan@sgi.com X-ASG-Orig-Subj: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Subject: Re: TAKE 985525 - Fix use after free in xfs_log_done(). Date: Thu, 14 Aug 2008 13:21:22 +0200 User-Agent: KMail/1.9.9 References: <20080812044629.B2DE858C52A4@chook.melbourne.sgi.com> <200808131115.03350.Martin@lichtvoll.de> <48A38550.4030102@sgi.com> (sfid-20080814_131859_502892_BDBAE707) In-Reply-To: <48A38550.4030102@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808141321.23164.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1218712885 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2630 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17547 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Donnerstag 14 August 2008 schrieb Lachlan McIlroy: > Martin Steigerwald wrote: > > Am Dienstag 12 August 2008 schrieb Martin Steigerwald: > >> Am Dienstag 12 August 2008 schrieb Lachlan McIlroy: > >>> Fix use after free in xfs_log_done(). > >>> > >>> The ticket allocation code got reworked in 2.6.26 and we now free > >>> tickets whereas before we used to cache them so the use-after-free > >>> went undetected. > >> > >> Is this intended to go to stable tree? > >> > >> How serious is this? I intend to update my laptops to 2.6.26. > > > > Nevermind, I just applied the patch. > > Okay. > > We've only seen this bug once and I'm surprised it happened at all > so I wouldn't consider it a serious problem. The fix appears to be trivial, so it might still be a good patch for stable tree. So far all runs well on my IBM ThinkPads T42 and T23 with 2.6.26.2, tuxonice 3.0rc7a and that patch. -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Thu Aug 14 08:44:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 08:44:09 -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=0.4 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=no 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 m7EFi3aI016717 for ; Thu, 14 Aug 2008 08:44:05 -0700 X-ASG-Debug-ID: 1218728720-4f5e00fc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from edna.telenet-ops.be (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0E867F45090 for ; Thu, 14 Aug 2008 08:45:20 -0700 (PDT) Received: from edna.telenet-ops.be (edna.telenet-ops.be [195.130.132.58]) by cuda.sgi.com with ESMTP id lBAfI7mbHPuOQkgQ for ; Thu, 14 Aug 2008 08:45:20 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by edna.telenet-ops.be (Postfix) with SMTP id E4BD0E404D; Thu, 14 Aug 2008 17:45:19 +0200 (CEST) Received: from anakin.of.borg (d54C15368.access.telenet.be [84.193.83.104]) by edna.telenet-ops.be (Postfix) with ESMTP id 7C13DE403F; Thu, 14 Aug 2008 17:45:19 +0200 (CEST) Received: from anakin.of.borg (localhost [127.0.0.1]) by anakin.of.borg (8.14.3/8.14.3/Debian-5) with ESMTP id m7EFjJq0005410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Aug 2008 17:45:19 +0200 Received: from localhost (geert@localhost) by anakin.of.borg (8.14.3/8.14.3/Submit) with ESMTP id m7EFjIuU005407; Thu, 14 Aug 2008 17:45:18 +0200 X-Authentication-Warning: anakin.of.borg: geert owned process doing -bs Date: Thu, 14 Aug 2008 17:45:18 +0200 (CEST) From: Geert Uytterhoeven To: Lachlan McIlroy , David Chinner cc: Linus Torvalds , Linux Kernel Development , xfs@oss.sgi.com, Andrew Morton , Linux/m68k X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27-rc4 Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 In-Reply-To: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> Message-ID: References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: edna.telenet-ops.be[195.130.132.58] X-Barracuda-Start-Time: 1218728722 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: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2647 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17548 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: geert@linux-m68k.org Precedence: bulk X-list: xfs On Wed, 13 Aug 2008, Lachlan McIlroy wrote: > The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: > Linus Torvalds (1): > Linux 2.6.27-rc3 > > are available in the git repository at: > > git://oss.sgi.com:8090/xfs/linux-2.6 master > > David Chinner (12): > [XFS] extend completions to provide XFS object flush requirements This change (commit 39d2f1ab2a36ac527a6c41cfe689f50c239eaca3) seems to have broken the m68k build: | CC arch/m68k/kernel/asm-offsets.s | In file included from linux/include/linux/mm_types.h:12, | from linux/include/linux/sched.h:61, | from linux/arch/m68k/kernel/asm-offsets.c:12: | linux/include/linux/completion.h: In function 'try_wait_for_completion': | linux/include/linux/completion.h:80: error: dereferencing pointer to incomplete type | linux/include/linux/completion.h: In function 'completion_done': | linux/include/linux/completion.h:99: error: dereferencing pointer to incomplete type | make[3]: *** [arch/m68k/kernel/asm-offsets.s] Error 1 | make[2]: *** [prepare0] Error 2 | make[1]: *** [sub-make] Error 2 (cfr. http://kisskb.ellerman.id.au/kisskb/buildresult/42080/) Apparently there was not sufficient time between entering linux-next and Linus' tree to notice this breakage before, while the original patch was already posted on July 11... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From owner-xfs@oss.sgi.com Thu Aug 14 11:04:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 11:04:50 -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 (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 m7EI4jVw023597 for ; Thu, 14 Aug 2008 11:04:47 -0700 X-ASG-Debug-ID: 1218737163-70a800610000-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 D5A58F46089 for ; Thu, 14 Aug 2008 11:06:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id VJhxkOWTf3umwfCR for ; Thu, 14 Aug 2008 11:06:03 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KThD1-0004Mk-7q; Thu, 14 Aug 2008 18:06:03 +0000 Date: Thu, 14 Aug 2008 14:06:03 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Fix reference counting race on log buffers Subject: Re: [PATCH] Fix reference counting race on log buffers Message-ID: <20080814180603.GA3087@infradead.org> References: <1215752481-6862-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1215752481-6862-1-git-send-email-david@fromorbit.com> 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: 1218737163 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.2657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17549 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 Btw, while this patch made it to mainline it never went into the oss cvs tree (and thus probably the ptools tree). There also are a lot of other difference between the trees, I'll see how to get them back into sync.. From owner-xfs@oss.sgi.com Thu Aug 14 11:07:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 11:07:41 -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 (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 m7EI7dfJ024018 for ; Thu, 14 Aug 2008 11:07:39 -0700 X-ASG-Debug-ID: 1218737337-5cb402270000-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 71540F4617E for ; Thu, 14 Aug 2008 11:08:57 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id l3yh1ahJWHuXiGMT for ; Thu, 14 Aug 2008 11:08:57 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KThFo-000831-Si for xfs@oss.sgi.com; Thu, 14 Aug 2008 18:08:56 +0000 Date: Thu, 14 Aug 2008 14:08:56 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: endianess macros Subject: endianess macros Message-ID: <20080814180856.GB3087@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218737337 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.2657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17550 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 This commit: commit 413d57c9907c72ed608df2be72ef8ed13a3eeb46 Author: Marcin Slusarz Date: Wed Feb 13 15:03:29 2008 -0800 xfs: convert beX_add to beX_add_cpu (new common API) remove beX_add functions and replace all uses with beX_add_cpu which is in Linus tree never made it to the oss cvs tree. It's doing this little change all over the place, so having it in both trees would be really useful.. From owner-xfs@oss.sgi.com Thu Aug 14 11:29:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 11:29:22 -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 (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 m7EITJFp025319 for ; Thu, 14 Aug 2008 11:29:19 -0700 X-ASG-Debug-ID: 1218738636-56ff03960000-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 A030F255009 for ; Thu, 14 Aug 2008 11:30:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 6AVwvYRc4RrXEYOX for ; Thu, 14 Aug 2008 11:30:37 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTham-0005ma-1G; Thu, 14 Aug 2008 18:30:36 +0000 Date: Thu, 14 Aug 2008 14:30:36 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V4 Subject: Re: [PATCH 0/6] XFS: replace the mount inode list with radix tree traversals V4 Message-ID: <20080814183035.GA21842@infradead.org> References: <1218696299-10572-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218696299-10572-1-git-send-email-david@fromorbit.com> 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: 1218738637 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.2657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17551 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 The whole series looks good to me. From owner-xfs@oss.sgi.com Thu Aug 14 11:58:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 11:58:47 -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 m7EIwiQx026835 for ; Thu, 14 Aug 2008 11:58:44 -0700 X-ASG-Debug-ID: 1218740401-0e3a01d90000-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 760F539B290 for ; Thu, 14 Aug 2008 12:00:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 8ZrHWf9FbcJona5r for ; Thu, 14 Aug 2008 12:00:02 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTi3F-000740-G4; Thu, 14 Aug 2008 19:00:01 +0000 Date: Thu, 14 Aug 2008 15:00:01 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Subject: Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Message-ID: <20080814190001.GA19070@infradead.org> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-6-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218698083-11226-6-git-send-email-david@fromorbit.com> 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: 1218740402 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.2660 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17552 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 Thu, Aug 14, 2008 at 05:14:41PM +1000, Dave Chinner wrote: > To avoid having to initialise some fields of the XFS inode > on every allocation, we can use the slab init-once feature > to initialise them. All we have to guarantee is that when > we free the inode, all it's entries are in the initial state. > Add asserts where possible to ensure debug kernels check this > initial state before freeing and after allocation. Looks good, and I think it this can be moved before the series and submitted ASAP. > diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c > index cf6754a..4f4c939 100644 > --- a/fs/xfs/xfs_itable.c > +++ b/fs/xfs/xfs_itable.c > @@ -594,21 +594,21 @@ xfs_bulkstat( > /* > * Get the inode cluster buffer > */ > - ASSERT(xfs_inode_zone != NULL); > - ip = kmem_zone_zalloc(xfs_inode_zone, > - KM_SLEEP); > - ip->i_ino = ino; > - ip->i_mount = mp; > - spin_lock_init(&ip->i_flags_lock); > if (bp) > xfs_buf_relse(bp); > + ip = xfs_inode_alloc(mp, ino); > + if (!ip) { > + bp = NULL; > + rval = ENOMEM; > + break; > + } > error = xfs_itobp(mp, NULL, ip, > &dip, &bp, bno, > XFS_IMAP_BULKSTAT, > XFS_BUF_LOCK); Yikes, what a mess - eventually we should convert this to opencoded cals to xfs_imap and xfs_imap_to_bp, but before the function needs to be split into manageable chunk. Another item on the todo list.. From owner-xfs@oss.sgi.com Thu Aug 14 12:44:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 12:44:36 -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 (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 m7EJiXBJ001371 for ; Thu, 14 Aug 2008 12:44:33 -0700 X-ASG-Debug-ID: 1218743151-095803d80000-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 F1634E32185 for ; Thu, 14 Aug 2008 12:45:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id qrELlUbkIdHxdQef for ; Thu, 14 Aug 2008 12:45:51 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTila-00040q-SJ; Thu, 14 Aug 2008 19:45:50 +0000 Date: Thu, 14 Aug 2008 15:45:50 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/7] RFC: combine linux and XFS inodes Subject: Re: [PATCH 0/7] RFC: combine linux and XFS inodes Message-ID: <20080814194550.GA12237@infradead.org> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218698083-11226-1-git-send-email-david@fromorbit.com> 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: 1218743151 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.2663 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17553 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 Thu, Aug 14, 2008 at 05:14:36PM +1000, Dave Chinner wrote: > However, this means the linux inodes are unhashed, which means we > now need to do our own tracking of dirty state. We do this by > hooking ->dirty_inode and ->set_page_dirty to move the inode to the > superblock dirty list when appropriate. We also need to hook > ->drop_inode to ensure we do writeback of dirty inodes during > reclaim. In future, this can be moved entirely into XFS based on > radix tree tags to track dirty inodes instead of a separate list. This part (patches 1, 2 and 3) is horrible, and I think avoidable. We can just insert the inode into the Linux inode hash anyway, even if we never use it later. That avoids these whole three patches and all the duplication of core code inside XFS, including the inode_lock issue and the potential problem of getting out of sync when the core code is updated. If you really, really want to avoid inserting the inode into the Linux inode cache (and that would need a sound reason) the way to go would be to remove the assumptions of no writeback for unhashed inodes form the core code and replace it with a flag that's normally set/cleared during hashing/unhashing but could also be set/cleared from XFS. From owner-xfs@oss.sgi.com Thu Aug 14 12:45:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 12:45:45 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EJjhJq001612 for ; Thu, 14 Aug 2008 12:45:44 -0700 X-ASG-Debug-ID: 1218743222-5f3102790000-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 5EF9A19E2E75 for ; Thu, 14 Aug 2008 12:47:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id G3evAAsI7ZcKEZRP for ; Thu, 14 Aug 2008 12:47:02 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTimk-000426-42; Thu, 14 Aug 2008 19:47:02 +0000 Date: Thu, 14 Aug 2008 15:47:02 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Subject: Re: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Message-ID: <20080814194702.GB12237@infradead.org> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218698083-11226-5-git-send-email-david@fromorbit.com> 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: 1218743222 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.2662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17554 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 Thu, Aug 14, 2008 at 05:14:40PM +1000, Dave Chinner wrote: > Once the Linux inode and the XFS inode are combined, we cannot rely > on just check if the linux inode exists as a method of determining > if it is valid or not. Hence we should always call > xfs_mark_inode_dirty_sync() instead as it does the correct checks to > determine if the liinux inode is in a valid state or not. Makes sense, and another candidate to put at the beginning of the series or rather just put in now. From owner-xfs@oss.sgi.com Thu Aug 14 12:58:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 12:58:51 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EJwm1R002785 for ; Thu, 14 Aug 2008 12:58:49 -0700 X-ASG-Debug-ID: 1218744006-5f3403220000-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 D82A219E2CFA for ; Thu, 14 Aug 2008 13:00:06 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id DkGIBLbhPLkt4tMD for ; Thu, 14 Aug 2008 13:00:06 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTizO-0005Oi-GT; Thu, 14 Aug 2008 20:00:06 +0000 Date: Thu, 14 Aug 2008 16:00:06 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Subject: Re: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Message-ID: <20080814200006.GC12237@infradead.org> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-7-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218698083-11226-7-git-send-email-david@fromorbit.com> 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: 1218744006 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17555 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 > + if (!(inode->i_state & I_CLEAR)) { > ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; > ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; > } Actually we can just do this unconditionally, as the atime values don't become invalid just because the VFS doesn't know about the inode anymore. And two useless because already previously updated assignments are cheaper than a branch. > + * We are always called with an uninitialised linux inode here. > + * We need to initialise the necessary fields and take a reference > + * on it. > */ > void > xfs_setup_inode( > struct xfs_inode *ip) > { > - struct inode *inode = ip->i_vnode; > + struct inode *inode = &ip->i_vnode; VFS_I? > + inode->i_ino = ip->i_ino; > + inode->i_state = I_NEW|I_LOCK; > + inode_used(ip->i_mount->m_super, inode); > + ASSERT(atomic_read(&inode->i_count) == 1); Where does inode_used come from? (It's also a rather ugly name..) > +/* XXX: development debug only */ > STATIC struct inode * > xfs_fs_alloc_inode( > struct super_block *sb) > { > - return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > + BUG(); > } Actually keeping this one is a good idea, even if it's just to catch really dumb things like the iget_locked OpenAFS's cache manager does on random filesystems.. > -void > -xfs_inode_init_once( > +STATIC void > +xfs_fs_inode_init_once( might be a good idea to already use that name in the patch that introduces it :) > /* > + * we need to provide an empty inode free function to prevent > + * the generic code from trying to free ouuur combined inode. > + */ > +STATIC void > +xfs_fs_destroy_inode( > + struct inode *inode) > +{ > + return; > +} Why it's this kept in the original place, close to alloc_inode? Also the return statement is superflous. > /* convert from xfs inode to vfs inode */ > static inline struct inode *VFS_I(struct xfs_inode *ip) > { > - return (struct inode *)ip->i_vnode; > + return (struct inode *)&ip->i_vnode; > } No need for the cast in either version.. From owner-xfs@oss.sgi.com Thu Aug 14 13:09:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:09:07 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EK94NA003518 for ; Thu, 14 Aug 2008 13:09:05 -0700 X-ASG-Debug-ID: 1218744622-5f3b03820000-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 A737619E30A9 for ; Thu, 14 Aug 2008 13:10:22 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 7alBUVvUyjBcIcjj for ; Thu, 14 Aug 2008 13:10:22 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTj9K-0006Nv-20; Thu, 14 Aug 2008 20:10:22 +0000 Date: Thu, 14 Aug 2008 16:10:22 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 7/7] XFS: don't use vnodes where unnecessary Subject: Re: [PATCH 7/7] XFS: don't use vnodes where unnecessary Message-ID: <20080814201022.GA20557@infradead.org> References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-8-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218698083-11226-8-git-send-email-david@fromorbit.com> 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: 1218744622 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17556 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 > do { > + struct inode *inode; > + boolean_t vnode_refed; > + xfs_inode_t *ip = NULL; This should not be inode_refed, no? :) > - vp = VFS_I(ip); > - if (!vp) { > + if (xfs_iflags_test(ip, (XFS_IRECLAIM|XFS_IRECLAIMABLE))) { These changes really need to be folded into the previous patch for bisectability reasons.. > + inode = VFS_I(ip); > + if (VN_BAD(inode)) { Just use is_bad_inode directly. (Also in a few other places) > } else { > - /* safe to unlock here as we have a reference */ > + if (!xfs_ilock_nowait(ip, lock_flags)) { > + /* leave it to reclaim */ > + read_unlock(&pag->pag_ici_lock); > + continue; > + } > read_unlock(&pag->pag_ici_lock); > } Maybe not for this patch, but in general, why do we even bother about the inodes we can't get a reference to, shouldn't we just always leave this to reclaim? > - if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { > + if ((flags & SYNC_DELWRI) && VN_DIRTY(VFS_I(ip))) { Why not use the "inode" variable we have in scope anyway? > + if (!(inode->i_state & I_CLEAR)) > + return atomic_read(&inode->i_count); Well, it's just zero when the inode is out of the vfs, so we could probably simply do it unconditional. > + vp = vn_grab(VFS_I(ip)); > + if (vp) { Please switch this one to igrab, and the inode name, too. As this is the last caller of vn_grab we can kill it now. From owner-xfs@oss.sgi.com Thu Aug 14 13:29:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:29:03 -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 m7EKT09K004835 for ; Thu, 14 Aug 2008 13:29:00 -0700 X-ASG-Debug-ID: 1218745815-43d503330000-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 82773F4AF8B for ; Thu, 14 Aug 2008 13:30:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id P6hi0Km3UuvQgc49 for ; Thu, 14 Aug 2008 13:30:16 -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 m7EKUHIF018668 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 22:30:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKUHFh018666 for xfs@oss.sgi.com; Thu, 14 Aug 2008 22:30:17 +0200 Date: Thu, 14 Aug 2008 22:30:17 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] fix compiler warning in xfsidbg Subject: [PATCH] fix compiler warning in xfsidbg Message-ID: <20080814203017.GA18619@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218745818 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17557 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 attr_list_context.count is a ssize_t adn thus we need to use %zd, not %ld to print it. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-08-14 15:24:38.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-08-14 15:27:20.000000000 -0300 @@ -4171,7 +4171,7 @@ xfsidbg_xattrcontext(xfs_attr_list_conte context->cursor->hashval, context->cursor->blkno, context->cursor->offset, context->cursor->pad1, context->cursor->pad2, context->cursor->initted); - kdb_printf("alist 0x%p, bufsize 0x%x, count %ld, firstu 0x%x\n", + kdb_printf("alist 0x%p, bufsize 0x%x, count %zd, firstu 0x%x\n", context->alist, context->bufsize, context->count, context->firstu); } From owner-xfs@oss.sgi.com Thu Aug 14 13:35:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:35:40 -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 (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 m7EKZZrH005379 for ; Thu, 14 Aug 2008 13:35:35 -0700 X-ASG-Debug-ID: 1218746212-56c4022a0000-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 AC8F339BAE0 for ; Thu, 14 Aug 2008 13:36:52 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id yiGeFY1oEYzDyDDV for ; Thu, 14 Aug 2008 13:36:52 -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 m7EKadIF019026 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 14 Aug 2008 22:36:40 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKaanr019021; Thu, 14 Aug 2008 22:36:36 +0200 Date: Thu, 14 Aug 2008 22:36:36 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: jasper@amiton.co.nz, daniel.blueman@gmail.com X-ASG-Orig-Subj: Re: [PATCH] stop rejecting options in remount Subject: Re: [PATCH] stop rejecting options in remount Message-ID: <20080814203636.GA18704@lst.de> References: <20080809195159.GA8562@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080809195159.GA8562@lst.de> 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: 1218746213 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17558 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 Sat, Aug 09, 2008 at 09:51:59PM +0200, Christoph Hellwig wrote: > Thanks to some not so nice code in mount(8) we can't blindly reject moun > options we don't support to be changed in remount. See the comment in > the code for more details. Here is an updated version with a hopefully better worded comments: Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-14 17:29:03.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-14 17:35:00.000000000 -0300 @@ -1303,9 +1303,29 @@ xfs_fs_remount( mp->m_flags &= ~XFS_MOUNT_BARRIER; break; default: + /* + * Logically we would return an error here to prevent + * users from believing they might have changed + * mount options using remount which can't be changed. + * + * But unfortunately mount(8) adds all options from + * mtab and fstab to the mount arguments in some cases + * so we can't blindly reject options, but have to + * check for each specified option if it actually + * differs from the currently set option and only + * reject it if that's the case. + * + * Until that is implemented we return success for + * every remount request, and silently ignore all + * options that we can't actually change. + */ +#if 0 printk(KERN_INFO "XFS: mount option \"%s\" not supported for remount\n", p); return -EINVAL; +#else + return 0; +#endif } } From owner-xfs@oss.sgi.com Thu Aug 14 13:38:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:38:35 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EKcXSg005820 for ; Thu, 14 Aug 2008 13:38:33 -0700 X-ASG-Debug-ID: 1218746390-57f3015d0000-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 8A81F19E3320 for ; Thu, 14 Aug 2008 13:39:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id LAO00HoXBoTqlVfh for ; Thu, 14 Aug 2008 13:39:51 -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 m7EKdqIF019198 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 22:39:52 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKdqYh019196 for xfs@oss.sgi.com; Thu, 14 Aug 2008 22:39:52 +0200 Date: Thu, 14 Aug 2008 22:39:52 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] use proper mnt_want_write calls for handle ioctls Subject: [PATCH] use proper mnt_want_write calls for handle ioctls Message-ID: <20080814203952.GB18704@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218746391 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17559 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 Since 2.6.26 all writes to filesystems need to be enclosed by a mnt_want_write / mnt_drop_write pair instead of checking for IS_RDONLY. XFs was updated for this in mainline but the changes to xfs_ioctl.c were never megred back into the CVS tree. The original commit introducing this was: commit 42a74f206b914db13ee1f5ae932dcd91a77c8579 Author: Dave Hansen Date: Fri Feb 15 14:37:46 2008 -0800 [PATCH] r/o bind mounts: elevate write count for ioctls() Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-14 14:54:53.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-14 15:15:49.000000000 -0300 @@ -543,8 +543,6 @@ xfs_attrmulti_attr_set( char *kbuf; int error = EFAULT; - if (IS_RDONLY(inode)) - return -EROFS; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) return EPERM; if (len > XATTR_SIZE_MAX) @@ -570,8 +568,6 @@ xfs_attrmulti_attr_remove( char *name, __uint32_t flags) { - if (IS_RDONLY(inode)) - return -EROFS; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) return EPERM; return xfs_attr_remove(XFS_I(inode), name, flags); @@ -581,6 +577,7 @@ STATIC int xfs_attrmulti_by_handle( xfs_mount_t *mp, void __user *arg, + struct file *parfilp, struct inode *parinode) { int error; @@ -634,13 +631,21 @@ xfs_attrmulti_by_handle( &ops[i].am_length, ops[i].am_flags); break; case ATTR_OP_SET: + ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); + if (ops[i].am_error) + break; ops[i].am_error = xfs_attrmulti_attr_set(inode, attr_name, ops[i].am_attrvalue, ops[i].am_length, ops[i].am_flags); + mnt_drop_write(parfilp->f_path.mnt); break; case ATTR_OP_REMOVE: + ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); + if (ops[i].am_error) + break; ops[i].am_error = xfs_attrmulti_attr_remove(inode, attr_name, ops[i].am_flags); + mnt_drop_write(parfilp->f_path.mnt); break; default: ops[i].am_error = EINVAL; @@ -1431,7 +1436,7 @@ xfs_ioctl( return xfs_attrlist_by_handle(mp, arg, inode); case XFS_IOC_ATTRMULTI_BY_HANDLE: - return xfs_attrmulti_by_handle(mp, arg, inode); + return xfs_attrmulti_by_handle(mp, arg, filp, inode); case XFS_IOC_SWAPEXT: { error = xfs_swapext((struct xfs_swapext __user *)arg); From owner-xfs@oss.sgi.com Thu Aug 14 13:46:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:47:00 -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 (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 m7EKkwuB006473 for ; Thu, 14 Aug 2008 13:46:58 -0700 X-ASG-Debug-ID: 1218746895-51e603190000-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 EF97F39BC1B for ; Thu, 14 Aug 2008 13:48:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jIsEMnTNHCpO6pi4 for ; Thu, 14 Aug 2008 13:48:16 -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 m7EKmHIF019767 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 22:48:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKmHXi019765 for xfs@oss.sgi.com; Thu, 14 Aug 2008 22:48:17 +0200 Date: Thu, 14 Aug 2008 22:48:17 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] use generic_file_llseek for directories Subject: [PATCH] use generic_file_llseek for directories Message-ID: <20080814204817.GA19614@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218746896 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17560 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 XFS currently doesn't set up a .llseek for directories and thus defaults to default_llseek. default_llseek only takes the BKL which means there is not exclusion vs xfs_readdir and thus we get a risk of corrupting the file position. Additionally default_llseek only allows seeks to 32bit offsets by default. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_file.c 2008-08-12 18:40:43.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2008-08-12 18:41:49.000000000 -0300 @@ -546,6 +546,7 @@ const struct file_operations xfs_dir_fil .compat_ioctl = xfs_file_compat_ioctl, #endif .fsync = xfs_file_fsync, + .llseek = generic_file_llseek, }; static struct vm_operations_struct xfs_file_vm_ops = { From owner-xfs@oss.sgi.com Thu Aug 14 13:50:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:50:39 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_65 autolearn=no 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 m7EKoaQ8006936 for ; Thu, 14 Aug 2008 13:50:36 -0700 X-ASG-Debug-ID: 1218747113-56c202b40000-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 C231F39BC54 for ; Thu, 14 Aug 2008 13:51:53 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id vvazwTfMq4iUAkEC for ; Thu, 14 Aug 2008 13:51:53 -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 m7EKpsIF019855 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 22:51:54 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKpsMX019853 for xfs@oss.sgi.com; Thu, 14 Aug 2008 22:51:54 +0200 Date: Thu, 14 Aug 2008 22:51:54 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] merge xfs_mkdir into xfs_create Subject: [PATCH] merge xfs_mkdir into xfs_create Message-ID: <20080814205154.GB19614@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218747114 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17561 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 xfs_mkdir is almost the same as xfs_create, with just an additional nlinks check, initialization of the directory btree and a different initial link count and the different transaction type and block reservations resulting from that. So merge xfs_mkdir into xfs_create, and also clean up the error handling which would be even more messy with that addition. Also clean up xfs_vn_mknod now that there is just one lowlevel function left to call. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-08-11 12:17:07.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-08-11 12:18:23.000000000 -0300 @@ -210,8 +210,13 @@ xfs_vn_mknod( * Irix uses Missed'em'V split, but doesn't want to see * the upper 5 bits of (14bit) major. */ - if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) - return -EINVAL; + if (S_ISCHR(mode) || S_ISBLK(mode)) { + if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) + return -EINVAL; + rdev = sysv_encode_dev(rdev); + } else { + rdev = 0; + } if (test_default_acl && test_default_acl(dir)) { if (!_ACL_ALLOC(default_acl)) { @@ -223,28 +228,11 @@ xfs_vn_mknod( } } - xfs_dentry_to_name(&name, dentry); - if (IS_POSIXACL(dir) && !default_acl) mode &= ~current->fs->umask; - switch (mode & S_IFMT) { - case S_IFCHR: - case S_IFBLK: - case S_IFIFO: - case S_IFSOCK: - rdev = sysv_encode_dev(rdev); - case S_IFREG: - error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL); - break; - case S_IFDIR: - error = xfs_mkdir(XFS_I(dir), &name, mode, &ip, NULL); - break; - default: - error = EINVAL; - break; - } - + xfs_dentry_to_name(&name, dentry); + error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL); if (unlikely(error)) goto out_free_acl; Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-08-11 12:17:11.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-08-11 12:17:13.000000000 -0300 @@ -1490,23 +1490,28 @@ xfs_create( xfs_inode_t **ipp, cred_t *credp) { - xfs_mount_t *mp = dp->i_mount; - xfs_inode_t *ip; - xfs_trans_t *tp; + int is_dir = S_ISDIR(mode); + struct xfs_mount *mp = dp->i_mount; + struct xfs_inode *ip = NULL; + struct xfs_trans *tp = NULL; int error; xfs_bmap_free_t free_list; xfs_fsblock_t first_block; boolean_t unlock_dp_on_error = B_FALSE; - int dm_event_sent = 0; uint cancel_flags; int committed; xfs_prid_t prid; - struct xfs_dquot *udqp, *gdqp; + struct xfs_dquot *udqp = NULL; + struct xfs_dquot *gdqp = NULL; uint resblks; + uint log_res; + uint log_count; - ASSERT(!*ipp); xfs_itrace_entry(dp); + if (XFS_FORCED_SHUTDOWN(mp)) + return XFS_ERROR(EIO); + if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, dp, DM_RIGHT_NULL, NULL, @@ -1515,76 +1520,85 @@ xfs_create( if (error) return error; - dm_event_sent = 1; } - if (XFS_FORCED_SHUTDOWN(mp)) - return XFS_ERROR(EIO); - - /* Return through std_return after this point. */ - - udqp = gdqp = NULL; if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) prid = dp->i_d.di_projid; else - prid = (xfs_prid_t)dfltprid; + prid = dfltprid; /* * Make sure that we have allocated dquot(s) on disk. */ error = XFS_QM_DQVOPALLOC(mp, dp, current_fsuid(credp), current_fsgid(credp), prid, - XFS_QMOPT_QUOTALL|XFS_QMOPT_INHERIT, &udqp, &gdqp); + XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); if (error) goto std_return; - ip = NULL; + if (is_dir) { + rdev = 0; + resblks = XFS_MKDIR_SPACE_RES(mp, name->len); + log_res = XFS_MKDIR_LOG_RES(mp); + log_count = XFS_MKDIR_LOG_COUNT; + tp = xfs_trans_alloc(mp, XFS_TRANS_MKDIR); + } else { + resblks = XFS_CREATE_SPACE_RES(mp, name->len); + log_res = XFS_CREATE_LOG_RES(mp); + log_count = XFS_CREATE_LOG_COUNT; + tp = xfs_trans_alloc(mp, XFS_TRANS_CREATE); + } - tp = xfs_trans_alloc(mp, XFS_TRANS_CREATE); cancel_flags = XFS_TRANS_RELEASE_LOG_RES; - resblks = XFS_CREATE_SPACE_RES(mp, name->len); + /* * Initially assume that the file does not exist and * reserve the resources for that case. If that is not * the case we'll drop the one we have and get a more * appropriate transaction later. */ - error = xfs_trans_reserve(tp, resblks, XFS_CREATE_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT); + error = xfs_trans_reserve(tp, resblks, log_res, 0, + XFS_TRANS_PERM_LOG_RES, log_count); if (error == ENOSPC) { resblks = 0; - error = xfs_trans_reserve(tp, 0, XFS_CREATE_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT); + error = xfs_trans_reserve(tp, 0, log_res, 0, + XFS_TRANS_PERM_LOG_RES, log_count); } if (error) { cancel_flags = 0; - goto error_return; + goto out_trans_cancel; } xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); unlock_dp_on_error = B_TRUE; - XFS_BMAP_INIT(&free_list, &first_block); + /* + * Check for directory link count overflow. + */ + if (is_dir && dp->i_d.di_nlink >= XFS_MAXLINK) { + error = XFS_ERROR(EMLINK); + goto out_trans_cancel; + } - ASSERT(ip == NULL); + XFS_BMAP_INIT(&free_list, &first_block); /* * Reserve disk quota and the inode. */ error = XFS_TRANS_RESERVE_QUOTA(mp, tp, udqp, gdqp, resblks, 1, 0); if (error) - goto error_return; + goto out_trans_cancel; error = xfs_dir_canenter(tp, dp, name, resblks); if (error) - goto error_return; - error = xfs_dir_ialloc(&tp, dp, mode, 1, - rdev, credp, prid, resblks > 0, - &ip, &committed); + goto out_trans_cancel; + + error = xfs_dir_ialloc(&tp, dp, mode, is_dir ? 2 : 1, rdev, credp, + prid, resblks > 0, &ip, &committed); if (error) { if (error == ENOSPC) - goto error_return; - goto abort_return; + goto out_trans_cancel; + goto out_trans_abort; } xfs_itrace_ref(ip); @@ -1611,19 +1625,28 @@ xfs_create( resblks - XFS_IALLOC_SPACE_RES(mp) : 0); if (error) { ASSERT(error != ENOSPC); - goto abort_return; + goto out_trans_abort; } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); + if (is_dir) { + error = xfs_dir_init(tp, ip, dp); + if (error) + goto out_bmap_cancel; + + error = xfs_bumplink(tp, dp); + if (error) + goto out_bmap_cancel; + } + /* * If this is a synchronous mount, make sure that the * create transaction goes to disk before returning to * the user. */ - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { + if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) xfs_trans_set_sync(tp); - } /* * Attach the dquot(s) to the inodes and modify them incore. @@ -1640,16 +1663,13 @@ xfs_create( IHOLD(ip); error = xfs_bmap_finish(&tp, &free_list, &committed); - if (error) { - xfs_bmap_cancel(&free_list); - goto abort_rele; - } + if (error) + goto out_abort_rele; error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); if (error) { IRELE(ip); - tp = NULL; - goto error_return; + goto out_dqrele; } XFS_QM_DQRELE(mp, udqp); @@ -1658,26 +1678,22 @@ xfs_create( *ipp = ip; /* Fallthrough to std_return with error = 0 */ - -std_return: - if ((*ipp || (error != 0 && dm_event_sent != 0)) && - DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, - dp, DM_RIGHT_NULL, - *ipp ? ip : NULL, - DM_RIGHT_NULL, name->name, NULL, - mode, error, 0); + std_return: + if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { + XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, dp, DM_RIGHT_NULL, + ip, DM_RIGHT_NULL, name->name, NULL, mode, + error, 0); } + return error; - abort_return: + out_bmap_cancel: + xfs_bmap_cancel(&free_list); + out_trans_abort: cancel_flags |= XFS_TRANS_ABORT; - /* FALLTHROUGH */ - - error_return: - if (tp != NULL) - xfs_trans_cancel(tp, cancel_flags); - + out_trans_cancel: + xfs_trans_cancel(tp, cancel_flags); + out_dqrele: XFS_QM_DQRELE(mp, udqp); XFS_QM_DQRELE(mp, gdqp); @@ -1686,20 +1702,18 @@ std_return: goto std_return; - abort_rele: + out_abort_rele: /* * Wait until after the current transaction is aborted to * release the inode. This prevents recursive transactions * and deadlocks from xfs_inactive. */ + xfs_bmap_cancel(&free_list); cancel_flags |= XFS_TRANS_ABORT; xfs_trans_cancel(tp, cancel_flags); IRELE(ip); - - XFS_QM_DQRELE(mp, udqp); - XFS_QM_DQRELE(mp, gdqp); - - goto std_return; + unlock_dp_on_error = B_FALSE; + goto out_dqrele; } #ifdef DEBUG @@ -2205,209 +2219,6 @@ std_return: goto std_return; } - -int -xfs_mkdir( - xfs_inode_t *dp, - struct xfs_name *dir_name, - mode_t mode, - xfs_inode_t **ipp, - cred_t *credp) -{ - xfs_mount_t *mp = dp->i_mount; - xfs_inode_t *cdp; /* inode of created dir */ - xfs_trans_t *tp; - int cancel_flags; - int error; - int committed; - xfs_bmap_free_t free_list; - xfs_fsblock_t first_block; - boolean_t unlock_dp_on_error = B_FALSE; - boolean_t created = B_FALSE; - int dm_event_sent = 0; - xfs_prid_t prid; - struct xfs_dquot *udqp, *gdqp; - uint resblks; - - if (XFS_FORCED_SHUTDOWN(mp)) - return XFS_ERROR(EIO); - - tp = NULL; - - if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { - error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, - dp, DM_RIGHT_NULL, NULL, - DM_RIGHT_NULL, dir_name->name, NULL, - mode, 0, 0); - if (error) - return error; - dm_event_sent = 1; - } - - /* Return through std_return after this point. */ - - xfs_itrace_entry(dp); - - mp = dp->i_mount; - udqp = gdqp = NULL; - if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) - prid = dp->i_d.di_projid; - else - prid = (xfs_prid_t)dfltprid; - - /* - * Make sure that we have allocated dquot(s) on disk. - */ - error = XFS_QM_DQVOPALLOC(mp, dp, - current_fsuid(credp), current_fsgid(credp), prid, - XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); - if (error) - goto std_return; - - tp = xfs_trans_alloc(mp, XFS_TRANS_MKDIR); - cancel_flags = XFS_TRANS_RELEASE_LOG_RES; - resblks = XFS_MKDIR_SPACE_RES(mp, dir_name->len); - error = xfs_trans_reserve(tp, resblks, XFS_MKDIR_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT); - if (error == ENOSPC) { - resblks = 0; - error = xfs_trans_reserve(tp, 0, XFS_MKDIR_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, - XFS_MKDIR_LOG_COUNT); - } - if (error) { - cancel_flags = 0; - goto error_return; - } - - xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); - unlock_dp_on_error = B_TRUE; - - /* - * Check for directory link count overflow. - */ - if (dp->i_d.di_nlink >= XFS_MAXLINK) { - error = XFS_ERROR(EMLINK); - goto error_return; - } - - /* - * Reserve disk quota and the inode. - */ - error = XFS_TRANS_RESERVE_QUOTA(mp, tp, udqp, gdqp, resblks, 1, 0); - if (error) - goto error_return; - - error = xfs_dir_canenter(tp, dp, dir_name, resblks); - if (error) - goto error_return; - /* - * create the directory inode. - */ - error = xfs_dir_ialloc(&tp, dp, mode, 2, - 0, credp, prid, resblks > 0, - &cdp, NULL); - if (error) { - if (error == ENOSPC) - goto error_return; - goto abort_return; - } - xfs_itrace_ref(cdp); - - /* - * Now we add the directory inode to the transaction. - * We waited until now since xfs_dir_ialloc might start - * a new transaction. Had we joined the transaction - * earlier, the locks might have gotten released. An error - * from here on will result in the transaction cancel - * unlocking dp so don't do it explicitly in the error path. - */ - IHOLD(dp); - xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); - unlock_dp_on_error = B_FALSE; - - XFS_BMAP_INIT(&free_list, &first_block); - - error = xfs_dir_createname(tp, dp, dir_name, cdp->i_ino, - &first_block, &free_list, resblks ? - resblks - XFS_IALLOC_SPACE_RES(mp) : 0); - if (error) { - ASSERT(error != ENOSPC); - goto error1; - } - xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - - error = xfs_dir_init(tp, cdp, dp); - if (error) - goto error2; - - error = xfs_bumplink(tp, dp); - if (error) - goto error2; - - created = B_TRUE; - - *ipp = cdp; - IHOLD(cdp); - - /* - * Attach the dquots to the new inode and modify the icount incore. - */ - XFS_QM_DQVOPCREATE(mp, tp, cdp, udqp, gdqp); - - /* - * If this is a synchronous mount, make sure that the - * mkdir transaction goes to disk before returning to - * the user. - */ - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { - xfs_trans_set_sync(tp); - } - - error = xfs_bmap_finish(&tp, &free_list, &committed); - if (error) { - IRELE(cdp); - goto error2; - } - - error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); - XFS_QM_DQRELE(mp, udqp); - XFS_QM_DQRELE(mp, gdqp); - if (error) { - IRELE(cdp); - } - - /* Fall through to std_return with error = 0 or errno from - * xfs_trans_commit. */ - -std_return: - if ((created || (error != 0 && dm_event_sent != 0)) && - DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, - dp, DM_RIGHT_NULL, - created ? cdp : NULL, - DM_RIGHT_NULL, - dir_name->name, NULL, - mode, error, 0); - } - return error; - - error2: - error1: - xfs_bmap_cancel(&free_list); - abort_return: - cancel_flags |= XFS_TRANS_ABORT; - error_return: - xfs_trans_cancel(tp, cancel_flags); - XFS_QM_DQRELE(mp, udqp); - XFS_QM_DQRELE(mp, gdqp); - - if (unlock_dp_on_error) - xfs_iunlock(dp, XFS_ILOCK_EXCL); - - goto std_return; -} - int xfs_symlink( xfs_inode_t *dp, Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-08-11 12:13:46.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-08-11 12:17:13.000000000 -0300 @@ -33,8 +33,6 @@ int xfs_remove(struct xfs_inode *dp, str struct xfs_inode *ip); int xfs_link(struct xfs_inode *tdp, struct xfs_inode *sip, struct xfs_name *target_name); -int xfs_mkdir(struct xfs_inode *dp, struct xfs_name *dir_name, - mode_t mode, struct xfs_inode **ipp, struct cred *credp); int xfs_readdir(struct xfs_inode *dp, void *dirent, size_t bufsize, xfs_off_t *offset, filldir_t filldir); int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name, From owner-xfs@oss.sgi.com Thu Aug 14 13:51:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 13:51:13 -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 m7EKpApA007195 for ; Thu, 14 Aug 2008 13:51:10 -0700 X-ASG-Debug-ID: 1218747147-511303460000-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 DF8F9F4B407 for ; Thu, 14 Aug 2008 13:52:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id XBcT7XBhsQivP5yi for ; Thu, 14 Aug 2008 13:52:28 -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 m7EKqTIF019886 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 22:52:29 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7EKqTNn019884 for xfs@oss.sgi.com; Thu, 14 Aug 2008 22:52:29 +0200 Date: Thu, 14 Aug 2008 22:52:29 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] merge xfs_mkdir into xfs_create Subject: Re: [PATCH] merge xfs_mkdir into xfs_create Message-ID: <20080814205229.GC19614@lst.de> References: <20080814205154.GB19614@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814205154.GB19614@lst.de> 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: 1218747148 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17562 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 Forgot to mention that this needs Dave's i_gen removal patch applied first. From owner-xfs@oss.sgi.com Thu Aug 14 14:24:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 14:24:35 -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 m7ELOWaR008907 for ; Thu, 14 Aug 2008 14:24:33 -0700 X-ASG-Debug-ID: 1218749149-279300950000-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 6680FF4B791 for ; Thu, 14 Aug 2008 14:25:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id xDR39EBGvVFcvVwS for ; Thu, 14 Aug 2008 14:25:50 -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 m7ELPpIF021081 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Aug 2008 23:25:52 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7ELPpjI021079 for xfs@oss.sgi.com; Thu, 14 Aug 2008 23:25:51 +0200 Date: Thu, 14 Aug 2008 23:25:51 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH][mainline-only] remove useless mnt_want_write call in xfs_write Subject: [PATCH][mainline-only] remove useless mnt_want_write call in xfs_write Message-ID: <20080814212551.GA20980@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1218749151 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.2664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17563 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 When mnt_want_write was introduced a call to it was added around xfs_ichgtime, but there is no need for this because a file can't be open read/write on a r/o mount, and a mount can't degrade r/o while we still have files open for writing. As the mnt_want_write changes were never merged into the CVS tree this patch is for mainline only. Signed-off-by: Christoph Hellwig --- linux-2.6/fs/xfs/linux-2.6/xfs_lrw.c 2008-08-14 14:52:15.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2008-08-14 14:54:53.000000000 -0300 @@ -51,7 +51,6 @@ #include "xfs_vnodeops.h" #include -#include #include @@ -668,15 +667,8 @@ start: if (new_size > xip->i_size) xip->i_new_size = new_size; - /* - * We're not supposed to change timestamps in readonly-mounted - * filesystems. Throw it away if anyone asks us. - */ - if (likely(!(ioflags & IO_INVIS) && - !mnt_want_write(file->f_path.mnt))) { + if (likely(!(ioflags & IO_INVIS))) xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - mnt_drop_write(file->f_path.mnt); - } /* * If the offset is beyond the size of the file, we have a couple From owner-xfs@oss.sgi.com Thu Aug 14 15:50:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 15:50:23 -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=-1.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7EMoJZO012814 for ; Thu, 14 Aug 2008 15:50:19 -0700 X-ASG-Debug-ID: 1218754295-603900550000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5EBF819E3C76 for ; Thu, 14 Aug 2008 15:51:35 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id vXiUyFFcwC580KxI for ; Thu, 14 Aug 2008 15:51:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4DABhSpEh5LAMbiGdsb2JhbACSAAEBAQ8gpFyBVQ X-IronPort-AV: E=Sophos;i="4.32,211,1217773800"; d="scan'208";a="182423267" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 15 Aug 2008 08:21:33 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KTlfG-0000dx-9z; Fri, 15 Aug 2008 08:51:30 +1000 Date: Fri, 15 Aug 2008 08:51:30 +1000 From: Dave Chinner To: Geert Uytterhoeven Cc: Lachlan McIlroy , Linus Torvalds , Linux Kernel Development , xfs@oss.sgi.com, Andrew Morton , Linux/m68k X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27-rc4 Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 Message-ID: <20080814225130.GB19760@disturbed> Mail-Followup-To: Geert Uytterhoeven , Lachlan McIlroy , Linus Torvalds , Linux Kernel Development , xfs@oss.sgi.com, Andrew Morton , Linux/m68k References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1218754297 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: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17564 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 05:45:18PM +0200, Geert Uytterhoeven wrote: > On Wed, 13 Aug 2008, Lachlan McIlroy wrote: > > The following changes since commit 30a2f3c60a84092c8084dfe788b710f8d0768cd4: > > Linus Torvalds (1): > > Linux 2.6.27-rc3 > > > > are available in the git repository at: > > > > git://oss.sgi.com:8090/xfs/linux-2.6 master > > > > David Chinner (12): > > [XFS] extend completions to provide XFS object flush requirements > > This change (commit 39d2f1ab2a36ac527a6c41cfe689f50c239eaca3) seems to > have broken the m68k build: > > | CC arch/m68k/kernel/asm-offsets.s > | In file included from linux/include/linux/mm_types.h:12, > | from linux/include/linux/sched.h:61, > | from linux/arch/m68k/kernel/asm-offsets.c:12: > | linux/include/linux/completion.h: In function 'try_wait_for_completion': > | linux/include/linux/completion.h:80: error: dereferencing pointer to incomplete type > | linux/include/linux/completion.h: In function 'completion_done': > | linux/include/linux/completion.h:99: error: dereferencing pointer to incomplete type > | make[3]: *** [arch/m68k/kernel/asm-offsets.s] Error 1 > | make[2]: *** [prepare0] Error 2 > | make[1]: *** [sub-make] Error 2 > > (cfr. http://kisskb.ellerman.id.au/kisskb/buildresult/42080/) > > Apparently there was not sufficient time between entering linux-next and > Linus' tree to notice this breakage before, while the original patch was already > posted on July 11... It spent the time between then and now in the -mm tree. Seems like nobody is building m68k out of -mm. I'm out for the next 3 days, but it seems to me that the easiest fix is to move that code out of the header (i.e. uninline them) so the patch below is only compile tested on x86_64 - I've got to go load a trailer and get moving... Cheers, Dave. -- Dave Chinner david@fromorbit.com Completions: Un-inline try_wait_for_completion and completion_done m68k fails to build with these functions inlined in completion.h. Move them out of line into sched.c and export them to avoid this problem. Signed-off-by: Dave Chinner --- include/linux/completion.h | 46 +------------------------------------------ kernel/sched.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index 57faa60..02ef883 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -49,6 +49,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); extern unsigned long wait_for_completion_interruptible_timeout( struct completion *x, unsigned long timeout); +extern bool try_wait_for_completion(struct completion *x); +extern bool completion_done(struct completion *x); extern void complete(struct completion *); extern void complete_all(struct completion *); @@ -56,48 +58,4 @@ extern void complete_all(struct completion *); #define INIT_COMPLETION(x) ((x).done = 0) -/** - * try_wait_for_completion - try to decrement a completion without blocking - * @x: completion structure - * - * Returns: 0 if a decrement cannot be done without blocking - * 1 if a decrement succeeded. - * - * If a completion is being used as a counting completion, - * attempt to decrement the counter without blocking. This - * enables us to avoid waiting if the resource the completion - * is protecting is not available. - */ -static inline bool try_wait_for_completion(struct completion *x) -{ - int ret = 1; - - spin_lock_irq(&x->wait.lock); - if (!x->done) - ret = 0; - else - x->done--; - spin_unlock_irq(&x->wait.lock); - return ret; -} - -/** - * completion_done - Test to see if a completion has any waiters - * @x: completion structure - * - * Returns: 0 if there are waiters (wait_for_completion() in progress) - * 1 if there are no waiters. - * - */ -static inline bool completion_done(struct completion *x) -{ - int ret = 1; - - spin_lock_irq(&x->wait.lock); - if (!x->done) - ret = 0; - spin_unlock_irq(&x->wait.lock); - return ret; -} - #endif diff --git a/kernel/sched.c b/kernel/sched.c index 04160d2..d3af81a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4663,6 +4663,52 @@ int __sched wait_for_completion_killable(struct completion *x) } EXPORT_SYMBOL(wait_for_completion_killable); +/** + * try_wait_for_completion - try to decrement a completion without blocking + * @x: completion structure + * + * Returns: 0 if a decrement cannot be done without blocking + * 1 if a decrement succeeded. + * + * If a completion is being used as a counting completion, + * attempt to decrement the counter without blocking. This + * enables us to avoid waiting if the resource the completion + * is protecting is not available. + */ +bool try_wait_for_completion(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + else + x->done--; + spin_unlock_irq(&x->wait.lock); + return ret; +} +EXPORT_SYMBOL(try_wait_for_completion); + +/** + * completion_done - Test to see if a completion has any waiters + * @x: completion structure + * + * Returns: 0 if there are waiters (wait_for_completion() in progress) + * 1 if there are no waiters. + * + */ +bool completion_done(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + spin_unlock_irq(&x->wait.lock); + return ret; +} +EXPORT_SYMBOL(completion_done); + static long __sched sleep_on_common(wait_queue_head_t *q, int state, long timeout) { From owner-xfs@oss.sgi.com Thu Aug 14 16:02:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 16:02:25 -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 (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 m7EN2Lk4013663 for ; Thu, 14 Aug 2008 16:02:22 -0700 X-ASG-Debug-ID: 1218755019-629100aa0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0BE1F39C3CF; Thu, 14 Aug 2008 16:03:39 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id zHNMFvB6VCG3sUnv; Thu, 14 Aug 2008 16:03:39 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m7EN3Ru4027642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Aug 2008 16:03:28 -0700 Received: from akpm.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m7EN3RKP001913; Thu, 14 Aug 2008 16:03:27 -0700 Date: Thu, 14 Aug 2008 16:03:27 -0700 From: Andrew Morton To: Dave Chinner Cc: geert@linux-m68k.org, lachlan@sgi.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-m68k@vger.kernel.org X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27-rc4 Subject: Re: [GIT PULL] XFS update for 2.6.27-rc4 Message-Id: <20080814160327.bf2a2673.akpm@linux-foundation.org> In-Reply-To: <20080814225130.GB19760@disturbed> References: <20080813081147.8ECE258C52A8@chook.melbourne.sgi.com> <20080814225130.GB19760@disturbed> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1218755020 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.2668 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17565 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Fri, 15 Aug 2008 08:51:30 +1000 Dave Chinner wrote: > > | CC arch/m68k/kernel/asm-offsets.s > > | In file included from linux/include/linux/mm_types.h:12, > > | from linux/include/linux/sched.h:61, > > | from linux/arch/m68k/kernel/asm-offsets.c:12: > > | linux/include/linux/completion.h: In function 'try_wait_for_completion': > > | linux/include/linux/completion.h:80: error: dereferencing pointer to incomplete type > > | linux/include/linux/completion.h: In function 'completion_done': > > | linux/include/linux/completion.h:99: error: dereferencing pointer to incomplete type > > | make[3]: *** [arch/m68k/kernel/asm-offsets.s] Error 1 > > | make[2]: *** [prepare0] Error 2 > > | make[1]: *** [sub-make] Error 2 > > > > (cfr. http://kisskb.ellerman.id.au/kisskb/buildresult/42080/) > > > > Apparently there was not sufficient time between entering linux-next and > > Linus' tree to notice this breakage before, while the original patch was already > > posted on July 11... > > It spent the time between then and now in the -mm tree. Seems > like nobody is building m68k out of -mm. I test m68k build regularly, but only allmodconfig. Our (complexity(config system) * complexity(header files)) is so large that compilation testing doesn't prove anything useful. You just have to check your homework very carefully and don earplugs for the inevitable explosions. > I'm out for the next 3 days, but it seems to me that the easiest fix > is to move that code out of the header (i.e. uninline them) so the > patch below is only compile tested on x86_64 - I've got to go load a > trailer and get moving... I'll give it a whizz on a few architectures, but it looks quite safe from here. It looks like the uninlining was desirable from a size/speed POV anyway. From owner-xfs@oss.sgi.com Thu Aug 14 18:02:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 18:03:17 -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=-0.5 required=5.0 tests=BAYES_20,J_CHICKENPOX_45, SUBJECT_FUZZY_TION autolearn=no 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 m7F12oZV024660 for ; Thu, 14 Aug 2008 18:02:50 -0700 X-ASG-Debug-ID: 1218762247-627302e90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web65615.mail.ac4.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 32E1139CAAB for ; Thu, 14 Aug 2008 18:04:07 -0700 (PDT) Received: from web65615.mail.ac4.yahoo.com (web65615.mail.ac4.yahoo.com [76.13.9.83]) by cuda.sgi.com with SMTP id Foi3sLu6XcnZ2EWT for ; Thu, 14 Aug 2008 18:04:07 -0700 (PDT) Received: (qmail 30215 invoked by uid 60001); 15 Aug 2008 01:04:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=3lsh1j5IfXqjKZHuuxEWStXe4boDyvFIqKBaLkPzE4/NuQKlmgi/Vf3QtcIqAR5OQge78F6B78rS/8C+x5z3KbSuG784ZSdvRs/mMRBQXPFz9IHqLN7CPAovx46m97Evw4+yDhv6W+fRHjLUk0VCj3FEH4ZHRHAgTngto6dXnmc=; Received: from [193.140.7.156] by web65615.mail.ac4.yahoo.com via HTTP; Thu, 14 Aug 2008 18:04:06 PDT X-Mailer: YahooMailRC/1042.48 YahooMailWebService/0.7.218 Date: Thu, 14 Aug 2008 18:04:06 -0700 (PDT) From: Rayne Olivetti X-ASG-Orig-Subj: Unformat XFS partition? Subject: Unformat XFS partition? To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <995705.29458.qm@web65615.mail.ac4.yahoo.com> X-Barracuda-Connect: web65615.mail.ac4.yahoo.com[76.13.9.83] X-Barracuda-Start-Time: 1218762249 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: -1.61 X-Barracuda-Spam-Status: No, SCORE=-1.61 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=SUBJECT_FUZZY_TION X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2676 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.41 SUBJECT_FUZZY_TION Attempt to obfuscate words in Subject: X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17566 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: rayneolivetti@yahoo.com Precedence: bulk X-list: xfs A live CD accidently formatted my XFS partition (presumably with mkfs.xfs), and I have an empty partition now. The disk is almost intact, other than an attempt to run xfs_repair (created a lost+found directory). I had no backup/dump/whatsoever. Theoretically, it should be possible since allocation groups act independently AFAIK. Is there any chance for me to rebuild the old FS using existing tools? From owner-xfs@oss.sgi.com Thu Aug 14 18:17:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 18:17:38 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F1HYde025824 for ; Thu, 14 Aug 2008 18:17:35 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA01805; Fri, 15 Aug 2008 11:18:46 +1000 Message-ID: <48A4DB09.7020702@sgi.com> Date: Fri, 15 Aug 2008 11:25:29 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: Dave Chinner , xfs@oss.sgi.com Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <20080814180603.GA3087@infradead.org> In-Reply-To: <20080814180603.GA3087@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17567 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Btw, while this patch made it to mainline it never went into the oss > cvs tree (and thus probably the ptools tree). > > There also are a lot of other difference between the trees, I'll see > how to get them back into sync.. Yeah, we're aware of these differences and we're trying to sync them up. If you identify any specific commits from mainline (other than this log race fix) that aren't in the cvs tree please let us know. From owner-xfs@oss.sgi.com Thu Aug 14 18:26:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 18:26: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 (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 m7F1QoVl026537 for ; Thu, 14 Aug 2008 18:26:50 -0700 X-ASG-Debug-ID: 1218763688-6318030a0000-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 B0EABB0A013; Thu, 14 Aug 2008 18:28:08 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id ZUEF56sppuTs5AsY; Thu, 14 Aug 2008 18:28:08 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KTo6p-0000YY-Pg; Fri, 15 Aug 2008 01:28:07 +0000 Date: Thu, 14 Aug 2008 21:28:07 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: Christoph Hellwig , Dave Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Fix reference counting race on log buffers Subject: Re: [PATCH] Fix reference counting race on log buffers Message-ID: <20080815012807.GA547@infradead.org> References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <20080814180603.GA3087@infradead.org> <48A4DB09.7020702@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A4DB09.7020702@sgi.com> 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: 1218763688 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.2677 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17568 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 Fri, Aug 15, 2008 at 11:25:29AM +1000, Lachlan McIlroy wrote: > Christoph Hellwig wrote: >> Btw, while this patch made it to mainline it never went into the oss >> cvs tree (and thus probably the ptools tree). >> >> There also are a lot of other difference between the trees, I'll see >> how to get them back into sync.. > > Yeah, we're aware of these differences and we're trying to sync them up. > If you identify any specific commits from mainline (other than this log > race fix) that aren't in the cvs tree please let us know. I think I have most of them covered: - log reace - the endianess helpers patch I sent a note out about - the mnt_want_write patches I've sent today - just yesterday the creds preparation in mainline replaced some XFS current_* macros with generic ones, I'll send a patch for these once the changes in mainline have settled a little The long term differences are: - a different xfs_version.h - IMHO we should just kill this versioning scheme completely.. - xfsidbg. Maybe now with kgdb in the kgdb folks get something submitted and then this is taken care off.. - modular quota. IMHO we should just stop doing this in CVS, it doesn't really buy us anything. If people are okay with that I'll send a patch - dmapi - well, this won't get merged and currently I don't see anyone doing HSM for mainline properly. But I have some ideas how to make it less intrusive at least Other than that there are some difference dueto a different base kernel version, which are temporary until the XFS tree is merged up to kernel including those. From owner-xfs@oss.sgi.com Thu Aug 14 20:13:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 20:13:11 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F3D63c032619 for ; Thu, 14 Aug 2008 20:13:07 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA03943; Fri, 15 Aug 2008 13:14:19 +1000 Message-ID: <48A4F61E.3050106@sgi.com> Date: Fri, 15 Aug 2008 13:21:02 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: Dave Chinner , xfs@oss.sgi.com Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <20080814180603.GA3087@infradead.org> <48A4DB09.7020702@sgi.com> <20080815012807.GA547@infradead.org> In-Reply-To: <20080815012807.GA547@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17569 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Fri, Aug 15, 2008 at 11:25:29AM +1000, Lachlan McIlroy wrote: >> Christoph Hellwig wrote: >>> Btw, while this patch made it to mainline it never went into the oss >>> cvs tree (and thus probably the ptools tree). >>> >>> There also are a lot of other difference between the trees, I'll see >>> how to get them back into sync.. >> Yeah, we're aware of these differences and we're trying to sync them up. >> If you identify any specific commits from mainline (other than this log >> race fix) that aren't in the cvs tree please let us know. > > I think I have most of them covered: > > - log reace > - the endianess helpers patch I sent a note out about > - the mnt_want_write patches I've sent today > - just yesterday the creds preparation in mainline replaced some > XFS current_* macros with generic ones, I'll send a patch for these > once the changes in mainline have settled a little > > The long term differences are: > > - a different xfs_version.h - IMHO we should just kill this versioning > scheme completely.. > - xfsidbg. Maybe now with kgdb in the kgdb folks get something > submitted and then this is taken care off.. That stuff is there for kdb. Are you suggesting we switch to kgdb and drop this file? > - modular quota. IMHO we should just stop doing this in CVS, it > doesn't really buy us anything. If people are okay with that > I'll send a patch I don't see any problem with this. Seems like a good idea. > - dmapi - well, this won't get merged and currently I don't see anyone > doing HSM for mainline properly. But I have some ideas how to make > it less intrusive at least All that would be very helpful. > > Other than that there are some difference dueto a different base kernel > version, which are temporary until the XFS tree is merged up to kernel > including those. > Last time I checked the fs/xfs differences between mainline and our internal tree resulted in a patch around 470KB. Most of that is changes that we don't push to mainline such as fs/xfs/dmapi and fs/xfs/xfsidbg.c. The rest I'm working though. From owner-xfs@oss.sgi.com Thu Aug 14 20:22:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 20:22:31 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F3MRKs005905 for ; Thu, 14 Aug 2008 20:22:28 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA04174; Fri, 15 Aug 2008 13:23:42 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id D47AE58C52A8; Fri, 15 Aug 2008 13:23:42 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 983925 - Fix reference counting race on log buffers Message-Id: <20080815032342.D47AE58C52A8@chook.melbourne.sgi.com> Date: Fri, 15 Aug 2008 13:23:42 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17570 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Fix reference counting race on log buffers When we release the iclog, we do an atomic_dec_and_lock to determine if we are the last reference and need to trigger update of log headers and writeout. However, in xlog_state_get_iclog_space() we also need to check if we have the last reference count there. If we do, we release the log buffer, otherwise we decrement the reference count. But the compare and decrement in xlog_state_get_iclog_space() is not atomic, so both places can see a reference count of 2 and neither will release the iclog. That leads to a filesystem hang. Close the race by replacing the atomic_read() and atomic_dec() pair with atomic_add_unless() to ensure that they are executed atomically. Signed-off-by: Dave Chinner Date: Fri Aug 15 13:22:52 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-clean Inspected by: david@fromorbit.com tes lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31904a fs/xfs/xfs_log.c - 1.365 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.365&r2=text&tr2=1.364&f=h - Fix reference counting race on log buffers From owner-xfs@oss.sgi.com Thu Aug 14 20:54:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 20:54:48 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F3sbSx007796 for ; Thu, 14 Aug 2008 20:54:38 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA04820; Fri, 15 Aug 2008 13:55:48 +1000 Message-ID: <48A4FE44.30405@sgi.com> Date: Fri, 15 Aug 2008 13:55:48 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com, jasper@amiton.co.nz, daniel.blueman@gmail.com Subject: Re: [PATCH] stop rejecting options in remount References: <20080809195159.GA8562@lst.de> <20080814203636.GA18704@lst.de> In-Reply-To: <20080814203636.GA18704@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17571 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi Christoph, Yeah, I'll check in this temp solution. I'll also check in the qa test for remount. The qa test can be updated when the remount code is updated. --Tim Christoph Hellwig wrote: > On Sat, Aug 09, 2008 at 09:51:59PM +0200, Christoph Hellwig wrote: >> Thanks to some not so nice code in mount(8) we can't blindly reject moun >> options we don't support to be changed in remount. See the comment in >> the code for more details. > > Here is an updated version with a hopefully better worded comments: > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-08-14 17:29:03.000000000 -0300 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-08-14 17:35:00.000000000 -0300 > @@ -1303,9 +1303,29 @@ xfs_fs_remount( > mp->m_flags &= ~XFS_MOUNT_BARRIER; > break; > default: > + /* > + * Logically we would return an error here to prevent > + * users from believing they might have changed > + * mount options using remount which can't be changed. > + * > + * But unfortunately mount(8) adds all options from > + * mtab and fstab to the mount arguments in some cases > + * so we can't blindly reject options, but have to > + * check for each specified option if it actually > + * differs from the currently set option and only > + * reject it if that's the case. > + * > + * Until that is implemented we return success for > + * every remount request, and silently ignore all > + * options that we can't actually change. > + */ > +#if 0 > printk(KERN_INFO > "XFS: mount option \"%s\" not supported for remount\n", p); > return -EINVAL; > +#else > + return 0; > +#endif > } > } > > From owner-xfs@oss.sgi.com Thu Aug 14 21:00:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 21:01:07 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F40pqZ008375 for ; Thu, 14 Aug 2008 21:00:52 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA05015; Fri, 15 Aug 2008 14:02:07 +1000 Message-ID: <48A50152.8020104@sgi.com> Date: Fri, 15 Aug 2008 14:08:50 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [REVIEW] Prevent direct I/O from mapping extents beyond eof Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17572 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs With the help from some tracing I found that we try to map extents beyond eof when doing a direct I/O read. It appears that the way to inform the generic direct I/O path (ie do_direct_IO()) that we have breached eof is to return an unmapped buffer from xfs_get_blocks_direct(). This will cause do_direct_IO() to jump to the hole handling code where is will check for eof and then abort. This problem was found because a direct I/O read was trying to map beyond eof and was encountering delayed allocations. The delayed allocations beyond eof are speculative allocations and they didn't get converted when the direct I/O flushed the file because there was only enough space in the current AG to convert and write out the dirty pages within eof. Note that xfs_iomap_write_allocate() wont necessarily convert all the delayed allocation passed to it - it will return after allocating the first extent - so if the delayed allocation extends beyond eof then it will stay that way. This change will detect a direct I/O read beyond eof: --- a/fs/xfs/linux-2.6/xfs_aops.c 2008-08-15 13:30:03.000000000 +1000 +++ b/fs/xfs/linux-2.6/xfs_aops.c 2008-08-11 16:51:07.000000000 +1000 @@ -1338,6 +1338,10 @@ __xfs_get_blocks( offset = (xfs_off_t)iblock << inode->i_blkbits; ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); size = bh_result->b_size; + + if (!create && direct && offset >= i_size_read(inode)) + return 0; + error = xfs_iomap(XFS_I(inode), offset, size, create ? flags : BMAPI_READ, &iomap, &niomap); if (error) From owner-xfs@oss.sgi.com Thu Aug 14 22:31:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 14 Aug 2008 22:31: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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F5VQEg012499 for ; Thu, 14 Aug 2008 22:31:28 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA06459; Fri, 15 Aug 2008 15:32:41 +1000 Message-ID: <48A514F9.1070304@sgi.com> Date: Fri, 15 Aug 2008 15:32:41 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] fix compiler warning in xfsidbg References: <20080814203017.GA18619@lst.de> In-Reply-To: <20080814203017.GA18619@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17573 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > attr_list_context.count is a ssize_t adn thus we need to use %zd, not > %ld to print it. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfsidbg.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-08-14 15:24:38.000000000 -0300 > +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-08-14 15:27:20.000000000 -0300 > @@ -4171,7 +4171,7 @@ xfsidbg_xattrcontext(xfs_attr_list_conte > context->cursor->hashval, context->cursor->blkno, > context->cursor->offset, context->cursor->pad1, > context->cursor->pad2, context->cursor->initted); > - kdb_printf("alist 0x%p, bufsize 0x%x, count %ld, firstu 0x%x\n", > + kdb_printf("alist 0x%p, bufsize 0x%x, count %zd, firstu 0x%x\n", > context->alist, context->bufsize, context->count, > context->firstu); > } > Looks good. I didn't know the z modifier existed until now! --Tim From owner-xfs@oss.sgi.com Fri Aug 15 00:38:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 00:38:51 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F7cgCQ025532 for ; Fri, 15 Aug 2008 00:38:43 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA08994; Fri, 15 Aug 2008 17:39:59 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16305) id 07E7E58C52A8; Fri, 15 Aug 2008 17:39:58 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 985710 - stop rejecting options in remount Message-Id: <20080815073959.07E7E58C52A8@chook.melbourne.sgi.com> Date: Fri, 15 Aug 2008 17:39:58 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17574 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Fix regression introduced by previous remount fixup (pv#983964) - so options will no longer wrongly be rejected on remount. Logically we would return an error in xfs_fs_remount code to prevent users from believing they might have changed mount options using remount which can't be changed. But unfortunately mount(8) adds all options from mtab and fstab to the mount arguments in some cases so we can't blindly reject options, but have to check for each specified option if it actually differs from the currently set option and only reject it if that's the case. Until that is implemented we return success for every remount request, and silently ignore all options that we can't actually change. Signed-off-by: Christoph Hellwig Date: Fri Aug 15 17:33:44 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31908a fs/xfs/linux-2.6/xfs_super.c - 1.447 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.447&r2=text&tr2=1.446&f=h - fix remount regression From owner-xfs@oss.sgi.com Fri Aug 15 00:59:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 00:59:28 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7F7xKe4026657 for ; Fri, 15 Aug 2008 00:59:21 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA09399; Fri, 15 Aug 2008 18:00:37 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16305) id 7F20058C52A8; Fri, 15 Aug 2008 18:00:37 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 985710 - add remount test to qa Message-Id: <20080815080037.7F20058C52A8@chook.melbourne.sgi.com> Date: Fri, 15 Aug 2008 18:00:37 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17575 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Add a bunch of tests for remount code. Written by Christoph and amended by Tim to do some more testing with fstab etc. Date: Fri Aug 15 17:59:06 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/xfs-cmds Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31909a xfstests/189 - 1.1 - new http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/189 - remount test xfstests/189.out - 1.1 - new http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/189.out - remount test output xfstests/group - 1.122 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/group.diff?r1=text&tr1=1.122&r2=text&tr2=1.121&f=h - add 189 remount test From owner-xfs@oss.sgi.com Fri Aug 15 15:00:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 15:00:49 -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 (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 m7FM0jNU021694 for ; Fri, 15 Aug 2008 15:00:45 -0700 X-ASG-Debug-ID: 1218837722-724d004f0000-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 1C1753A0CBB for ; Fri, 15 Aug 2008 15:02:03 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id dDoBReOy1rN8xetm for ; Fri, 15 Aug 2008 15:02:03 -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 m7FM23IF026201 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 16 Aug 2008 00:02:04 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7FM23Fq026199; Sat, 16 Aug 2008 00:02:03 +0200 Date: Sat, 16 Aug 2008 00:02:03 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [RFC] btree test harness Subject: Re: [RFC] btree test harness Message-ID: <20080815220203.GA25942@lst.de> References: <20080813223022.GA15025@lst.de> <20080814005755.GF6119@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814005755.GF6119@disturbed> 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: 1218837724 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.2759 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17576 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 > > does it's own freelist to avoid having to call in the alloc code > > and make it even slower. > > I'll have a closer look in a while. It's just a bitmap array, right? Yes, it's just a trivial bitmap of all blocks. > > I'd also like some input on how interface to userspace. Doing it during > > mount but conditional would be one option, the other one an ioctl - > > in both cases I'd like to be able to specify up to which maxlevel to go > > as the tests for higher levels can take forever. > > I was thinking of a couple of approaches when I started on this > harness: > > - similar to RCU torture tests, the btree test harness is > run on XFS intialisation if config'd in. Requires faking a > struct xfs_mount, though, and isn't configurable. > - ioctl interface to run each test operation individually, > and hook that up to an xfsqa test that used a sparse > loopback mounted filesytem to exercise AG sizes up to 1TB. > > I think the second approach allows us to test btrees on demand on > arbitrary disposable filesystems. It would also allow us to easily > extend the test harness over time - a new xfsqa test group could be > added so that each test can be written as a standalone test so > that we can easily isolate regressions. Faking up the mount doesn't really wrok, we need a _lot_ of fields in there, plus a buftarg plus a real xfs_trans and thus the whole log subsystem, so we need a real filesystem anyway. With the way I use a separate btree I can just use up the whole filesystem without making it sprase. But yes, splitting things into individual ioctls makes sense to make the tests a little more flexible. From owner-xfs@oss.sgi.com Fri Aug 15 15:05:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 15:05:46 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7FM5iY3022255 for ; Fri, 15 Aug 2008 15:05:45 -0700 X-ASG-Debug-ID: 1218838022-5da000cd0000-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 9718C19E4C89; Fri, 15 Aug 2008 15:07:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id fQalkt9SBH7xYobB; Fri, 15 Aug 2008 15:07:02 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KU7Rl-0002D5-M9; Fri, 15 Aug 2008 22:07:01 +0000 Date: Fri, 15 Aug 2008 18:07:01 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: Christoph Hellwig , Dave Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Fix reference counting race on log buffers Subject: Re: [PATCH] Fix reference counting race on log buffers Message-ID: <20080815220701.GA13770@infradead.org> References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <20080814180603.GA3087@infradead.org> <48A4DB09.7020702@sgi.com> <20080815012807.GA547@infradead.org> <48A4F61E.3050106@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A4F61E.3050106@sgi.com> 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: 1218838023 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.2759 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17577 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 Fri, Aug 15, 2008 at 01:21:02PM +1000, Lachlan McIlroy wrote: >> - a different xfs_version.h - IMHO we should just kill this versioning >> scheme completely.. >> - xfsidbg. Maybe now with kgdb in the kgdb folks get something >> submitted and then this is taken care off.. > That stuff is there for kdb. Are you suggesting we switch to kgdb and > drop this file? No, sorry for the stupid typo. I meant now with kgdb in maybe the kdb folks can get their act together and try to submit it, at which point xfsidbg could go upstream. >> - modular quota. IMHO we should just stop doing this in CVS, it >> doesn't really buy us anything. If people are okay with that >> I'll send a patch > I don't see any problem with this. Seems like a good idea. Ok, I'll prepare something. > >> - dmapi - well, this won't get merged and currently I don't see anyone >> doing HSM for mainline properly. But I have some ideas how to make >> it less intrusive at least > All that would be very helpful. > Last time I checked the fs/xfs differences between mainline and our > internal tree resulted in a patch around 470KB. Most of that is changes > that we don't push to mainline such as fs/xfs/dmapi and fs/xfs/xfsidbg.c. > The rest I'm working though. Yeah, the list above should have been complete, I just went through the diff yesterday. From owner-xfs@oss.sgi.com Fri Aug 15 15:08:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 15:08:44 -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 (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 m7FM8fcW022723 for ; Fri, 15 Aug 2008 15:08:41 -0700 X-ASG-Debug-ID: 1218838199-11fd00310000-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 58379F51F6B; Fri, 15 Aug 2008 15:09:59 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id I5sBmWETOArJgkd2; Fri, 15 Aug 2008 15:09:59 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KU7Uc-0002QA-PQ; Fri, 15 Aug 2008 22:09:58 +0000 Date: Fri, 15 Aug 2008 18:09:58 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: xfs-dev , xfs-oss , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Subject: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Message-ID: <20080815220958.GB13770@infradead.org> References: <48A50152.8020104@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A50152.8020104@sgi.com> 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: 1218838200 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.2760 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8048/Fri Aug 15 05:56:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17578 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 Fri, Aug 15, 2008 at 02:08:50PM +1000, Lachlan McIlroy wrote: > With the help from some tracing I found that we try to map extents beyond > eof when doing a direct I/O read. It appears that the way to inform the > generic direct I/O path (ie do_direct_IO()) that we have breached eof is > to return an unmapped buffer from xfs_get_blocks_direct(). This will cause > do_direct_IO() to jump to the hole handling code where is will check for > eof and then abort. > > This problem was found because a direct I/O read was trying to map beyond > eof and was encountering delayed allocations. The delayed allocations beyond > eof are speculative allocations and they didn't get converted when the direct > I/O flushed the file because there was only enough space in the current AG > to convert and write out the dirty pages within eof. Note that > xfs_iomap_write_allocate() wont necessarily convert all the delayed allocation > passed to it - it will return after allocating the first extent - so if the > delayed allocation extends beyond eof then it will stay that way. > > This change will detect a direct I/O read beyond eof: The change looks good to me, but I really think the direct I/O could should never send down requests like this down to the filesystems. akpm and -fsdevel Cc'ed. > --- a/fs/xfs/linux-2.6/xfs_aops.c 2008-08-15 13:30:03.000000000 +1000 > +++ b/fs/xfs/linux-2.6/xfs_aops.c 2008-08-11 16:51:07.000000000 +1000 > @@ -1338,6 +1338,10 @@ __xfs_get_blocks( > offset = (xfs_off_t)iblock << inode->i_blkbits; > ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); > size = bh_result->b_size; > + > + if (!create && direct && offset >= i_size_read(inode)) > + return 0; > + > error = xfs_iomap(XFS_I(inode), offset, size, > create ? flags : BMAPI_READ, &iomap, &niomap); > if (error) > > ---end quoted text--- From owner-xfs@oss.sgi.com Fri Aug 15 15:26:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 15:26:49 -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 m7FMQiYS023867 for ; Fri, 15 Aug 2008 15:26:45 -0700 X-ASG-Debug-ID: 1218839282-080c021b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A7DFCF52914; Fri, 15 Aug 2008 15:28:02 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id B0jR8t0LnHv25BZT; Fri, 15 Aug 2008 15:28:02 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m7FMRuxV028861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Aug 2008 15:27:57 -0700 Received: from akpm.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m7FMRuM7022976; Fri, 15 Aug 2008 15:27:56 -0700 Date: Fri, 15 Aug 2008 15:27:56 -0700 From: Andrew Morton To: Christoph Hellwig Cc: lachlan@sgi.com, xfs-dev@sgi.com, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Subject: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Message-Id: <20080815152756.61aab5a7.akpm@linux-foundation.org> In-Reply-To: <20080815220958.GB13770@infradead.org> References: <48A50152.8020104@sgi.com> <20080815220958.GB13770@infradead.org> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1218839283 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.2760 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8048/Fri Aug 15 05:56:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17579 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Fri, 15 Aug 2008 18:09:58 -0400 Christoph Hellwig wrote: > On Fri, Aug 15, 2008 at 02:08:50PM +1000, Lachlan McIlroy wrote: > > With the help from some tracing I found that we try to map extents beyond > > eof when doing a direct I/O read. It appears that the way to inform the > > generic direct I/O path (ie do_direct_IO()) that we have breached eof is > > to return an unmapped buffer from xfs_get_blocks_direct(). This will cause > > do_direct_IO() to jump to the hole handling code where is will check for > > eof and then abort. > > > > This problem was found because a direct I/O read was trying to map beyond > > eof and was encountering delayed allocations. The delayed allocations beyond > > eof are speculative allocations and they didn't get converted when the direct > > I/O flushed the file because there was only enough space in the current AG > > to convert and write out the dirty pages within eof. Note that > > xfs_iomap_write_allocate() wont necessarily convert all the delayed allocation > > passed to it - it will return after allocating the first extent - so if the > > delayed allocation extends beyond eof then it will stay that way. > > > > This change will detect a direct I/O read beyond eof: > > The change looks good to me, but I really think the direct I/O could > should never send down requests like this down to the filesystems. akpm > and -fsdevel Cc'ed. Oh gee, I forget, and so many people have done drivebys on that code... We _could_ add additional i_size checking into direct-io.c but bear in mind that it would be best-effort unreliable stuff. The code will still be tripped up by concurrent extends and concurrent truncates. So we'll still end up calling the fs for blocks outside i_size, only less commonly. I think. From owner-xfs@oss.sgi.com Fri Aug 15 15:39:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 15 Aug 2008 15:39:33 -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 (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 m7FMdTAA024607 for ; Fri, 15 Aug 2008 15:39:30 -0700 X-ASG-Debug-ID: 1218840048-1f0900a90000-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 09A19F528B9; Fri, 15 Aug 2008 15:40:48 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id DcSkTr68evj1eTOB; Fri, 15 Aug 2008 15:40:48 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KU7yR-0006aQ-V5; Fri, 15 Aug 2008 22:40:47 +0000 Date: Fri, 15 Aug 2008 18:40:47 -0400 From: Christoph Hellwig To: Andrew Morton Cc: Christoph Hellwig , lachlan@sgi.com, xfs-dev@sgi.com, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Subject: Re: [REVIEW] Prevent direct I/O from mapping extents beyond eof Message-ID: <20080815224047.GA15914@infradead.org> References: <48A50152.8020104@sgi.com> <20080815220958.GB13770@infradead.org> <20080815152756.61aab5a7.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080815152756.61aab5a7.akpm@linux-foundation.org> 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: 1218840049 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.2676 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8048/Fri Aug 15 05:56:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17580 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 Fri, Aug 15, 2008 at 03:27:56PM -0700, Andrew Morton wrote: > Oh gee, I forget, and so many people have done drivebys on that code... > > We _could_ add additional i_size checking into direct-io.c but bear in > mind that it would be best-effort unreliable stuff. The code will > still be tripped up by concurrent extends and concurrent truncates. > > So we'll still end up calling the fs for blocks outside i_size, only > less commonly. I think. Yeah, guess we should put in this patch then. From owner-xfs@oss.sgi.com Sun Aug 17 17:17:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 17 Aug 2008 17:18:01 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7I0HwgS006088 for ; Sun, 17 Aug 2008 17:17:59 -0700 X-ASG-Debug-ID: 1219018756-27a300f70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6342719F422A for ; Sun, 17 Aug 2008 17:19:17 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id JIRDPmZ9bTUpTIY3 for ; Sun, 17 Aug 2008 17:19:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDALpbqEh5LAMbiGdsb2JhbACSDgEBAQ8goAaBWA X-IronPort-AV: E=Sophos;i="4.32,224,1217773800"; d="scan'208";a="184272034" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 18 Aug 2008 09:49:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUsSm-0002df-RU; Mon, 18 Aug 2008 10:19:12 +1000 Date: Mon, 18 Aug 2008 10:19:12 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Subject: Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation. Message-ID: <20080818001912.GE19760@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-6-git-send-email-david@fromorbit.com> <20080814190001.GA19070@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814190001.GA19070@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1219018758 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.2959 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17581 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 03:00:01PM -0400, Christoph Hellwig wrote: > On Thu, Aug 14, 2008 at 05:14:41PM +1000, Dave Chinner wrote: > > To avoid having to initialise some fields of the XFS inode > > on every allocation, we can use the slab init-once feature > > to initialise them. All we have to guarantee is that when > > we free the inode, all it's entries are in the initial state. > > Add asserts where possible to ensure debug kernels check this > > initial state before freeing and after allocation. > > Looks good, and I think it this can be moved before the series and > submitted ASAP. I'll reorder it.... > > diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c > > index cf6754a..4f4c939 100644 > > --- a/fs/xfs/xfs_itable.c > > +++ b/fs/xfs/xfs_itable.c > > @@ -594,21 +594,21 @@ xfs_bulkstat( > > /* > > * Get the inode cluster buffer > > */ > > - ASSERT(xfs_inode_zone != NULL); > > - ip = kmem_zone_zalloc(xfs_inode_zone, > > - KM_SLEEP); > > - ip->i_ino = ino; > > - ip->i_mount = mp; > > - spin_lock_init(&ip->i_flags_lock); > > if (bp) > > xfs_buf_relse(bp); > > + ip = xfs_inode_alloc(mp, ino); > > + if (!ip) { > > + bp = NULL; > > + rval = ENOMEM; > > + break; > > + } > > error = xfs_itobp(mp, NULL, ip, > > &dip, &bp, bno, > > XFS_IMAP_BULKSTAT, > > XFS_BUF_LOCK); > > Yikes, what a mess - eventually we should convert this to opencoded cals > to xfs_imap and xfs_imap_to_bp, but before the function needs to be > split into manageable chunk. Another item on the todo list.. Yeah, bulkstat is an utter, utter mess. There's a lot of work needed to clean it up... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 17 17:18:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 17 Aug 2008 17:18:20 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7I0IIIj006138 for ; Sun, 17 Aug 2008 17:18:18 -0700 X-ASG-Debug-ID: 1219018776-20b1017b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 332CA19F41B7 for ; Sun, 17 Aug 2008 17:19:37 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id PgxMy6dpWYeaHkXZ for ; Sun, 17 Aug 2008 17:19:37 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDALpbqEh5LAMbiGdsb2JhbACSDgEBAQ8goAaBWA X-IronPort-AV: E=Sophos;i="4.32,224,1217773800"; d="scan'208";a="184272216" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 18 Aug 2008 09:49:36 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUsT9-0002eG-P2; Mon, 18 Aug 2008 10:19:35 +1000 Date: Mon, 18 Aug 2008 10:19:35 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Subject: Re: [PATCH 4/7] XFS: Never call mark_inode_dirty_sync() directly Message-ID: <20080818001935.GF19760@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-5-git-send-email-david@fromorbit.com> <20080814194702.GB12237@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814194702.GB12237@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1219018778 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.2961 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17582 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 03:47:02PM -0400, Christoph Hellwig wrote: > On Thu, Aug 14, 2008 at 05:14:40PM +1000, Dave Chinner wrote: > > Once the Linux inode and the XFS inode are combined, we cannot rely > > on just check if the linux inode exists as a method of determining > > if it is valid or not. Hence we should always call > > xfs_mark_inode_dirty_sync() instead as it does the correct checks to > > determine if the liinux inode is in a valid state or not. > > Makes sense, and another candidate to put at the beginning of the series > or rather just put in now. Ok. I'll reorder it... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 17 17:33:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 17 Aug 2008 17:33:38 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7I0XaMK007768 for ; Sun, 17 Aug 2008 17:33:36 -0700 X-ASG-Debug-ID: 1219019694-27a7015b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4E1DA1BC6374 for ; Sun, 17 Aug 2008 17:34:55 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id Ic7nWFsweJiXUaOP for ; Sun, 17 Aug 2008 17:34:55 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDAHVfqEh5LAMbiGdsb2JhbACSDgEBAQ8goAGBWA X-IronPort-AV: E=Sophos;i="4.32,224,1217773800"; d="scan'208";a="184281139" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 18 Aug 2008 10:04:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUshv-0003Wr-7p; Mon, 18 Aug 2008 10:34:51 +1000 Date: Mon, 18 Aug 2008 10:34:51 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Subject: Re: [PATCH 6/7] XFS: Combine the XFS and Linux inodes. Message-ID: <20080818003451.GG19760@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-7-git-send-email-david@fromorbit.com> <20080814200006.GC12237@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814200006.GC12237@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1219019696 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.2961 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17583 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 04:00:06PM -0400, Christoph Hellwig wrote: > > + if (!(inode->i_state & I_CLEAR)) { > > ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; > > ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; > > } > > Actually we can just do this unconditionally, as the atime values don't > become invalid just because the VFS doesn't know about the inode > anymore. And two useless because already previously updated assignments > are cheaper than a branch. Ok, I'll make it unconditional. > > + * We are always called with an uninitialised linux inode here. > > + * We need to initialise the necessary fields and take a reference > > + * on it. > > */ > > void > > xfs_setup_inode( > > struct xfs_inode *ip) > > { > > - struct inode *inode = ip->i_vnode; > > + struct inode *inode = &ip->i_vnode; > > VFS_I? Yup, I thought I caught all of them :/ > > > + inode->i_ino = ip->i_ino; > > + inode->i_state = I_NEW|I_LOCK; > > + inode_used(ip->i_mount->m_super, inode); > > + ASSERT(atomic_read(&inode->i_count) == 1); > > Where does inode_used come from? (It's also a rather ugly name..) Ah, separate patch not sent. basically does: void inode_used(struct super_block *sb, struct inode *inode) { spin_lock(&inode_lock); inodes_stat.nr_inodes++; list_add(&inode->i_list, &inode_in_use); list_add(&inode->i_sb_list, &sb->s_inodes); spin_unlock(&inode_lock); } > > +/* XXX: development debug only */ > > STATIC struct inode * > > xfs_fs_alloc_inode( > > struct super_block *sb) > > { > > - return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > > + BUG(); > > } > > Actually keeping this one is a good idea, even if it's just to catch > really dumb things like the iget_locked OpenAFS's cache manager does on > random filesystems.. Ok, I'll leave that in. > > -void > > -xfs_inode_init_once( > > +STATIC void > > +xfs_fs_inode_init_once( > > might be a good idea to already use that name in the patch that > introduces it :) The problem was that we have two init functions at this point; one for the vnode, one for the inode.... > > /* > > + * we need to provide an empty inode free function to prevent > > + * the generic code from trying to free ouuur combined inode. > > + */ > > +STATIC void > > +xfs_fs_destroy_inode( > > + struct inode *inode) > > +{ > > + return; > > +} > > Why it's this kept in the original place, close to alloc_inode? Just the way things happened. I'll move it back. > Also the return statement is superflous. Yup. > > /* convert from xfs inode to vfs inode */ > > static inline struct inode *VFS_I(struct xfs_inode *ip) > > { > > - return (struct inode *)ip->i_vnode; > > + return (struct inode *)&ip->i_vnode; > > } > > No need for the cast in either version.. Ok, I'll kill it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 17 17:40:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 17 Aug 2008 17:40:58 -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 (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 m7I0etCa008582 for ; Sun, 17 Aug 2008 17:40:55 -0700 X-ASG-Debug-ID: 1219020134-22a001d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8CF1FF5D24A for ; Sun, 17 Aug 2008 17:42:14 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 8a5A4dD2MeUxSKJk for ; Sun, 17 Aug 2008 17:42:14 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDAHVfqEh5LAMbiGdsb2JhbACSDgEBAQ8goAGBWA X-IronPort-AV: E=Sophos;i="4.32,224,1217773800"; d="scan'208";a="184285407" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 18 Aug 2008 10:12:11 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUsoz-0003gZ-2U; Mon, 18 Aug 2008 10:42:09 +1000 Date: Mon, 18 Aug 2008 10:42:09 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 7/7] XFS: don't use vnodes where unnecessary Subject: Re: [PATCH 7/7] XFS: don't use vnodes where unnecessary Message-ID: <20080818004209.GH19760@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <1218698083-11226-8-git-send-email-david@fromorbit.com> <20080814201022.GA20557@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814201022.GA20557@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1219020135 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 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.2962 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17584 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 04:10:22PM -0400, Christoph Hellwig wrote: > > do { > > + struct inode *inode; > > + boolean_t vnode_refed; > > + xfs_inode_t *ip = NULL; > > This should not be inode_refed, no? :) Yeah ;) > > - vp = VFS_I(ip); > > - if (!vp) { > > + if (xfs_iflags_test(ip, (XFS_IRECLAIM|XFS_IRECLAIMABLE))) { > > These changes really need to be folded into the previous patch for > bisectability reasons.. Right - this was catching all this bits that I missed in the previous patch ;) > > > + inode = VFS_I(ip); > > + if (VN_BAD(inode)) { > > Just use is_bad_inode directly. (Also in a few other places) Will do. > > } else { > > - /* safe to unlock here as we have a reference */ > > + if (!xfs_ilock_nowait(ip, lock_flags)) { > > + /* leave it to reclaim */ > > + read_unlock(&pag->pag_ici_lock); > > + continue; > > + } > > read_unlock(&pag->pag_ici_lock); > > } > > Maybe not for this patch, but in general, why do we even bother about > the inodes we can't get a reference to, shouldn't we just always leave > this to reclaim? Right now, we either get a reference or an ilock to prevent reclaim from freeing it. The case ofthe vnode disappearing made it difficult to make a clear delineation. With the combined inode, it is much easier to make this distinction, but if we are doing ascending order writeback of inodes, we really want to get all the inodes that are dirty regardless of whether they are in reclaim or not. > > - if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { > > + if ((flags & SYNC_DELWRI) && VN_DIRTY(VFS_I(ip))) { > > Why not use the "inode" variable we have in scope anyway? Yup, should do that. > > + if (!(inode->i_state & I_CLEAR)) > > + return atomic_read(&inode->i_count); > > Well, it's just zero when the inode is out of the vfs, so we could > probably simply do it unconditional. Ok, I'll have a look at that. > > > + vp = vn_grab(VFS_I(ip)); > > + if (vp) { > > Please switch this one to igrab, and the inode name, too. As this > is the last caller of vn_grab we can kill it now. Ok, I'll fix that one up, too. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 17 18:12:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 17 Aug 2008 18:12:30 -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 m7I1CQJG010885 for ; Sun, 17 Aug 2008 18:12:27 -0700 X-ASG-Debug-ID: 1219022024-130300600000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail05.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D235E3A897A for ; Sun, 17 Aug 2008 18:13:45 -0700 (PDT) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by cuda.sgi.com with ESMTP id 4CEyRsX1XkOSsFkp for ; Sun, 17 Aug 2008 18:13:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDAAZqqEh5LAMbiGdsb2JhbACSDgEBAQ8goACBWA X-IronPort-AV: E=Sophos;i="4.32,224,1217773800"; d="scan'208";a="184303635" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail05.adl2.internode.on.net with ESMTP; 18 Aug 2008 10:43:41 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUtJU-0004M1-PS; Mon, 18 Aug 2008 11:13:40 +1000 Date: Mon, 18 Aug 2008 11:13:40 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/7] RFC: combine linux and XFS inodes Subject: Re: [PATCH 0/7] RFC: combine linux and XFS inodes Message-ID: <20080818011340.GI19760@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1218698083-11226-1-git-send-email-david@fromorbit.com> <20080814194550.GA12237@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080814194550.GA12237@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail05.adl2.internode.on.net[203.16.214.145] X-Barracuda-Start-Time: 1219022025 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.2960 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17585 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 14, 2008 at 03:45:50PM -0400, Christoph Hellwig wrote: > On Thu, Aug 14, 2008 at 05:14:36PM +1000, Dave Chinner wrote: > > However, this means the linux inodes are unhashed, which means we > > now need to do our own tracking of dirty state. We do this by > > hooking ->dirty_inode and ->set_page_dirty to move the inode to the > > superblock dirty list when appropriate. We also need to hook > > ->drop_inode to ensure we do writeback of dirty inodes during > > reclaim. In future, this can be moved entirely into XFS based on > > radix tree tags to track dirty inodes instead of a separate list. > > This part (patches 1, 2 and 3) is horrible, and I think avoidable. Yeah, it's not pretty in it's initial form. > We can just insert the inode into the Linux inode hash anyway, even > if we never use it later. Ok, that will avoid the writeback bits, However it doesn't avoid the need for these hooks - the next 3 patches after this add dirty tagging to the inode radix trees via ->dirty_inode and ->set_page_dirty, then use that for inode writeback clustering. > That avoids these whole three patches > and all the duplication of core code inside XFS, including the > inode_lock issue and the potential problem of getting out of sync > when the core code is updated. The adding of the inode to the superblock dirty lists is only temporary - with the tracking of dirty inodes in the radix trees we can clean inodes much more effectively ourselves than pdflush can because we know what are optimal write patterns and pdflush doesn't... As for cleaning the inode in ->drop_inode, I was planning on letting reclaim handle the dirty inode case for both linked and unlinked inodes so that we can batch the data and inode writeback and move it out of the direct VM reclaim path. That is, allow the shrinker simply to mark inodes for reclaim, then allow XFS to batch the work as efficiently as possible in the background... > If you really, really want to avoid inserting the inode into the Linux > inode cache (and that would need a sound reason) the way to go would > be to remove the assumptions of no writeback for unhashed inodes form > the core code and replace it with a flag that's normally set/cleared > during hashing/unhashing but could also be set/cleared from XFS. As I mentioned above, I'm looking to remove the writeback of inodes almost completely out of the VFS hands and tightly integrate it into the internal structures of XFS. e.g. to avoid problems like synchronous RMW cycles on inode cluster buffers we need to move to a multi-stage writeback infrastructure that the VFS simply cannot support at the moment. I'd like to get that structure in place before considering promoting it at the VFS level. Basically we need: pass 1: collect inodes to be written pass 2: extract inodes with data and sort into optimal data writeback order, issue data async data writes pass 3: issue async readahead and pin all inode cluster buffers to be written in memory. pass 4: if sync flush, wait for all data writeback to complete. Force the log (async) to unpin all inodes that allocations have been done on. pass 5: write all inodes back to buffers and issue async. pass 6: if sync flush, wait for inode writeback to complete. And of course, this can be done in parallel across multiple AGs at once. With dirty tagging in the radix tree we have all the collection, sorting and parallel access infrstrastructure we need already in place.... FWIW, the inode sort and cluster readahead pass can make 3-4 orders of magnitude difference in inode writeback speeds under workloads that span a large number of files on systems with limited memory (think typical NFS servers). Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 18 00:06:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 00:06:29 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7I76GIi004896 for ; Mon, 18 Aug 2008 00:06:17 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA24375 for ; Mon, 18 Aug 2008 17:07:36 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16305) id 933C258C52A8; Mon, 18 Aug 2008 17:07:36 +1000 (EST) To: xfs@oss.sgi.com Subject: TAKE xfsidbg.c Message-Id: <20080818070736.933C258C52A8@chook.melbourne.sgi.com> Date: Mon, 18 Aug 2008 17:07:36 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17586 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs attr_list_context.count is a ssize_t adn thus we need to use %zd, not %ld to print it. Note: non mainline file - only in xfs-dev. Signed-off-by: Christoph Hellwig Date: Mon Aug 18 17:06:56 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31917a fs/xfs/xfsidbg.c - 1.362 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.362&r2=text&tr2=1.361&f=h - attr_list_context.count is a ssize_t adn thus we need to use %zd, not %ld to print it. From owner-xfs@oss.sgi.com Mon Aug 18 00:50:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 00:51:19 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7I7ooNQ011692 for ; Mon, 18 Aug 2008 00:50:51 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA25089; Mon, 18 Aug 2008 17:52:09 +1000 Message-ID: <48A92BC6.5020105@sgi.com> Date: Mon, 18 Aug 2008 17:59:02 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [PATCH] Allocate inode tracing buffers before locking inode cluster Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8051/Fri Aug 15 20:44:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17587 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Trying to allocate memory while holding the inode cluster locked can cause deadlocks; a thread creating an inode will have the inode cluster locked and is stuck allocating memory, pdflush/kswapd are both trying to push out dirty pages and convert delayed allocations which need space in the log and xfsaild is trying to push on the tail of the log but is stuck trying to acquire the inode cluster lock. I tried fixing this with KM_NOFS but turned a two-way deadlock into a three-way deadlock. This patch moves the allocation of the inode tracing buffers before we lock the inode cluster. We can also leak memory because we don't free these allocations if we return from this function early so use xfs_idestroy() to fully clean up the inode first. Lachlan --- a/fs/xfs/xfs_inode.c 2008-08-18 17:40:42.000000000 +1000 +++ b/fs/xfs/xfs_inode.c 2008-08-15 12:05:14.000000000 +1000 @@ -818,19 +818,6 @@ xfs_iread( spin_lock_init(&ip->i_flags_lock); /* - * Get pointer's to the on-disk inode and the buffer containing it. - * If the inode number refers to a block outside the file system - * then xfs_itobp() will return NULL. In this case we should - * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will - * know that this is a new incore inode. - */ - error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, imap_flags, XFS_BUF_LOCK); - if (error) { - kmem_zone_free(xfs_inode_zone, ip); - return error; - } - - /* * Initialize inode's trace buffers. * Do this before xfs_iformat in case it adds entries. */ @@ -854,11 +841,24 @@ xfs_iread( #endif /* + * Get pointer's to the on-disk inode and the buffer containing it. + * If the inode number refers to a block outside the file system + * then xfs_itobp() will return NULL. In this case we should + * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will + * know that this is a new incore inode. + */ + error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, imap_flags, XFS_BUF_LOCK); + if (error) { + xfs_idestroy(ip); + return error; + } + + /* * If we got something that isn't an inode it means someone * (nfs or dmi) has a stale handle. */ if (be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC) { - kmem_zone_free(xfs_inode_zone, ip); + xfs_idestroy(ip); xfs_trans_brelse(tp, bp); #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: " @@ -881,7 +881,7 @@ xfs_iread( xfs_dinode_from_disk(&ip->i_d, &dip->di_core); error = xfs_iformat(ip, dip); if (error) { - kmem_zone_free(xfs_inode_zone, ip); + xfs_idestroy(ip); xfs_trans_brelse(tp, bp); #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: " From owner-xfs@oss.sgi.com Mon Aug 18 01:12:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 01:13:05 -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 m7I8Cmlq013411 for ; Mon, 18 Aug 2008 01:12:49 -0700 X-ASG-Debug-ID: 1219047247-30dc018f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 127303A99A5 for ; Mon, 18 Aug 2008 01:14:08 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id KHAb3IQT5gJ9VO5d for ; Mon, 18 Aug 2008 01:14:08 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEDAGTMqEh5LAMbiGdsb2JhbACSDQEBAQ8goTmBWA X-IronPort-AV: E=Sophos;i="4.32,227,1217773800"; d="scan'208";a="173853993" Received: from ppp121-44-3-27.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.3.27]) by ipmail01.adl6.internode.on.net with ESMTP; 18 Aug 2008 17:44:06 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KUzsJ-00057V-Qp; Mon, 18 Aug 2008 18:14:03 +1000 Date: Mon, 18 Aug 2008 18:14:03 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Allocate inode tracing buffers before locking inode cluster Subject: Re: [PATCH] Allocate inode tracing buffers before locking inode cluster Message-ID: <20080818081403.GJ19760@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs-dev , xfs-oss References: <48A92BC6.5020105@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A92BC6.5020105@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219047249 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.2988 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17588 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 18, 2008 at 05:59:02PM +1000, Lachlan McIlroy wrote: > Trying to allocate memory while holding the inode cluster locked can cause > deadlocks; a thread creating an inode will have the inode cluster locked > and is stuck allocating memory, pdflush/kswapd are both trying to push out > dirty pages and convert delayed allocations which need space in the log and > xfsaild is trying to push on the tail of the log but is stuck trying to > acquire the inode cluster lock. > > I tried fixing this with KM_NOFS but turned a two-way deadlock into a > three-way deadlock. This patch moves the allocation of the inode tracing > buffers before we lock the inode cluster. We can also leak memory because > we don't free these allocations if we return from this function early so > use xfs_idestroy() to fully clean up the inode first. Seems sane, but I think it should be wrapped up in the xfs_inode_alloc() code added as part of the 'Make use of the init-once slab optimisation' patch I posted recently. This moves the initialisation of all things inode related into a separate function - xfs_inode_alloc() - instead of doing all these intialisations around the place.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 18 02:54:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 02:54:33 -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=0.5 required=5.0 tests=BAYES_00,HTML_MESSAGE, J_CHICKENPOX_43 autolearn=no 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 m7I9sUSw018854 for ; Mon, 18 Aug 2008 02:54:30 -0700 X-ASG-Debug-ID: 1219053347-3b1a028a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nf-out-0910.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B82D8F62345 for ; Mon, 18 Aug 2008 02:55:47 -0700 (PDT) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by cuda.sgi.com with ESMTP id RR6cG3i3kqaS7fjk for ; Mon, 18 Aug 2008 02:55:47 -0700 (PDT) Received: by nf-out-0910.google.com with SMTP id h3so975573nfh.42 for ; Mon, 18 Aug 2008 02:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=8WorjiogDL569b5dbEoD38+/c07vfTUu5l+S9oySo7w=; b=WGsIZbIuRNGcimCp3jwTcS85ktS67DDvjAqZs0dTQtF1NmE/AJ07MtPmmgRfI0XIaG BAWOvbFdY1KUOiPKoFYQDz21//NIIUSrghqzDCbXYMLk7D0CCLECv3/nvaJ/3PGHNZAC 50bgLKgNE5/7HrnzDcQuk3TeHSEW/q3bWm2Os= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=aPou+XuirORQjlE0LEPR3H9qSUqEmYnIQwiOBHSw9d/G0eIU16p2IBfzld8hVsaOYT DQRIJj06dDXUVIHCLD5CWqxUhggkGlZ5WqNeNnR+HkckFoSzRiilsWGV+5GaPkVoH+53 Hz+ZxluytHt2jp86uWvPx9i8HChi0YsgQyq14= Received: by 10.210.63.5 with SMTP id l5mr7748951eba.85.1219053346665; Mon, 18 Aug 2008 02:55:46 -0700 (PDT) Received: by 10.210.24.9 with HTTP; Mon, 18 Aug 2008 02:55:46 -0700 (PDT) Message-ID: <702ec7d40808180255n28683008p68f7c1e9a24173c1@mail.gmail.com> Date: Mon, 18 Aug 2008 11:55:46 +0200 From: daniel To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs slow ops Subject: xfs slow ops MIME-Version: 1.0 X-Barracuda-Connect: nf-out-0910.google.com[64.233.182.189] X-Barracuda-Start-Time: 1219053349 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=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.2998 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 5854 X-archive-position: 17589 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: luriad@gmail.com Precedence: bulk X-list: xfs I'm working on a new server and test the performance from xfs and ext3 with iozone. iozone -T -t 32 -F /data/iozonefile{0..31} -o -O -i6 -i7 -i0 -i1 -i2 -s512m -r16k -+u system : SLES 10.2 : 2.6.16.60-0.27-smp #1 SMP on a DELL 2950 : 1 GB RAM: raid: raid 10 with 8 disks 15k : 64k chunksize : dell md 1000 : perc 6/e : WriteBack, ReadAheadNone, Cached, echo "3" > /proc/sys/vm/drop_caches why is the xfs read, reread and rewrite so slow ? 1) xfs mkfs.xfs -f -L DATA /dev/sdb1 /dev/sdb1 on /data type xfs (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 5940.92 ops/sec Parent sees throughput for 32 initial writers = 1244.99 ops/sec Min throughput per thread = 127.88 ops/sec Max throughput per thread = 742.80 ops/sec Avg throughput per thread = 185.65 ops/sec Min xfer = 5641.00 ops CPU Utilization: Wall time 210.499 CPU time 3323.852 CPU utilization 1579.03 % Children see throughput for 32 rewriters = 2298.54 ops/sec Parent sees throughput for 32 rewriters = 2293.51 ops/sec Min throughput per thread = 66.23 ops/sec Max throughput per thread = 79.09 ops/sec Avg throughput per thread = 71.83 ops/sec Min xfer = 27439.00 ops CPU utilization: Wall time 415.265 CPU time 1032.129 CPU utilization 248.55 % Children see throughput for 32 readers = 6923.75 ops/sec Parent sees throughput for 32 readers = 6920.53 ops/sec Min throughput per thread = 211.00 ops/sec Max throughput per thread = 226.58 ops/sec Avg throughput per thread = 216.37 ops/sec Min xfer = 30525.00 ops CPU utilization: Wall time 144.732 CPU time 389.016 CPU utilization 268.78 % Children see throughput for 32 re-readers = 6864.93 ops/sec Parent sees throughput for 32 re-readers = 6861.38 ops/sec Min throughput per thread = 209.57 ops/sec Max throughput per thread = 220.73 ops/sec Avg throughput per thread = 214.53 ops/sec Min xfer = 31133.00 ops CPU utilization: Wall time 148.571 CPU time 400.709 CPU utilization 269.71 % Children see throughput for 32 random readers = 2335.44 ops/sec Parent sees throughput for 32 random readers = 2335.30 ops/sec Min throughput per thread = 70.48 ops/sec Max throughput per thread = 74.36 ops/sec Avg throughput per thread = 72.98 ops/sec Min xfer = 31058.00 ops CPU utilization: Wall time 440.693 CPU time 647.208 CPU utilization 146.86 % 2) ext3 mkfs.ext3 /dev/sdb1 -E stride=16 /dev/sdb1 on /data type ext3 (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 3238.64 ops/sec Parent sees throughput for 32 initial writers = 3238.20 ops/sec Min throughput per thread = 101.20 ops/sec Max throughput per thread = 101.21 ops/sec Avg throughput per thread = 101.21 ops/sec Min xfer = 32763.00 ops CPU Utilization: Wall time 323.791 CPU time 281.362 CPU utilization 86.90 % Children see throughput for 32 rewriters = 10553.17 ops/sec Parent sees throughput for 32 rewriters = 10517.38 ops/sec Min throughput per thread = 307.10 ops/sec Max throughput per thread = 378.34 ops/sec Avg throughput per thread = 329.79 ops/sec Min xfer = 26628.00 ops CPU utilization: Wall time 87.079 CPU time 966.580 CPU utilization 1110.00 % Children see throughput for 32 readers = 20602.73 ops/sec Parent sees throughput for 32 readers = 20579.60 ops/sec Min throughput per thread = 518.61 ops/sec Max throughput per thread = 683.18 ops/sec Avg throughput per thread = 643.84 ops/sec Min xfer = 24893.00 ops CPU utilization: Wall time 48.045 CPU time 292.886 CPU utilization 609.61 % Children see throughput for 32 re-readers = 20938.47 ops/sec Parent sees throughput for 32 re-readers = 20912.34 ops/sec Min throughput per thread = 587.57 ops/sec Max throughput per thread = 685.95 ops/sec Avg throughput per thread = 654.33 ops/sec Min xfer = 28093.00 ops CPU utilization: Wall time 47.864 CPU time 291.858 CPU utilization 609.76 % Children see throughput for 32 random readers = 3315.69 ops/sec Parent sees throughput for 32 random readers = 3315.50 ops/sec Min throughput per thread = 102.18 ops/sec Max throughput per thread = 105.06 ops/sec Avg throughput per thread = 103.62 ops/sec Min xfer = 31868.00 ops CPU utilization: Wall time 311.905 CPU time 619.687 CPU utilization 198.68 % who can me explain that results ? thanks, daniel [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Aug 18 04:06:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 04:06:49 -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=4.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, J_CHICKENPOX_43 autolearn=no 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 m7IB6liI022957 for ; Mon, 18 Aug 2008 04:06:47 -0700 X-ASG-Debug-ID: 1219057685-0bc102460000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ik-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 68D90F623C1 for ; Mon, 18 Aug 2008 04:08:06 -0700 (PDT) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.177]) by cuda.sgi.com with ESMTP id x4vIkRzK3l6Fwbv6 for ; Mon, 18 Aug 2008 04:08:06 -0700 (PDT) Received: by ik-out-1112.google.com with SMTP id c29so2671621ika.4 for ; Mon, 18 Aug 2008 04:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=QoZ6hBDv60RYAuVKDJG17x0AQmBNLc/R5k67ICR8wsE=; b=a7UcMJa8aZe5f5GLeBMq7Bh55Fm6kwgMDfCYBdCcTeWvDebZHMkAuKm/8LbmfDmUv2 MBjwSU8faLc6KgM899sLpBh9zRCeXFs1k2kc1EHmjFHNbwqMcK6JF/meX0hsEqSnFWs8 PHTSiLm6sz9jINyZfIiCHOBlWI6NEWzBeE6HI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=eLmXI16iolNCJiRsvVF5j1Y+OwCj/+GZYxDzfMPyHoUWx0gySTfy+hk8pxmVxTvdt/ G05BzHi9P/NGHdWrv+Dt5JSXHna1zxNgaf29OZYWYUoq2QtJW5L71tI/oh5dmm3bHLiu NPJzqaqgkma7CDSjy4s9svT6G9isqiW+oQDeU= Received: by 10.210.76.12 with SMTP id y12mr7825349eba.151.1219057685321; Mon, 18 Aug 2008 04:08:05 -0700 (PDT) Received: by 10.210.24.9 with HTTP; Mon, 18 Aug 2008 04:08:05 -0700 (PDT) Message-ID: <702ec7d40808180408u57c14e82p778cfb7af6f3dc9e@mail.gmail.com> Date: Mon, 18 Aug 2008 13:08:05 +0200 From: daniel To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs _ slow rewrite ? Subject: xfs _ slow rewrite ? MIME-Version: 1.0 X-Barracuda-Connect: ik-out-1112.google.com[66.249.90.177] X-Barracuda-Start-Time: 1219057687 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0206 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=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3004 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 5854 X-archive-position: 17590 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: luriad@gmail.com Precedence: bulk X-list: xfs I'm working on a new server and test the performance from xfs and ext3 with iozone. iozone -T -t 32 -F /data/iozonefile{0..31} -o -O -i6 -i7 -i0 -i1 -i2 -s512m -r16k -+u system : SLES 10.2 : 2.6.16.60-0.27-smp #1 SMP on a DELL 2950 : 1 GB RAM: raid: raid 10 with 8 disks 15k : 64k chunksize : dell md 1000 : perc 6/e : WriteBack, ReadAheadNone, Cached, echo "3" > /proc/sys/vm/drop_caches why is the xfs read, reread and rewrite so slow ? 1) xfs mkfs.xfs -f -L DATA /dev/sdb1 /dev/sdb1 on /data type xfs (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 5940.92 ops/sec Parent sees throughput for 32 initial writers = 1244.99 ops/sec Min throughput per thread = 127.88 ops/sec Max throughput per thread = 742.80 ops/sec Avg throughput per thread = 185.65 ops/sec Min xfer = 5641.00 ops CPU Utilization: Wall time 210.499 CPU time 3323.852 CPU utilization 1579.03 % Children see throughput for 32 rewriters = 2298.54 ops/sec Parent sees throughput for 32 rewriters = 2293.51 ops/sec Min throughput per thread = 66.23 ops/sec Max throughput per thread = 79.09 ops/sec Avg throughput per thread = 71.83 ops/sec Min xfer = 27439.00 ops CPU utilization: Wall time 415.265 CPU time 1032.129 CPU utilization 248.55 % Children see throughput for 32 readers = 6923.75 ops/sec Parent sees throughput for 32 readers = 6920.53 ops/sec Min throughput per thread = 211.00 ops/sec Max throughput per thread = 226.58 ops/sec Avg throughput per thread = 216.37 ops/sec Min xfer = 30525.00 ops CPU utilization: Wall time 144.732 CPU time 389.016 CPU utilization 268.78 % Children see throughput for 32 re-readers = 6864.93 ops/sec Parent sees throughput for 32 re-readers = 6861.38 ops/sec Min throughput per thread = 209.57 ops/sec Max throughput per thread = 220.73 ops/sec Avg throughput per thread = 214.53 ops/sec Min xfer = 31133.00 ops CPU utilization: Wall time 148.571 CPU time 400.709 CPU utilization 269.71 % Children see throughput for 32 random readers = 2335.44 ops/sec Parent sees throughput for 32 random readers = 2335.30 ops/sec Min throughput per thread = 70.48 ops/sec Max throughput per thread = 74.36 ops/sec Avg throughput per thread = 72.98 ops/sec Min xfer = 31058.00 ops CPU utilization: Wall time 440.693 CPU time 647.208 CPU utilization 146.86 % 2) ext3 mkfs.ext3 /dev/sdb1 -E stride=16 /dev/sdb1 on /data type ext3 (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 3238.64 ops/sec Parent sees throughput for 32 initial writers = 3238.20 ops/sec Min throughput per thread = 101.20 ops/sec Max throughput per thread = 101.21 ops/sec Avg throughput per thread = 101.21 ops/sec Min xfer = 32763.00 ops CPU Utilization: Wall time 323.791 CPU time 281.362 CPU utilization 86.90 % Children see throughput for 32 rewriters = 10553.17 ops/sec Parent sees throughput for 32 rewriters = 10517.38 ops/sec Min throughput per thread = 307.10 ops/sec Max throughput per thread = 378.34 ops/sec Avg throughput per thread = 329.79 ops/sec Min xfer = 26628.00 ops CPU utilization: Wall time 87.079 CPU time 966.580 CPU utilization 1110.00 % Children see throughput for 32 readers = 20602.73 ops/sec Parent sees throughput for 32 readers = 20579.60 ops/sec Min throughput per thread = 518.61 ops/sec Max throughput per thread = 683.18 ops/sec Avg throughput per thread = 643.84 ops/sec Min xfer = 24893.00 ops CPU utilization: Wall time 48.045 CPU time 292.886 CPU utilization 609.61 % Children see throughput for 32 re-readers = 20938.47 ops/sec Parent sees throughput for 32 re-readers = 20912.34 ops/sec Min throughput per thread = 587.57 ops/sec Max throughput per thread = 685.95 ops/sec Avg throughput per thread = 654.33 ops/sec Min xfer = 28093.00 ops CPU utilization: Wall time 47.864 CPU time 291.858 CPU utilization 609.76 % Children see throughput for 32 random readers = 3315.69 ops/sec Parent sees throughput for 32 random readers = 3315.50 ops/sec Min throughput per thread = 102.18 ops/sec Max throughput per thread = 105.06 ops/sec Avg throughput per thread = 103.62 ops/sec Min xfer = 31868.00 ops CPU utilization: Wall time 311.905 CPU time 619.687 CPU utilization 198.68 % who can me explain that results ? thanks, daniel [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Aug 18 04:10:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 04:10:54 -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=-0.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no 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 m7IBAqU3023592 for ; Mon, 18 Aug 2008 04:10:52 -0700 X-ASG-Debug-ID: 1219057930-378002810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ik-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 532313AA043 for ; Mon, 18 Aug 2008 04:12:10 -0700 (PDT) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.180]) by cuda.sgi.com with ESMTP id aSvlTGCNNNao3OhH for ; Mon, 18 Aug 2008 04:12:10 -0700 (PDT) Received: by ik-out-1112.google.com with SMTP id c29so2673232ika.4 for ; Mon, 18 Aug 2008 04:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=JM1eeojUlnD7IAdp3HJrbme0cnvmJzKog2Jdt1D+bb0=; b=UP5hQpezAAEo21dNCULLZzpAqq6AEbn0FDnNInZoIQzafrGyydKss34b++KAhApIS3 zxbEU8JC8MY191ysTpysRhLhnWbUwjZ0BSAhRLaJqHfcStF9KzvluQrBv+MLEevvwAYk 0ZR+zYmjq8nW682ZJZxn/CK39RmdpDB3j1qqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=IU+V6LdK8HquBCpZBJTcNMzIRVm0VhhCq3R/rEDtF+tin7O/OjrytROAvX6bUbWK45 AJcdooGpfTkV7j1ItIXEHLC7bMwUynYET1gdzuqRZUXYVGvjHzozHLHitS5Yb13M4lBy 6ZbdoAt761xhfHoOxVBS6EZSqI2ddWKXmMls4= Received: by 10.210.44.1 with SMTP id r1mr7841706ebr.11.1219057929966; Mon, 18 Aug 2008 04:12:09 -0700 (PDT) Received: by 10.210.24.9 with HTTP; Mon, 18 Aug 2008 04:12:09 -0700 (PDT) Message-ID: <702ec7d40808180412u21613a03q757f4e20748ec039@mail.gmail.com> Date: Mon, 18 Aug 2008 13:12:09 +0200 From: daniel To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs _ slow rewrite ? Subject: xfs _ slow rewrite ? In-Reply-To: <702ec7d40808180408u57c14e82p778cfb7af6f3dc9e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <702ec7d40808180408u57c14e82p778cfb7af6f3dc9e@mail.gmail.com> X-Barracuda-Connect: ik-out-1112.google.com[66.249.90.180] X-Barracuda-Start-Time: 1219057932 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.3003 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17591 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: luriad@gmail.com Precedence: bulk X-list: xfs I'm working on a new server and test the performance from xfs and ext3 with iozone. iozone -T -t 32 -F /data/iozonefile{0..31} -o -O -i6 -i7 -i0 -i1 -i2 -s512m -r16k -+u system : SLES 10.2 : 2.6.16.60-0.27-smp #1 SMP on a DELL 2950 : 1 GB RAM: raid: raid 10 with 8 disks 15k : 64k chunksize : dell md 1000 : perc 6/e : WriteBack, ReadAheadNone, Cached, echo "3" > /proc/sys/vm/drop_caches why is the xfs read, reread and rewrite so slow ? 1) xfs mkfs.xfs -f -L DATA /dev/sdb1 /dev/sdb1 on /data type xfs (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 5940.92 ops/sec Parent sees throughput for 32 initial writers = 1244.99 ops/sec Min throughput per thread = 127.88 ops/sec Max throughput per thread = 742.80 ops/sec Avg throughput per thread = 185.65 ops/sec Min xfer = 5641.00 ops CPU Utilization: Wall time 210.499 CPU time 3323.852 CPU utilization 1579.03 % Children see throughput for 32 rewriters = 2298.54 ops/sec Parent sees throughput for 32 rewriters = 2293.51 ops/sec Min throughput per thread = 66.23 ops/sec Max throughput per thread = 79.09 ops/sec Avg throughput per thread = 71.83 ops/sec Min xfer = 27439.00 ops CPU utilization: Wall time 415.265 CPU time 1032.129 CPU utilization 248.55 % Children see throughput for 32 readers = 6923.75 ops/sec Parent sees throughput for 32 readers = 6920.53 ops/sec Min throughput per thread = 211.00 ops/sec Max throughput per thread = 226.58 ops/sec Avg throughput per thread = 216.37 ops/sec Min xfer = 30525.00 ops CPU utilization: Wall time 144.732 CPU time 389.016 CPU utilization 268.78 % Children see throughput for 32 re-readers = 6864.93 ops/sec Parent sees throughput for 32 re-readers = 6861.38 ops/sec Min throughput per thread = 209.57 ops/sec Max throughput per thread = 220.73 ops/sec Avg throughput per thread = 214.53 ops/sec Min xfer = 31133.00 ops CPU utilization: Wall time 148.571 CPU time 400.709 CPU utilization 269.71 % Children see throughput for 32 random readers = 2335.44 ops/sec Parent sees throughput for 32 random readers = 2335.30 ops/sec Min throughput per thread = 70.48 ops/sec Max throughput per thread = 74.36 ops/sec Avg throughput per thread = 72.98 ops/sec Min xfer = 31058.00 ops CPU utilization: Wall time 440.693 CPU time 647.208 CPU utilization 146.86 % 2) ext3 mkfs.ext3 /dev/sdb1 -E stride=16 /dev/sdb1 on /data type ext3 (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 3238.64 ops/sec Parent sees throughput for 32 initial writers = 3238.20 ops/sec Min throughput per thread = 101.20 ops/sec Max throughput per thread = 101.21 ops/sec Avg throughput per thread = 101.21 ops/sec Min xfer = 32763.00 ops CPU Utilization: Wall time 323.791 CPU time 281.362 CPU utilization 86.90 % Children see throughput for 32 rewriters = 10553.17 ops/sec Parent sees throughput for 32 rewriters = 10517.38 ops/sec Min throughput per thread = 307.10 ops/sec Max throughput per thread = 378.34 ops/sec Avg throughput per thread = 329.79 ops/sec Min xfer = 26628.00 ops CPU utilization: Wall time 87.079 CPU time 966.580 CPU utilization 1110.00 % Children see throughput for 32 readers = 20602.73 ops/sec Parent sees throughput for 32 readers = 20579.60 ops/sec Min throughput per thread = 518.61 ops/sec Max throughput per thread = 683.18 ops/sec Avg throughput per thread = 643.84 ops/sec Min xfer = 24893.00 ops CPU utilization: Wall time 48.045 CPU time 292.886 CPU utilization 609.61 % Children see throughput for 32 re-readers = 20938.47 ops/sec Parent sees throughput for 32 re-readers = 20912.34 ops/sec Min throughput per thread = 587.57 ops/sec Max throughput per thread = 685.95 ops/sec Avg throughput per thread = 654.33 ops/sec Min xfer = 28093.00 ops CPU utilization: Wall time 47.864 CPU time 291.858 CPU utilization 609.76 % Children see throughput for 32 random readers = 3315.69 ops/sec Parent sees throughput for 32 random readers = 3315.50 ops/sec Min throughput per thread = 102.18 ops/sec Max throughput per thread = 105.06 ops/sec Avg throughput per thread = 103.62 ops/sec Min xfer = 31868.00 ops CPU utilization: Wall time 311.905 CPU time 619.687 CPU utilization 198.68 % who can me explain that results ? thanks, daniel From owner-xfs@oss.sgi.com Mon Aug 18 05:27:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 05:27:38 -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,J_CHICKENPOX_24, J_CHICKENPOX_53,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7ICRWfs000770 for ; Mon, 18 Aug 2008 05:27:33 -0700 X-ASG-Debug-ID: 1219062530-5e9b01270000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 52A6319F8B41 for ; Mon, 18 Aug 2008 05:28:50 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id p6gaeA8x3Lv5QOAD for ; Mon, 18 Aug 2008 05:28:50 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54C.nec.co.jp [10.7.69.197]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICS7p1023643; Mon, 18 Aug 2008 21:28:07 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7ICS7p17964; Mon, 18 Aug 2008 21:28:07 +0900 (JST) Received: from saigo.jp.nec.com (saigo.jp.nec.com [10.26.220.6]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICS7lg001450; Mon, 18 Aug 2008 21:28:07 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Mon, 18 Aug 2008 21:28:04 +0900 To: Andrew Morton Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 0/3] freeze feature ver 1.10 Subject: [PATCH 0/3] freeze feature ver 1.10 Message-Id: <20080818212804t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Mon, 18 Aug 2008 21:28:04 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1219062532 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.3009 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17592 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi Andrew, I've addressed all of the comments (including yours) in these patches and re-based from linux-2.6.26 to linux-2.6.27-rc3. If there is no problem or objection for my patches, could you consider merging them into Linux? Currently, ext3 in mainline Linux doesn't have the freeze feature which suspends write requests. So, we cannot take a backup which keeps the filesystem's consistency with the storage device's features (snapshot and replication) while it is mounted. In many case, a commercial filesystem (e.g. VxFS) has the freeze feature and it would be used to get the consistent backup. If Linux's standard filesytem ext3 has the freeze feature, we can do it without a commercial filesystem. So I have implemented the ioctls of the freeze feature. I think we can take the consistent backup with the following steps. 1. Freeze the filesystem with the freeze ioctl. 2. Separate the replication volume or create the snapshot with the storage device's feature. 3. Unfreeze the filesystem with the unfreeze ioctl. 4. Take the backup from the separated replication volume or the snapshot. [PATCH 1/3] Implement generic freeze feature The ioctls for the generic freeze feature are below. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, arg) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 o Unfreeze the filesystem int ioctl(int fd, int FITHAW, arg) fd: The file descriptor of the mountpoint FITHAW: request code for unfreeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature It removes XFS specific ioctl interfaces and request codes for freeze feature. This patch has been supplied by David Chinner. [PATCH 3/3] Add timeout feature The timeout feature is added to freeze ioctl. And new ioctl to reset the timeout period is added. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, long *timeout_sec) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze timeout_sec: the timeout period in seconds If it's 0 or 1, the timeout isn't set. This special case of "1" is implemented to keep the compatibility with XFS applications. Return value: 0 if the operation succeeds. Otherwise, -1 o Reset the timeout period This is useful for the application to set the timeout_sec more accurately. For example, the freezer resets the timeout_sec to 10 seconds every 5 seconds. In this approach, even if the freezer causes a deadlock by accessing the frozen filesystem, it will be solved by the timeout in 10 seconds and the freezer can recognize that at the next reset of timeout_sec. int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) fd:file descriptor of mountpoint FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period timeout_sec: new timeout period in seconds Return value: 0 if the operation succeeds. Otherwise, -1 Error number: If the filesystem has already been unfrozen, errno is set to EINVAL. Any comments are very welcome. Cheers, Takashi From owner-xfs@oss.sgi.com Mon Aug 18 05:27:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 05:27:50 -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 (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 m7ICRk87000840 for ; Mon, 18 Aug 2008 05:27:46 -0700 X-ASG-Debug-ID: 1219062545-5dad016d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 99FFD12F8F74 for ; Mon, 18 Aug 2008 05:29:05 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id 1OkYXbjQcggJtTFI for ; Mon, 18 Aug 2008 05:29:05 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53D.nec.co.jp [10.7.69.160]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICSTVQ023911; Mon, 18 Aug 2008 21:28:29 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7ICSTO03324; Mon, 18 Aug 2008 21:28:29 +0900 (JST) Received: from kuichi.jp.nec.com (kuichi.jp.nec.com [10.26.220.17]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICSSLL001626; Mon, 18 Aug 2008 21:28:28 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Mon, 18 Aug 2008 21:28:27 +0900 To: Andrew Morton Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature Subject: [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature Message-Id: <20080818212827t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Mon, 18 Aug 2008 21:28:27 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1219062546 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.3008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17594 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs It removes XFS specific ioctl interfaces and request codes for freeze feature. This patch has been supplied by David Chinner. Signed-off-by: Dave Chinner Signed-off-by: Takashi Sato --- linux-2.6/xfs_ioctl.c | 15 --------------- linux-2.6/xfs_ioctl32.c | 2 -- xfs_fs.h | 4 ++-- 3 files changed, 2 insertions(+), 19 deletions(-) diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-freeze/fs/xfs/linux-2.6/xfs_ioctl.c linux-2.6 .27-rc2-xfs/fs/xfs/linux-2.6/xfs_ioctl.c --- linux-2.6.27-rc2-freeze/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-07 08:58:45.000000000 +0900 +++ linux-2.6.27-rc2-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-07 09:01:53.000000000 +0900 @@ -1529,21 +1529,6 @@ xfs_ioctl( return -error; } - case XFS_IOC_FREEZE: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - - if (inode->i_sb->s_frozen == SB_UNFROZEN) - freeze_bdev(inode->i_sb->s_bdev); - return 0; - - case XFS_IOC_THAW: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (inode->i_sb->s_frozen != SB_UNFROZEN) - thaw_bdev(inode->i_sb->s_bdev, inode->i_sb); - return 0; - case XFS_IOC_GOINGDOWN: { __uint32_t in; diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-freeze/fs/xfs/linux-2.6/xfs_ioctl32.c linux-2 .6.27-rc2-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c --- linux-2.6.27-rc2-freeze/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-08-07 08:58:45.000000000 +0900 +++ linux-2.6.27-rc2-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-08-07 09:01:53.000000000 +0900 @@ -398,8 +398,6 @@ xfs_compat_ioctl( case XFS_IOC_FSGROWFSDATA: case XFS_IOC_FSGROWFSLOG: case XFS_IOC_FSGROWFSRT: - case XFS_IOC_FREEZE: - case XFS_IOC_THAW: case XFS_IOC_GOINGDOWN: case XFS_IOC_ERROR_INJECTION: case XFS_IOC_ERROR_CLEARALL: diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-freeze/fs/xfs/xfs_fs.h linux-2.6.27-rc2-xfs/f s/xfs/xfs_fs.h --- linux-2.6.27-rc2-freeze/fs/xfs/xfs_fs.h 2008-08-07 08:58:45.000000000 +0900 +++ linux-2.6.27-rc2-xfs/fs/xfs/xfs_fs.h 2008-08-07 09:01:53.000000000 +0900 @@ -477,8 +477,8 @@ typedef struct xfs_handle { #define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection) #define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection) /* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */ -#define XFS_IOC_FREEZE _IOWR('X', 119, int) -#define XFS_IOC_THAW _IOWR('X', 120, int) +/* XFS_IOC_FREEZE -- FIFREEZE 119 */ +/* XFS_IOC_THAW -- FITHAW 120 */ #define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq) #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq) #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) From owner-xfs@oss.sgi.com Mon Aug 18 05:27:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 05:27:41 -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,J_CHICKENPOX_21, J_CHICKENPOX_53 autolearn=no 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 m7ICRdtL000789 for ; Mon, 18 Aug 2008 05:27:39 -0700 X-ASG-Debug-ID: 1219062538-24be00da0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 69A243AA25F for ; Mon, 18 Aug 2008 05:28:58 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id iRv9hgmBG4UFnfE4 for ; Mon, 18 Aug 2008 05:28:58 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53D.nec.co.jp [10.7.69.160]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICSKgg023810; Mon, 18 Aug 2008 21:28:20 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7ICSKY03246; Mon, 18 Aug 2008 21:28:20 +0900 (JST) Received: from togyo.jp.nec.com (togyo.jp.nec.com [10.26.220.4]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICSJrv014968; Mon, 18 Aug 2008 21:28:19 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Mon, 18 Aug 2008 21:28:19 +0900 To: Andrew Morton Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 1/3] Implement generic freeze feature Subject: [PATCH 1/3] Implement generic freeze feature Message-Id: <20080818212819t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Mon, 18 Aug 2008 21:28:19 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1219062539 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17593 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs The ioctls for the generic freeze feature are below. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, arg) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 o Unfreeze the filesystem int ioctl(int fd, int FITHAW, arg) fd: The file descriptor of the mountpoint FITHAW: request code for unfreeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 Signed-off-by: Takashi Sato Signed-off-by: Masayuki Hamaguchi --- fs/block_dev.c | 2 + fs/buffer.c | 27 ++++++++++++++++++- fs/ioctl.c | 61 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/buffer_head.h | 2 - include/linux/fs.h | 6 ++++ 5 files changed, 96 insertions(+), 2 deletions(-) diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2.org/fs/block_dev.c linux-2.6.27-rc2-freeze/fs /block_dev.c --- linux-2.6.27-rc2.org/fs/block_dev.c 2008-08-06 13:49:54.000000000 +0900 +++ linux-2.6.27-rc2-freeze/fs/block_dev.c 2008-08-07 08:59:54.000000000 +0900 @@ -285,6 +285,8 @@ static void init_once(void *foo) INIT_LIST_HEAD(&bdev->bd_holder_list); #endif inode_init_once(&ei->vfs_inode); + /* Initialize semaphore for freeze. */ + sema_init(&bdev->bd_freeze_sem, 1); } static inline void __bd_forget(struct inode *inode) diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2.org/fs/buffer.c linux-2.6.27-rc2-freeze/fs/bu ffer.c --- linux-2.6.27-rc2.org/fs/buffer.c 2008-08-06 13:49:54.000000000 +0900 +++ linux-2.6.27-rc2-freeze/fs/buffer.c 2008-08-07 08:59:54.000000000 +0900 @@ -201,6 +201,15 @@ struct super_block *freeze_bdev(struct b { struct super_block *sb; + down(&bdev->bd_freeze_sem); + bdev->bd_freeze_count++; + if (bdev->bd_freeze_count > 1) { + sb = get_super(bdev); + drop_super(sb); + up(&bdev->bd_freeze_sem); + return sb; + } + down(&bdev->bd_mount_sem); sb = get_super(bdev); if (sb && !(sb->s_flags & MS_RDONLY)) { @@ -219,6 +228,8 @@ struct super_block *freeze_bdev(struct b } sync_blockdev(bdev); + up(&bdev->bd_freeze_sem); + return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */ } EXPORT_SYMBOL(freeze_bdev); @@ -230,8 +241,20 @@ EXPORT_SYMBOL(freeze_bdev); * * Unlocks the filesystem and marks it writeable again after freeze_bdev(). */ -void thaw_bdev(struct block_device *bdev, struct super_block *sb) +int thaw_bdev(struct block_device *bdev, struct super_block *sb) { + + down(&bdev->bd_freeze_sem); + if (!bdev->bd_freeze_count) { + up(&bdev->bd_freeze_sem); + return 0; + } + bdev->bd_freeze_count--; + if (bdev->bd_freeze_count > 0) { + up(&bdev->bd_freeze_sem); + return 0; + } + if (sb) { BUG_ON(sb->s_bdev != bdev); @@ -244,6 +267,8 @@ void thaw_bdev(struct block_device *bdev } up(&bdev->bd_mount_sem); + up(&bdev->bd_freeze_sem); + return 0; } EXPORT_SYMBOL(thaw_bdev); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2.org/fs/ioctl.c linux-2.6.27-rc2-freeze/fs/ioc tl.c --- linux-2.6.27-rc2.org/fs/ioctl.c 2008-08-06 13:49:54.000000000 +0900 +++ linux-2.6.27-rc2-freeze/fs/ioctl.c 2008-08-07 08:59:54.000000000 +0900 @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -141,6 +142,57 @@ static int ioctl_fioasync(unsigned int f } /* + * ioctl_freeze - Freeze the filesystem. + * + * @filp: target file + * + * Call freeze_bdev() to freeze the filesystem. + */ +static int ioctl_freeze(struct file *filp) +{ + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If filesystem doesn't support freeze feature, return. */ + if (sb->s_op->write_super_lockfs == NULL) + return -EOPNOTSUPP; + + /* If a regular file or a directory isn't specified, return. */ + if (sb->s_bdev == NULL) + return -EINVAL; + + /* Freeze */ + sb = freeze_bdev(sb->s_bdev); + if (IS_ERR(sb)) + return PTR_ERR(sb); + return 0; +} + +/* + * ioctl_thaw - Thaw the filesystem. + * + * @filp: target file + * + * Call thaw_bdev() to thaw the filesystem. + */ +static int ioctl_thaw(struct file *filp) +{ + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If a regular file or a directory isn't specified, return EINVAL. */ + if (sb->s_bdev == NULL) + return -EINVAL; + + /* Thaw */ + return thaw_bdev(sb->s_bdev, sb); +} + +/* * When you add any new common ioctls to the switches above and below * please update compat_sys_ioctl() too. * @@ -181,6 +233,15 @@ int do_vfs_ioctl(struct file *filp, unsi } else error = -ENOTTY; break; + + case FIFREEZE: + error = ioctl_freeze(filp); + break; + + case FITHAW: + error = ioctl_thaw(filp); + break; + default: if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2.org/include/linux/buffer_head.h linux-2.6.27- rc2-freeze/include/linux/buffer_head.h --- linux-2.6.27-rc2.org/include/linux/buffer_head.h 2008-08-06 13:49:54.000000000 +0900 +++ linux-2.6.27-rc2-freeze/include/linux/buffer_head.h 2008-08-07 08:59:54.000000000 +0900 @@ -170,7 +170,7 @@ void __wait_on_buffer(struct buffer_head wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); int fsync_bdev(struct block_device *); struct super_block *freeze_bdev(struct block_device *); -void thaw_bdev(struct block_device *, struct super_block *); +int thaw_bdev(struct block_device *, struct super_block *); int fsync_super(struct super_block *); int fsync_no_super(struct block_device *); struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2.org/include/linux/fs.h linux-2.6.27-rc2-freez e/include/linux/fs.h --- linux-2.6.27-rc2.org/include/linux/fs.h 2008-08-06 13:49:54.000000000 +0900 +++ linux-2.6.27-rc2-freeze/include/linux/fs.h 2008-08-07 08:59:54.000000000 +0900 @@ -226,6 +226,8 @@ extern int dir_notify_enable; #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ #define FIBMAP _IO(0x00,1) /* bmap access */ #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ +#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ +#define FITHAW _IOWR('X', 120, int) /* Thaw */ #define FS_IOC_GETFLAGS _IOR('f', 1, long) #define FS_IOC_SETFLAGS _IOW('f', 2, long) @@ -574,6 +576,10 @@ struct block_device { * care to not mess up bd_private for that case. */ unsigned long bd_private; + /* The counter of freeze processes */ + int bd_freeze_count; + /* Semaphore for freeze */ + struct semaphore bd_freeze_sem; }; /* From owner-xfs@oss.sgi.com Mon Aug 18 05:28:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 05:28:20 -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,J_CHICKENPOX_24, J_CHICKENPOX_53 autolearn=no 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 m7ICSHH8001094 for ; Mon, 18 Aug 2008 05:28:17 -0700 X-ASG-Debug-ID: 1219062576-144901730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6937F3AA27C for ; Mon, 18 Aug 2008 05:29:36 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id WFaMq8YcO5LsBVBk for ; Mon, 18 Aug 2008 05:29:36 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54A.nec.co.jp [10.7.69.193]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICT0wk024245; Mon, 18 Aug 2008 21:29:00 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7ICT0123216; Mon, 18 Aug 2008 21:29:00 +0900 (JST) Received: from yonosuke.jp.nec.com (yonosuke.jp.nec.com [10.26.220.15]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7ICSxQc000643; Mon, 18 Aug 2008 21:28:59 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Mon, 18 Aug 2008 21:28:57 +0900 To: Andrew Morton Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 3/3] Add timeout feature Subject: [PATCH 3/3] Add timeout feature Message-Id: <20080818212856t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Mon, 18 Aug 2008 21:28:56 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1219062577 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.3008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8052/Mon Aug 18 00:05:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17595 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs The timeout feature is added to freeze ioctl. And new ioctl to reset the timeout period is added. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, long *timeout_sec) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze timeout_sec: the timeout period in seconds If it's 0 or 1, the timeout isn't set. This special case of "1" is implemented to keep the compatibility with XFS applications. Return value: 0 if the operation succeeds. Otherwise, -1 o Reset the timeout period int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) fd:file descriptor of mountpoint FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period timeout_sec: new timeout period in seconds Return value: 0 if the operation succeeds. Otherwise, -1 Error number: If the filesystem has already been unfrozen, errno is set to EINVAL. Signed-off-by: Takashi Sato Signed-off-by: Masayuki Hamaguchi --- drivers/md/dm.c | 2 - fs/block_dev.c | 2 + fs/buffer.c | 16 +++++++-- fs/ioctl.c | 77 ++++++++++++++++++++++++++++++++++++++++++-- fs/super.c | 57 ++++++++++++++++++++++++++++++++ fs/xfs/xfs_fsops.c | 2 - include/linux/buffer_head.h | 3 + include/linux/fs.h | 10 +++++ 8 files changed, 160 insertions(+), 9 deletions(-) diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/drivers/md/dm.c linux-2.6.27-rc2-timeout/ drivers/md/dm.c --- linux-2.6.27-rc2-xfs/drivers/md/dm.c 2008-08-07 09:00:27.000000000 +0900 +++ linux-2.6.27-rc2-timeout/drivers/md/dm.c 2008-08-07 09:14:30.000000000 +0900 @@ -1451,7 +1451,7 @@ static int lock_fs(struct mapped_device WARN_ON(md->frozen_sb); - md->frozen_sb = freeze_bdev(md->suspended_bdev); + md->frozen_sb = freeze_bdev(md->suspended_bdev, 0); if (IS_ERR(md->frozen_sb)) { r = PTR_ERR(md->frozen_sb); md->frozen_sb = NULL; diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/fs/block_dev.c linux-2.6.27-rc2-timeout/f s/block_dev.c --- linux-2.6.27-rc2-xfs/fs/block_dev.c 2008-08-07 09:00:29.000000000 +0900 +++ linux-2.6.27-rc2-timeout/fs/block_dev.c 2008-08-07 09:14:30.000000000 +0900 @@ -287,6 +287,8 @@ static void init_once(void *foo) inode_init_once(&ei->vfs_inode); /* Initialize semaphore for freeze. */ sema_init(&bdev->bd_freeze_sem, 1); + /* Setup freeze timeout function. */ + INIT_DELAYED_WORK(&bdev->bd_freeze_timeout, freeze_timeout); } static inline void __bd_forget(struct inode *inode) diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/fs/buffer.c linux-2.6.27-rc2-timeout/fs/b uffer.c --- linux-2.6.27-rc2-xfs/fs/buffer.c 2008-08-07 09:00:29.000000000 +0900 +++ linux-2.6.27-rc2-timeout/fs/buffer.c 2008-08-07 09:14:30.000000000 +0900 @@ -190,14 +190,18 @@ int fsync_bdev(struct block_device *bdev /** * freeze_bdev -- lock a filesystem and force it into a consistent state - * @bdev: blockdevice to lock + * @bdev: blockdevice to lock + * @timeout_msec: timeout period * * This takes the block device bd_mount_sem to make sure no new mounts * happen on bdev until thaw_bdev() is called. * If a superblock is found on this device, we take the s_umount semaphore * on it to make sure nobody unmounts until the snapshot creation is done. + * If timeout_msec is bigger than 0, this registers the delayed work for + * timeout of the freeze feature. */ -struct super_block *freeze_bdev(struct block_device *bdev) +struct super_block *freeze_bdev(struct block_device *bdev, + unsigned int timeout_msec) { struct super_block *sb; @@ -228,8 +232,11 @@ struct super_block *freeze_bdev(struct b } sync_blockdev(bdev); - up(&bdev->bd_freeze_sem); + /* Setup unfreeze timer. */ + if (timeout_msec > 0) + add_freeze_timeout(bdev, timeout_msec); + up(&bdev->bd_freeze_sem); return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */ } EXPORT_SYMBOL(freeze_bdev); @@ -255,6 +262,9 @@ int thaw_bdev(struct block_device *bdev, return 0; } + /* Delete unfreeze timer. */ + del_freeze_timeout(bdev); + if (sb) { BUG_ON(sb->s_bdev != bdev); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/fs/ioctl.c linux-2.6.27-rc2-timeout/fs/io ctl.c --- linux-2.6.27-rc2-xfs/fs/ioctl.c 2008-08-07 09:00:29.000000000 +0900 +++ linux-2.6.27-rc2-timeout/fs/ioctl.c 2008-08-07 09:14:30.000000000 +0900 @@ -145,12 +145,16 @@ static int ioctl_fioasync(unsigned int f * ioctl_freeze - Freeze the filesystem. * * @filp: target file + * @argp: timeout value(sec) * * Call freeze_bdev() to freeze the filesystem. */ -static int ioctl_freeze(struct file *filp) +static int ioctl_freeze(struct file *filp, int __user *argp) { + int timeout_sec; + unsigned int timeout_msec; struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + int error; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -163,8 +167,25 @@ static int ioctl_freeze(struct file *fil if (sb->s_bdev == NULL) return -EINVAL; + /* arg(sec) to tick value. */ + error = get_user(timeout_sec, argp); + if (error != 0) + return error; + + if (timeout_sec < 0 || timeout_sec > UINT_MAX/1000) + return -EINVAL; + + /* + * If 1 is specified as the timeout period it is changed into 0 + * to retain compatibility with XFS's xfs_freeze. + */ + if (timeout_sec == 1) + timeout_sec = 0; + + timeout_msec = timeout_sec * 1000; + /* Freeze */ - sb = freeze_bdev(sb->s_bdev); + sb = freeze_bdev(sb->s_bdev, timeout_msec); if (IS_ERR(sb)) return PTR_ERR(sb); return 0; @@ -193,6 +214,52 @@ static int ioctl_thaw(struct file *filp) } /* + * ioctl_freeze_reset_timeout - Reset timeout for freeze. + * + * @filp: target file + * @argp: timeout value(sec) + * + * Reset timeout for freeze. + */ +static int +ioctl_freeze_reset_timeout(struct file *filp, int __user *argp) +{ + int timeout_sec; + unsigned int timeout_msec; + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + struct block_device *bdev = sb->s_bdev; + int error; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If a regular file or a directory isn't specified, return EINVAL. */ + if (bdev == NULL) + return -EINVAL; + + /* arg(sec) to tick value */ + error = get_user(timeout_sec, argp); + if (error) + return error; + + if (timeout_sec <= 0 || timeout_sec > UINT_MAX/1000) + return -EINVAL; + + timeout_msec = timeout_sec * 1000; + + down(&bdev->bd_freeze_sem); + if (!bdev->bd_freeze_count) { + up(&bdev->bd_freeze_sem); + return -EINVAL; + } + /* setup unfreeze timer */ + add_freeze_timeout(bdev, timeout_msec); + up(&bdev->bd_freeze_sem); + + return 0; +} + +/* * When you add any new common ioctls to the switches above and below * please update compat_sys_ioctl() too. * @@ -235,13 +302,17 @@ int do_vfs_ioctl(struct file *filp, unsi break; case FIFREEZE: - error = ioctl_freeze(filp); + error = ioctl_freeze(filp, argp); break; case FITHAW: error = ioctl_thaw(filp); break; + case FIFREEZE_RESET_TIMEOUT: + error = ioctl_freeze_reset_timeout(filp, argp); + break; + default: if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/fs/super.c linux-2.6.27-rc2-timeout/fs/su per.c --- linux-2.6.27-rc2-xfs/fs/super.c 2008-08-07 09:00:29.000000000 +0900 +++ linux-2.6.27-rc2-timeout/fs/super.c 2008-08-07 09:14:30.000000000 +0900 @@ -981,3 +981,60 @@ struct vfsmount *kern_mount_data(struct } EXPORT_SYMBOL_GPL(kern_mount_data); + +/* + * freeze_timeout - Thaw the filesystem. + * + * @work: work queue (delayed_work.work) + * + * Called by the delayed work when elapsing the timeout period. + * Thaw the filesystem. + */ +void freeze_timeout(struct work_struct *work) +{ + struct block_device *bd = container_of(work, + struct block_device, bd_freeze_timeout.work); + struct super_block *sb = get_super(bd); + + thaw_bdev(bd, sb); + + if (sb) + drop_super(sb); +} +EXPORT_SYMBOL_GPL(freeze_timeout); + +/* + * add_freeze_timeout - Add timeout for freeze. + * + * @bdev: block device struct + * @timeout_msec: timeout period + * + * Add the delayed work for freeze timeout to the delayed work queue. + */ +void add_freeze_timeout(struct block_device *bdev, unsigned int timeout_msec) +{ + s64 timeout_jiffies = msecs_to_jiffies(timeout_msec); + + /* Set delayed work queue */ + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); + schedule_delayed_work(&bdev->bd_freeze_timeout, timeout_jiffies); +} + +/* + * del_freeze_timeout - Delete timeout for freeze. + * + * @bdev: block device struct + * + * Delete the delayed work for freeze timeout from the delayed work queue. + */ +void del_freeze_timeout(struct block_device *bdev) +{ + /* + * It's possible that the delayed work task (freeze_timeout()) calls + * del_freeze_timeout(). If the delayed work task calls + * cancel_delayed_work_sync((), the deadlock will occur. + * So we need this check (delayed_work_pending()). + */ + if (delayed_work_pending(&bdev->bd_freeze_timeout)) + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); +} diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/fs/xfs/xfs_fsops.c linux-2.6.27-rc2-timeo ut/fs/xfs/xfs_fsops.c --- linux-2.6.27-rc2-xfs/fs/xfs/xfs_fsops.c 2008-08-07 09:00:29.000000000 +0900 +++ linux-2.6.27-rc2-timeout/fs/xfs/xfs_fsops.c 2008-08-07 09:14:30.000000000 +0900 @@ -621,7 +621,7 @@ xfs_fs_goingdown( { switch (inflags) { case XFS_FSOP_GOING_FLAGS_DEFAULT: { - struct super_block *sb = freeze_bdev(mp->m_super->s_bdev); + struct super_block *sb = freeze_bdev(mp->m_super->s_bdev, 0); if (sb && !IS_ERR(sb)) { xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/include/linux/buffer_head.h linux-2.6.27- rc2-timeout/include/linux/buffer_head.h --- linux-2.6.27-rc2-xfs/include/linux/buffer_head.h 2008-08-07 09:00:39.000000000 +0900 +++ linux-2.6.27-rc2-timeout/include/linux/buffer_head.h 2008-08-07 09:14:30.000000000 +0900 @@ -169,7 +169,8 @@ int sync_blockdev(struct block_device *b void __wait_on_buffer(struct buffer_head *); wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); int fsync_bdev(struct block_device *); -struct super_block *freeze_bdev(struct block_device *); +struct super_block *freeze_bdev(struct block_device *, + unsigned int timeout_msec); int thaw_bdev(struct block_device *, struct super_block *); int fsync_super(struct super_block *); int fsync_no_super(struct block_device *); diff -uprN -X linux-2.6.27-rc2.org/Documentation/dontdiff linux-2.6.27-rc2-xfs/include/linux/fs.h linux-2.6.27-rc2-timeo ut/include/linux/fs.h --- linux-2.6.27-rc2-xfs/include/linux/fs.h 2008-08-07 09:00:39.000000000 +0900 +++ linux-2.6.27-rc2-timeout/include/linux/fs.h 2008-08-07 09:14:30.000000000 +0900 @@ -8,6 +8,7 @@ #include #include +#include /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change @@ -228,6 +229,7 @@ extern int dir_notify_enable; #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ #define FITHAW _IOWR('X', 120, int) /* Thaw */ +#define FIFREEZE_RESET_TIMEOUT _IO(0x00, 3) /* Reset freeze timeout */ #define FS_IOC_GETFLAGS _IOR('f', 1, long) #define FS_IOC_SETFLAGS _IOW('f', 2, long) @@ -576,10 +578,13 @@ struct block_device { * care to not mess up bd_private for that case. */ unsigned long bd_private; + /* The counter of freeze processes */ int bd_freeze_count; /* Semaphore for freeze */ struct semaphore bd_freeze_sem; + /* Delayed work for freeze */ + struct delayed_work bd_freeze_timeout; }; /* @@ -2159,5 +2164,10 @@ int proc_nr_files(struct ctl_table *tabl int get_filesystem_list(char * buf); +extern void add_freeze_timeout(struct block_device *bdev, + unsigned int timeout_msec); +extern void del_freeze_timeout(struct block_device *bdev); +extern void freeze_timeout(struct work_struct *work); + #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ From owner-xfs@oss.sgi.com Mon Aug 18 13:27:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 13:28:07 -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=-0.7 required=5.0 tests=ANY_BOUNCE_MESSAGE,AWL, BAYES_00,VBOUNCE_MESSAGE autolearn=no 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 m7IKRYNv010844 for ; Mon, 18 Aug 2008 13:27:35 -0700 X-ASG-Debug-ID: 1219091333-075a038c0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from omr-m23.mx.aol.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 120313ACA42 for ; Mon, 18 Aug 2008 13:28:54 -0700 (PDT) Received: from omr-m23.mx.aol.com (omr-m23.mx.aol.com [64.12.136.131]) by cuda.sgi.com with ESMTP id a0FnyXqxnndFXOdU for ; Mon, 18 Aug 2008 13:28:54 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from rly-da04.mx.aol.com (rly-da04.mx.aol.com [205.188.159.50]) by omr-m23.mx.aol.com (v117.7) with ESMTP id MAILOMRM234-7dff48a9db711bc; Mon, 18 Aug 2008 16:28:33 -0400 Received: from localhost (localhost) by rly-da04.mx.aol.com (8.14.1/8.14.1) id m7IKSWTp005390; Mon, 18 Aug 2008 16:28:33 -0400 Date: Mon, 18 Aug 2008 16:28:33 -0400 From: Mail Delivery Subsystem Message-Id: <200808182028.m7IKSWTp005390@rly-da04.mx.aol.com> To: MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="m7IKSWTp005390.1219091313/rly-da04.mx.aol.com" X-ASG-Orig-Subj: Returned mail: see transcript for details Subject: Returned mail: see transcript for details Auto-Submitted: auto-generated (failure) X-AOL-INRLY: wireless138-6.crosswind.net [12.183.138.6] rly-da04 X-AOL-IP: 205.188.159.50 X-Barracuda-Connect: omr-m23.mx.aol.com[64.12.136.131] X-Barracuda-Start-Time: 1219091335 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/8056/Mon Aug 18 07:33:41 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17596 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@aol.com Precedence: bulk X-list: xfs This is a MIME-encapsulated message --m7IKSWTp005390.1219091313/rly-da04.mx.aol.com The original message was received at Mon, 18 Aug 2008 16:27:22 -0400 from wireless138-6.crosswind.net [12.183.138.6] *** ATTENTION *** Your e-mail is being returned to you because there was a problem with its delivery. The address which was undeliverable is listed in the section labeled: "----- The following addresses had permanent fatal errors -----". The reason your mail is being returned to you is listed in the section labeled: "----- Transcript of Session Follows -----". The line beginning with "<<<" describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. Please direct further questions regarding this message to your e-mail administrator. --AOL Postmaster ----- The following addresses had permanent fatal errors ----- (reason: 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent.) ----- Transcript of session follows ----- ... while talking to air-da10.mail.aol.com.: >>> DATA <<< 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. 554 5.0.0 Service unavailable --m7IKSWTp005390.1219091313/rly-da04.mx.aol.com Content-Type: message/delivery-status Reporting-MTA: dns; rly-da04.mx.aol.com Arrival-Date: Mon, 18 Aug 2008 16:27:22 -0400 Final-Recipient: RFC822; coolingkim@aol.com Action: failed Status: 5.0.0 Remote-MTA: DNS; air-da10.mail.aol.com Diagnostic-Code: SMTP; 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. Last-Attempt-Date: Mon, 18 Aug 2008 16:28:33 -0400 --m7IKSWTp005390.1219091313/rly-da04.mx.aol.com Content-Type: text/rfc822-headers Received: from oss.sgi.com (wireless138-6.crosswind.net [12.183.138.6]) by rly-da04.mx.aol.com (v121_r2.11) with ESMTP id MAILRELAYINDA047-a6748a9db1e3cd; Mon, 18 Aug 2008 16:27:12 -0400 From: linux-xfs@oss.sgi.com To: coolingkim@aol.com Subject: Report Date: Mon, 18 Aug 2008 15:28:10 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0006_C9CB36EB.8550959F" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AOL-IP: 12.183.138.6 X-AOL-SCOLL-SCORE:0:2:331485440:9395240 X-AOL-SCOLL-URL_COUNT: X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_helo : n X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_822_from : n Message-ID: <200808181627.a6748a9db1e3cd@rly-da04.mx.aol.com> --m7IKSWTp005390.1219091313/rly-da04.mx.aol.com-- From owner-xfs@oss.sgi.com Mon Aug 18 20:44:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 20:44:49 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7J3iiJj012461 for ; Mon, 18 Aug 2008 20:44:45 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA19946; Tue, 19 Aug 2008 13:46:03 +1000 Message-ID: <48AA439B.6080907@sgi.com> Date: Tue, 19 Aug 2008 13:52:59 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs-dev , xfs-oss Subject: Re: [PATCH] Allocate inode tracing buffers before locking inode cluster References: <48A92BC6.5020105@sgi.com> <20080818081403.GJ19760@disturbed> In-Reply-To: <20080818081403.GJ19760@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8056/Mon Aug 18 07:33:41 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17597 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Mon, Aug 18, 2008 at 05:59:02PM +1000, Lachlan McIlroy wrote: >> Trying to allocate memory while holding the inode cluster locked can cause >> deadlocks; a thread creating an inode will have the inode cluster locked >> and is stuck allocating memory, pdflush/kswapd are both trying to push out >> dirty pages and convert delayed allocations which need space in the log and >> xfsaild is trying to push on the tail of the log but is stuck trying to >> acquire the inode cluster lock. >> >> I tried fixing this with KM_NOFS but turned a two-way deadlock into a >> three-way deadlock. This patch moves the allocation of the inode tracing >> buffers before we lock the inode cluster. We can also leak memory because >> we don't free these allocations if we return from this function early so >> use xfs_idestroy() to fully clean up the inode first. > > Seems sane, but I think it should be wrapped up in the > xfs_inode_alloc() code added as part of the 'Make use of the > init-once slab optimisation' patch I posted recently. This > moves the initialisation of all things inode related into a > separate function - xfs_inode_alloc() - instead of doing all > these intialisations around the place.... > Okay, sounds like a good idea. I'll pull that patch in first. From owner-xfs@oss.sgi.com Mon Aug 18 23:28:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 18 Aug 2008 23:28:16 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7J6S7fr020930 for ; Mon, 18 Aug 2008 23:28:08 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA22853; Tue, 19 Aug 2008 16:29:24 +1000 Message-ID: <48AA6844.7000203@sgi.com> Date: Tue, 19 Aug 2008 16:29:24 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: endianess macros References: <20080814180856.GB3087@infradead.org> In-Reply-To: <20080814180856.GB3087@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8057/Mon Aug 18 20:23:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17598 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > This commit: > > commit 413d57c9907c72ed608df2be72ef8ed13a3eeb46 > Author: Marcin Slusarz > Date: Wed Feb 13 15:03:29 2008 -0800 > > xfs: convert beX_add to beX_add_cpu (new common API) > > remove beX_add functions and replace all uses with beX_add_cpu > > which is in Linus tree never made it to the oss cvs tree. It's doing > this little change all over the place, so having it in both trees would > be really useful.. > Yes, thanks I'll add this one into dev. I'd really like to start changing stuff to minimise our cvs/mainline differences. It's time I did the diff like you and Lachlan have done :) --Tim From owner-xfs@oss.sgi.com Tue Aug 19 00:59:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 00:59:21 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7J7xHsT032544 for ; Tue, 19 Aug 2008 00:59:18 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA24609; Tue, 19 Aug 2008 18:00:35 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id D962F58C52A8; Tue, 19 Aug 2008 18:00:34 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - convert beX_add to beX_add_cpu (new common API) Message-Id: <20080819080034.D962F58C52A8@chook.melbourne.sgi.com> Date: Tue, 19 Aug 2008 18:00:34 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/8057/Mon Aug 18 20:23:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17599 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs convert beX_add to beX_add_cpu (new common API) remove beX_add functions and replace all uses with beX_add_cpu Signed-off-by: Marcin Slusarz Date: Tue Aug 19 17:59:33 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: marcin.slusarz@gmail.com lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31920a fs/xfs/xfs_log.c - 1.366 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.366&r2=text&tr2=1.365&f=h fs/xfs/xfs_ialloc.c - 1.200 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ialloc.c.diff?r1=text&tr1=1.200&r2=text&tr2=1.199&f=h fs/xfs/xfs_da_btree.c - 1.183 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_da_btree.c.diff?r1=text&tr1=1.183&r2=text&tr2=1.182&f=h fs/xfs/xfs_dir2_block.c - 1.63 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.c.diff?r1=text&tr1=1.63&r2=text&tr2=1.62&f=h fs/xfs/xfs_arch.h - 1.54 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_arch.h.diff?r1=text&tr1=1.54&r2=text&tr2=1.53&f=h fs/xfs/xfs_ialloc_btree.c - 1.88 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ialloc_btree.c.diff?r1=text&tr1=1.88&r2=text&tr2=1.87&f=h fs/xfs/xfs_bmap_btree.c - 1.174 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.c.diff?r1=text&tr1=1.174&r2=text&tr2=1.173&f=h fs/xfs/xfs_dir2_data.c - 1.41 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_data.c.diff?r1=text&tr1=1.41&r2=text&tr2=1.40&f=h fs/xfs/xfs_dir2_leaf.c - 1.66 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_leaf.c.diff?r1=text&tr1=1.66&r2=text&tr2=1.65&f=h fs/xfs/xfs_attr_leaf.c - 1.117 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.c.diff?r1=text&tr1=1.117&r2=text&tr2=1.116&f=h fs/xfs/xfs_trans.c - 1.188 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.c.diff?r1=text&tr1=1.188&r2=text&tr2=1.187&f=h fs/xfs/xfs_alloc.c - 1.194 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_alloc.c.diff?r1=text&tr1=1.194&r2=text&tr2=1.193&f=h fs/xfs/xfs_fsops.c - 1.136 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_fsops.c.diff?r1=text&tr1=1.136&r2=text&tr2=1.135&f=h fs/xfs/xfs_alloc_btree.c - 1.92 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_alloc_btree.c.diff?r1=text&tr1=1.92&r2=text&tr2=1.91&f=h fs/xfs/xfs_dir2_node.c - 1.66 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_node.c.diff?r1=text&tr1=1.66&r2=text&tr2=1.65&f=h fs/xfs/quota/xfs_trans_dquot.c - 1.21 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_trans_dquot.c.diff?r1=text&tr1=1.21&r2=text&tr2=1.20&f=h fs/xfs/quota/xfs_qm.c - 1.74 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.74&r2=text&tr2=1.73&f=h - convert beX_add to beX_add_cpu (new common API) From owner-xfs@oss.sgi.com Tue Aug 19 01:09:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 01:09:44 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7J89fww000883 for ; Tue, 19 Aug 2008 01:09:41 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA24756; Tue, 19 Aug 2008 18:10:55 +1000 Message-ID: <48AA81B0.9000403@sgi.com> Date: Tue, 19 Aug 2008 18:17:52 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Timothy Shimmin CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: endianess macros References: <20080814180856.GB3087@infradead.org> <48AA6844.7000203@sgi.com> In-Reply-To: <48AA6844.7000203@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8057/Mon Aug 18 20:23:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17600 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs I just pushed it in. Timothy Shimmin wrote: > Christoph Hellwig wrote: >> This commit: >> >> commit 413d57c9907c72ed608df2be72ef8ed13a3eeb46 >> Author: Marcin Slusarz >> Date: Wed Feb 13 15:03:29 2008 -0800 >> >> xfs: convert beX_add to beX_add_cpu (new common API) >> >> remove beX_add functions and replace all uses with beX_add_cpu >> >> which is in Linus tree never made it to the oss cvs tree. It's doing >> this little change all over the place, so having it in both trees would >> be really useful.. >> > > Yes, thanks I'll add this one into dev. > I'd really like to start changing stuff to minimise our > cvs/mainline differences. > It's time I did the diff like you and Lachlan have done :) > > --Tim > > > From owner-xfs@oss.sgi.com Tue Aug 19 16:11:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 16:11:40 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7JNB9Ep008477 for ; Tue, 19 Aug 2008 16:11:10 -0700 Received: from [134.15.251.2] (melb-sw-corp-251-2.corp.sgi.com [134.15.251.2]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA13742; Wed, 20 Aug 2008 09:12:10 +1000 Message-ID: <48AB5335.4030900@sgi.com> Date: Wed, 20 Aug 2008 09:11:49 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Dave Chinner CC: xfs-oss Subject: Re: [PATCH 0/28] XFS: sync and reclaim rework References: <1219151804-30749-1-git-send-email-david@fromorbit.com> In-Reply-To: <1219151804-30749-1-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17630 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Thanks Dave - this is queued behind the btree factoring series; both need to be QA'd and stress/perf tested independently, which leads me to ask: how much QA has the sync/reclaim rework received? (and could you make use of the machine Christoph has been using, since you're in non-overlapping TZs?) Also, if we were to change the inode / block offset direct mapping to an indirect method (e.g. inode32+), would this grossly affect the ascending inode number traversal optimization? If so, could that mechanism be made conditional? Thanks -- Mark Dave Chinner wrote: > Multiple patch sets, all in one patch bomb against a current > git tree. This includes all outstanding patches I have previously > sent that are not committed plus a bunch more... > > --- > > XFS: replace the mount inode list with radix tree traversals V4 > > The list of all inodes on a mount is superfluous. We can traverse > all inodes now by walking the per-AG inode radix trees without > needing a separate list. This enables us to remove a bunch of > complex list traversal code and remove another two pointers from > the xfs_inode. > > Also, by replacing the sync traversal with an ascending inode > number traversal, we will issue better inode I/O patterns for > writeback triggered by xfssyncd or unmount. > > Before we make this change, move all the relevant sync code > into it's own file in the linux-2.6/ directory. This aggregates > VFS specific sync interfacing in the one file and will allow > all the subsequent change history to be associated with this > file so it is easy to find in future. > > Version 4: > o revert xfs_syncsub -> xfs_sync change in xfs_quiesce_fs and > rediff patch series > > --- > > XFS: clean up sync code > > xfs_sync and xfs_syncsub are multiplexed interfaces that > shares relatively little code between callers. because it is > a multiplexed interface, it's hard to tell what is executed > in each context it is called. > > Factor out the sync code and explicitly call the sync functions > needed rather than the multiplexed interfaces. Once this is > done, we can remove xfs_syncsub and xfs_sync altogether. > > --- > > RFC: Combine Linux and XFS inodes V2 > > XFS currently has to deal with two separate inode lifecycles > which makes for complexity in inode lookups and reclaim. We > also have the problem of not always having a linux inode around > when it might be useful to have it. > > To avoid these lifecycle problems, this series embedÑ• the linux > inode inside the struct xfs_inode and changes the way we reference > to two inodes. We can no longer check for a null linux inode - > instead we have to check to see if it is valid or not by checking > either the linux inode or xfs inode state flags. While this means > that inodes waiting for reclaim use more memory, this is not the > commonn state for inodes and the will soon be completely freed so > the additional memeory use in this state is only a temporary issue. > > This combining of the inodes simplifies the inode and reclaim logic, > making it possible to do reclaim via radix tree tags (an upcoming > patch series) and to be able to use RCU locking on the radix trees. > The fact that we don't have a simple mechanism to determine the > reclaim state of the inode makes RCU locking very complex, and this > complexity is removed by having a combined inode structure. > > This patch series also changes the way XFS caches inodes. It no > longer uses the linux inode cache as the primary lookup cache - > instead we rely solely on the XFS inode caches. This avoids the > inode_lock in lookups that hit the cache - we should get much > better parallelism out of inode lookup than we currently do now. > > The patch series also makes use of the slab 'init once' feature > for the XFS inodes. This means we only need to do partial > initialisation of the xfs (and embedded linux inode) whenever > we allocate a new inode. > > In future, we should also be able to cull duplicate fields out of > the xfs and linux inodes reducing the overall memory usage of > the active inode cache. This provides scope for continuing to > reduce the memory footprint of the XFS inode cache. > > Version 2 > o reorder and rework as a result of review comments. > > --- > > XFS: Track reclaimable inodes in inode cache. > > Move the tracking of reclaimable inodes > into the inode radix trees. This currently does not replace > the reclaim flags in the inode, rather it allows traversal of > all reclaimable inodes by walking the per-AG inode radix trees without needing > a separate list. This enables us to remove a list and a lock to > remove a point of serialisation during inode reclaim. > > > Like the matching sync code, this also allows reclaim of inodes > in ascending inode numbers which substantially improves I/O > patterns during reclaim driven inode flushing. > > --- > > Combined diffstat: > > fs/inode.c | 205 ++++++---- > fs/xfs/Makefile | 1 > fs/xfs/linux-2.6/xfs_aops.c | 2 > fs/xfs/linux-2.6/xfs_iops.c | 19 > fs/xfs/linux-2.6/xfs_super.c | 265 +++---------- > fs/xfs/linux-2.6/xfs_super.h | 3 > fs/xfs/linux-2.6/xfs_sync.c | 780 +++++++++++++++++++++++++++++++++++++++++ > fs/xfs/linux-2.6/xfs_sync.h | 55 ++ > fs/xfs/linux-2.6/xfs_vfs.h | 31 - > fs/xfs/linux-2.6/xfs_vnode.c | 6 > fs/xfs/linux-2.6/xfs_vnode.h | 5 > fs/xfs/quota/xfs_qm.c | 10 > fs/xfs/quota/xfs_qm_syscalls.c | 137 +++---- > fs/xfs/xfs_ag.h | 5 > fs/xfs/xfs_iget.c | 473 +++++++++--------------- > fs/xfs/xfs_inode.c | 140 ++++--- > fs/xfs/xfs_inode.h | 22 - > fs/xfs/xfs_itable.c | 14 > fs/xfs/xfs_mount.c | 8 > fs/xfs/xfs_mount.h | 12 > fs/xfs/xfs_vfsops.c | 617 -------------------------------- > fs/xfs/xfs_vfsops.h | 2 > fs/xfs/xfs_vnodeops.c | 118 ------ > include/linux/fs.h | 2 > 24 files changed, 1391 insertions(+), 1541 deletions(-) > > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Tue Aug 19 16:43:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 16:43:17 -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 m7JNhF7V015215 for ; Tue, 19 Aug 2008 16:43:15 -0700 X-ASG-Debug-ID: 1219189474-742202fd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CF3083AFA18 for ; Tue, 19 Aug 2008 16:44:34 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id OucUoMqyik5vYHzA for ; Tue, 19 Aug 2008 16:44:34 -0700 (PDT) Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail04.adl2.internode.on.net with ESMTP; 20 Aug 2008 09:09:36 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KVanV-000588-CE; Wed, 20 Aug 2008 09:39:33 +1000 Date: Wed, 20 Aug 2008 09:39:33 +1000 From: Dave Chinner To: Mark Goodwin Cc: xfs-oss X-ASG-Orig-Subj: Re: [PATCH 0/28] XFS: sync and reclaim rework Subject: Re: [PATCH 0/28] XFS: sync and reclaim rework Message-ID: <20080819233933.GJ24344@disturbed> Mail-Followup-To: Mark Goodwin , xfs-oss References: <1219151804-30749-1-git-send-email-david@fromorbit.com> <48AB5335.4030900@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48AB5335.4030900@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1219189475 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.3147 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17631 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 20, 2008 at 09:11:49AM +1000, Mark Goodwin wrote: > Thanks Dave - this is queued behind the btree factoring series; > both need to be QA'd and stress/perf tested independently, which > leads me to ask: how much QA has the sync/reclaim rework received? It passes xfsqa. I've only been caring about correctness and getting the code into a decent shape right now. Performance should not change significantly for most workloads. The workload that might benefit the most (cached lookups on a SMP NFS server) I can't test myself anyway... > (and could you make use of the machine Christoph has been using, > since you're in non-overlapping TZs?) > Also, if we were to change the inode / block offset direct mapping > to an indirect method (e.g. inode32+), would this grossly affect > the ascending inode number traversal optimization? If so, could that > mechanism be made conditional? Depends on the indirection mechanism. with inode32+, it was making the AG number indirect. The per-ag radix trees only index the offset of the inode into the AG, so such a change would not adversely impact the new algorithm. If we move to full location independence for inode numbers (not that this will ever happen) then we'd fall back to the current situation of effectively random order reclaim. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 19 17:15:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 17:15:21 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7K0FIF4017791 for ; Tue, 19 Aug 2008 17:15:18 -0700 X-ASG-Debug-ID: 1219191392-4f7702f90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B44D21A10F56 for ; Tue, 19 Aug 2008 17:16:33 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id gxjQ5lr9oLAqAqjc for ; Tue, 19 Aug 2008 17:16:33 -0700 (PDT) Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail04.adl2.internode.on.net with ESMTP; 20 Aug 2008 09:29:24 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KVb6e-0005gK-71 for xfs@oss.sgi.com; Wed, 20 Aug 2008 09:59:20 +1000 Date: Wed, 20 Aug 2008 09:59:20 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/28] XFS: sync and reclaim rework Subject: Re: [PATCH 0/28] XFS: sync and reclaim rework Message-ID: <20080819235920.GK24344@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <1219151804-30749-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <1219151804-30749-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1219191397 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.3150 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17632 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 19, 2008 at 11:16:16PM +1000, Dave Chinner wrote: > > Multiple patch sets, all in one patch bomb against a current > git tree. This includes all outstanding patches I have previously > sent that are not committed plus a bunch more... A bunch of ppl (including me) have not seen the entire patchset come through the list yet [*], so I've tarred up the patch set and attached it below. Cheers, Dave. -- Dave Chinner david@fromorbit.com --vkogqOf2sHV7VnPd Content-Type: application/octet-stream Content-Disposition: attachment; filename="xfs-sync-rework.tar.gz" Content-Transfer-Encoding: base64 H4sIACZeq0gAA+w7a3PiRrbz1fyKTvZWAmPAgLE9s75JLWPjCRU/JhhnMlW3 ihJSA7oWkqKWjElm/vueR0tqCeFxNsneu1Xhgx/dfU6fPu9zunmcq5ba+HYr kusguj948Sd8OvA5OTrC392To475O/286HY7R73jo5NO//BFp9s7Ou69EEd/ BjHlT6JiKxLihWM9yKfWfW7+P/TzWJK/kpEr1R+7Bwr4uN/fJf/u4dFhSf59 GH0hOn8sGdWfv+Tfcv3AkaAAq+BBttzpQvq1fFiFnhu3giQmNdk54dDMvet5 LXfuJWrZsuDPXi3Tr0QB7shy3Ecac36OpCcZlSpPMhraxXNVXFvay1aKSCWz 1lJ6oYyUQYztSctvPeiDzGUkfVuqHFniwxZOhsCKFvmcgTknF41BRgAXW/7C k/mEFcdVw4701pFbMWF7ARxue5y2zlhKQ8R/wv9zAkZo82p3IePW3LLjIGot geN+a+Uq8+zIPOVZM/gXBeJrOBzG3ysrutcrHTeKNzX+mxZb3traKD1iOU4r DlpqRkwvcDdYzVyf0Xmunzzmc4qpjqTtWe6K4DM1IYG2FJCfTVsLE3QORICm pLMgNGslTVg8Qzo7h/ODTpnwWmXTFaQrBrQNehiDEL0guE/C2v+1qf2//JT9 f7U/+H17fMb/nxz3T1L/fwSeH/z/MYz95f//HZ+fLm7/LljUgkQt5lGwEq5v BxGMoCbUajzhKhyGtdKPpQN/C/AnEv3SRgTgj63YDXwl1ktYGy9lLZ8FSHsJ /k86bTGK8V9fPsgI9rUcEUQigOXR2lVSoJeuqUC4sVDLIPEcMZOaPEfEgUDP D/87iS1xD6HcX6QI5rSfiqPEjgVo8JTobtdqE1gSWrG9FJYHWBmREpZwEohe thVL4QWLhesvNJL8SOwUBbKhLd7DJr63AbKZDCeAxXAMdLYCji7iyPIV+Gjg AJKPzp3QBb4UllKB7VrIs7UbL2lcczRlZ7vWarVqYq7Q/g7yEywFfD7ij64o zrOvbNt6vtsT+/ut7FNYSlExCBUsxqW914WlW5+aOBRz15OZzJqiD5RCYkjy re83muLwlYCAJ3mg1aiBrOdz0WotQG7WQcUxZhWDwGFHPop+vzPr9w/b7cPu sX140hdd8hbIkUpctf39/Wp8//iHaPV6h80TsY+/jgUMxJtQOnIuysohfq2J vcRX7sIHuYCuRfHenjude9ZCne4dvBRKgjJIiFAwTaOgiV6wFi8PTEBgUYRw SeiAgKeoLQQduysJjmUVqgNSUdAVCr5Pg+NSAndc+hvkIMEETOBWDuz6RDIo 0ukeAsEf2ghBayHhKO2ll4PcrI10pjPvng/Ka0H9aQYMxQtsgbMEDxiIZ7ZD bJsyDt5wFSgCDHzHVffsLBBolzJkOjurGtXq4Jx0Oo5lt9ud3rwjX813qkMG t6UP2QwqxOHxSbMLKk+/u6gS+ZI6nA4/X83dSMXAksC+b4qv5pGUU0wmmkKF lg3JpGqcwlJ3LuoyioKogXCLAByBNQPFAWxxEvmnIBzm1XKB8q+ryJ46YVOA j52Ozr57OxldDadXN+dghoUh+I34AfzgJfwQL8Ud6QN5irJU0emgkIreipmv GDpeWrFYy6/Bga8CEMYG/FubplB/mKrWt6Q5+/untf3fRTUBk/ubgitl46rH AF/Ac3nzdnp2Mx4CRAtoQE76cj0NLRBE3ABjbO3tQRyGVLdMW2kpcn7XjhmC ik33PpEuA4MFsmg0ZwfuYjDA/GcZBX6QKGAY8LgpVtY9BJckksxMDmfVWm24 11n1uNbs131pn/Rn7Xa/d2wfPeHoDMgt3TbmULu7J69fNV+Jffp9nGo3RBVQ n3qRV5CHT/GkwCqS2yfSuAK3WwaHBnFs2RysnJ+TIK6rBkY+Cl6ka8LyHa1f OJrmDG0Gh8gL4dx1VBpY03AKMd3/OhZLSKfSAANR3NfxHCSt3XjvdbN7iI68 d5IfjAN4nakvqu2/ZmhvklWoyRMrQA6WtOVGA0pnBCsgg+V2pwLWEEphhG35 4t6HKEFjLh4zT30yCyzyfKc6VxsPuyFXTYGGBkUxFhmSdR4FfBoo0u51Ihd+ rcSX7faXbc3Xo0PUl16v34ff22wV0lOyhPY9ZnS0BhMlS/iB38o5sJZZWgT0 F1mF0Cx44A6EM8j18uyHg15biAsYtgyeasvU8A7mUO4K8zU3hhxsRupGdDtw XjqqjQ4xxY6nFbB/tGmD/yiSsHu38j4a9DftRuw6eMpFVckUlZlk09e5S7/b z1Ued6w/J/iU7CF+vkG09uKCSu726XEl/QBAlIlviOJZsiI+cRRw0dvQ8Y47 nWYXde/oNfzRSQ+4ugdZ/LkmDbWGQnv2k9UMrFR7JNZSI+Mn8KJBh1FgS6XQ 29n4BxoAmPUa83sACxY+pmkIkIZeMyg/w/pLvAPYKXZmiHe2QxqzK/egf3t8 eDvDCoi6p09J5PMISVqvIKCQA371qpNro9qsUoX8TSrOgeU/UT6t35MzEJzm mVkjikUAJGMhiYnzTM6x2GZDxhPEAUMitVARR+0/r3e1u/9T7O/+nj2o/9Pp VPd/up1et1vu/5z0To7/6v/8Oz7U/6HuD0oZMh4IlDH2XyBxW/vUCOA2Sj4N dgtQaAYqpA6OFYEBQBaHPR3L4+ZBu/Z+Cb/RGLGngzjZPqSvaAdKAFWCrRm0 gjhyZwmaRrOGWs8bKQxxSYzLZzCGPX5AlYSUeoIjsDHuWlCpsdlDnk0NFxUG kKMrMh+q7KD6lyHtr5iAYr/lCiaQaFH46LbLfraMOt+tXvuYEnGVhGCY9meX AduwSwPLjjtHYv/Zn6fwLTV1J8a2VBzMFRci5iGOjjviqX5PofWzjWy5xRFY dlzuEB13j8o9Itz3802ijPez8oiumk4OT+zXVr/dnvd70gKcVVVTBlOol7JR qpQ6xxDG9vHXiY5mrQ0W//vfiP+qW44Dujx3H+FvDF6Xo+u7nxoHTfE/3CKA g1NqghwJSoNetN4aY+3A0X1zFIVXXkoV3dboI94DtQMIzpVsq9bF2ZPTmqHz 1x2n47xqt49e2X2oRysZWo2gwN3qJcjqIyxF9+EnMrom/gbVnZeAPX+JC+Vj TP0VN5ar9vLL8vQqSqY2FJ6yYo47UCngfnGSDeNLTDWyif8mGg+w1eO2l99u z2CqhRPPYDHb8a7T02wNqlcyDCyLZcpX5rq+62i37ZPjIznrEbsPHPlw4Cee 9yRnGTcyttMEU+420ZEAY/chMdmHLOEsCDeRu1jGom43RA92acGPI3HrQikD ucbbyAqXrq2aYgSYCGQA6dEYQZQYQ50ePWACBBM0OcEkBxKrRWSt0AejuMDb zuM1JGSnYhMkVOdGMnPb5ObBJx8EEWHQXQH0/XB4rpNiGa2yZsDb6zvxlups T7xLZkCnuHRtCg2WIhQhjqoluHtdgV0gFbeaCijiADMV6bvpzsmjywpEsgxC mdXm6/R+AQLUPPGahASWi/ejyXc3dxMxuP4g3g/G48H15MMp9e4xGEGUY2RU K2JT34ogs4s3cDhCcTUcn30HMIM3o8vR5ANecFyMJtfD21txcTMWA/FuMJ6M zu4uB2Px7m787uZ2CGXpraQOCGF4gj1Ydq4wW3RkbLmeyo//AeSi70wotkKS K128NrEgmoabz7OesFheALFU31Pk/DwVUC/4AWS568jVncldEmFGoq41Ifp0 YZ3l34NOi1sAv3DngPrCC4KoKd4EKob14mogBKaBnVb3sNMV4u52gDgOSjZe YfWVg9jzrxqfobFvjUL1UjEKJljlZSiHr/I+s4pBqwoxVB+9quGVFboV41Rb VJ0F1k9nMYigamPs4e+cdZ+e3jWOhE/VvGo7CFXVM/pmpgLXjgkqQavYYIaF sg5gKgJEW1UCy/ql21OQbnqVapLMdwWZJyMQpAE4mPnl1HkLeg9DDdONCKXv YLY6OrjBtJaihdpAfroSkHCFJW8GiXXs+pQJY9OJveGDxltv5Fm1UXUCdsWj kBEjJp1BU6mJzitOANWmiX1NjUYTgFtQVUoEC+3sog3hZKvGxDu94C0QDxQm PikrXvJSkw2XGLTalpJNvLkgRGt0UEiHeaeKJQUyjCheSu4n6iNizw3vmhLw f+D6WuBrLMLEbUSF17ArqA98CIPy0ZZhzC267CKuocniU1JzNKSDOvUGH44v 2UJrgbICht4jEt31BL4jIP4ZOgQGR9KdYX33gigg3oJb5iJ+CVoi8OqY7p6Z p0b7XN/SUCzFi6c0wBAe5UkZUrcVGE4X3Zhf0QUVemITjNodHJoyKDwd4TH4 nzZOUHvhfMxhjCFpZEBu47H5UVB6cMCbK+UFXoT+nf6kz+2H67Ppm/OLy7vb 70QLzop3TjOJcFpfic9FKoB4J8A7gDVETcRFSS9+QNZ0BOOIdOEPfltQzlLU mjIsaxCEMrMHQ8fSioXBMBZQRqrivsBaF1IWJHljiCwsSQxkUQDbLRO6DylL hWH3tEQ3xGsIqQLmfJ1/GVwdTCZj/Ae5mtlIWYmA2NG8KAV8XBEUj6ckBN4Y rTbnH/KeW/ZArsSbHm6SI3W0SwGDG5fJez8YTZi8gb6LTL0cMx5NNvQsW3Lq pR2YTlAKuGfSbKaV9zkfXr4fj3AfcoixRONNyEuReAo2W3xoUTxByq+cejxq gXUoEN2sKMBCqgW+hfzwnEWXv03hUzt0BPBu/IvTYAMe3waWT3Z2CYmfyE6G bwxQeCGcQhpONvevZFcFxKbHBS3RVJELxcO5/oPluXSTnPvxMhkXt+eDySAj A6oVehejcgMiS450uuy59zL1ySVjiOSWpwKzs+b4CoaiD1OJRsI2WrRf3B28 rMK0eoP40YtkWNGKFzJWKcOLwt22AdJ5ZAKgtGwOeZS76laRCY5Gmj1BIv7s EbrRDWs5siZng4V38KyBa8vlKIOqjQEpDet2AIcArSkpOrV512mnV9Q5fUCK uCeN4BCmIEqtuHvlRBBMimx2nfTBk07FZ1B+uEAY+gj2EshzOK1+RJpWFRkK ypdIqzLHDpm2i744TVnq+lEAqdc03nu5Cpt4F49PSOgxTKO2/2s6QDnbKSY+ 2Crfx8b1W8mq80MSAFOuLB/sMyo6MLpURnPfExoIPBn2FX8mGNCiMIhi7c5A YawZhhNKK9BasjMwrOtDkMdLZAcb6wgBhsyoFN1G/HA1Pf8Bpcp3A/rhK8Fq afwio4DJAW5k1ycF2DqwgR8DNdKnCXyFIpAZfHp9EpDyAruQvhjd8MVKE8do c/R4yyQmVXSCtZ9eU94G5KYj+TUdAa2Vaz1UMdY4J+BrTIZAQvcGt7fD8YQJ EV98I4aw4Ue+JYNy82x4Pr397m5yfvP+GshvEOFE+a4F1LHSPME1w/H4ZqzP icCfSNKIgZ9FfSUMYyHoYlI+5WxphddOCKlRp6qmklnO1qa4vru8xIWfiok0 O7U0HUZ+gOrJyIciNuHKdTtp1iqk0tSRgxSSnL3r0lkqXflDIZzmKYSLNphj BAMVko8QzAjGmmGznPsaWXtmlx1xwaA+a076P2F+Xs42HAu0reX1ByBwQ9BN 5BVKRL9to8m9lw/mVMFA+T8Psp9pNpTA2HEfUM6RkHQEVoH/1q/hsrEZZPDT 4sQsCLArD/B8NpyVTnGGSrApvsp3MiJCqDFXYZw9PgqhgqRjBcT2U6yt5vhu 73z45u5tAV26BpgBB30zvRhc3g5Jtf7GchWjdzej68lwPL0dTraWT8Z3w4ql Z5fjasywFp9EVGOvRoQgEEbnSBMqsRhRZ1xYAt/i07tXO4joRZ7xoEbgizNh zYEAPeCGbYo89K6d+moJrJhJwVxOcwS+kuR8uy0GhCCN2/o1iNJXoj4lNgJ7 PLAow9ROuy3lw4yuybe4YJ9gv3u/cj9be5wCuzJ+NU55UTrb+tYNpytfPsbA U5fuVum/ymWgFg+0LJvN1sNw3TAB8bKRKcuuDQlWo3waVqsjrOvoEfR8Vzd3 15Pp6O768ubse3JgPGequqGCPGmqBw9pVybG/MoaJaL1gIqjogK0+Zo5W7LW 91j0/NileEe+KRdsrDNFrNyoosCnOroGNV5qrbP8EAOdSAtNyiOWYFv57mtG RCqURHQHv6SH2vPSptlxcJq7tuBbhE7iq/RpPLy6+XH4XH1CU83UCR89bavU FzslCzFZ376Qr9yGPc2mTT3Z1sd8XXnG1M1MZYnSFeBcaeePZ/ksjXtFCAPd J/6dPszSo5plz90nRVbahaKEySVj4FNJncGvGeqcShbN5N14OLx6N5leDW6/ 3+s8npDfSyn8opgl6Ay9oXMB5JUR5vb2sqBHpqhXMNUpntwyx+c315cfCE4n FQSSpm70Tx7t0hHT1nXSijVsQN8GsET27bHUAinLSjmZeRIKWMDi+5VcTX+h jmodn2wHc2O+0RTfX01vL4fDd/rAFGV1WvlmOkCe8Ftq4KeVeLF+iEbNETfW e5dTLa6J6dxFfDxxWgWTJWcpRIf3Nd+xgDlDKUEOA2IF7o2Btxj09V4jdImQ Nw7Gw/PyfnWzcP9oFLuNcp6cdTbAh2DllLdSsI+0CPgtDAcybJ7iBcte+jCG 0soDqnHTlE+ZeXGZ8I+a8psS6ZzPGv4+8/asomgXpt3w8FYMQGeF6IxsR5Ty k6Ix0Qjk878+I6QaS0z8xSW4qCCo7XytwP0JxYy15KChnYIRWZrifynfgCT+ nuMFgWXdwiA02c0OGkmiFJ6PtUfARP6n0u7vMY3HZyOWz0+5KMOPl/SiRJte S6h7N6RyvbQPuV56nVvaUDv7PM2gUWzLun4iTUooT/4RNaLupsIulHDUv/b1 Q5QFPiyJzYSL25xxAG4Hi7imBiRl1d9IRF12yaZ116LJXtyD8jiSi8SzorTZ xrC4mSNBoekCDkA9i9PBCpanzHjYYjqY9S3yDUhGU0aO4hcEMqqYkQYnTdc6 Gg/PLgejqxTZDo4WWYo81RjJ+5HS+QH6MAr2ucsY/nQGdALBnc9soAMeotQe Fd+Xg8RRWhrBV19lzyv4eca8uHEj22NHRqulnpas+G3UqeYSLek2eZrzwRHF Lu3ZpkMwO/bgOZpqL0LxfZe/MIkrpkcFPvya0+kmPuKpYuzpkxzdaQrI5B+v p28G56BNjd9uSk+0E0BGopQDFGLBjkSbpii24uuDep7ImN2JTqVjmeCb7qBw pZK14KkDibGFWn5zAVUY5tjULM4Ci1GNERJ0k028uOAm/xyvTIxH7/gs3IBm r0SA1OkHaqwFpOPcqufIZtyNaMhZdqfEu5Gn4URgRu5R233uulMyUwrzLqcd wLFcn5q46RcONZzl0Xe2VJhELkZ8A4fLLRk3VX+6XMQsF1/y58djhwjHX8Lp PP2uP2WzmT2Zh5N8JyWpZsVLQ+qBpivpdofrjvTyRH/xlMHX+iHh1yq9cNM8 RgkZ7KLmc+FkGsGO81lZpeymXj5MyoIpbUdVNN9RwZirb6TwRonewBi9Oe5F 3cNKZTCOKr6n+aHB6cqlEPUqPWse3otetToyPNuZ02+KkA/+dBFZM3QMp38Y 5t3uOPVxmYczDpi62TQTIiKyCK6hs0yqkCIYvr6QQJmOOHMk4gKlRJod+Gbw RTmtrA2/ryl1c1Kx+SUfUgzYpRYxIcra4nSDEET5tQLmxPoqAb9YrM2h6Hp4 O204+kaZq3ZwBVDYO+3Cjlug/J1Ht9ShIlenAYlIbKmnqQR9U0YFZf0sFQDk 5j+aveGG+PiRYOBTryxpMFpAIDofjScfKBSZ6myG0GcE9izi7Y6ZXARkmrFV NHGkSrfCtGqZxJjs0WOGtrggsRWv2tppevX5Jrv+mlCgFN1fEnGdpmjlWQdf 2VyMMDMYvLtI4zs3JGmB+TUP0iKiZJohzDAx4i1cZpr1LImk3NjaeGoeItsW 96SSk7a+vvlne//a3baR5YvD81b8FHBmnUQyCJp3Sfak+yi27Gi1LTmynXSf M/PnAklQQpsiGYKUrG77+exP7UvdgAIIXuxMzxFXVmgRVYW67trX3z4/PbBJ AZ0IFWYGVPEf4G5iblY8EGzXB/YazkXGeCabARsaKkTZBgcNcF0h5oyWc5Q2 8KyhnyKYOzHYL5yg2Vq2Q9ZreUnA5TCNJ/ItT9wbxjCCAKHpxYoTlXvMJm6u rWhxVXbz4BMguV48RETljOBz44TJp6A0nMEyGn+Kf4wF2z+d34SLWjwe9TDQ PCk4b6XYaLfWweJdRzx2tZWNbUTAQXpiiN22OGy9W86kx4VgkcLB78uYVZZE SomqKbZAcQNIorVQxDextOFPLZYLtx1ZzPck72W9WfnfMLcGkQxo6udOkK+L KChrMo6Od7McL+LZWF4T0nNC3B3oiYGeWmjcrVnbzTirxdLO6knl052hAUoZ J5va12YoisdmqmrsUUPn8MjgQNJk177IrRaMK1nLsPZ0X4dICdCvxGQzmSO8 NRcYTXTS4yVEL2Rg1egoCw4c7Xe0r2UVfWcvpoqhgx/VmwSP+p7jUrlOPxqE YGXmzdCP1LaCa5ddwOytR0IJ9EuI2a9P0SsOHFpIbQuxYbfR/kF6w73RLn7G xW0IGuxZwA5qauL4FdLxS/ldLeagHAAAlulynkRjgESJR7KawZZcTZWJ1BRr QJxhRkedKe48qjDsXbvx1U2cIg4izmffpHrN2lCmVd5WASvDZ0Zu7KMrnJBi 4pHybtTON4K4zpezRTRMcz3c8I/e6ct3zy8uLz+8fS/ouGfQ0UfO0eerCorV AauE5hKaxJWCtcvsb7DHryMZfknqukQyxBAOBHfmIrVlJG+seV7gpiPQ803u yUVTyZCwv2d8eAz5LcNs+r5U5H+fsUJkRaENeUdjS9kKHD2jWTWGvR4Fip/C hXbpWUqsrUMMEz9/YTkTNLSPbHU2H6y8HVXxV79VlMnZUZn9pM/i/xwnD/Bg qezAwUP7aijjl+2vIX+WHhpXlkkGwq1R1JBOFeDHLrrSn5k/YKy2oGn4JJ5J C1gFPaHepZyv5Z1H7LPhEsg+tabfLLUgWSkMkiFCOo+0E9d0eXXt4U0RL+7Z /32McUIz7XqVb7vSQ/6sx4w2NBwGR3MAXzuI0KkI+aRxMuktDurAgVxZmoSs 0QoY7M+m+MPHO9MlacdUnI6tPIYIDOxAg06lEthMzsx0EDI8oNSu0MYpuT4v ScBDp2z2fEU5hrbrbD7th/2xQjAB+joFL0uioVdq4qUyky0ZwBKYMQUohrFV glkjrI1azPxVkgIjTthaS5HnUkauqQ7nOmmCSfcanSTYjmQ6olr3T6HjPMry yutQeWZbV49zI0h714wXF3xVybENTbMfXgq6/zegq4YWrY/E2NKi9ZF+yyov 3729PPv15P2pKFrNnuDHSt8PF2I/NppLW0ZkTEsPdw2U1dICMSn78qVn796e nZ+fvhDvPDAK7cnnaPKAh8/kEwtqAuUWHLhRxDZi7ClqNIefzbaIvUmXzyv+ xbipzRqOVahzHUuugF0i2h2Bwivh1aadhL7l04na/MnUYI/vkIsWbXvJYgkM fchuxRPDLXcETuBUJZneRNNJBAgR9/1IM91V2yMWCK6sckpBhkgvxRvREDsj 0qrOI0k5d4oHH8ZD3LXEvdue2DxKZkNCpSxBio43tkeoiyTJCEE1kvMRww+L uyia6EpobxBHRem7LW7fuZMqSgdQRBesi8w4Ku77QG/KD+epbalVZDn7dsWm /bKmKJGi1OfTO8ENR6CUnSKUYKxjbECrBRAi3w2XNzf335m4IDZ5TdnNgEsU DBqq5OQ8Qlu9Achy0RAVi5r8EjbLwnu8QAbA9B/1HsubX5PVt2i/wS5ZSCWx PgQgf0cQv7VHbtP43nvaQ8h+wcag0KmLv5hUcyHPI/WJvGUkbXx/eXL+rvfi w5s3f2to7+R9c32o2pwilRFkRmoYGQvo5PzVKe6by9N3MA38tI761DqQMUMp Qa0NQFQZU2O29JMREQ0XkPl0uoiN+SwwxNrrEP9dHDJ8W57Z1igL+gMum35m Y+0YbSmsHd/e2zza6c0NowrVdZOrLMmb3OLyBKA213Jzt1S6cSpK6+TsNRng KLgDyQzHLDL/bsjjQKTC2SwK51Iu166Uby8v3tjHKN8uwVYJcJzLeYS7Bqam L73YYRcMh9FtD9AGZ3rD8v5Y6EeGZGjVNsukyMdKeakkUMF1IZjAdSmgglF7 0Oo3ojWBCq5NoALEfwBP7gm4csOocG5/tv0H6TevATMAF5EKQjEwW0mXAGIV iGw6BsMsD3LYiir0z8cmi62ctXPxHSWoSt/1qwSxbR0Ph63jWq3eiJp5oBpW vSyyo3yCEBoIVtLpOiE0zJjm9CMGbck8yAt2NmAzKt679yfvz557t9N4SJgp x91qp9sUS3l8WG0Basoo4QPXE2xz82nFy25ZSw/2rOIhziSAf20cEi1qYu3d hEQHOwyJDnYVEh3sLCQ62FlIdLB9SHSwo5DoYEch0cHuQqLlpuSQ6GCHIdHB FiHRwRYh0cFmIdHBFiHRQXFItD2rW4ZEB1uHRAepkGi7e9uFRAcFIdH2e7YJ iQ62CIkOtgyJDhwh0fbINgyJDrYOiba7sU1IdLBlSHSwRUh0sF1IdJAfEh3s MCQ62EVIdLB9SHSQExLNhP1JJQAtf6BDooOsij+wQqKDf8ofWIQMDFjaNUKi oTxV2jAkOtgiJDrIhERLYNTVIdGBrTEJ9mj0G4VEB2uHRAd73NH1Q6KDFd5a QZFtFLDlJai90xsoKAqJhpqlQqIDfItmpFdYy5xM8xbWsmBda1nOOVIh0SuO E//lmR/DYoZnLS8kOsgPiU4d0GxIdJAJiQ4cIdFBXkh0kBsSHeSFRAepkOgg JyQ6sEKig9Uh0WK7lA+JzhbND4kOKCTa2bq7IaiCUnZAm3gnIdHBjkKiA2dI NO3dMiHRQZmQ6KBcSHSmmBUSHawREu18YcmQ6CATEh0UhEQHRSHRQTYkmgnm 7kKig52FRAc7DYkOzJDonP3kCIku2E8qJDrYOCQa7rKCkGh6vDokmsqtDokO 9kz9aMmQaKjkDokO9ig0ObBCooO9jUKig+xbZAS0miXjhy+p7cwh0bydi0Oi 4ZpfGRItuQjjmsuERAelQqIDM0gqML1KgoxDSWCHRBPTuiokOthJSDS8a/2Q aAerJUOig7yQaEcdxZytExINPS4TEh04vEvyQqJNPnmDkOhgRUi05ovLhURL ftbp0oZbNBsSDT/neLoFuSHRUMkOiYZfMCR69ZVqFMkNiYbmVoREB9bsrx0S HWRDovV0Z0OigapwSDTQk9Tb1wuJTr/HGRJtEHvDJTCw/At1T9Ih0Xb3NgiJ DrYIiQ7Kh0TLqZCTcZuZ9BIh0fKiKg6JxpvJPaP2lMKc7m0QEl3wgpIh0YHp +OMMEggKvV8Dep4fEh1oh6CCkGhuxk1F9vI9Y+3OpV1jjXn4p+5noSG7aEZz j0I2JHq9o7RpSHSwl+vdDY+cfraGdqLuJCwbhkTri2WTkGhde92Q6KBsSDQW 1KR7zZDoYKuQaD289UKig+1CooNtQ6KDLUKiM0taOiRartGGIdGBCom2b73S IdGSFGdvhtLEHL+zIdG7ajmfHO8VhkQHpvCTDYk2HrpConlUzpBok5BsFhId 5IVEmxd2SkW8Xkh0sGFItPnGtUKigxUh0fb+LBcSHawdEq2E6lRYy4qLXd14 JUKiA/USd0g0vmqNkGg6EauU7AUh0cx1ZEOi8QEpJLHAypBo2ZIjJDrNZpUN iQ6cL7ZDouVrnSHRJimgE7GLkGhuZuuQaG4nJySanj5xbxjDCJIJiQ4cxM21 FS2uKickWh4iZ0h0sGVItPO8lWKjc0OiNe9qhERntlFhSHR6t2wQEs011w+J poqZN5cPieaaG4REm9utTEh0yUlVIdGpds2QaGwqFRKtqKqxRx0h0S6ya1/k VgupkGjXQpcKieYa64REc5W1QqK5zjoh0VylbEi0veHWDYmWE7dmSDRXWy8k Wp4pOyQ6TSQ3urqJU9Qh0W72TarXrA1lWuWdcQwOubF0SLTN9eSHRMvBZ0Ki g2JVQbE6YJXQXEKTuFKwdpn9DfZ4/ZDoYMOQaC2/ZZjNciHRW/KOxpYqCIkO ipazQPFTuNAuPUuJtXWIYeLn4pDolP7b2lGVYPVbRZmcHVXs4v8/xMkDQ6J3 4OCRDonO+GvIn1eGRAfpkOggPyTadNvaKiQ62DYkWrpe5duuCkKiAx5j2Qie tA9TQUh0UBQSLTmdgpDowBDY1guJlsYpuT6bhUQHG4dEqyziRkh07irpkOhg vWCqXJcyHRIdpC0za4ZEm/fPBiHR9tWTFxIN61sqJFpeSnZINF5Ja4dEK01D JiQ6kPqDgpBoktJXhESzKO8ILeUnRdGlVMQ2YjhjnLkgfafK5xX/YtzUZo2c kOiMXLFWSLRmj0uHRHOVdUKiucpaIdFcZ62QaCX3rBMSrYUlKyQ6ze27Q6KV DmCdkOh8rYLmojMh0UholYosZ9+u2LRf1hQlUpR645Bok7xuGBIdOEKiA0dI tC3+rBESHZQLidZUc52QaMnfrwyJVovrDInGp3ZItLyqnSHRhvSTEREdIdHB ypDowF6HFSHRQUFIdLBeSHRQIiQ6KGdJ3uQWlydgq5DoYNuQaPMYbRcSHawK iZbyoSskWkqGBSHRFvlYKS+tiNu9dkbZXnPcbnjY7tc79Vqte1hvDOvRqrjd 69y4XQp8hpz3/lG1C7Gy7IP+MVmEi1HyrOKlg5MdP/XEFEBRlKfWiYTGoF0s MJzS5uwlbJlZHRQ9uBbb5vFoEt5E1Yq3h2LZeDJZ3lgNY5pnjqBxtilK/9vD 51/rIxYwgC0WzKO76fwj7OgAiWmQzMbxIhCiAD4fbvEOwBPo1uvw3TjsWN/i 0+o0G81/azTqnWa302lDucZhu936N6++s1EWfAQbKTa/929DwSIWlVv1/F/0 I+jqU/JaFyuPC00ud+KmUVqeQaXyBkrI4IlMSfgRICV0DbyaahVUlaDVMEFO ejxNKOgNapB3DjdCYdikfBIPkgrIoVVPyOykVBXXG7leonkqFdbqXcdCKBhH t9G48uvLd1LjHgQVz41UAVKA6ORnz2t0Gp4flPoUNnYNjXley8stRvOC7+y2 PL/0p6i9a2zP63S9UnXEVQVVsE6r4WUGpqg5lpIfHJiYpYrXJY4DldpX4LrZ bLbYT0Lwxcm+f1D1GkdNMPlF9EtwUCmDWcLrkQcsQo/5yu4cDdri1hZXdrN7 1G91nFe2u4Ei8BIuApf4cbtdbbTFnMI/8CpHdZZgGceCv2JeU9yTrAX+K7nb wK8HygcoBXxxOvl9GS3BIABUFqNW4Bj0QaRE+XM5g7BcxofQJ4ysCRSg/IKc v+FIXUMIzN3UC4e34WQBTgaEQBB4Z0JqDcF6BVAWi1BIW8lMHL8qaLshol3U E2cFDpo3EMsGZqskFucQl0u3wdY7DP3exyM2EDLMAaiEQ+8mgg0QJziEEPmD oegl8M0crK60cqRjDymWgBUCoTdaCkpiMK/zCI3VCVqZZaSMCUaiFMvDHs5j D2YRNMxO1kb8DrX29h6DKlD/uf8YEQ/mBw7upUp8zuMD1jxzif71bU+q1PCl 3mP4P8ky+PePHir6rXCHvMqp4Ie9s/Oz973XZ+/e934+PXmx/z2UCf501wMn KSwgf6B+i3fRP8xHqO38EZWe5s/s5iVkNPg1mcUTNLjsf08MN3YJfsDXwPt6 4XDYA+wLuxtVz6ohO4YNsqjkbPIu/Bj1lrPebD4VxD/ZN8oswuRj2tRBbkOC boT3oIyRsSe4fp5gPMGqxaEPYFKB48Ky75A2OLaCEk/0SXQSLwnedWJjA1bG wnBZEXsQ7itdQr4Dm4HTBS6t8nY5Pb949/a5DBkDWZ41ADw4MLIkA3FVDVgT PadmwA4IEuEU4/bDPqhVwfSCAcxCbL6p1XI3O/kPkXKi5GYXooO9eTn6lYz4 P4qOYzArnLubcMYxyMTrgWksRBsjRXHPlgsmaHKdnD2TNh4jBrewB6nQghi9 KNV79pyH3PBarFJ7Vc81QdgCbqD9myQagBNZ7+/i5hHiyn6nXj9I7zj2XMB1 /K4fX0H053V4cxPNv/Nuo3kCm0Ksq+tVvGze/tnFb1Xvu7MRmHdH8VywJ/fT JXsUJMvBIII7EvwhQu8nesPP9IaDFesupOF4sOuFx8OHuk/RvDyQcO0Ff0p6 ffFb2bWn3v3xi2/MUpnVT+lurLYLVK6fTauamhPn7YRdieYllmw5WbqsnNoI 92hViN9BWquFigIQ7E0Mk882Cshnw2kOZsSgykn0O3kzMeWWZB00+b1EUIZx 5CDfPA3S+IsLuK+G6diaakLAIKz3JoRfi/Lg9zCORugpnbk9YY/Bd9V7PIEC 6uIUN/tCmeaTaIFW938AOsY+jlK2akzUsDeIJosYtgoEkae3TIM0gkCs9589 Y7WV0UwyuI6GSzEj8Jsg6z2UW0DrFsNbZUnSZUFI4V2yTGZS9Tu/h3dhJ7mH uOQfidnrUUxyL1lMZ/uo2cbrGW6n+/3MZUxKfxlTBn+suOutcDNg88Boczf9 GE2AAR2HM/FahAWsMrhGSObDgGuBpPYDkc19MC4+IhgzcOGSuDQYFcBoQFwL e8+hF2JydDx22pL4SM3y58/FAzfdidSEk5J71YKzDW1vL2/h9zKsmfF6vAIM Jm0vzT+5y0oHYCc/RcYVbEdsuh74PPZEf8VOAeSafdr2kywzJvh6akT3A4T5 DA+3kE40qxi3kt1YAKHhV/NC7D+2udUDJEYmm2rOlqDVDn6XlpP46h+99ETy 6trxE9rNRt0DWe1xnemVhXBIN4moKUQ7UH2CSOeiUgeEhdioN6tHQibsNhGU UcqE4rqkWxSqIyXfYwyqHgYKKYcU0QdZgGm9EA/31KGH0+5gkhnWnrYwFwLh ci9L8hEe7bPleQDv8Bg25OeTX097L96cvD2j8Rx2hJTb8vxGt9GqHhsjAgcU PaS9qykw3WJj924n4AYKL0fRdi+7z5WckroRnzlL2zJKavAgWPHczJeTfXm5 gDtYFaEr8c/vFOrQGdoHMlPIu1NelMHb95fOcgDEmr5Nh4KsxwuZykNbPt2z EuCs0MLEi7mQSXpCFFmweiDpA5cFtrLgT0PimQ5wecpqR/IhXekxa0dGUTMa taNardMdDtpHYWntyPVq7QiZOBr1htguPnyZZg5kLJklw20XfQJHNa/Xk3g6 dKrCTwiE1JuORuKq3l9OkviKbOoLnI+A6ymzgylvGMeT2Er093DXYC7VXUV1 T1Xqj4Et7sVJIphPko2Mqv3lCKxTWFmPTVAiCB2kYtEn8LrrTWfgaARCJ1bM /PqsLIZvvjqMdLK03oPDbifqN2u1sNPotNqDMutN9Vch+ZIuDDVgvvj/sQOI llh/UGY5EGfnd4QrqwFn/wPf8oSPde36T9lnxBTN8VnFE6yKtzFqrKiJI+jW W1VB5rr1bhUUr0znlJei58KwtWyMnpmmZltFnr9akefvQJHn70CR52+tyKNk Oead62vaairy/Bx5ybcVef56ijz/n7rhXEUewG5vqcjzVyny/HxFnu9W5PlO RZ5fzNz7ayvy/FX8oF9CkWelcdpekefvRpHn70aR55dW5OVs9qwib+VmR6HZ 3LwufY6/WpHn28ocWidnz2T+KkuXU9ADQ5eDmXssXY6/tSLPX6HKsXbcloo8 f1tFXuG6W4q8XS18GUVeqbWXirw/evFtRd7K1d+RIo/mxHk7KUXeyiWTijzf zuCmE4yVUOT52yryfIcizy+ryLOmQSa2Y0WebyvyzE3hVOT5WUWev0qR5zsU eTB5GUWev6kizzcVef6Gijw/pcjzHYo8fytFnq8VeZg8ZsVdr1P3rKvI8zdS 5PmrFHl2lrS1FHl+VpHnl1Lk+YWKPH8dRZ5fXpHn5ynyZOKobRR5fglFnr9S keeX7EZKkeeXVeT5RYo8f6Uiz7cVeb5LkefKjFOX9MrKwMmKmhzixHRrHW2V q7TNiG+srfILtVUwaB5qoaoqPR1p4QppTvF8rNA8Yrs7SjfEqilKKFSrtQ7b 3WGjlOMO1S+XdAjyDfmNKsr4ijt8Pp3dz1FQ3h8ceM16vR6I/3W9d/E4FvvP ezUPZ0KgFuz9Gad4xewNl1Al8S5ZNKnZyWeFuCCYHgyCRiEmmY4Wd0KceIZs I9DieTQUR2Ee95cLREESIseTKUkTiLBxjxF+GEyJOUcigLfnWM1X5x+8Vxiv NvbeLvuin95rwR5NgP0kyX4Gv2LkC6saXkIv3nEvvJcAIhhyPrmcfuvuDaUQ dD2daUc8SfaB6xVSfhUbEcW9387e/3zx4b13cv4377eTy8uT8/d/e6aixqJb CS9xMxvHIHeF83k4WSBQJTTx5vQSYhPen/x09vrs/d/Ak/3l2fvz03fvPMGk eSfe25NLwYh8eH1y6b39cPn24t0pZKiICLMfWiiYHiWTDSMg4Ike/t/EujDW L8YCzaNBFIPMGXoDsUNWTz22EgJ3IwHE9Hw+g1CWyRRoOMY5Fa0ITSTstarn dRqiXDj5KLa0905UfxmPRNMvhaA5r3o/TcXJFCT6zYnn1ZuNRj1otOoNz/vw 7oRkDs+RWMtzJtbyKn7W91xQjcX9LIIGcnUkBr+HxB4k4T0i88+c1OVOta44 R7oynklkVUCH4kBlwTIubwBLGbkGLi9uH3XvFGh3gEBlO9yjcclJUDzy3l79 E3gdy06AloB2f4IvtypgyAPXaEINdFu1NIwIeJSpSEYXrtmGmqAyAJlS6kNw fzheCaEVXO8I6im4q/jJ1Eyeka3JAgFVbtShspHyQ+ZnEhSWYVww9C3TCgkZ 1EgTG6EYvFFC0bT7Ue2qZgTPJQfZNi5PXz4/ef4zz1y77nmimZm4DSOM9pNH bCLanIs9NxAsiWM8HNFFjRxRI4LHxNWH6wo41SqgFlFY1utLx2wS5BA2Ia4Y bMJKS5LKSIINqAsDg3T4jajtsfWb4TDAkNrpXOEypUJx6IQryJC7qTe7Fnw1 5qqIPkWDJQBiUX4b1DTgU5mOSTaHqbyQ5KoMKUbuEg+wifhtOh1WJO6zoUJW ZcWZIpsMZouYhAbqC0wMIwJI924j1E3sIDHkBV402Aq9XHfbmEYC5ude0NMl DJuW5PzixWnvlw9np++en1JL00xaKgnNPqeA0QVcJegqHmOYJun3OHEOtpHx DlcqQ7jSzGHokD2e+5soZDU5zUZozq+Mz8cQv3k0E4dXqrYJfEuRec5z5hux WfsLQyEFwpEHXBRj83DYqJTFYO3Um5UuySYq4mDKidszcaQ/GydXB2hZ6HLp c2EuArfF5+1zKtafq9sJFpnNzgn98ZUpzWBB88pWvHXjm7bO9OgZPSy2Kcb2 cFaYE1kR5hWkkXR54efws/iQGebDqFsfHB7WavWw3633y9j2qHoBv0wFgF1u taotwTCLL9OMq+ZTRaJ5KS6B49lQrQP/hAt4gZbbEuxEkM9OuFzEFDsRrMlO BGuzE0EOO2Eg+5dlJ4JN2YlgY3Yi2JidCHbCTgQ7YCeCnbAT6VY2YSeCbdkJ 7Wa8A3Yi2BE7EeyKnQh2wk4EO2Mngh2wE8Eu2IlgR+xEsCN2InAQlW3YiWA7 diLQ4qlEfu29ORX9ObsgvwuDrNKcsDEXsysKkR6JBxt0UQBOtwbWHbuxprMx Cd9Q1BbajHofiH5oGiyjqslGHXpogxrKvJPQVF5Auoys6zt+5Bu/2z5q1uud Wu3oKOofR93ccHRZLRONLh+gQgwC0f3GkUoiTeqCXk/boH7u9dTQ9zIPCpJF p+56eGpCUrAH1D8rHkFzLeY9XAS8t8F7arIgoz2dK5i2PzoS9v/NzydH/PfH eDwOCCQ1EIsUNLd8B8Z/t9s58d+NZqvZTsV/d9ut+kP897f4YPw3p2FDoYak HUovNPQg4nUCTjooCGUB3Q68X1uVil1R/HgXjj/yjSVTa1GONHDUQ2xwle+7 gvAn3Cbmo/jNQI0FnidZDq4FocUGAm5UcMDccIWStF1GBE6d7Qpoa0PO/DfN HUel3GhFC5zlAdkqvokXDA53g6OaTO8482ytUrmYx1fxBJNQQO6hITAcoTcD FyO6QZ5fz2MQla+9n6Px+C6+EpV+ZbeVVmWKlgRxnyDUnJgA8HZyOotCzLuu 2cSatwBgbwrNB4zoK9Pe9CMxwzEkkO+HBMw05f5WPGqRZoxZit4oAfBc0qOD O0xRCpgqJt32zDL8u86iwZHkwMyrrhQG7tNYMSK96fl25DoODULszcD1Vsdz hPLnhvbrdq5TAfAtgAlwRMqn3pftFuPDDFYVg7eaBaFYu+kACsgfhCM+Px2e 322vH51f3huZnZBrtcHwqNkPS5v4ynojd+ptMPLRl8uTtyR+pbclfqW/oogD WNxOjuQxHJu3NgAmBF/kcZjyBPQdP0r0hH6/2zrqixWKhs1m1M7lMGW1DIcp H6AOqd1pVdsNz8d/oB6J0ad6QjJ8ShgIXirKGyixAsfWOdZuZlJg0UGVBiWv ZOBk3UmAUWND5PJpJS+JnTOFXTpfG2wEDPMQQ3lmpaZ7YgKQQxZRSC1GaUIS PnBkm0WpbMdJ2tBPRqd4WZ0zKrtRZVqNNGnmCjhonEHzvSrZXo9yjhldQGjp ZwYyXGogK7CWPdwr+YDLX4woJo3J9v7yRMj+3kcKtRFrjxsBo1Dop/5y5A62 MIm8Y2tLYaxz2Dhsttu1WrvT6TfC4xVHxSGMyQcYSHF0DKSLvsQPpJ/EUuTF A467veQ6BNhCY0+DknLJwTFGnRG7/lglU2XkamfKoJ+iY1ukXhuTsyaG5uVU waPp0qtSNX+DarKuZ8V/SNI2m4vNCcJnUqMboXmIN4L46qamdRZPCqdnOXGW UF2OSU4FpMDZfXpu4M/+TX8BI+oZIzaqk1+2eykDcykVjcvOSKrLg+srcIlz LBQUxHmGyAVxGmjOx1EPQ1n694uoaC5w//G1YxWTS8LdLlZtDFyqCHnxdPvt Vqd+WKsN6+2jqNVfodpwXDzyAao2ml1y96FvZgVYCTOiQfBVgSYncW2KjSSR FlFno5VAoICsYYknHL9XGo9VcGlpeID0orLDXgG74KbEwM7Az7+86b345e2H y1enJ69fK4jQX95cvH3f++XDxXvxK/eCfiON1dn5q9zwQosrdWEZquCyTjiM jgU7128d1/tHo1XoiI5FU08wFKsLa4b/5xUzBAsVHTtgRzsxLTLB5TMVWUnz yuF4GexJCeVZNNnrrYaTeRN9ecIuVZgDDZPQz5cQfOJBnhQh6N7Fg4j2FOqx SckNEhymgzASxlL+PJIfcxdLywZ99+/SYtg/7h4O6rVaY9DttPvu6M9UzeyS 6WewaM3jRqPa6no+/aOuIoXtu4N5PZUGwDG7qUNJJtrJFE1ABxyXkK3Fq2Xl EWBXe1lZ/QACuDjrClRjtpwLOUiGSxtcosSQwFKYvI0CtAH/gliVR/Arc1fU jMw1kJvYItfdFt6nfX617kLMgByqCWcgp0TlEVwrhyzDDNhR8roNK2cspcYi TPRHTLdyEiiVzLOafu+Xij+PQMUmODzfPXP+1hPnZ+bNX3/aHC7JuZPmr5wz v9SUpd7p7ZXIZiM75WDp1XGgpSgkY7xPKNSGUab1Rm88M3FFPCUE8FF5JA+W n9tVv1RPMUCBYx90V3yWQXjnkNAb8H3oeJdn+EMLMvRH61T/lT6fHPp//HuZ REE8D4fxp63fUaz/b9U77Yz+v/Wg//82H9T/f0gM87O3ANdlsOCDqp6TSS7u paYG9P0fMLtiWmFFaSnHRrZiD/cPNUgOGmwAqJhNsgl9jkYICEu/Xl5BEorJ 4BoYpYngp+4FoYiS5J7AYiGPhBDxMbiTHRxIXDLSVMP1Mb5HG4ZqeEIZupaA QTsdVVz1dqZ8D4cAj3uD/kicRAn6CkpzMaarUPwbvHmWs4ScJTyKzOPceFMs iIneUI0O+UbhD/EALTWURwErgnNCvIhD0XvyaAAfCkimXVKR3uo2vDLaZaVk bqSVzI16I61lbnbrX1PNzNrlWq3TGh51op2DXjSagtEFUF34R+PYUjVLRvdf K0eXL1NZSa8crXfFl8QQt3HyygsHA8yUfsVeEliRksnC3qJyHHSC/UWcjXT6 L6lKyISVmk974dU+M+Yu3j68qkqJsEy6MK5l/IJq/hTb75HS9ZlGeuLY5lv9 KIXHl844Bj9JRJs9TOMrf4FkXDKfp/4NrH49+0F/OgVDo6hvZsKznxg5HVUn OLuf0jHMFnMaFqWXE7+zkvTF6U8fXlnNWZnqjBSR2qVHZd57d/o+UxwS9DmK Pn996W5ZlKVsM67W3Q1BFXSgDch7zjtL5d+mnOKwlabGDYPEnnyuOGX9jDzH 4AGelRuCDZeJfu4oAS75VCGhHNa8E5X3fiAPiM5tP5liOxD7IwqpltLuVTmp E/f+6f2noT7PSxlIheTT4E/xjNTnKWW6qxjYUrGYeqrKi59Taj+1WfJeiHW5 yeK6MtkkiMX0i5s9p2eZpI+0BemhuT3oJ4Zqla4J5PyG+0ClNTFubZm5iovc heR8gK6VANHDRFMvrEyDPCcYkMlUBzIrv0FCCWFr9z+iORqClNvi3bU4W/rt jCeCW4hyzSNsiNL0qJeq4cBjbG0GCqNlkruf7FSYq/YTHFW1ndDmlNlSj3JX VkiuVFOacdJ1n6nH5j7J7kddLv3E3JtqyxrpYnj2fyzRxz27htHcF/qWGdD4 V56ysu+RjaXegreEOUvGD19S21nQNWM7m7F5Zm7Wvfqnw5GZV/SR2zItkXPN pNTwOnXpqSSZajZzUSegngGOaCfZzObXNM865zSCOFkC9zGTT/MJpExDPJOK kuCFJaYYQ73/YSEt6edpbCV4AuhpV3DXzQS/q+LJ8df/G179F6JMuK5O865j DmEy740gGlP9gKrZHjGWODw/k3bUd6cdlQ3AJMsUhaRd0VV0IvAfM6ntSd/o qo4mZrFbwuUYMy+Stz16naONIi/TJGhq7PbowTNXHXLKNWrU6b3Ao13Pp5Pp MsGU2PMYyaG4CeHdwFbYLI17ZA5XDOqLxC7BuAjpjQGWPollQVYaQSHBsZ7S UgJ9/UGQ16sps6YDclDDsGJPpStHLfqTeHIrWG/mtIFBVQCz6Y5zytSzC6vr vrVs7jISAtOtCs5xMACQy7zUx+amTXFoNjlBPZh0RCiR/ViZ7Y1DkU5VbG/T LMfKK0RQvu/x1ryL6Nq05QgCqaBELaA6pBsTqxkmD4YKYUAlQxZW/oGUUOaT lMy5ddAjcFW+4FGzALEOs3CeROz/bjbIjoisdfDVTpksb/qoBfCm/b8L4SZB h/wowWzmnoVIbHiEyFyajLbMYB+IokA4HII8BX8S/+vFg9hAapE0R0wuakR6 0O8e9LNH/UzVBJhQRhnZByPt48cH38P1b5Aq8kPyKilAZ3qN1HSgYEowD5Iw B+SsEvOy7MI1RQK+yFFK9TfOi0QoyZkZS8OMo0FJzISYQpq0JI0TsX0IJsHi Me4SXmwCn7HpOZ7d84ve+4veySvxDzTx0WDE3vJ8nkYvnU038m5p6yWC6Ewi yTCS2EBJiBZTcXliFj+uiERJulaKKaGsuZz/uUq8yDiCwKOr5Ticq4zCWBde NowE4UKHVVF1HJJQkzk2tIDq3PELa5iDXsrYybIPkD8YCwPqMnngIKWpYFXp PpHm8LvpfH6vt73cEreZjS8W4h28XExIonx0dRfMhKc0xSb7cXZ5+vz1ydkb bdZy7quUAemLZfMoZ8opfgEzhZgGMWvcoQbSuYLzzWI5Uh/T1Vznq4a00RQb aVQzeSZHh1wlbxSzc7YIYc3DP3U/V1v3cmYUtpfj3CJVuJ2Vpgde2hgGJIHO fz9UTuPhnA4KparGQRBkFXJG+NJfz3s/nbwQG/ggn4Zt2yMgscyMIJkdLufw pwoP0r2BqURnkRc9GVwE6weAYClGX7NEK2yAGitJSyvlR2QYy/YYtNq43ueY hR75rnQu8Jon7hjgw+BHuDvnoGmEUpVAXa2GXgYbgbWR6dUF6YGQKzPr6XA+ nRm16QbCihiJKHpDWdY9krLh7aS1QUUA1+wPydnqgN+G1JpDVPEq5DQDmoWR 3ZQ95Gx0YzAxoAY0hMhahnqRWQzC8c0UbAszsdbAHRttCCpo+dwdGF7uxvDo UsFoTowiIF6Kp9mUo8zB4W0Dqz1kP8q7yCgZL+TcUE/UGnB1qhID1htn7+Y5 hhUypguDPq2RcQM54wuVziyWN+VsmV6Y1OtQn4a7yYN42DGNBFxmECVJ5c6W 6vKPomRiTBzqforng6uLWeFLb+3F5mWWt+2ai617yw2UXGznsLiJEoudt8zc wurFzhmZ5LcLFzt/mSXjkbfY3qp15gaKdr9kXLwCPkGLMzaP4OZzSrMmSE7x 5rud9BAH9dZ00yjVcmlWWV6n+FJHX4IidsTbS6fnNqaEOWAlK2K3tX/3M/Nh SlCgxmkeUnoXYkR8g9PwiYcE2yycGBown8hExbibJ4NY+lLX2heZvd17CbsH WzWTtYOrHein7uVbLLuCJBuTtGpZyUmWmoKOIIXkTxndAKOTp3MNDgD6Cw5n j6cTrpm6+uh1fJYFs36n9MeCOkHS85r1xkxV8qKJU7YSvGq5InYSbMiSYUcf nmSalnPzc4Jz+Ld0FwOmeN+pfgKWRvBeL84u3/8NuS/zmJmMagn2WfKVGbUV MUmkNipgW0lTozjo/GawHyDZSM4NUFBrMlYFgxVvw3EM8mdNSjhFfJ10wIOu LaZJMgNUfxlxEWjGH+fRe3kGzPnJ25eSxSa7GRYwA4MYhEH0pKcaVC1Rw5m2 TEmn1HLJ2ci8uGcOQr0W3om6Q3z1+cX56YFNjYip3JMwGBLhwsp6j6eFoRsk msY+RZ2z70k0WMhmxMMDtNtJrA0N+yCE+dFyjmoPPIgIsxgzygNAMi7Cj5Fs h2JF5aUmweT56RNFbXNX2C9aYGsdfLmkfpkVlVtEwtqmWzKhR2CipjypUvjJ bnMJ3YB3hrikYiXCSrJt3wqOA6R1M9mdhADULC4jXaDrgdQ1vQFgjWiiIZ+C RW4Gm8/4U/xjHIMP6E24qMXjUQ8wSYZJAQlZQUB8V3cLNr4M6VtBTfyVx8Nz Hgu/aHF8x+L4ZZbGVxJp/tKwkypezhjgLPUXzv2CHeKHe1r1wXkb03uYY1xU 70iPYakuNA2gG0wcRSGVhQOEP9Fae77IFHOqBBC8lbW2iblk0qmBVGlKeXg4 ZFI5FvesNzOTu5ACorgxh9H4bh5zJ0g7JgrKmoLQ9MFkd7McL+KZ9M9SiWgE uwAuy4TUggAXNYuIEM/mmn8+4qUn01d3g7+nl0btVebRDIpfrLZa/V6VQWxH 47DbW2ckytYpt+W+9vIBpHvymraplGHQeMTsvp9+cuDkICy2OFD6EWTnNYOr NaL2HrsO8VKDu8biY1kkuzV3NXpr8ZZHqk5SkgmnRP2KhrKK4aQ5VbIU/Kje JCWqOJF1+tEgBEsLn4C+ga4g2EvpQGmdN1L+QL/QBXH/AFUuCQfiUeTu/kH6 lOmQWJNBNRQ6DD7FKGJq4vgVyVRxwHSmF3NQNd+CmWY5T6Ix+HCCf9CeFquJ /b6aKnOAqT4CtREz9IqQyLBjULfro7oNi0oyIA2Ck9u6hCE259m7lDJM6b2p 08vZtmbleCbfp+SQPmjTQJ0Qj1K4YcQmYSx21qbFDf/onb589/zi8vLD2/fi PvHMlJrOuchXQxermlfpM0vYMXN1nvnjMZWdOreXTOsVmCIj2E6mjP4FhyOR QiJ4uQKruEhtLykvajkQJMwI7GyTe0yNkChVD5yFGR80Q6eWTn267/vSzeL7 jI9IVm2x0Wa1osht04Ge76z+2V6tApND4TZIRbPjMSix8i6ViYooV0ZHMoYW R5or3HzTndPPWPKtMBaX62pRTBo7q/qFzqqZZDFZL1P+KaZxrZomP+UV5Ge8 gvxSXkG+aR3wbR+YtPsLpi91H0rMtxKTZ2Ds/QevQ9KvJf1eeEUhnV7s+wbt e2T69MT/VZMKHvBuJy7DsjjngGaAUzFaeF3QGTaV9XOobDFJMZO0INexMneg 9986HskV/zP8HViLgGZ0B4FAK/C/Gu1ux47/aYofH+J/vskH43/eUzCNGQCU EP9HPCYqYn5fThcU/oOMnn5CeC7ov0BlFrI5uDIhLVl4VUnHAyUW2qY7FMcO C7Kjd3KqWNE7I/EuGYMjuhvKxIOY6RL/Pb/nnwxeuuJ5MIzQ9AMW9zjOjnK2 +G8e7IMDwKiW3yGrS4LsO8X7NJqHZTGlHLE+neMMoNRRiUifvP70VxTgeJ9G 2Oof1Vu1WrPb6DT7biSWvCaskJ+8QpTYuNmsQjCTj/86biqQghuZxhfvFESa UgFAr0BsmS9zAmsMlOeqcWQIhJaOC/p9e+fThQFdSxubQlRAoLqKxLEijSZp TSEybxDKKjgq8oyYjkbY3slLwYWhbrMq+4LZvcR+xNKiHMfdhWMheeELLLs6 466AK9qSkDcwFuiSD4ocLh/56SQ1+BDCiWRwkAZ0ElNJtwuE9ituKgv9TVn2 ZAwNo8A7kvXp9oygonzmDIKKfG5U6gAcGFJV7/FiKjj2qQ7jkRZRDOBJxw7l hO4MpfuyKwIpnV3x1nxU0ue50H9ZOzobDCQ1gjsgnoymrKVzc/oKQ6sMWBbJ DPkiHrFJCAZl+K9KhzIXdpbk7HaJn4VvvBRbWuagnPdvRE2MEk2W8E8S+5Jk OogJqBrxyTPuoAi3ctb78MvZW/Tl+fzZsx684geye5bxdImHRo3gWbbElatE CT9M1ya0fOArZt7A/67+tzqR4B/oWuvvzq/V/yZOrPIt6B66koNhg1Haay9I e+3xX5kNXmrnZ9wGMjs/U6Lkzt/Uey/YyzkZRc4jRU6m6l7QJNK8Kfb26CLJ EFC340jpYSlfENT6WIB9q3RtYov89a9/ldgagm++EZzan6UaNM/klA9YkppP 5fWxqikv5YK66UwWDHdt1xHWzv0mVdDgl6QZMlIrD+bTJGHeBzgP1o5LJ3DB 36FbkrI5C4qIOqma0vd5KXMd9P4DQnn1Tp4/f3+gTaN0XkxnB8XwWCdK7grr kKlQZ9r3VjwOqhf1KzE18itnF65UF/z120BSLj7ppvJGc5UdzZVjNF45f2W9 ntq6QnYV1MhylFGsnE31Ii+mXHM4ZbtND3pZ8y4wABhyUkQ3E2LFxTJHEO4f I6CFoeO1jA3w6Doaj9ObQJ+eg4whIV8Fa8YqhBPpARgaDNR0zpLzEL0tBIWA DCC0Q/Hco2GFXGtTemg+Zyn1KRD61LGEIuoPI0YAyAvxFgmk6p1EY0ldssii mwCGutW/K/S4nN5tB+Kav2Nxzd+BuOa7xbUnZmZYt+yVn+E8JXspnXVMvEau RPEt1L95sp+p+z1gFS3DdZSAAS/1+Z+VqsKl/6X8DzCnAWjVtn4H6n/r9Rz9 b/2w3Wik8Z+ah40H/e+3+KD+d26ALKRUqpXK+fSOb02+UJB2gho2ydPDVivs bAA7CX3WWZU7XA4i4p0g7FtWVyqSihD7mx4bkgSltXSaWEoQPgDIl9j4pQ+t E+AfgfiPPGcZiWiLZTiHgKMAN9LwxMN2BhgprSvtdEroSo1x9rO/SWzq1vGg ORwC0H673RzmA31yrSw0Nf0Oes9DRGUV/+9KhSc8ROe9fULRsTVV0/GQptCB q6mwadRPvz+TMD5sX/P2lpMkvgLuCSBV9izJ+yZMPspmTQXYM4Ii7darzbbn NzvH1FmOrMO3PUVHHXTCWsHvG4qCmbg/pkJAiCbD/QOJbCD+J67T1/HkI4i2 cH3jdQ57nERpDKgVa2YGWvyQGAeghk08yVWtEf8f/54SZqS6SErEvyuQDQM1 QzBLv0vDuAXCoUvTU2dtj9bIfGr8aCHHwNIFloyWej5z9WJGOr7AAc6R1jXa EI645MsFLTte5GLhyEvVI+1hL549JSz14yNEpG0fHlcbHbVrRbfmguXe19BP hg5YM5kMKOxSssJPsPd1H5SW5cC9tdWWK7nh8PxHLqXUCi0PhWGU2d75E6k3 N8PqYJzNBtuXN+i+uSEeSYWsEB33zU0hH9DG/z3L7af3orWPjT8zm9MY0Mv4 EyTukcA68hLhMGz8K/Es5CjyJKX1GOoRu5Bo4hkfTK0AFmeQBR4XPAwKN6Zy I30YflfyD3l0CanphQr+Rt0C9UvKJxhWhapB54p4BKFLALnxYv97mjUJkUtO aSnpjVwn847jqiQjhZkTOGGCuJ0aUXR8eLhd5oTGcbPaADA+8X0Eh92Rey4e DGlV4eT3eiC6tJrikA5jcZ4nhGuCSHpkNmX1M4jhX6z67ky2/7QtVHwPKkwk DAe2tOVGLBxuKndl3OJQebaYywhCbiNdi/PhQi0kX5hTNbEET2wF6vGIEEwH V941X2qyEGmNDv7kI5rzIeRlCIK7Cp8AwQ4c88W/a7kD2mYyVs2F55qL1VOh qulsw+pQYD2pDJedS7E68BJU0GBhCk2ERFmSuKxM9liYEYETIdRqnUZz2Do8 2jIjQqt+WG2A8Rr+0S2TEkFC6oM7Rp/PvUFST6RfRyKDPGM5zTgBEhqtH1F4 pqahOUBbUqPP4EC5zmjnFx8+nL2QuNze3t5yGQ97i7A/Bk0ZXFz735sqBXh8 UJTsoETmTU64Wau1mt3Dw6Pmdpk3m21IuunDVzeHYtFESkYlvCKS1AMQe/FX DGlO5rjtwJ8MPD+GsYQ4ROAsTlu6l8xiSh9j1URu4JmoXavhgUatJuROASBP wLhb6GQX9rtvwk+iEXzzdXx1HSUL863e1XxKRirXOVZKeahtJnjKHjB9Ik1c d6zIGwa9cgxb1c1yEX2CPooaqLPVhal5LEBlSXW1Z5oQMPM2zvl0xO7s+g3/ s3Q663zS+p/rwXUgf0uW/eA6Ggs+MtnqHcX6n0az0eym9D+HjU73Qf/zLT6o /0lmY5BmlwvML85LTkRfemGIvVCpQGD102zGSu8/xK7532MhNwyjP1Uq70q1 pozflHkdEvGAC128qKgM5Co/PIVWiRZronVUHQTT0Sjo36/sTFACAbvRdWVZ zHWMc3jFHbcyXnHHXxP/mmGvBedwPAxbLfdltQX+davRgczR8CWGZoBfK6tB Kb/nDPozLXAPV5zSRbvsD3uW/WEPczEZNggXL630KCBJg6bBKoZv2nu8mCnf KOV3L35AdxjB7rxFUA7ajUaydw0gQJjYEWF8gfnsniqiTQdxvMFBlew6F3+p 4UOQ2BYz1ixQgmyCvZR5nN5fnpy/67348ObN3yjzhenYbmbUjvYXRnKi5z+f nL86xbxTl6fvgHfDZ3WZ3ygdXaRbG0A8y5gaIxM5r6RyfyeHlVWOAFyEGo3/ LhhCbDPHa8AoClFnXDT1CFYalzTd0qve84tLCnMg8+K+OOMHTz1BCqZzGcFG E4eoIjWa+OxU0gbUg5fjLMzRwoXsnGB1iBS86mlDkxE2gRPoRD4fJRCbXrTp aXvm7Pf+cgRxHen9LX6muVtEN+JxnN7n7BZo7HWEuCMsO9EAdG0IIDbg8Y2Y yQwcaNHgWAbRUhMykjaNEUXyIyLfgS+z+GlCPl20JrlpV2mfugFwCX6CXZz6 M62oQ7GF1uynDy/FYfobrJyBPtafkfFQ5/GkNpBkyGov3729PPv15P3pfl80 ljOxmDJPNRujR9QjWQgK9DCnxX6fUgSpxs/evT07Pz99Ido+sPvS689BQ0T2 bI2Q4hif3KvadY8xCsW7R6DkSnieaQlnEMo81WSLoprvwKOFq4umxTiXcLNS xLSkcnjR4tWcTG+i6SQClfx9X7r9qUDMqoY94bew2x4XPL3FOO7p8uoa3o2I oDOK2Za94vBXCPeMh7hXwPfS8BE09h6Pk0PO0OoeKil0yt42XLUviPNNJCck hojXxV2k4b7F9iScKe1mKLEe3OvlPPxWFsADRTZdO1zF+MtXfDhHdD94A1J8 joWWj82HmrDgVsPlwS7Ix8ZGesqECjYk/sBtUHpVP03nob9Ghs0VWSxEKWIN Wo3qkee3G0dax6AzMGeQkz03crKnEiZcWRjCakalsh3GsiCSp3+QRxKfALWj hHwVzLaHWS6Q+eR9yQHRBBOSaKcN2INwcKJ5PAXvjPH4nkbY6VSPWmKI7Xq1 2XSMEYnfFcm3MaSmIWw7JqjgNiZzdUiaSkCfntzYWJs8bzxD6+xEqkD1cXYH 2ikpzZsoQNicXIBoP2c/m02kE2ljAy/fvTh5f3Ig/ba1/5G8SNKDzrtIpHdU BpOh5E1iOyvl3SWgdC91U8hw2v5MWzA4mLbglshuxccyEhpVW/14ZhpE6IlE E3XcGDrNHt4vbmqkC7loBT8xmZ40vaAiNvDnnotmcEH6TpXPK06lv2RMHzn3 WQY9YZ37TFaT11qJC01Wse+14huNq6xzmck65p226jaTdVyXWu51pivZt1oa 08B9rwVyJUtnujWOiuN2U+gAmfsNnmhMq5x9u2LTKv9VU6TJRAAzcw0VNVte GlfBY6QPeY+A2wtF3gHCaxRJhAVYbcCugkRl36G0+J0pLuo8wnSQrbmCoPgP 5+RdKycf2uqhOBkNjYgRLbMsPJRc+TeVp0La0zUtLi/AcgUpxuZKsJrUriPD SjiDVZKs3hEucZaeSpn2QIFTFEmy5hsduoabWVpoS+8Om0Uy0BKyGoZgpYN7 YK/jChnZLmsLydaz1VJysLda9A3KuVCvw3kYJ+iP1mo+fMp+0vp/+JtcPxHj KUCjZ6DghTYyBKyI/283W910/P9ho/mg//8WH5X/0zR8YxzBgtNX3SpzHHpz crxSpfKbdFVBHh9jHMCZboBhk+xpozTMjOM4FZcNc/0gVNrvpCLje5lPi2Mv kvAGOCiEfWOTAXqbV2TM/gAjOblZdmXlXopLbTEVvCEggHvebxgzQCjIg+lE XH0LTALKcPEHdN/jUGPBh4Ts5kjYVOn2ocsV8JKYQ55RbSBnZKlVdgePnFg7 LZfpodCD1W4OO4LtoSNq14PahWWvZVnyai2DGeCB+43RM4eva+swbQJpt76q CYQsH7Vau9sYNIa7TwHaalQbdfCmaFQPHSYQzl5pQv54rhSUmdhyw0UsNwDc 6ZuYDQDPyRdphzWmY8FzgsazqhuchQ54BfuNTgsmI3cW6N7HoG7BU9nDYk9h Kzg51p1V0RzOGHkL62yjcGVvi3BlnIHDw2qjLabg8Ai+c6dg08QscmhlErOU DNfF2cQ92VtECYWw7psZWD6bf5z89Pr0QEXrbpYRw1snR0fgytEBXce1c+UQ sYgx/n+r/pJPYbfaguN9fFhtHhcsayY9xqbZBIJtswkE22cTkGLf5tkEgi2z CQTbZRMIts0mEKzOJqAMLAqsFpRLDjBP3KhVYxicaZZbMCmABqCFthb2HpJr iMohgMeWDaDqU4Lla9WUdF9WsJ4gLGr6hjpWRmkQBO6T4RlPU0lKqHl8dS0o zfSu5v1MY7f2gRqE3g0mXKh6UzW9d+NE2piWoRA8F0zK6KXTSWbwgNx9R0Mg JRbk8HBNgJ5/3YTaCRpKH8+Kr0AWNVb4+D6Ngqnk9zKZIpzB+rH71pV0C8uu SbCkkk1H99vh9rbSwUarrRhAItkkDhmUETuJA9XOTeKQGSs9SUfxb5TeQaML F6yGhN9An8gIWgIcZ8tJEB+Xguewo0kppLwkVIDNlHzLRBDkWVonz9J6EVu6 Jap7MUx6ufL2ts/XNZkd2ghZvRD2nqLGjqrHYsrE11HBlK0NDq0mL4ULLU+/ /Ws2uH8FRrBnaSdXC09SEsyRbfgxi0/9TrPTPOrXasNB1O8O+yXEJ9lAgfwk i8CsH9dRfqIv8QPC2+Ng9gkVDHAIFvFAUOwxWJzB6oHTTbn4MrEKQi5ggcqU L7zH2bxz9nMHW+mxwZUpLCt9RQfp1UzckSjRLja8pMLF9CYe9IBU7H9PijJB SbEihXpRsaDBPnBl1+26eE6lm3r3qDWIGt1arT86Oo7ajdLrdr163ch1/aiO UQTiC+37INR5/wni4Wy52DeuE/hRwTCAm34lsBc0tUx8c6YXT6wArClPW2zk UMLAKPZPgNgoYD2QqdZyBm2krwA4yDiDtVq72Wn36+4Aph0ADoKSoQV4g/QP jTeYBbXzMrB1meDbHaoWVqgJTGw5jea2En2sSAfg1Bp41l27kQKAJrojpPhj mGj6R/FEb5FCdg30rUJxfjO8rUIpmmjZHwfktbF6YUNkLje6lpwfkzcv2TeL M1dsK98QjpxsucBYuZz0OpBZpbpMm/+oDSwjf6/Y+tujLqVRjRzsUJoZ8tx4 7l8e7Ihf/eOy/yH+y3IiyO1QxQGF86uN37EK/7ubjf85PGw92P++xQftf3Cx pqQiC57bUF5XKn+JGTqLdogndoZU9EknyQOleTKDRg5qnvdyOq8QYDWCx9iV UO5Ft8G7cLLQ8jTVB0AuzNtWsWshT0i2Qx3Xl3k3mQDCBeWSGlfkvxkFAFIi Ko1tMosGEPxMbkRchHMpIFxaSeNes+E5DXpFla9lZQ/gbUoZ5+ySn0Y63tX8 cMkUis3tKJnOEuqyWRJMHlbXK14nA2/TTZv8mmXwbTY2+Y2Gw1FnKGRWEF6P Dt2YN9uY/BqHeE/il6En2He5wxp59VBZAVMj+M3whvQWOpracN+We1Z5qFUl b+QXFpPxVCANYUeboMnw4Qs7aoSa5Cg31KaQeNiexsMOLCNmkDFimnlNDLmj rAihRQXSxaD7OAD5dIvUV2tlFMMK6GPoKQ9VO6NYoN1Y0xnFUMValFEMu32E QDN+86hbbTRzO+5aAef0O+Y8N1dMdvptNKVM5hjPyhxj54UJMnlhvFJ5YTw7 a3zKTNyqI4RUq+5WSsIUrAMJ6JWBBPTS/PaGGWFKVjtQEMErnEnNUtn0MYhe VD9GFUu7nrGqy/gwD00vi2g+wjylicwqAdcteBqLu3coLmdFwDA8g7D2MeDM RRE4euGr7cXCgA8cd6sJu6Td7Ni7hDuW786vRCOG+2IhGrxQcY0aDrLQO339 7pTcjGnplA9yzoKbVNneIatr2M6PJS+9XI0fPeVLr3XY7g4bnVqtedxpH3XL KPy4/qpLj9R9HVgMv8NLIpWwGBFIUEIudFAYL+CKGmUhBju3bMVq2FmsikWU JcssD/tjRRX652Nz3cwW5IKtfrFnDIwMEOR14FRHP8sUHka38SC39FdQVLJ+ slY7Ho2aR1H3Kykqm8QZNQ8tBQJWGSzGeHol4L34NyLX/tL7K2JBwwl8aqjZ 912nyLAiVRVYmFa6r6jC6rdhNAqX48VTozdbAMJEx6PmsBHWakeC2Wy1OtsB wgjZFvge+EK+J/oEsXWpWFPvMfyDwmQMMu09xj0Ko+RqQGKhAGYqXFEWdqgJ 82MVdrQp/oMADADbyZQNUmXl6cx2gA9kTh25jkX1ZL+gjIFQQ2eKciD9I2KM u1Q7dhXXXAimA5xCepC31zytSR/qGz8M4ZecFhbTTP1hpgH6oSf6vOi2sTN5 e1KJYn3Xr7wr64NOFHWiWm3YaR13h+7zbtXLbEv1BPZl9wj5WvqSJ3sZR8kg EjtB8gtE3MQOXQhhn3nFoaB1PfibAwq8ohu6vvqGRuAp8t+BTJrkTDNfgsUN zP0JoIkI2kogU+iGhVp69FTGFJ1TGZ8jKqOfC0VdYnHwwPJuokVItvn+kiOI sRzjwoHP0Tzi8qro/uJ+RsGhhgszJfJIDrgzv13Hg2vyhGIXIJWgmrCXrq4g kwxmv6Ua7AxEwWmkS6ELCUJy5hguL0P1V8+It2I2qB09JWvMhi5FjRTPhrdi JiRwgDEdq2dChlNJI1NaQiZp/PzixWnvlw9np++enxpSdYnY7c/yL51oO/e6 sV5DbOUsnhCqlOm0kH9SGlqOeCSrSgPLMBqH9/sdOEzfTv/3KU//+0mDQG37 jhX6306j007jf3eaD/jf3+SD+l8M7DAOFoF+q0h5VMmS1pYRQzjQuyrow/yK zu3iblqRsRYgsYrr7Sb8GEHsNqSBSNA/SuZTuRE/zUIgMyW0qQDR1G6UjZPI gWjqNtPKysOvCtHEOspaLTqsN446rV0rKwFg8FgI0wTDUPH+XRCT8VKIGv+B VZ4At/ePaF67/pORq1C2wUQZbNP33iyaoFsnOKmhPV2lwICQ/hmmJ8TahOHO ABGxyj/Rv7dC/6e47JwHnnaQaD2hX+MFtoTwDFMPuCcP3ZzRfboK7qHcDHdA 6fPp4oJ6EUSsYptVbAtu2DvphGx2XvSQ75JoSJYHcgnWfQU5pYrWgIDuZMFP w9Wm3PKm6H+aApRQQ8SA2RFEkOM1GeA1CS3xhQjQEjfhBLy496NPg2hGzoCY G3wR3swSNojwKNFLeYYDHe4f0OAQIMBDHzj0qf8IjdxMb2G9+nQm0TYxJAXp gZ2HEZsAHRnnI4WDB5d0RElEUh7FifY7lKAM7JmM7VioDHnQQPlYDiqppDH/ CcdBABZCIlOsLzCjvY61hmGH47vwPpEDRxw4uSlfguD+FP+JH1Nx5AVirD/M JdSzkS8l1QsVeAF2J2iLsBrEB2K/YQjGEAHQjjznASDV3jXpurSDCHokgzwC 7yc0G+TmrLomKomxZLPUigFTZVbLXxMkuulVobp7vKL3ONcW1IY1qyfv31/C HzCr6oykNxEFFFirQPgddj+jBYcO6PmTNj/sbhQOriXuqOgds/JGC/Ei3T2w x1D3TthAKakcTTwcWbQfknsQEzAGsbXa7lNM4/V8Opkuk/R7SHqB9yBBhHj6 BAJ4Frw81pnViSRh7u0RyPnSvYehWlMHC4JGVkhIZdQdQsapG6TDI1o6A4uX GW4YgqBu9AX4F1b9seC40yN7/vri3amnRgY6MQzNIGuBIrKavnJMhdGwSXHF LuFeIQlFNJfJrZDbMQuipuPpbhDSjOqGzJ1kQPcwL3KHjY/jj5GkyanDMM9A b8h4AkEn4fahXsIhoTNqn194u6CySXwzE/tTtA9URLUKpxjzMPGE24ubPQO4 52ESRJMqYgjkHsLjtarDIUUshrs4iXB+9gyrI02NnoYQsO1pByqXc9jaKN3x tS6jIFIbXcpgUjlHXASaxMmiLqqLa0rcUjec824uLhN7muOhEjdJjOuH83ks OgY0gqgEzLkYLWsWML7EbAJ5NdxVirCzJSPQRtig2HTBjqSmbczMD/CK425+ Qde8N+FEnM+5TcBUOmaAMQvYuV/wx+zOJ3YR5ICWcETRBFRkmGgNN4oeA9VV kvhwGlEN8LLg1F/oYvem9+IXWFWSu+mOo7q8GoJ/m2pQbWmFsOpaNojAxkhJ 4TRRFjhIF3d2QcYqDJqmkCA4qsvFgnwh7mRKOO/dtEoAMz/gEDAIG/UCsMVo xw2nGniG3RrZD5A6/OhH71S8kBHxUOR+0Xv384f3Ly5+O0f/QuU1llcAzTYZ vFEJNRowSEeuiT4oMtEHK0z00hM5YE9khBdzJ4+7igEn6OSVON0DjAO84jB4 rEjnCfBYqFz/nu8o8RLOk42mVAhIbHp+q9muHh65jYNfbJZ+BXKbvzHj77kY fz4GiWR/1SDEpTJCC6WM0kdNUjxQvBa2tZZV09+Z1OHvUOrwdyV1+DuTOvyd SR3+9lKHvyOpw9+R1OHvTurwPcoiyVKHv0Opw99C6vC3kDr8zaQOfwupwy+W OvxdSh3+1lKHn5I6/B1KHX6B1OHvTOrwt5A6/C2lDt8hdfi7kDr8raUOf2dS h7+l1OFvIXX420kdfr7U4e9Q6vB3IXX420sdfo7Uof2nDNepwOQI0aNEQ3kX eVVq/6gg4x/lF3vvlYbHZV8jf03ZxieI5s1lG38L2cbPyDYSFXy1bJOFtDex sNeTbfy1ZRsNFb22bOOvkG38ItlGgvHnyjZ+kWzDiO/bwyJjC5LCA+vMF8A8 0jsG0VElJjLLE5D7VfCl0oj7R9u6Hj7Zj8v+i3/DX9E8ENQtnFyNtzJ9Ftt/ 681ut5WO/2nXH+J/vskH7b+fOAfEUxZIkEWVN12l8k7M0EJwb8HNcryIxYX+ CWilNgMDb8F8ilJW0PbZP8BoHzuqhhQRywlqQ9BQjHi6nCQ6TsjeLC6lG1G1 WllO4t+XwE71BS8jr3wC3jP7gACECUk+YRLjBVgZTcfj6V05G7MGudPmZYch udHORL18TTsym49rtaYQTo6P3W6IW9iRO01IFujDV6Mh1U2WMyszOtqLxgCP KUSMTnvWUE6gJyRBnyLwMG4FumpMPJTlRMiCyEyikF5VYdMyEgz3JTRD7Atq Y5AJlDecZr5rwGvfENgRN4+ox/Kyw2YA8ZEZfkYdiodjYoGfVGR8Dfj+VTI7 vJLNTYluxTS7rTa6fbbMPMV27UxAB6syH62KyThwBT1oXyWWZz7bEsFnLVRr kIuVb9I5hNaBC/e3dNpHHs8bXg2eEkuXUL6fiJDOmR/L5xytEAJ3qIeBGJ4t LYPOnSDdmbiAHLhpV5oQmYkXu5BEv1PE0Z0QJHvLmcxsCSJVL4nh6qWCgrX+ +BWConPv/3Cx2M3tv/L+70Kwb+r+F3883P/f4oP3PyqWtbZtAuqwCciQZmBw pfKcw61QNDK4AW1e6EccpIsqW0G/VaMq6jcbrpt2txSS/8kQHEZBkQUYvYI8 Ts2rXvzFyk3UNS6BtksuQ4+CX1h4+cMtIaNoAYl3VVwvRvVakL1rxPXiWxre qgBcI6Q3g7KbZT4aG4Tc8qjzmAN6rHB2R91m/RhSDQo2fVQq1SA3UMSAcBEE iuq2ILgEvpS9a0QZ7LGYgtnVN6SnXHQ58IjT0mdvQdwJn1PBIjn53Fa4Bed6 BcM7PmfCUf49HkHG359Pfj3tvXhz8vZsRaQlloGbdqfsI3ONtVq70Q+P2tHO M0W2W4CtBl85xsrNzAveFuYF71/aqWkj6we46xIsLCp6TfKaNg5lqS2ap/Ur t7NoeAUWDW9nFg3ceodtTFJ6mNp6+1tpVf2cFITIMR8QJLXUqa2hd4XyHPzb rjbrEPzbqTbS/c6IWisSbqS8Hvbd5IjY94IMY98m9jaN75gXSSv9OaTnzkuY TLbA8qZAEwO5DMzm037YFydNxq0MjTCejdK0BY40bdIHpyitmtJHb9ZhCVm7 QY91ykSjy6yy9krke/M5drkg55tXLt/STkOfOeJZsB6tRve4UVr1UTb0uX2M 4ejHFJG5uJ9FcGGzMN+/vu3J2UZhHSaBNAXoQLIv094hWLWYcQ/GzrC2MuNk qG2QoTRDHbCzj/fv5C/D+0jMswws2ts3ttZnYyE+K/r82XZwspqygpS4LU48 9TlFIBjCxA7P3l3c91aRjhzgWKsNjpr9405+/G3JSMdDhKjA/zvjHI0os7wz U8ggBmvEjRXFmKVW52sHmeXK/2Ss/wb6/0a92Wik5f+WKP4g/3+DT0r+Z6Zs 1xoAarZAB6DNAchkcuof2JE17yyZjkOKDq3gRSoN+ogzIHoSquomEFltYFdl hShWoqwUn2bjeBC7UMP4ajsoqzxotr28iLQSGoXWoSu4LRvtVka/gMqJivhK aQ7anYzmYIP4t/U0B6gwqNXC9mjUbX8FzYGgHE1CtsRvrTtAW4DWHvD1hH/3 UJDce5z0JYANasCTfvCnREnlb95ZSnbFoaO0LsoeWDr2FEHnvWOUpfB4egXw gyyOSHCpRr3VomGI764xDFIQ8yj+6TA0gNcJCzH4qmdpVUlg5pO38yS/FxLq QnIoU8BRwAOEfk2hR+GD0kkgTjgbzUfucPsQhRjxj64BYZTu8p7yJYXD/BrW 0crboNOAmOkqz55cUFXpPJTYaZLR2ejzZ0gvIPo6vpdrN5/+Q7BcP/7ovfup 9/Ly9PT/nPYEzXl/epD2hX+JkfKC7F+hBxENVYihguih/wfuHqRSgnwhaRQ8 +9U8ShJuABJWCBEfFAuUBIWcORn8H+9N5PngroVEmZzwVVY3EqdYjlMpnykx +S+A2sXopAtjC2X+FZ0otua9iRbhkMuBmoPKVs0pTVBjkogpl5k/p4PBck5m lGTKRt8+un7RKGSaD+YxvP24JrPH4MaXrIzKQhIvfhAjwMy4kOGEVl0JTzIw QErdGZYXpT5PQjRZxeiMkaO+09plewitvzvSliHJFrJwc2CmaC+SgXJOOZMY 1Z9xOBMsszi/nB2BkQcJ0a/RPbQIGWSbA0h6Prne/M4L/uTNp2aG2RXGO0jK sP/YQdk0nEJOZMSeQ59qLpqme9kpYxYajEjyqXpgdvjzj5keE5bWTrWgrPwE OPfWYBQe7VoL2jykpByHBv6dwyCo0wNI8m96G/o2eqBSoDqpvvI1lM6GqBFr kkZMfLUbxaEj/lZ0MEMByVe/HBVcQf84fCCfBpahfmTUd1LAzWifvxHlQ/cB 7TdqHROdqMJaWEGO/klOohJQkLz4SCc6mU4CmSaKDOC5cqSpPjDt2iUM5fk0 wewLOhWjXlt1ZGcmFbPzGX3HpgacnJHLNmlo5EZimBwwKdUUPUbAjRQ8SKU7 guW6mnclcLvyWIBLDdeE/vTl5NoyvLrOOOf0Qj8BmpupaRagV9qZrH10I+UQ NiWrrR0M5u0sHmunikLWD9Zqo8GwXW/XvwJGYhcxEjFxxFcFPrTKl4cttNEO eQeWqKYrWrQpfzhfDxzxj1aE/D/6ydX/DcbTJNqNA9Aq/Z/4K63/E4zwg/7v W3xQ/4eQ/joYq1IxArOkPy5ETlFUGNyImCkb4fAh1PPvUv2Gxll1q1Y5alM2 gSj7ogZ8JbPpoobxRPgIr4cKFsWYkpivCuOmO9B6OrSsEnQd8mhJrVLBewlZ 1etwJm4zjxxMr6dzSKCHqoa7cD4kg80nfVVBoxVxA96F9zKQW0LQzcLFtXcb h6oKngmmYwnAX2EsaZxUBpzFdB4Nl5Mh2PxxkgTPifpQSBk+hNHK/AZiHufA cxtzHhNXfSUmB9v9GCvre3hlJbEsp5Js1L31lJANLx9Qaz33pozyMYO9Je7o r6p77A8GR+1Wo1arjwZRPzz+Cl5Lx80qOIzDdzfPbcnkDXlTKW5aKgx+O7k8 712cq5AfzzB9Y2TTDxSSRAp1xYNWPQ3FKEURsaFC7yYaih1LMVAKbFK6oWim 7C4ywyJNXwtk1/oR6P8RdsZKGTyklLoJJfQcj23TeF6QE6ka8n2V0eXks3Ea SP2QibUyodSlo0BJryqPuOZ3p+cveh/O8SG+fw5JBV686V2evfr5fQ+AI1GU qFcpl4BcNcQL6K1p5i6pnCCdRK3WbY5GrWEpPfk6ygnSTRwW5gvNWP5VcgtM t4mqLEpvpv15PJCJ5jFuBkGqQCPl9Edhk5K1vGVcUlTaN+X5JIghiCfaEwyO xtWUgTbQCwlEmemIKyrfpSe41aXUktQK033kJQBXQYIQWQri03A5x9BcKRXq xMI55wBUcSm3InM6Vh2h0gnUzEwNMt95p0Ua+06rMPGGCqfMpKalZM9Ex4HM hBC/QMvAFTEJLihhwjF0k+/7ZJpOu+yYAM7DgTJBcZZYmYStECsGG1pMkyST PfblGfhCnLx9yU2prADZ1LO4ZzL5Z6mw+KRbAt2Bme9XcEOsUaORF+LTQLK4 Xizz2h3IZMw4Hytmg2jgf7ekvKiOPELM89ahcUPaKjBvC2ACb0tgAs8BTPDf BA7N9pPcBpjA2xKYwNsCmABdrABYHJysOk2b7OybhEoFw3+xuJ/fYIat0O2q SZniFL7JydlrXB4GY9sznLUYhEeHseMYQUwQot9gOp8vZwtCaIFiby8v3th8 TepGw41h+Ohg3sm8R0jZilV9TBezqjwmiyvUfUQEmBBkQsm1F6wMwdup7o1V brVas1M/HvZ3rnvDHFd+86i8k96X7M+9Bbnkm25y4Ge1t1f/BBoIydl4YK+K +8sFqWhtvzpcWq7RhBooDVqaUskGpHz7kBBzzTamr59OP4IlA52xIo5dTLI1 YQtxvSPrgomfTE1TcbYmU0yq3KhDZcNzXSI4iTVi+4fU4//R6oiHzzf+5Or/ EAQe/rX9O4r1f81WJ+P/1210HvR/3+Sj9X9aJwbKNDCPUuQMGYOl654diTeZ 3qGyilRc6GanXPHC8WJ6BWbVkhDvraZXCOq+jjIKffI6np8ubCY5UjF3rC3z U6kxY8HNWIkxsVyHtGSO2LzmcTY2r/U1oQFYX1CrRf1uZ9DeOTRAq1HHPHXw 3VzhTxB8BX8C5P/YA4aUXwYDBxJmgLpUcR3iq6TdXhdCdhGkUnIHuJt6s+sw iXATR5+iwRIcDIi3x67jU4mRJ5sjPbOErGLQAQUoZb1NYRRGgylw94l2KEgh hkJkCKqkGQPyh9sIL3dGz5SlbQ8GcNgjS+tC5XuhLme8Jt7rXlCJDMyPjLXj dVmAMIOK9Zj6JBgCcghk0cDKB4zeDtGnOCEUsYndUdaiI8gQzC62dxOJEuzx F5ozKDGEUIBA1+F78SUKzInN15lhJF7klEEqt4zCIOeM1b4w62xbb3duMN4u 3GCCHbvBBJu6weyoF9hUmVdSiI3yqLLVDkjcWi0ibm0zCWdKPbGBm4m3ws2E 81yt7Wayos5y5qrmrXZYpO5kvFOCld4pupZojyixUd/L817xVoqzHgcWd8T6 QFLZTjtXffTlIbfJQ26Th9wmD7lNvlVuk6I4+2BlnP1DvpLd5it5SBTykChk N4lC3IARwWrACLDTFQNGPCQheUhCUiYJidwj71Is2VpAvcG2QL25QBdqFPow fNanAYrQMLISUz5+iXPCtA+Iy11AwZJI8/jGsCSBYfwvB0tiRBBuCEmyBSaJ E5RE7nWnmGrNdN721AgfDgctF8IHLwrte5w8i2oqgmpjuADfhC6jSOMjyQbg aBD81Qu97zBU6jtTU2DvxxSBZUwLdHCQE5DBacwOLAeo0Z6t9BhtQ7UcXbGt 1UobdDr5fRktIbIWzZQgFcBUCJI3i9GRVgjwrNgTO0AB8oofQNFJLgEvyNMJ 9sq1IN+gzwyHt+JOB9btKRYJvDPBAYe3oGIEFUsoZjyZCR5SUFlMzQwMIGKh guNuNAfpSdzLgsdAxcyO8VvIIlyrtTvHjeHga5iGwWlVfDXaf7RxeB0bb7Cx jTfYiY3XboUoADXSrGu1jtiFlAA9qok7SHPGyUG2jcvTl89Pnv/M1vF23fMg SGy+RPevG8X0TUbgIT0SXRO0wNUKHmhq5IgaYfU/qvtBx1QFjSyeXe/1pWM2 6brFJsRuwyaKYqyxATykwU4MDlLZgq5wWxgcsB3NdNsGB3FtlTY4cM4t2+iw tsGB9MgZo0ORwWEJw86C31BL04zaoMAckTFFYBubmyPIFEH6te3NEXJAW5sj AgdR2QYUys+nT81i+uTn0af2Kvrk59MnIm6l6JOfd6LFkS51or8aoJWHsuY3 iOfzNovnc/t2pYzefffvEnZrVBc7diQu7W6724kOnZd2qqZ1XaeeYazE0SFc 0T5+a1vLTW/4+zASPMp1SpUvMUe0Ev5XcN0HKZVwM4ELBJuUUislhrZHq87j BehVBasNkPFhouKPFB+hNK2SIXjqZU6WxuOSm7f+qdUgtfF9Qiq5VTVZBVf/ 1OyQEh3Xbz4V8tjTnAgIE6ld/psa11kR9RRJl3SS7GtSV9UHKj0mSP0ksqLH KWI/uhHsYzxA7VUUM0W1jy/5vbKBIewnSMvoQtdR8dh9KMiWt8C0vd0oj8+M XiYPIY59L/rZ36TvQ73TaQ+iWu3wuNXsdBq56HBcK4MNx7+jkyqYAMX2xO+W 3J4xi5T7KlC1t8BQVR5HHH0S18yA/bUZWQeFnZ8jurWHgEyVzJZCPl8mDHxD ukVxlc2HpPkZTDFVKLgAk8Z1z7BlARS2Wmpp9jTcb1RYTmLdSKT5oUsICcVY XI1KQb4g9aRRlw0r4AgbJbMpmsyolVup84UcCqCQxgv74i9ksYVNA/c4cS5k X0HajPA+GkiTho42Kxg/hQ0aw9CMzpWYsmvBaJHyH5UZc5AWF9QFMPOCdRhb nUdXy3E495QpFF/FULs8WboPxuswWO8mvM/GOMgmgU4IRh/VUtQEWauv8TDp 11ACq60WnIpRO8QXz8Nh/EmwMFGEd/Ryljg2AXE08BQPulpMasjgqHgfUNO5 WyC7wtRQiWXOWWGF7UQNcV/dK12wyLFcXWNgU3OFeefmrSjVt9bTd64nLaeE gcwLvDj96/PXHikRzy7UL3j+/2hHvg0/uf6f4NBHSSCYR938HSviv1vdTjsd /91tPeR/+iYf9P98A2pLIfiyLV3hK4pjVatUfgMyJSVE9s3RcjHyHRT/vLDh FyvaRqQc6cymq1ADaA6YvCYkUcKuqxApdvVGBn8n4Q0bR0und+h6vl8qELqT TgNV8CkXEu2XyPjQOfRyPF2LnF+N9q7t9igSu5N2Uu3W006q3cbXDcVuHLW7 UXhYqx0N2ofR0M2pbQcD2egcUSQnfrvQ074CdpqXB30W5EGfpcDSoMB6mGgM F0kgccVgcTJbPalklF+jBnZ8L09knKh4TfYtJKcRUHWhsCLvVHRIGICGhrj/ G/Y5rHkXkwHxDT+wjEVKkpAUdSgl5DXilW7FQ5Ok4FHpglewkmgGmxCsK45w MA+Ta1B3jyMekXQHNPN4cQRwl0OAu9ZMws2PqNAlQTfZ7uVa8rwVV2+6IlME /75GfFbJ/HHkG16rRcOjQdjeOfRdCwOKffxq5rlRpuL8MA+cuRgWOhpM/Cps tD0Jh12vehLhmnCvPo1W42PXDZQzp/Wwvjo3GaVWRV4SeXPB4M68G1BEzpcT 5ffkLe7iAcGoSuWpMskrP7DpjNpBIzgp32+moiQcDQlzwu6+WESaFckIrkpR I/saFoIcM6bze+m0B9Lkb2gGQtMi9tZwwFFcttiUV6B3Ucw6iBha8SnhUeg0 6iS+iJ3uzBO3GpttDTx0fyM8dN+Bh+7beOjwJz6DhGw+BFX6e1+YkOzT+/7D ax4YaGq+k8TyRnbTWHKMq0rXcTIUEF0kH34nbTyP7mylNnkOUpN9ErkkDC2T WoosUJrSyb3BUllNobgEumqQDHnNZ/Op6KXMki4WN3tMkZitPqhm6mt2Yza1 tzfTIeQEDVVXLHXyHk9+uJjexIMeDFfmx0MTekQG3APvT+JMw5LRagoSlwbe 0z6FDF4o3q3nQ7rkm767CtTQoEsKA5GcS3onr387+du71d378UcTCvCt9PVJ uXLzfTdJHbAszCAcrqSPO5KcHVL5sVXmxaQ3uJmAQXr/+WkPgGaqHmjdYKPv fZe+sZ56ozBmZSJcqkmf2cak5n3HdV4ShxDfwGZHgXuKJEQcgSQW4sBkUfvO wmeU+Ck4NvNO5AcjButO+vwQjpb37YzmOzV4s527Vmv128dh2Np5wpI6XLVt RnL5xpYFbx2kQF8ZVSxy8UfgCm6VhIRzj9Rqh81+q9ndOgmJEFC6Lc/vUDg7 JIlDETny8DQuF/FYCHLfpX+nLfAd8JkKMRgJcpDmm2zXRyLF2tvRzTVJr60y XFOwHddkugTtgGsKdsE1BTvgmoINuCbp2YRcU54P18YZZzJcU7AR1xQ4uKbA 5poCk2uSUBQurkn5QwW75ZqCnXJNwW64JrLm60NqiYZZD2XjlJr+xxwrVpph CtZjmAKbYQrMWLCNGKbAyTBpH+l1GSbu0QYMU7CSYQpSPn5FDFOwAcMUrMMw BUUMU1DEMOGp8gxkZwtn0IOIhOgmAr//EAILMLiV4s1Uyg/wFJxFgzgcYyMy xzo5DGLYDLnnh9TGLEQyyo2pZhIZ8rTqxr123o+Sh+oe1hvDelSrdftHUb2/ 8sa9zr1xrzlXCfBM4v+Yfj3NgPQAPNRmQIZTIsE9GU+5ijuqwqrPvcejSXgT IWwgPBpPJssbWB/VsEUC8jmhf4eQxRG4ufSA3v/68t3F23e9n78WOIvL/gO2 8WAUwi0YXMeLYBLcxEmy+TtW4H90u42M/adTbzzYf77FB+0/tNae9IvoCSoa 7R94mHf7OiYwW9gCqGVNTHgQjg8EsQqfSQuQ0UzNZOPQUaFC1uhrTL2VUBC8 4cOIl7h8G9aGcDF4G0L6juPFYhxVyIKEIdDokoKxWWESIx4qjwgiY5YLGoci XCrVWI0wg8kCpc3IS0H1oCEy1y8FVZoD70mW6mTZTyIhlU4W4/sK3sUpQF45 eDI7tdorUnvlW3gamdzfx40swEi3hPHG6FK+Q81g2G43h6Ggu+36IGq6EXON WoUONfVqo9tASbXROC4UdJTP12twRxTyfDhhZwIh2AsK2geMSXJhuIohnsWI gq6xs5jhfgBuBqQXsPwerqMx+pxgAuaTV1TxbGS7LowEHR5a9arg8o05mxfS 8ChYvNt4SDF85B2jnchEg7GKzEJgbAB4ACaHTaMKYc4YBBg7UH5lt7Xh0Hgb 9R73HnXE7EL69amJIC+MwQC9Ta5ki7fheGkIUYOPbHOCs3ED3nQ17YGHjl/q gRFeeS24cPSvM2ZQjOPsQvviaOcX8pRT0Z7Ask90p29m4ACqPZUQz4Kv6SWH eOFMLOdzCDY3l9+DYAeskOjAUDlQ6sA1mIIWECNH41rg60KqRQfcbN1MQ2YG Tk0nRio0410c8MmIkIvrOcZWcaOfyIlMsLgEMl6TvthyxLy9p+Y+FJwXeBqb iddQdowFzfHEqk8WgvuP5kYf0KknzkIEyJnj0xSRw49oJlnI8Gdj/UWX6B+8 ylAallmmLlctQfxvJL1uboCz5ADNkbxA0G3mgAQW8jwTI0ScS9p9HKDc1xNB HD1PB1zHCwP2Q8gZqTh/6gielz0MoP04AdiL/RDdGPvL8UfRxkKQR4jv8uqE P/Kcoo/oCMRDCH2zJl6IgOhGzlRgoc8fezQamZoC+4YTDDqzc9jU3mPZP1cc KvyE2wx+WqifRBXxg/h/VUWdEnNpBKHKxTLqgFPi3uPH8Uw1NBQUZC5+FNN7 UPFhIuKBpzIQUadhVD1x+xrqe+q56rql1gcO/2rv8Sy8Sj2Qw0WVspGNSv+p O33g9YS8B+qdKNnPAhdXULFgT+N0PKRXPEsPOJ6pmF0VkrUUAtXVRBxDAC7f Q3ajh1ebEOHC5KNsAwcDbYjXy9/CK5p+/FZS58L2xcP4Ak5kEMtLahDOgLiI OyWxUdDPzi967y96J6/OL/ZJWpgKoftHj4Tdm/CTeBeKnWwaPT07//XktXr3 FQcKY28Ncgik1QydiMFYbncFuzFDzG4YGyw4tqK6IUXfR3IVYprY6Udnh2Qg rbVm4FCPDeGUsTVcjfnMGPSzHBORqBOLuYjpl2fZnWisvm8mtZRp9QKMgnyK YXjhsJePiC1GC2/DpezBUvbIGTFVGryxxYV/JTstrbviVj87P/2NA/M5VFNe s0RW4fclG3HfolMiuqPONQASW0hh2nEj45Hoibt0oR0MxUskELgc6OnJq5Oz 82cy5ROQICj4fP8THOXeaB4N7gfjiGyXV1NBrAW725M5nxhOF14qZuDRjx6g 29Mb1OSqZbhVUy2KG491Lc+O5C49KbL85enz1ydnb5x1uBhcu+KMQSoOBDYg Ai1jqwhl3EAAnrnm2sYaXznbQRlQda3yNEzJuU3zQOViZlbT2yuznI71RIu0 PI+rXn/y0+vTA3ZO4cZwhrAh3Ny8MOyaC/hHlLUZ3ZIhX+Xko8Qni7g483FM I0J26fDiG8w6AelJSJ3KxSmwh8EhYwNimU0HxB6Q3wGUn01BIxajSCmuCpPt oBJP5OTv064d1oYxptIkjaH3/fdYTnx0sDBOyqvT973nl6cn70+zy3J+cXr+ 3j3nHs85Tja4+0c9cQ+I61zQU5jw75Tkg9hu37GRd89YHLGg4dy9OvjOlZvP l8efHMLQEVk5lMEE9sTWpBCn72lWeHYPnqVqfjjXdXFb5JIBPj1OOkBg9/hV 5mRzueKjzYVWnW0qpuH0Sx1BVMSWOuLGGcc/VxxSwui3jhb88AX/v+YpDbLT Wu5ccvnSB5PLlz+ZXKHoaKaXJf9wYsmVp3ONFUOWbmmyOKKUfChZGT7gvDgK OqLkgaYKzr0AsgK/rOyJL3ffqFdmzjwiLhQf+lRd89QH+jJgI65ksNF0RxIT Mgx4fAXPoEiAPvq2poFu+8VUTDRB9KuTK7dOwQFWrcMIQFiJAGT/DDM0n52/ 8j57Z73nr09PLv+gk+yvnhN/rSnx0zNiX2vrzYeLufC3YC7A6PD8OsSYsJDB q8jfH68FCG+OPI6hVMf/wB5xBYmLEMfnCDOBANFoq4u8sfgGjSyEds/gBoCI n19AIYH6FjQ5QUDytEJXwXD6Z+/D5BoUg/jisVQrMe4l6gtRkRLdQbf+XJFb yzDivT05P3uOF8x3ltT+1Atv+vHVEiK1bifJU+929qT+6X+h1ML//E4me1Gr UuUhq8QrFroRi2Gs2q4EamWz3fE36o2f0xm1S5FJL3NAiqgZyw0mfXgqGQIX YbezGuXR8yJCnaXTX1gQ2ex9vpO5k1teS0b4CkMJ9uhHtoqn4r8MLYaUkDK1 /MJKnrQwu68IsRTyclh9MeE6kdGYxkTT1yOlyBf2ryt+kb/Oe/wV28VIN2X4 95jHAaw57PDiK6LzFB3DV+5V17uhvQhfLlp7mpPtuFD7BS3kea8Wqr9M/R0p 8HxDgUcaPJeSjHR0vqWjAyVdGdUZedO6FG8p3Qj8aevBXIow31J6lVHhcHQz REd6l2DPwHgucPpggqyRcdDWFiJJpme28kqsAGH31JsYc93oIsa8+MmmNzIQ 0/TiIGU69GpBPat638OWxVn0kLPMkoWfPrz+C2yfA+/P9OObk7fqR+8pe7Wl IevyqJXlZeu5cKE8GT1ajrn0MGnPzRxX22TnKN3am0sMMj15/frit97pLx9O XvfeXp595p9/Orm8PDu9JM0IfOAFYl6+q7I0x6vnap8iXtUbZFPURLoFXLFm o3osFuwQkno51quY/HnFgsHqCwRbHwJ23vSeU6QVXiqpO6X4SuhxwzLMCnc7 DrrVqLYgQugI0Kjr7n0qgbln8cSOIoYhG2rH2TwaT8UOfvXybe8vp5fnp68L B2exsCn9jYPryxnLHpx5UfL/t78vFdMvTgUP+eHd+9PL3ruz/3OKmQn/9CdW TSf9WtKn0Y2nV6KDAXpLeSYhEc0R0fieKYq3h1NQqISV9wJnEJR8G4W/891A /vGuEjY1MCaVCufrcmEjY/9hMUB4/ihkYT7BPPs/fXilErDCbR6cnv5V3JQ0 8TSwFexUdpF70WS4b9zo1uKK1bKyvtov9dzs2XA5W3srULezmdWEtJKwLTjx euDR2kP0zUi5MpKpRhrcLEiCwcdHcr1Y8tmqLT4qSBiWiH6qlFFX8k9QPcmg OWZsRPu2MpeozOrl8gpWy4c7lUwTNmPjE99C7QLDsfo9ftF7jHP6VDIQqS3i Ymk45GgjXwl/U18Jf2tfCV/7Soh/yga38pXwN/OVkK/fla+EguLZka+E7/KV kJ3ela+Ev9pXwt+Vr4R+15q+Ev7ufCV0Hzb0lfB35yvhr+0r4e/EV8Jfw1fi iQrOTUlO6Ozgu50d/Kyzgy0sZWQlFpUsZwff4ezg27Z/lyBFzg7/TBc15CMl HmV9AGxxiH0AmBXZwAfAX9MHwM+Y3Pnd2/kA+Ct8APxcHwBHh4p8APxSPgAV n831vhURusp2729ku1fKo5QyyOEBw5o0EO69WMIcZzQ+qdjKlPa0J/5T/JjS xJUy7blZPa3eKOg9ajBY5HFKxD4nqt5+SMx5uSQtwVVq/ROIQ7xTWNAb1eKR kIEXsNuFsAeSEX0oUOzi8i+9FyiDwFo9EXfEP6LpCI1m/Zv+AmwavQUZsQnw t4FYA3WJ+JuWxVwqQ1LPsXwquMbljKMLWS7IMHn2BDw1ZX6QV4nP5p1lOQXY jLlUxLnVCA5EhD8GQsrp/48WiGUSBck47Adw0IPpZHMEKPT/r9fz8J+6zW4r 7f9/eFh/8P//Fh/CfwJUlmUSaf6KV9yDDeBNZ4tYkJuQINkr78Uux6iW6/CW 2WWoEAu2JWHAZwApHiayOUhfQXK+4BUxx5WHCjBssCpDJSWYG75S92AUhXDt Vey3LDDdEycpkuGAV0vBgAteNSJeECI/r6NJBbLxzSMDtBfzYtG9KXiyeczm LmXVwrd4aH6rVU6GEPkESoYEmoMwv2mSxHDNahzjYdRfXnkfo/lEUH+JdA+p D63GpEAMvZHZphiCWE1HWTyr1lFeYMGKLKaUxrTtGaEGZnHkW9NZT7tlILHy m7tONZeBxIpJ7BhkOinbdSBZHWfSrbbaXxfJ6rDTPux2B4Bk1Rodtpq7R7I6 OoLAcB++2k0Dj4g4WthLPTgTAKmT/mnf5Mq9xwe3bBsksB2NVoLnuf93TFsF +N4ovslzRX9KaUgdW0POxdwKzAHjYRlGN+QaIs88nyJV+RnJ6pBPjqHjsJj0 8+lHxrFG47A+C1hTKQKALjCCN5KfhDWE1M48miFaOXLm3BzVt7olJpSnCOnD OBotUuceaRicVgJQwRwcfF5Nb7QUKkpmhfw9eLgnXaoLbDigbuKJEiVuohup 2qpXJUOUrnZAfDdF0UJxpdTHGFeJcJQtIOO4ZQnQWfcytgHSsCke9ez87H3v 9dm7972fT09euJzMcNwQpox4Hb1rjOvlLsEb4BGzs9uaOvxCU4ez/bVMHSaw 008MMYp4p5OFhFEOvYHMEMDB13iNqcRZCqmUAm11GQ8vNGASxRa/g2Ba0Ya4 R8LBALLJAmZPblUJ3Srxmw2nYph8XVIvomgBp0R2LPPERlt5b2qCxLkErINw DpoxzqxK4uivL9/VFPgqJ79donZ3OQEVUjQ0oojJ/8O4omWacHkIGc6xH/xJ SPPwmh5pQZbzJBrfYkY6CuM9bjYQqu24Y4De4dD/MZ1EyT6cNgXNjIcRfvdA 5Nj7KA4V/kkVcHvvG7IGKwwOpIUO/vyOTIp7e3950/s/F+envZ9/O3l99upc 3EzyF+n2+JndROTv795einNSJYfJZyyHpR86iIYyUzyyB4HSS9q804tGMT7N Q30vFfVXjzqHRxBt3e602kfH4TZRf41up9qsg0m3oxO2Zkzu69tHtyYZQSHJ cLa/FskIytK/YCVFNgFSNqQ+webUJ79qlvqoxEzF1CfIpT4Bb3bTz2GVFTl3 nzPX2nf8yDv9+HB0PGw3arXjRlivt4b5O52rZbc6P4C9fkiMGny1j+VeH8aD 5iciLjqfATARJ8TRRKztV2xGONFkQLIUWRQjk8HAc1Hkt2K7ohR7jhg3ncxB NoyH4BdMWblTiVRIUEPbBCCrYz1B1d6c/O3lydlrHBtrNYDwEXT4FC3wb07f 1Lx3pM6kehhpDd57mLoPXx1O7u/Ce+NaA8ZIU24auU0Yq/D+d69PT99qhSYA 9GsNJhkONWKbjTxiMU0apa2grMbBSRd+hKxUTGxTNHSwUmZp9OAVnPPiPs1O maX0seoBIKp9gqSiUxIiYiOfqZ9uGOrnZqZ/648/YsG6/mksrnnrh/50NALj 7Y/Gb+FopqywikX9Xur4TE6VLLSYVevgQDcgs2cabRK6EhoVnA+gQfsBZ6qB Uai2Un3JdGUwlJe70Zts05PozvxVK+jwoEjbK/A1r9CyGrIJztbKK3ssmWeq yh1f2tCwBekfNVZaEEyIEOBMsB7fzMQgmSS06Wreil9SI8GxfgypK/yjTrN6 bGSwEDvX4onYKOJZRhFPB/mluCcZM8apGu0T+Y+VRzLI7s7AsTtd16IlyQTl 5BTsX5pWZiweNoEg6mR7uEGWVl6wHxI5+9NJYDq8cbqJrM0tXtCKHDca1SPP P+7UDWZILgip/bP6732wfh24teDai2OVPBYYY9FMvTiUN4KFZ/0JCbZ3ETLk NBaIKyHeAj3VsfpNSLjurabXh/Ad8CkEW7JKWQl7HhyzuXU2BqKyvtvCGWh2 u0fGFEgvB/ZO0hp7QWM0AyCZXKAkys0DMM0ACe0vzLWBWG4yhI6fiY8j35B/ j0eQHVA7Qb2/PHl+Kl75kVhRrEfV8Afp99Y9RMmjeVjvstkhPRDxwQ0qTT2M aBWPtc8JDtY4iIBl2Us7BXGfxaOZ4fTyhcyBUgcp9uNtNI9HSD1Yr4iKmTmm YcZrFy/Q/4k3nmfIcrheaeoTF6JomypJB28nMagO+5161G/XakeN1uC4705c aVbL4RUJgapTbwOvCF8St1O5eS8nQP4ZUNFU8yDj5T1+bAqKC+8xC6UozpBu UNCK3gLRqPB/B4TwyS+gYDFHu6lm8YA4WM8MNc3CVqmWiESR0it7hu1RyJ5m S+9n+mWWCRdhDxGHrHtHtiibzV15qWXuu36VODij7mGnHQqJeNQeHLcKcHBk veziyye4+sftarMhlp++mXpIxwumHntEr/Hj6TThzAyIzQ82ArprdLEnrHZY fXdTsVLXtywsM65btzk3k7nSjd/te31Pkcbiu5vHBJdBn26BPRncJ0YNuBFJ BE+kMmX1Va/ae6S8APDTNxlZ+sxvwzG5BSMnoEqKjfZR/flFdsqyxi+m/Rm+ FlpEBwLV973vh3Bvfd83HdTxk/FCTz376cPLHmgd7Hl5pJ3O8YO7Ih5+Us6S km9/knXkBSKhlqMMAfX1/NtuiUaHoKvvTwUTYiRCR2O7MRyxgW748hal3p+8 UmPugRas9/znD+d/sctD2cuT8xcXb1xl0WX3jzaZ/o/6uOz/YPmHb1D/sjMA 6mY3fUex/b/eahya+H+Nf6s36/X2Q/6nb/JB+/85GOXR8RJV/kwQSB/PSfMI Fnl8X6lwnpbIew12zJRApMx+aBcQ7Fw/noC1lmz84OwriPk9+AEg2hJZymUy eKM99rRDyNGbaHE9HYIzgcz3CfkJY+lBTO6SgviI1mvezwgGKF7HbrTh+C68 pzyZFWRbcsYHANOYji6BZodTBQlIbDV2FJWkKueo7rbRb0Q+EH2mThF3zl2r FFj2Q84IhdbxpufnlYtLlrMyX1G5VtqA3srYz9c2n4cpBHXXU5lXNuxGYVfw 1I1B1OkfunFdnfULbOehRlZvHLN9qKHNQ+I6xDGL6w8ZLcM1jJU9MV2N6pmt lGpkn3C9Bl6n7r0UT6PJUFSZsq0Wr9P8rcf3qhE5xmJkNvNgDm/r3CI5Mxab a3Lc6A+Gx4e1Whe8sDqjEmsSr1yT2FiTJuXlahppueLB9dUiviEfBsFGEHr5 ggGGALH858uLc1CJHBStS/7srzfnJfMtreMmMjjsRvWhmFX2F9m9m4gQS2Be 6Ut7iVBMCjk3kvoGKBnZbsErkRBAfoBEfhJ/wBuHGMdgRqxpSOwtZhg37r5y VvC0o2WgfR7/6Lvv4ZPl/4jdQ/c7ujp38I4V/p/tRuPQ5v8a3Xqr+cD/fYvP GfpOo4nyTnBdghpMhDisjZTzhBw+8Tlwd5RyANg6xfAB82cwbyoInAzMFWUk qZoAT8N5fCtVHAx1pFy9NBdJsWUVYBzRBgJJPDCkXz1kl7CbCBRbMj0xvsS0 tFYs9zh8UYhqezFkcKtIYmBZQY3ABPSAOUEMUUO9dzSvLBNKRy/6J9i5l4Sa jfEYn2ZTDlm1XpTyrBvIl1fsV6Fvq/IFoXNHPWBrfzSfhdD+tJJ2NIPsJHFN zILhZDOgZK3IiwK2EwNeo2MfhPVVZOcA11r0Dx/u02sFHyheO53Npkk09DJv 46wAcVJBF0BOPw8ZBAzHwlTD6Nui/VrTLqafwdNzhYNpLko2w0rTZSluztq1 4WHaTLO8R800z9vtrGB6LdcC26Vg0OoOj9tH4qKP6uLOz7oUZFwJTBeCRv2o etSC1ARH1eNjSk6AcBXoWn0Xfox6KlTB9u1kh0JvTxbqo1oNCbeEDap6vd6Z UiOh3Yibt9sy9yE/QU6jR3Fmj5P+AZg+H8t4PHuPegFEJ4HtJwP2IJ0wtSPn /076e3uBmcMj5nA7OF0gW5Gf6f8mH4VAu4jpg2wGcCYRe23Tw3/IlChAAgzv UkwlqvzOyQ2dPVLZzRQ2PEUEoqcoZrzAqFTtlirOPG5w00/b8tcwl8Y6xe5J rXruJaV8o7hOkCFEGpgh1HUeJYILnIGlysi5gRYVlIOe6apm29nCsV3Yeg+c l2yNEdaw4Xm5z88UxCj58E0Fu27sKWQjqfyPnrMEZVAN9kDFaxZO+zOT5po8 yUjdS8PDX4SkZIAqsLVaInZxlL9rJtETBYZ/E85mYL390dPnCKwNDA2mz1Yf x/HM+rE//ojGUTlCXGU0zMDPdlnDEUL8bNm9ZRE2fMv0S/LnKWiuvzeX0GrX fDzKPEY7kJKcnK9F6cEyuhvDVq4R9rhhnI7f7yHwOfMzJ+CCA8e+FxsuCbq9 ZFbEL78gvnM9/JXL4Rethl+4GL5zLXJemV4K37USvnshfOc6+PnLIO3izy/O X5696v3y4eL9CQp/0rNGTT6AMZgONvYTsuNuUotT3libZRbPImWpsTbXMLp1 PhjkPZjTA2s3gqQaR8MeekGoZ0DFosFSzP69ZVhiMZaRzBRhoe0naZo0d2q6 Z9ENZzElS0NpSQHZREOkjpwSLEqnpWoDO00N+4u51tYs+jmT6OfMoe+aQj9/ Bv0yE+iXnT9/nenzefb8NSYv4yQoQeEy9krZC433Av8aRjM4tr3BOEySVKmq 9z11eXE/Uz/2Pkb37qCL1Av8rdrHMdwshWCTbh5/XD0ALJZ5A7Uoh1DYfnH/ VzdP0HzAQ83vkujGqEt8g/ht9ShU0cyr1BM1mpXvKh5R+VfR2tDFJrggsaMT fVEQExd4RolrSGipwoPMujYfwT9j765Gsx6gMu3zj8Qa/Xz26ucP704ve29P Xp0+P3n+M8MN6s4kieiqvnQVQVEl+iG6fkO6VbHyI7D/fy8ujnA5XvTSz3CP FI7Tzxul7xykv+kY/VVD9DcdoWejf440PAdnpJXoMyDFZ5oGWXwwjjF/yt6e DphBXGcKhQ0XQra/gKC5Ow55lVLWtURnBUL+Q8ItpN9RkxCk8m4jZkg8llcZ M2CZzj3uD+NnFSsHwqaD87cdm+8emplSwR6Yv2pchIgv/qkZRFFCLD8DqzrW Wt77j0Qtvtvz6yM9y9tT1FbRlsM+Bowjrq/yeXwLxkQXh6O3NP8Lb7e1Buib 4/O3GZ5fYnReik1Jjc0vHpq2JUgRVLR2+te3F5fve+/+9uani9f7GTmcvOU3 V4EYYRS2+OtbezAj/vqlxF9fsS87EX8VAIrqgzlftnqib8II2wzRF5UX0+a6 XKoLD3QXlu7MoZnrO36U5uGjqHnYbdZqjaNOvd5v27o0RzXSqTkeoG7t8BiR QvAbTWSk2fbG09Got/AkUR+LWY+UfyQiQj2G/1dlQfKpomSf03l8FU/ImGU3 dztKNm7K56bsSXWtlGNrptVI0CK3h+tmtILq2xWlZ8tFfpF0B6/mYT9b+o82 Zzx81vy47X/hcBgspoEgWeC3va0NsDj/a6PRqjfS9r/24eGD/e9bfM5gvTP2 PwzCto1XD2bAHDPgyYgQH6eyKhsVzFhPjXQjxw3glYrrrcg4eG0bgRWocglw yOQfEKSRM/IOpwi2UwHgSooIlvAY4zG+JzFNIJg9Rr0RNQaE9QnBPguV0Dcc Q/THvZeAvUTshNk4HFBaX8MYtqA8DWRjhI5VbsKJuD7GZBrxPDaNYnp4Rj9k 82cVRx56HEjs3c0FXxehFbViWFGVzRKSiseIDwRZ08nciOuGk19gU/S6K1Lv ui2L65oU24dpk2KzsblJsRENmv1Ov1brD0ajdqu/nkmx0z7GSBPxRVHJBIry VDPMuEn/zJv1qQwx+kLRH8gbW/DxuN1yTVjZorfhmHll+9nihuONFxjZtM9l BRuxbxU8ENyw9/95+68uXr84Pe9dnrw/u4CQ/jennq9e4GFOjb3XjR7K+L2f /vb+9N0z1Tj8XzSxT9/ZlhDr+qz388m7n386e//O5Huhyvf87M3Ju7/I0E+V R2AM5I5AX3pSwTkc9hZTRK1Yaey7xiAoQAfwHsP/CaPPaQnESSQyigbd2mTO vvy+j/ooaEm821QMIoH4XvJ8PUE0DnKKJn1ZmoQSalnFSELfUGy4lnUlpIFs ANZCECMop+NjTSOxOS1ewGdeo3kjYM84ugVcAyyzpYUYnNCARi0NE/FvoG1Q IblEFmW07cKij0xAIwxjRAJFNJqopWzUIMnTO4z1NDoq/Z/pZTA9TIszdBgT ihPArkWMq0DqmAKGmv4ZEfLzEAGUBPE10u9o3OB4kUTjUc37DenkAIgx3c14 Z+CNLu+dKYUJihfS1YZwaBO6+xn2CLw8AAI3nktPaKC9iAKMbib6nljINDzU HwuIWu8IfreJnOTYKuuZy02pPH22pEIRtyoGZDEJ0SKvDfqjtPK8zbU23n3U +7T/TfHZCgK1G0lrKHqv3kothdks9sWDo+R5j/cgKp1GLPb6tA8hxmpDYwFx YJ4au5AugcMu5GnoNtg51J451WSuqsNTOoiMmsKzjereXu6kSe2Ui3gFe+Wp l7tsAfnKXywO0eLF8gz1WYyxbL4/DjHBwdR+Sj78ZCrdK1himPtu67DaqIvJ PzySk+9QOAGyb2/VQrgvDQyVIjObwq4Fo/gBB4YhShBoyEehYFOGUtdZtBZr LcZaqwHlS94gewULZ58yb8+xNuTp9Pmsd376GxXJXyeCku0edXGlDpvt0isl JjVZlF0u6AUExv8IILVDqwFzTLwVQfUqSvOpSm/NWIZZPqxjeh0PG61qA5B4 2gwy8BXWMaNs1s5023PLAVhiHNwy+B3tiFsOHNxysDG3HORzywGkxFO3V8xI /AEimYcKmN/gEpyX2BZa5EHU6RwftWq1wajbGRw2ttQiH4nNBVpk+HZokbdR ++ZpVb+N2tfPll7Jha186Q60x7J0DHACHm+gnN7EDDnwRyvQ/sU/rvhfosus 3sNIYDwZG7+jOP6j3T7sNlP638PD9oP+95t8MP73uUOTa0T3Jibod5wkkOkJ 1YlAqiPMBjOOR5RfFkG/XW1UK5Eg+UOFNaRDZieodbURhzPaXBAmzVrX7LSd hDeRfrt05VYNVcHve0JoR/GiopBNKScVqXGhwsW7mq6UcHrsMaimb5ZCEibF L4reFZTF90MIMJ6D4zRQ9niiEmeLvt5MEwATTaYqKw60Bjd3PIoH4WRRuYlu pvN7b5mEV5DgQ4jdC0Ahh9JFAOBm+G8D1ZtlAoDbDBWeBui2a9yyVhJ1nV2v DIx4o2uAkOeEaJia1ZU44+2WZzRXBklcSLqpnuI4eJ4MLHHRMjZ5mFbgQlq/ lAa3cbw+kvgaYbccbVurdUZH0WBwuOuw224bU2vSlwyFFiT+ej6dgBN0yPG3 FGyQyeUjuMJfKXpzdqDd+5XUzzBq+ynm/XsrM7UdbI0vrC16STQAfhYkhEWr KW5v1QaXuIUiz3JqT0pUn3D9LxqAM9D+S1mAgSprDjlO1kp2ZtEohhnIlAc4 vg+JxFMDO0eM0KwhB95KEoeGMDNlFhKHcEGIgEp5dhePx8gugwv4QrQIHjSS RlGHBqz8eULAfxj1fmQEvbvjcTda7fy13j/r/Xb2+jXmJf+s0pN/VlsA1RHF 4cO4QCjCdYUo3hQinPjWCElDzvMneNJYYqpKpS5oHmGScQ0RdI+oNtqFEKVP otOxwUiBV3gSUF7StCovHELh47ppJTXpRg2bE1bHmqga49wNgr3HqqYWVCdt +02a1RQMBWwWuDwh5cXEDDKyrje8CbgBaTO081+InwG4NxT3iIxcAiU0pPII xRThxTwgDSxg/C9qtGvIfiHxEVSImd4ditoCViTGJNmRP3t659ApvSXB2M8r 9b1dzHTvYv2GhJSyQx2UUuD89LfPpBpQBWx5xcCeQugjuPxMxawT3k6+R8Pb NThSXT2CBEJ7sn8qpdAzswhGc9hl8KcyUA1rwQpEw0Zz0IlqtWYjGnXD9u5h BQjn8LCBihSYCFuXAuEagniN0ZsX6ho/yICxZ+lKJLQZEWXqpVYtqU/R4FQL 77G6zSXOeV4hRNyQhW4gIcV0bD+DX6TK6AjojOAbjgCvvMP0JozHQ7HjpjMJ 3VwJwKTlPQ8Xgv27iZOrJeaRTKbLseRIxcFjTG6OtRXUYAQhTOK4AS8Jh40T 6dmSbkUiNpgadn0ADUF3j1Ty/9RaFxcisp6kFCLyTx9e7UtSKzOAGD4I7MIL lAhds5VbRBRZBqjZHJjohTJaSfcLFc4Mc8FItVh5ulwu5wr9xyCJekY0FQJi b/kX5tAb1pU58MvM8ctDj7qowHxZwC9La0dEmzJVx6289hwXJS9DunZe3hVp VJYKQ5VmYcMMLN42GVhw2x8fEkTwcbPaOCpMLrNV1hSvIGsKXkCBXo3Mq31z wfzcDqZzq5jMjXV96bACoOvlc6sQ5OqtGjYn2rD7ofgmXeOTWcNbhWvsKmDn A/DKoCciJAymZffhq2usrRCJw7kmMMjOwSMWVrHzqGefhZN4sP/d/0qeapwu kmfrn/7X7D8n30FAOdCEXs/U4eMhk9erifkC1ynDTxI9NReWlKv1DmruxT9a VUqtjp2GJI8EyNtfjlReD52Q1OvhTFRyEoDAGbVpgoV6mU0AYp5fmQEEK38n wTA3zgDCv7q3MarSVbYP3d0DleN7ulw806hQ6o7LjMdKZYLFdCoT+PM7Zbp9 ZLdkvUoRYfPK9fO7AlcquOXzdYukLOpBlDw+2m8LOvDm5K8IZ/mWg3IU1COh 1xo9ecabolUnjXuzWZjlBT84wv5NOKNNA7jJqaHaDwuSqYynVz3BWnyMFnLg PNY+Jh0dLOerp14XFdNv91E+SXfPavyAp+DwEE6y+K5Xj/KnYLepbrbc6DnZ bPxybXrpY+MXHZoNU+RwEiGkko3jxrEBSZ7dXnJTW6DEatdDJ6z36H381EKo zlbnvR7kHLinFn9jVjfoA7/d8OoLFIr9Fx5np0lgeO2WHqd8nT1U9+tS5wGn ffWklBp6qQGWBWaTSssc6YYfyxiTQdTvDvu1WtSJBq1uVEKCkg0USFCyCN7C 9WqjIW7hOhGv2wmMHeDO9ln2tj0J4TYjTDy48TOciOeWvz2X4kYiXjySrLKK +SkSeg1rbtAwHCGtOuotZj261P99KI6YGMhfEEq/d3r+/vQS2atbcGergkZD sOTz8EAc6P/cPEtVozmKWodC9B01wlZ9WJC7Z3WWqna7eiiOhvjqdlDMtddF 8hV2lugciaRqc52Y5ReTildz2NGqzLwh853LP408R4K/YeNEsp/NGZ1hdVX2 H6VHwV/ScC2iy9Mxu6Go/B9mKm4zAcbZyDs7P/0NtF8JQpHHkquNwXyCro/o 9qeiQ88kMS+ospiKnTWc3k3oJW8xuRWqrCQaocQhDBSfKpWAglBoPEzRtQOt iXYV25flPuM/uHMHUjUth02pnFHf7ErDLRgHNCqRt4qdIFtn41DTmtaH0SiM x8wRY8+fWNN28tPrU546CBL4AWG8eLZQftKSCOKAqcjX3DkyGqa5giGYwcqF K8bFUG2YeHfhPXryczbf5D4RzFSVy5jqBNeK+vKFHNyBfqwD9PwHJShlKKhS aLBG7ZV0aML1acXim5toGAs2U4i+iGXJdrp5hGkFAepMho6w9MLV0fkVOkaC Mqhv74UUG360hFMrWHrVzCo4kPRmCvZW7iZfhttmkpVjjg3v+++9R/sU/P49 vfTV6fvec8EcvT+VKBr6vecXgu6St1R2j1IUsZkhYOVu4f5h4bJJ+lKbq9Ra c/H0iuetNRdfteJqrbl80YrT5vjNTCIbpHTsv2o8a4wDkgZkrvsDCBfDH6SF BnNjvmB3belizemth1E4xnkwt3TigYQ+Gd/zrIhJhreQYzYHvbCHNSNRj+/l npbIreauzd1QFU6CWLyvAse+kpHhWdckzjNAynatDHFsUGJOCzboGpstUJuT drLU6Kir4ZnKtEMFUAfi3utYFLgc5WKYvXF5e0PdNxcfzt8THrMYPNVGN8Fh NLbUMzoXk13zw7muCxzbFw/ivj1lcYP8CerC4AV5YiZxyl6mVU12eccbxNfG f1Atpyx5bL0Tgphpwt2QtgWOVSYwA9CmX4eTAWdbxzgKDGjA+9LbpyxbRhp2 nANrxJXgMd2J8/jqekHJZYGsiyM2Ft+ERLmYzuCqihc175elIHOoX4XshRS0 Bm3gzfFn78PkWhAq6sl4KM+5aA9/Znse2ANFt/4s6uFMDm4mMK59we++PTk/ ew4X4XeaZ5zOo6deeNOPr5bTZSLGljz1bmdPQIsGijP+pxS51ZKY1ipjVzwi R7nM4XqirNSaQBXuDWNXEPeQWVt/9bXlZIKos7JXxLyIYhDiB+4zsKKoCy1x zvakSbjZaKMg1aw34Vv8ZMjLT5Uq/TUvkwryEWTYCj+hnHnklklsSy2V6hji F0UrYufAfTXhSJcBRM1EuCUQMNU7eVUzHQlU3ZHgtYdWPbEhFwuoEi9kCBGb WYbYwq2yhZRqLHUdKT6QAmtG2gaMA8PBnY1UwCpq6WFLVtFmjr9P9JVpzMsP iUe4LlXsJUQJ6QHQhGCGQxqbOSpzRHnV8kahO51aEUgohmFZczMD4m04XkaS DdUiE/DE4U1E16E0k8AT/UC0PYwh9ktcy5D7FvpkzL4Y/dmFpwK5qCMqoqbZ 6kBETbPZIoWcvRcBnWYyFXKthsiRmxA8CxfSBJJNFaheX0U/aA+69HEC5G0f uIx7T2aJOqjSIatLC4rWhrMdRZKejKQqBVUfyvqyrEwKiaJij5PH0k/oowI/ LdRP6GkL1g+Z2A9R/ZudDmk5kKqANgrNLfNwGH/qoWKTuMDUWZ9PAQ4wvIop 9kHGFM34yrHSK9lCONNJEK8h05JHIrSdItgvbKGwKltHjDRLNrHrif9wqBbV wwk5alabLch0eFxt2FPyhadwJlpB9QBmixL9OLDSbspMqrV4JPifRe8m/CQ4 N/GcPdjc2SLdeSIPKAFkHof05uLF2cuz0xc44sfxjPQG1BuZefqdjukjD04V O244dBopoLXUa4KVKVZDw/vEM+LfioftbzhsS4Eh4bDBFUYw3oDIhmZVyFdp pvKUqWmQzZ7Okv3v6Yo6oJbEcaztEUn9IbG8g+iuJbPHsGq6BaETl+B0huOI 3G4MpUaaP4eEWWBwfvIk76n3+bNXrApZpQuAQiBTut/NzLLpC8TpMVgkq0v1 eQvCIDpinx+3SaucPRtP0XVCut0BUf9hAplBxz+o+FLD9Qrvr2hIAbkwa1jr Bxmn+0MVUuf8IIr+QGG3fNMEOJ0W8dtnq59F0IIsQQvSBC3YW6IqjPVx8k9N GYw6lD8Xzoz8cQjQteLHPqTaDjKOUo/VWbBawFNgZeAFWcDFfInrFhwzEhIX xHrM75/KkwXHCcgbZ9+0hLFY5qW3NcJP5MkA/mwylT6H5KHGGh72TCZeN5Uk 14JVtl0/cY8hBbfHcTvpgcPjLYsG2Yew1iwNOUg3XGl8TIFwLijDnyTgxEMb a+XB2sB1fKAAXYmeszxzA4Dp/XDoQF8tGBe9hsiCEbdp1YbgF+OHL8bsKSGI jOWSyKa5P+DWRktQUyD+MWwj8FxcgiqQagC7xmTlJk5uwDMJHPFD0IKwwwg7 aUzFClOdEJR3KZUcPKCnxgYiqoWZA3o9aLM3nfTYhYMGTFVE23lvxJcZ1wLM aJKZbl6L9Ixhcu99Br3Gmxe3u5435C5MFwO9wWcbtymqG3wkEUSpjlBJmCw2 wX1QkXXHp8aVGhgUlNyRTLnFnsD8jN9QQAoFGMlP2UVtVp/xW4B3XQjemoje TGax9uRegfMjoxnJH1RjMKonoKSmHNbtowZ6kreOW1YSa/IdMWgaW6pwan55 03vxy4vT9yfPfzb9MmVqXrqlcSu9FbtdkJ25uErFVR2L+RBc9WAezwA6Rgkp xFcMrtXWta/SW0NVYvySB5losSryZ3Uw8cp/CR5smAqPSCHChsaIG2Fj6Oi0 STgVuWm7vM/0w8WqRF5qRjPWMMuOedwI6/XWsFZr1UetYXtVemKXPcywWR41 muByAV8NwyY+VeDNYnxlcjh7pXM4G8CiudpW3M9AVQRXBrHsS3E6qIphiQDa FoXz8b0NB7q2qrJkStQMXDQ7faUGkfIBy+TL9RypcuVv/fFHLFh/JnOEdNEf pn7cNfxh1LoYvIsy6inNDMREJDNgjvcWt+Q4DYUh+kWIZ+FNkjX8PafEMZFH UPw34SS8im7AtXDAVH4Ws1AsutQCqbjRqLcNPxXVNRq8eaMP+SEQoZmg5n+G /8u5eQoeeTd40U8/YjlyoQExgOr1GKaripcUsZsU265uAp2DVpsHtTyXvY5J 9nys2wNeG1eKaMPLd2fnF2wzZLouk7IbpB1nQ0wHzUbjuNxsEFuKvOtCzMKC toPB45AHUUpLnyYtMAGzLcavBDEjXbSndqNhRoCwG9htja6QtcgJnsYN3qSQ xaZZb0AUR2bktDu9zz/Knr/qvTj9FaeQMyx7e4NQHB0Q9S5PXz2VjBtsESG0 GJ5FSU9vXnicUVOjz5Aq0lOEGwrzMZasHlX5D77v99LJ6RTer06Gl290eHn2 +vTde7E+byTzh7pQttOQeAnxfyRVmwcQUNvGHEZi0T+uy7ZZUWs2B3d5onRM 6krPElpj7HNPmS0F7RrRiZ9Pl1fXtEnVYrw4u3wqtSL8mv2ZsTFMQ9KLs5ev T171Ts7/hotCyR+7mPe+0TwUW6ST3RlPULpWWH0krQvGhHaclspRMQs/QdwB sDh00eqbNyu6El2G1mXDBkyRtqXzO9Q+UUpRmih9oxiTx1fGGlvOz+w4P7vh fHu/+WW3G11DtibHFNy/sMqug2vR7B42DF9bmdtbsK/zj+T3fbbwbiAxL7rx G/IJYkuRCnhyz7pME1FLtID1SZMjbozkifgnQNOwsrXXB81fzVNvCMfJVL8G la3QQAG3JUOqzqeL6KlgGgdo3FBeAMY1jLmeFtfASk8xXEzDMgr2gUKiiIWg G/4uoj5FkwRyV4FPg+BN49G92ZIywIpXi+GSCt50clcAl9lIK5VFfQXfd+3i 0yS6xVGjNTju12u1dqtTHx67I4DMajl837V0EiQfwQ7x9qAhgzwwGS+0f9JZ PSOleDxB2EZc1CFY1iGimWMYIBEYI0Di4cy6KUnvJCQ9iUcsEBebLeZWNYV7 tKf4TKxnGfpRGkj7ZrEHDrrwk64uHHyUslC6Z5iGBiot8V9YS+wrIYzAn/nF r3TxK0E+Z0Z5OnNNBGNsNo/4xBVOMLm7QnSu4NEozc+zPWIuA5ZDMPWPInpG YVBJUAVRHkth/AVmEfKYGxfCnxmRgPU4FgGrAfbpIiTp8+zJBWUdRAJItFRz 5kgU7Rk3J5yC/MXptWvQHnoPFn5FPWYSNpW2C+chIpXlxYvTHjoV6tn/iP4B uL74L5p6zGY0lmoIbJ9DY5udLrImzc4xfK9YAbBOTyfitLNLib4lBNdrs/S2 E2fWa5OUFHkJ3pRWwOHvqSOaWXY1fDLZcASBcyOpE0u3IG6cngxAkgHQUFEP 65M5rNvVw+LHv5pDcjmopsakxmMHiOaUsgNEVeR2Hqk0Ivz77t+lw283igat Ua02qA+io3orl2AaNTM003hGxp46hijgtxLJpE5Eeqdns1YD98TiDuh0lTcg ixe2ximT9lt7tFCRA5V+2cUhOFxccN6JWZnEybURAFT1GpKxeP3h3c+CO3/9 2+VZ7/T1u9MepOM+sOxd3BFDz572O+VJOgJHe/FtONobk5TrTmMCCmYjnTyA Fys3asGHW47LJZVBGYg/ZycUGJo4keOULkSIZKRtIKegKWGo5fsBsQWxjXB0 4h+Gqi21VlLCx5TpN1MV+KZ8j2FBZuEVs6Wg2yWbY0oNp3Ev0/aK25nbq/wW uf9fz3s/nbwQfxwcGApVuphZjYAmH8IbJXzpOToKLATfBNYzIWigG8LEVvFz cD1IPJa/IEQ5Ko5DM6OIiUAh9NIkRJPYOkTD9FHLCB7KziGlSS9yQ1m1CWFK rH3o9hD1Pn9mE+7+o9XFcd/CNN/axIGsoWUbMHE5i/cwTUOxP45SkEfDA2Xs BhECrIAQR033qnueQZqQviwJum2EICYMIIr6erlAP6478NsUHPV0Im2cy+Qa EyJTA25TQx9QdMUIIbaYeHHWXRNnSioOpzM5tA7zpo8Qe0gqXBPe5FpHqMTr wtokTRsoK7RBdUXUhbInVJqUq5+UCll5Q63SLdMhlcfwqSxvxHdmBEIb/+lT Hv5XEoCLbcAtYTYIUWwjjKkV+d87zVbHxv9qwr8f8L++xQfxv8iZGo+XlK5k /H/C/C+CtwgeqPKToL4g8Cg/KVkDvL2XE+kKLapAjWHNewONw08VWRI2muD9 rVcAuv94mkTS9gWVSescJpCeAG3UmMI5iW/icYgufkriJs2E+O5PxamDbuCV ogDC+rrTdAcVoWzRSBE26rhRJoeA/BS1x0kEWp5fDGuFpZreCkwr7FvdW4m5 ZYBvtdPAV8dtL4V7ddxcG/aK5yoPXYT2DHHj/ePoqNlt12rHw1bYbA7KAJhQ /SL8EipBsFfNagtgr5rV47ZtyKIweAIhAtdyJIkrvVFzHbfQ8qMc6tI3n5/2 9qhK2wvdpOpPg4/z/8nVNuPjWEjfgvnyt2C+sO7FZBApbSvDTyjWhLwxQQfL jj7o7bCYLgfXVHuZaBPeKv7MX8Gf+evwZ+tzV/5q7sovw135ae5K63xNNkD9 WsQC+Gx04Hu+wXrh1cKSns7C4ZQZjX1arK1Kx8avZBJKKueXZAGbAg8oR8Ig 0wTbZbpErbFRgU3HysEZHpycveaKcoeJC+XiL4hII1sStE0MBO4TbACxlsPE ZjyH04ja/RhFM9R1KyStRKeE0Nv+twiiim4ZGGUYDeIEdKFgapjaLScxnBAO IcLUCFAf/H3H0fAK+eO76wgDItDXkDovLruZ4I+HAB/H/afxTEfUgJ5GwSXL BoygPOSgyc5kzjhVni11Ph2eRT2uq4hT8eD7kKTMo6twPhS3SAKTDTajqvf3 JSWWAN8qD9Tn1IBSy6OKHxblOh5LTDXyncSGo2HKeG8diBVqEd+lFvli77Qt RBB/axHEGtmGooVfWrRwToeTptAclaArWWnCN6QJv+gmBPcReRtafpl8/Ylj ht7y6ofUVWjeoN7jCRKQeYQ+9U9FEacGibPdiPXoQdxGL5os5ve9JBxFOMCJ QzkDOlPpxqITlHPfJF1WIiT5AE5hU7imjBYNq+yBwlbwKoSioluQAD/ozYw3 EEfm6aXTL1DBdKXugPQ7v6iLIUf35Ot+OfSCcn3QL4PNyNqlzlcaIFwSeeXk vim1a0qylteFjJ+0jEVRVO8OolotPGx2o9Ct6HXWX8Vakq2s26gCoCqjbCIM Ms4ZnT6Mm3Erx59VdGnaz5CcQzOiDhNAtkqae3VXwnPoUsW4OkZ49MyP4r81 4XmW1xIe6LRNz4MjjS2o7QJ/yJYq3r9HE7HW29g9++1mfXR0WKt1h60oaje2 s3u2j5qgmoYvVLSSD5U+3AAZhEmoh7aHo1wY6yjmlq5iu6k6kggXtev0rgQt j+pmanlTr40nlGygoErOOlp1PRVkp+dvgNLEFKxogl3f2jrTadWPO/1OrXZY rw86kVseXNs6c1yvHqN55rjutDxYqjDPCCNIi3EZp/2qdNqXYlyQEeMCiT62 oToevVC3EeOCLcS4YCsxLpBinHTRXSXGBSvEuGB9Nfs6YlywWowLyohxQVqM C5xiXFDmCk8FDjTYN7mUGBeUGE6Z0awU44piGNYT44JtxbhgF2JcsKUYF2wr xgXbiHFBrhgXbCvGBeuKcaZz/iPrQKwQ44Ks3JKJltlCjAu2FuOskW0oxgWl xTjndDhpCs1RCbqSFeOywSk5NyGJcc7wupQYF5hinLoKM2IcRrKxGBe4xbhg azEuyIhxwfpiXGCLVEGRGBesFOOCUmKc451f1MWQByWylhgX7Lkjo1iMoysn 902pXWNyieSmD1aGHsYP7B/gI/xgTP5cXALgWyTdRhMC66dgA3k2NWRD7SG3 09f/fHLZfzGIPxCchjb/hlebv6PY/ls/bDQ66fxPneZD/qdv8iH7L6VPnmIS DXEOpaH2Ng5B4gBQKjPlMG4PDzAeKpW382gGhleqdjO9lXIGWhIjBaYBzrr9 e3yTzthRMV+W84pEpkqR7voEuB9VzCLAHwqpUraF6X7pFSUNve01DL0lzLxt zyqI1PHKyl7Elt6O52dKZnItSctxqpzTKkxp6jtpY28nY+ytf01bb7veHXWO hGzfOGp3m6Nw97ZeyFLhw1e7wNUrJez7GlZeK+Mkm4N24Yzm2dBHF/g8lrDd opYsZbJFG/Q2hk4DbEV0n2Dks2grqLhlt+re+4veySvxj1SHmBN5fiZhmXvv T16VtA6uNKWnjYPalE4GBFoWlnINladjaVKGhPS0V3NXMDVVBAq368kyRlNi LP8y26x4ZXg1VbTT198wnsLpdYkqDmijnRobmq1G4zBs1GqjQTiq10sl4lnH 2NA+AmND+4jiSNczNuzMBJDT0gYmACa7KROIuYFyBpOult15hRWLN617DGkw Z0/SFMhEnTPlK+wbeO3307/ITICNfvO4GdZq7WY3areOclXgWCej/MZfUe1d x0TF8EVweY5IFxyQjqYx6CHQPc8kgs8o8AjVyjRWgnLDguDC+kW32MPEEDK5 0AJCQoGpyzCKmPzHl4DhDvq5V6e3siqRlDO8ZIKNpCAiro8E+uRV783JX1+f /nr6+h1Ip3t7+/AFagHRrZvw0zi6jcbJgV3rzdk5Al6+Pnv3vnd58tt+f1wd jKtQ/z/F7OyL5+Inz5dREem3HIhHUGZQVOZgc6xzhjgX1KXeHRwfFoA7rMY6 P0YmSfz/WLnDpXDNEX/V2yGeqs/uCliIcHnVHtC+pWBGCBPB0I/HEo5ynTtm O9DW7cOKBu3hUf1QMLejTjcK8+2RaxmuCIYDv11hRd86LEU6jjgptnZQL3It f/j8C3yc+h/y/6erX6mA5tEkvNlIBYL6n3Y7T//T7bQaaf//w2bzQf/zLT6o /6GlzYsAqFTAIq0SAkLRxMEbog++m2WsgIYIzHHowC9RnhAeeES4zOKmuEcH fq4VT65q3iV1azGtGMSQSNL/Tf6LrFULhqOVTDTTtv0D1eGSGiAIv1N5rEuq eFI5qpGTNDU37My/KkO1USzrpZ9x0v+aehtW19Rqnb7gTDv9XettWl0ImvXp iy+535ex2BBRb5TICMcBIyPVASiIzCw6+xjJQf3lSBzbKwZ2GgqxqAd/zyht XpDn9XJDqf9ywl1PON6VxE9rvyUlq5poSmjzGE+nMwKXgKgUTJ4YgqX1Tohx NQ99PUbxPAELOATgDwx84+kM56xTx2RO9GWk8+5RGM2+AtF9xLNhArPQzX75 4uL89d/MWGNI8IQmVBwX5XxKJr3FAQ8RcHpeXlw+P9XGx5zpzI8e1tO5xXwi Nzm8GjyVCRPiq4mQS4bkF0PxdBKMRcHPQWV8Afyj99MLbJ9aM4FbcBZHCaCU uErj5FOC7Y6ZYRvjmqxksblORH5m4FI/YTkWebZjUTbOF3WeRy3oCn05wlss DVNhv9gz17EoblzolJ3XM+28mDi4jj2jL/GDMu96eyxffCngNNezXhouq/a8 ugp7lqnTS5s6gYPdqWqINUKCfI66w6hRJsPYeqqhDroudlKqIUlBw8Vi7tRs WE6lREBp0lY6rZbSOqHvwG70TjktbeJ6Kluyt8kW3rCps7KuGszlCVxCm+X2 Bi5RMU/OlVxK3/GjRBpqHTb7gDDZ7HSPjyL3PjarZcRb+YCQwNpIRPmbSddy gmXo1gekbfZ0wluJb8AruhttoM3SVxfjbsLffJuswResyQuY97+6ht5+uHx1 evL6NZanXy/evu/98uHivfiVu0e/fUDCeHb+CtvYWkXBmolarX3Yb0XdfMXi esgnDcJXqDfcKgrcgWuBmBSonjJwHluCmPhWC9m7Y7coKN6/ii7EKf+T/8cy 0eH/4sAF4qBs9o4V8n+n0TxMy/+tB/n/23xQ/meXiozW3nQGMbw2Kh+4vJT8 wUMEnVTHH9M6X1AKgGtGRbUPsJfDSLVbIznpjtxpKa894q+RHFTJ+pGUFOiP Srp0sMDfSEveh4206N34qj4Tg247OooOa7VW2OqODt1q5S1k78NOq9pqCjZd fB+3UvRbCye5ARJpUcGv+GZSd4c40aNQ+4xEkfEc5QBAsrXhP93ChpfrVJqx qCtEJ6fRnHXh+Ov/Da/+S8EjT+aE5W7gJQsGpIcrpH5LPsazWTTE2/7ru7L6 Zh8Is9mXXZB/DqcyULRCyLGY9su7EltZJmOULlKU0+yTRF9jryuy0WFVPoh4 esGnfxbOOYeY3SCcduV5xXWxcUp+JI7vtP93DFqZR79DIjYK9ZXotSu9EtRa 2FmFoAucWgi53zwfjr09zHH9GOHlqp4xh3DXc5EcPw4pZT6SXZBhmCU8FxSu McVesj2MoOCYyKKoyO6uuBQ8ozQx9moXu6KADVJ2uCDJ536ao0rnxdWGO1Kv QGqWcAyjvbeptQE97HpRJkNq6UmzIlcJ03YHHtwy8vZRmToq1rYENogj1tYr cg/3VrqHe+WjfNftn6GGyXci98sslEVjrm9ubryAMwcnOguf3DjxRN/xL6YV BYcdgYN3n3I/DkCBj6zFAjV6f5YUwltHz2O7tMMcMX30fUqoSFEr++o401Dg BVyQ136FsijXL16GN2O7dlB85trcKCAe/46p20A69mMk/V7s/YfHyQ36taQv blxSl3ux7xvh7I/M+y7+r5pcV8BMPsieP/dVjpQnPfkU951hG/5otvbhU/JT YP+lJMtKBAQ+ZrN3FMt/jTb8OyX/tdudB/nvW3xQ/vuIYZumoJWgpFWpnEuE /oxLP5UAwr+cCG5TCEzYCqTdBYGugvjutIWIoVRMLVUEZG8dsqi496qXXM8p XLkSY8jA4m4qExkVe/NDdheW/QBBbYWISOW6Xsqn/5N20kp74B95Gk0tAy6Q 8de3eqDLXafLNbwVRuSiYpnWjjzf1ceMyZlM3k1VmmocpWXgo7QI3NoAIo7X JU9CpcfSubYRjbohgMS1jgft48MyQjA3UCQFcxF0iqsjSix8aaBdKTpizqDp ZICSMGOlo1c9c9yEmE5GZlcByfbJEsqzumemB0+FZZ+dn73voT/iz6cnL1w5 xLFbwCwKOWoZISi+6hK8AR6x8vlmnnkd3dZvLpGPPHn9+uK33ukvH05e995e nn3mn386ubw8O72kDK+NDiLo+uK7YU2S2B1jmsx9xSBBEkgIDu6Fc8xC5Bi1 ZFD0kG+Wi+iT9TRWrGv22dV8eqcem5NOjynBIGXUkROfnlPuAph1gPrkmEc2 1t00G53D+qheqx0dhvV+Z7T7eJc6xbvU2cG3jOpGOuX+RulPtIKP/C9xHkNI OKgSbRh6OyFaU05niQiBceShlP4RVsKuUmVJQL0Cq0PElkoN6KfTYrijcDIW cjaAdyjop9NNG8AdLazCcC4ZOuNtEzpTFqvcK+HcuQVe5ea+yOSCXKu1jzph vZ5vRSrji9xBgHOZbUQ+TTkjr+057O3eczhICcmWpwIq80hVpwmsJtX54rWy HlF+gKt52N+3E9F5MkGrnQlP4SwspuJsA9YBDGjJKjmd1jPlC3N68urk7Jyc WNqNYyAbfrvRMU5O9AnSZSw0JPqGaKgEWvMCsiwrQuLiFBHZoEhHmj+t4lKg S4J/SkCuzxXGVyaQkBxbQY5FTq1YqzUOB616Dh9iVsvBnOIci/VjuE+tbAi0 YdMpFvl2m5s3PDEdrNJ6VlhW8h/Zwo+QxMSJzBecpTK4EDvO9IjOcGg8Pmyh j5D4bhpzoNIi/Q+dgFKpJT23F5IpMxShox01ov4gROy7eqORn+SkFDpa47hN WaHa+VmhBkOiTIJk/XdJGhWsmzTqq6eA2sL7hp1uBO0Zjo6PBvl5vkp533SO yH30yDh3pH0Uu/dmOtk31JHkwoS8Zx/+SvqY1peIL2r9bsLko7hdxIPgT6IM /oYppwLKKWgUvcPfXWX/9Cfkgn67uHzx+uJVuhq/ItNSQIBYbs7ejmoxnHDf YQJBUJmCd1zcF8IFGNgmBCWEbufA2Q4EEUEDVfG6XbvmWeVna3aOWq1OrTbq NMPDKP8kymo568YxfW1KoSO+8k4inQSZAia8IssbJPeCELgYwPrmuDvH4HIs OKdhPFc6ejGxFFZH3CeKa1ZNJIrPRO1aDU8uQkcxEB1r7JVPlv3um/CTaATf fB1fXUfJwnwrnxX3qTVX8pkKCEQzo2GBkgLkAnK6k+ioC9MZxwLUQUJ43DPY ByxMXubTEeaTNd9gV4LbJZ6C1xnWukGrRjikRGvgota/V9nV0pVoyz/zMvXo gcxU1mq0YKlbDfarKlxq+QrYzmKmr+LBbLCAZWod/i/pO66PGqUg5ipi+XWN PbsKbI1UNcr4esRr+pFxLudTmgeADKFfvPkUpEF26KP1serSjcdeqtBVTDPP f0PVSXSn4TrQMAvGslEcjYdCeLyN5ojPde/xWpMRcuNXOEaXiD3d76tFhj9h aQPvp5/e/Xz28j2nRp1OkoW5KhCeAllJH+Pc8l+Ud1C0MEUjOEwshrFgwdRy 9McfVea+IWzPBWT6w3Xwkn8EgdpbFAjQhRzDnXqrgCIMBemW+6TbxtEJ2isO 1SLEtzxH1Z5CegNsulk0EBcyAMjhhOsAX2qNInwDK4jW5uD5NJL0oIJwSaNz 4Kyp2XWuK2WPbO2KBwlFheiDIKm6W3hvURZlBC/t9XjEcAFwFZjpT+wymvTJ IGtddxqmNVVD+qamLsddhI+yS6a4Jhr1o0a9uSPfzGa1QRnXmjoBdcY5cxPX S29bx8lAO04GKx0nAwbKe0sXDeWBoay/4pYig8EyYZi8PCl9FbLoOlnkSqCE rh93W4jllq/XUnG3/upCDwbZh8/D5+Hz8Hn4PHwePg+fh8/D5+Hz8Hn4PHwe Pg+fh8/D5+Hz8Pl/+vP/B8YTSOcAmAMA --vkogqOf2sHV7VnPd-- From owner-xfs@oss.sgi.com Tue Aug 19 18:42:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 18:42:51 -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.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7K1gm5a024791 for ; Tue, 19 Aug 2008 18:42:48 -0700 X-ASG-Debug-ID: 1219196649-3412033c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from white.servertr.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2A0E61A12F3D for ; Tue, 19 Aug 2008 18:44:09 -0700 (PDT) Received: from white.servertr.net (white.servertr.net [65.98.57.242]) by cuda.sgi.com with ESMTP id lC3AeSFVPny7cfO7 for ; Tue, 19 Aug 2008 18:44:09 -0700 (PDT) Received: from [88.250.21.212] (helo=okaratas-home.karatas.gov) by white.servertr.net with esmtpa (Exim 4.69) (envelope-from ) id 1KVck4-0001Pt-7I for xfs@oss.sgi.com; Wed, 20 Aug 2008 04:44:08 +0300 X-ASG-Orig-Subj: How to XFS quota arrange? Subject: How to XFS quota arrange? From: Ozgur Karatas Reply-To: ozgur@ozgurkaratas.com To: xfs@oss.sgi.com Content-Type: text/plain Organization: Ozgur Karatas Date: Wed, 20 Aug 2008 04:44:09 +0300 Message-Id: <1219196649.7079.10.camel@okaratas-home.karatas.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - white.servertr.net X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ozgurkaratas.com X-Source: X-Source-Args: X-Source-Dir: X-Barracuda-Connect: white.servertr.net[65.98.57.242] X-Barracuda-Start-Time: 1219196649 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0005 1.0000 -2.0178 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.3156 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17633 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ozgur@ozgurkaratas.com Precedence: bulk X-list: xfs Hello, my name is Ozgur, i'm from Turkey. My operating system Debian GNU\Linux and running filesystems of XFS. How to configure XFS to arrange quota? Thanks, Best Regards Ozgur Karatas http://www.ozgurkaratas.com/ From owner-xfs@oss.sgi.com Tue Aug 19 19:30:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 19:30:19 -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=-1.8 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 m7K2UFsI031632 for ; Tue, 19 Aug 2008 19:30:17 -0700 X-ASG-Debug-ID: 1219199495-559500320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice2.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 83AA3F7C001 for ; Tue, 19 Aug 2008 19:31:35 -0700 (PDT) Received: from postoffice2.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id imxhKBiYwwB1BWwM for ; Tue, 19 Aug 2008 19:31:35 -0700 (PDT) Received: from postoffice.aconex.com (localhost [127.0.0.1]) by postoffice2.aconex.com (Spam Firewall) with ESMTP id 84F5F54CA26; Wed, 20 Aug 2008 12:31:33 +1000 (EST) Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.3.1]) by postoffice2.aconex.com with ESMTP id Nj8DDBrva8Y7WmAm; Wed, 20 Aug 2008 12:31:33 +1000 (EST) Received: from [192.168.5.24] (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 7016992C272; Wed, 20 Aug 2008 12:31:33 +1000 (EST) X-ASG-Orig-Subj: Re: How to XFS quota arrange? Subject: Re: How to XFS quota arrange? From: Nathan Scott To: ozgur@ozgurkaratas.com Cc: xfs@oss.sgi.com In-Reply-To: <1219196649.7079.10.camel@okaratas-home.karatas.gov> References: <1219196649.7079.10.camel@okaratas-home.karatas.gov> Content-Type: text/plain Date: Wed, 20 Aug 2008 12:29:53 +1000 Message-Id: <1219199393.4519.19.camel@verge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1219199496 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.3159 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17634 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Wed, 2008-08-20 at 04:44 +0300, Ozgur Karatas wrote: > Hello, > > my name is Ozgur, i'm from Turkey. My operating system Debian GNU\Linux > and running filesystems of XFS. > > How to configure XFS to arrange quota? RTFM - xfs_quota(8). cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Aug 19 20:22:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 20:23:02 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7K3MrH8010143 for ; Tue, 19 Aug 2008 20:22:56 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA18735; Wed, 20 Aug 2008 13:24:11 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 8AA8958C52A8; Wed, 20 Aug 2008 13:24:11 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Make use of the init-once slab optimisation. Message-Id: <20080820032411.8AA8958C52A8@chook.melbourne.sgi.com> Date: Wed, 20 Aug 2008 13:24:11 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17635 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Make use of the init-once slab optimisation. To avoid having to initialise some fields of the XFS inode on every allocation, we can use the slab init-once feature to initialise them. All we have to guarantee is that when we free the inode, all it's entries are in the initial state. Add asserts where possible to ensure debug kernels check this initial state before freeing and after allocation. Signed-off-by: Dave Chinner Date: Wed Aug 20 13:23:19 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-inode Inspected by: lachlan david@fromorbit.com hch@infradead.org Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31925a fs/xfs/xfs_itable.c - 1.170 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.170&r2=text&tr2=1.169&f=h fs/xfs/xfs_iget.c - 1.245 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iget.c.diff?r1=text&tr1=1.245&r2=text&tr2=1.244&f=h fs/xfs/xfs_inode.c - 1.519 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.519&r2=text&tr2=1.518&f=h fs/xfs/xfs_inode.h - 1.257 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.257&r2=text&tr2=1.256&f=h fs/xfs/linux-2.6/xfs_super.c - 1.448 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.448&r2=text&tr2=1.447&f=h - Make use of the init-once slab optimisation. From owner-xfs@oss.sgi.com Tue Aug 19 20:31:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 20:31:48 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7K3ViRV011382 for ; Tue, 19 Aug 2008 20:31:44 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA18978; Wed, 20 Aug 2008 13:33:02 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id AF92058C52A8; Wed, 20 Aug 2008 13:33:02 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. Message-Id: <20080820033302.AF92058C52A8@chook.melbourne.sgi.com> Date: Wed, 20 Aug 2008 13:33:02 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17636 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Use xfs_idestroy() to cleanup an inode. Date: Wed Aug 20 13:32:01 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-inode Inspected by: lachlan david@fromorbit.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31927a fs/xfs/xfs_inode.c - 1.520 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.520&r2=text&tr2=1.519&f=h - Use xfs_idestroy() to cleanup an inode. From owner-xfs@oss.sgi.com Tue Aug 19 20:55:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 20:55: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.5 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 m7K3tPAM013206 for ; Tue, 19 Aug 2008 20:55:27 -0700 X-ASG-Debug-ID: 1219204605-5a2e028f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9DAA6F7C337 for ; Tue, 19 Aug 2008 20:56:45 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id UuCZsPqkT0hpfKf0 for ; Tue, 19 Aug 2008 20:56:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOAvq0h5LD0w/2dsb2JhbAC1doFb X-IronPort-AV: E=Sophos;i="4.32,238,1217773800"; d="scan'208";a="175217233" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Aug 2008 13:26:43 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KVeoM-0005qZ-Fb; Wed, 20 Aug 2008 13:56:42 +1000 Date: Wed, 20 Aug 2008 13:56:42 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, markgw@sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. Subject: Re: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. Message-ID: <20080820035642.GB6061@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, markgw@sgi.com References: <20080820033302.AF92058C52A8@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080820033302.AF92058C52A8@chook.melbourne.sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219204606 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.3165 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17637 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 20, 2008 at 01:33:02PM +1000, Lachlan McIlroy wrote: > Use xfs_idestroy() to cleanup an inode. I'm not sure what has been checked in this patch, even though it's recorded that I reviewed it. Yes, I reviewed the original patch, but I asked for changes to be made. I *haven't reviewed* what got checked in. With the changelog being entirely useless - not even mentioning it fixes a memory leak or a deadlock - I have no idea what changes were made in response to my initial review. I now have to wait for CVS or git to be updated before being able to find out what just got checked in so I can review it. Lachlan (and for everyone else @ sgi), in future if someone in the community reviews a patch and asks for change, can you please repost the modified patches to close the review cycle before anything is checked in? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 19 22:13:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 22:13:37 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7K5DTwK018699 for ; Tue, 19 Aug 2008 22:13:30 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA22129; Wed, 20 Aug 2008 15:14:48 +1000 Message-ID: <48ABA9EC.5040902@sgi.com> Date: Wed, 20 Aug 2008 15:21:48 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [PATCH] Fix use-after-free with buffers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17638 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs We have a use-after-free issue where log completions access buffers via the buffer log item and the buffer has already been freed. Fix this by taking a reference on the buffer when attaching the buffer log item and release the hold when the buffer log item is detached and we no longer need the buffer. Also create a new function xfs_buf_item_free() to combine some common code and move an ASSERT in xfs_buf_rele() so that we can catch more cases. =========================================================================== fs/xfs/linux-2.6/xfs_buf.c =========================================================================== --- a/fs/xfs/linux-2.6/xfs_buf.c 2008-08-20 15:08:23.000000000 +1000 +++ b/fs/xfs/linux-2.6/xfs_buf.c 2008-08-20 15:14:06.000000000 +1000 @@ -831,6 +831,8 @@ xfs_buf_rele( XB_TRACE(bp, "rele", bp->b_relse); + ASSERT(atomic_read(&bp->b_hold) > 0); + if (unlikely(!hash)) { ASSERT(!bp->b_relse); if (atomic_dec_and_test(&bp->b_hold)) @@ -838,7 +840,6 @@ xfs_buf_rele( return; } - ASSERT(atomic_read(&bp->b_hold) > 0); if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { if (bp->b_relse) { atomic_inc(&bp->b_hold); =========================================================================== fs/xfs/xfs_buf_item.c =========================================================================== --- a/fs/xfs/xfs_buf_item.c 2008-08-20 15:08:23.000000000 +1000 +++ b/fs/xfs/xfs_buf_item.c 2008-08-20 15:14:06.000000000 +1000 @@ -732,6 +732,7 @@ xfs_buf_item_init( bip->bli_item.li_ops = &xfs_buf_item_ops; bip->bli_item.li_mountp = mp; bip->bli_buf = bp; + xfs_buf_hold(bp); bip->bli_format.blf_type = XFS_LI_BUF; bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp); bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); @@ -867,6 +868,23 @@ xfs_buf_item_dirty( return (bip->bli_flags & XFS_BLI_DIRTY); } +void +xfs_buf_item_free( + xfs_buf_log_item_t *bip) +{ +#ifdef XFS_TRANS_DEBUG + kmem_free(bip->bli_orig); + bip->bli_orig = NULL; + kmem_free(bip->bli_logged); + bip->bli_logged = NULL; +#endif /* XFS_TRANS_DEBUG */ + +#ifdef XFS_BLI_TRACE + ktrace_free(bip->bli_trace); +#endif + kmem_zone_free(xfs_buf_item_zone, bip); +} + /* * This is called when the buf log item is no longer needed. It should * free the buf log item associated with the given buffer and clear @@ -887,18 +905,8 @@ xfs_buf_item_relse( (XFS_BUF_IODONE_FUNC(bp) != NULL)) { XFS_BUF_CLR_IODONE_FUNC(bp); } - -#ifdef XFS_TRANS_DEBUG - kmem_free(bip->bli_orig); - bip->bli_orig = NULL; - kmem_free(bip->bli_logged); - bip->bli_logged = NULL; -#endif /* XFS_TRANS_DEBUG */ - -#ifdef XFS_BLI_TRACE - ktrace_free(bip->bli_trace); -#endif - kmem_zone_free(xfs_buf_item_zone, bip); + xfs_buf_rele(bp); + xfs_buf_item_free(bip); } @@ -1120,6 +1128,7 @@ xfs_buf_iodone( ASSERT(bip->bli_buf == bp); + xfs_buf_rele(bp); mp = bip->bli_item.li_mountp; /* @@ -1136,18 +1145,7 @@ xfs_buf_iodone( * xfs_trans_delete_ail() drops the AIL lock. */ xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); - -#ifdef XFS_TRANS_DEBUG - kmem_free(bip->bli_orig); - bip->bli_orig = NULL; - kmem_free(bip->bli_logged); - bip->bli_logged = NULL; -#endif /* XFS_TRANS_DEBUG */ - -#ifdef XFS_BLI_TRACE - ktrace_free(bip->bli_trace); -#endif - kmem_zone_free(xfs_buf_item_zone, bip); + xfs_buf_item_free(bip); } #if defined(XFS_BLI_TRACE) From owner-xfs@oss.sgi.com Tue Aug 19 23:05:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 23:05:08 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7K654pm022252 for ; Tue, 19 Aug 2008 23:05:04 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA23133; Wed, 20 Aug 2008 16:06:22 +1000 Message-ID: <48ABB602.5030404@sgi.com> Date: Wed, 20 Aug 2008 16:13:22 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs@oss.sgi.com, markgw@sgi.com Subject: Re: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. References: <20080820033302.AF92058C52A8@chook.melbourne.sgi.com> <20080820035642.GB6061@disturbed> In-Reply-To: <20080820035642.GB6061@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17639 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs This change was part of another patch that you reviewed. This small change got left out when I merged my changes in with your inode allocation cleanup which you asked me to do. I also had to modify your original patch because it did not apply cleanly due other changes that you made (the semaphore completion stuff). I didn't have to take your cleanup patch - I could have just fixed the bug. So in amongst your complaining I'll assume there is a covert "thanks for taking my patch". Dave Chinner wrote: > On Wed, Aug 20, 2008 at 01:33:02PM +1000, Lachlan McIlroy wrote: >> Use xfs_idestroy() to cleanup an inode. > > I'm not sure what has been checked in this patch, even though it's > recorded that I reviewed it. Yes, I reviewed the original patch, but > I asked for changes to be made. I *haven't reviewed* what got > checked in. > > With the changelog being entirely useless - not even mentioning it > fixes a memory leak or a deadlock - I have no idea what changes were > made in response to my initial review. I now have to wait for CVS > or git to be updated before being able to find out what just got > checked in so I can review it. > > Lachlan (and for everyone else @ sgi), in future if someone in the > community reviews a patch and asks for change, can you please repost > the modified patches to close the review cycle before anything is > checked in? > > Cheers, > > Dave. From owner-xfs@oss.sgi.com Tue Aug 19 23:07:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 23:07:19 -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 larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7K67D3w022660 for ; Tue, 19 Aug 2008 23:07:14 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA23175; Wed, 20 Aug 2008 16:08:31 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id B658D58C52A8; Wed, 20 Aug 2008 16:08:31 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 983683 - Prevent direct I/O from mapping extents beyond eof Message-Id: <20080820060831.B658D58C52A8@chook.melbourne.sgi.com> Date: Wed, 20 Aug 2008 16:08:31 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17640 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Prevent direct I/O from mapping extents beyond eof With the help from some tracing I found that we try to map extents beyond eof when doing a direct I/O read. It appears that the way to inform the generic direct I/O path (ie do_direct_IO()) that we have breached eof is to return an unmapped buffer from xfs_get_blocks_direct(). This will cause do_direct_IO() to jump to the hole handling code where is will check for eof and then abort. This problem was found because a direct I/O read was trying to map beyond eof and was encountering delayed allocations. The delayed allocations beyond eof are speculative allocations and they didn't get converted when the direct I/O flushed the file because there was only enough space in the current AG to convert and write out the dirty pages within eof. Note that xfs_iomap_write_allocate() wont necessarily convert all the delayed allocation passed to it - it will return after allocating the first extent - so if the delayed allocation extends beyond eof then it will stay that way. Date: Wed Aug 20 16:07:36 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: hch Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31929a fs/xfs/linux-2.6/xfs_aops.c - 1.164 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_aops.c.diff?r1=text&tr1=1.164&r2=text&tr2=1.163&f=h - Prevent direct I/O from mapping extents beyond eof From owner-xfs@oss.sgi.com Tue Aug 19 23:43:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 19 Aug 2008 23:44:00 -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=-0.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no 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 m7K6hviG025149 for ; Tue, 19 Aug 2008 23:43:58 -0700 X-ASG-Debug-ID: 1219214717-035701130000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nf-out-0910.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 98008F7CA5E for ; Tue, 19 Aug 2008 23:45:17 -0700 (PDT) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by cuda.sgi.com with ESMTP id WlhoBCiAcjkEO4SB for ; Tue, 19 Aug 2008 23:45:17 -0700 (PDT) Received: by nf-out-0910.google.com with SMTP id h3so174975nfh.42 for ; Tue, 19 Aug 2008 23:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=4AbafWBakvjhQPk/gLnZ753DkMAK+i6ln7hjP+ZQnoQ=; b=i/TdWZefdYm11DHsosXXLuA+BKWllxmATIpbRFOiqtavgW0PGP1VLiKj0VE2DgOlyf LFtdRCsEglzgrrZjsC5+GCanWXoVlqqLpPow/njSNhU7G58H8nioizmN6jUMlum3axyu x+sjDECGEXKcVYMKyKM1oQqowlZejiKXIxCtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=kdBXnuUNi/M1ls38ZS/O/5ad3Uwe0GyRSl0u7dufOmnH7OJaLva1kvNFpToqrqcpef Us/srZw9ChKToxDpwwYcmwO+y+WSCzotTRUtxRqBixIrFqrwcyUD3DI0ZDFGEBmOjTN3 +OIbz5BbrHuaofs5tK8xjJuP+YMoeUwUxcGyw= Received: by 10.210.35.5 with SMTP id i5mr4648166ebi.87.1219214716706; Tue, 19 Aug 2008 23:45:16 -0700 (PDT) Received: by 10.210.24.9 with HTTP; Tue, 19 Aug 2008 23:45:16 -0700 (PDT) Message-ID: <702ec7d40808192345s17b02fdaxc0e667743896de@mail.gmail.com> Date: Wed, 20 Aug 2008 08:45:16 +0200 From: daniel To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs _ slow rewrite ? Subject: Re: xfs _ slow rewrite ? In-Reply-To: <702ec7d40808180408u57c14e82p778cfb7af6f3dc9e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <702ec7d40808180408u57c14e82p778cfb7af6f3dc9e@mail.gmail.com> X-Barracuda-Connect: nf-out-0910.google.com[64.233.182.188] X-Barracuda-Start-Time: 1219214718 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.3177 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17641 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: luriad@gmail.com Precedence: bulk X-list: xfs I'm working on a new server and test the performance from xfs and ext3 with iozone. iozone -T -t 32 -F /data/iozonefile{0..31} -o -O -i6 -i7 -i0 -i1 -i2 -s512m -r16k -+u system : SLES 10.2 : 2.6.16.60-0.27-smp #1 SMP on a DELL 2950 : 1 GB RAM: raid: raid 10 with 8 disks 15k : 64k chunksize : dell md 1000 : perc 6/e : WriteBack, ReadAheadNone, Cached, echo "3" > /proc/sys/vm/drop_caches why is the xfs read, reread and rewrite so slow ? 1) xfs mkfs.xfs -f -L DATA /dev/sdb1 /dev/sdb1 on /data type xfs (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 5940.92 ops/sec Parent sees throughput for 32 initial writers = 1244.99 ops/sec Min throughput per thread = 127.88 ops/sec Max throughput per thread = 742.80 ops/sec Avg throughput per thread = 185.65 ops/sec Min xfer = 5641.00 ops CPU Utilization: Wall time 210.499 CPU time 3323.852 CPU utilization 1579.03 % Children see throughput for 32 rewriters = 2298.54 ops/sec Parent sees throughput for 32 rewriters = 2293.51 ops/sec Min throughput per thread = 66.23 ops/sec Max throughput per thread = 79.09 ops/sec Avg throughput per thread = 71.83 ops/sec Min xfer = 27439.00 ops CPU utilization: Wall time 415.265 CPU time 1032.129 CPU utilization 248.55 % Children see throughput for 32 readers = 6923.75 ops/sec Parent sees throughput for 32 readers = 6920.53 ops/sec Min throughput per thread = 211.00 ops/sec Max throughput per thread = 226.58 ops/sec Avg throughput per thread = 216.37 ops/sec Min xfer = 30525.00 ops CPU utilization: Wall time 144.732 CPU time 389.016 CPU utilization 268.78 % Children see throughput for 32 re-readers = 6864.93 ops/sec Parent sees throughput for 32 re-readers = 6861.38 ops/sec Min throughput per thread = 209.57 ops/sec Max throughput per thread = 220.73 ops/sec Avg throughput per thread = 214.53 ops/sec Min xfer = 31133.00 ops CPU utilization: Wall time 148.571 CPU time 400.709 CPU utilization 269.71 % Children see throughput for 32 random readers = 2335.44 ops/sec Parent sees throughput for 32 random readers = 2335.30 ops/sec Min throughput per thread = 70.48 ops/sec Max throughput per thread = 74.36 ops/sec Avg throughput per thread = 72.98 ops/sec Min xfer = 31058.00 ops CPU utilization: Wall time 440.693 CPU time 647.208 CPU utilization 146.86 % 2) ext3 mkfs.ext3 /dev/sdb1 -E stride=16 /dev/sdb1 on /data type ext3 (rw,noatime,nodiratime) Children see throughput for 32 initial writers = 3238.64 ops/sec Parent sees throughput for 32 initial writers = 3238.20 ops/sec Min throughput per thread = 101.20 ops/sec Max throughput per thread = 101.21 ops/sec Avg throughput per thread = 101.21 ops/sec Min xfer = 32763.00 ops CPU Utilization: Wall time 323.791 CPU time 281.362 CPU utilization 86.90 % Children see throughput for 32 rewriters = 10553.17 ops/sec Parent sees throughput for 32 rewriters = 10517.38 ops/sec Min throughput per thread = 307.10 ops/sec Max throughput per thread = 378.34 ops/sec Avg throughput per thread = 329.79 ops/sec Min xfer = 26628.00 ops CPU utilization: Wall time 87.079 CPU time 966.580 CPU utilization 1110.00 % Children see throughput for 32 readers = 20602.73 ops/sec Parent sees throughput for 32 readers = 20579.60 ops/sec Min throughput per thread = 518.61 ops/sec Max throughput per thread = 683.18 ops/sec Avg throughput per thread = 643.84 ops/sec Min xfer = 24893.00 ops CPU utilization: Wall time 48.045 CPU time 292.886 CPU utilization 609.61 % Children see throughput for 32 re-readers = 20938.47 ops/sec Parent sees throughput for 32 re-readers = 20912.34 ops/sec Min throughput per thread = 587.57 ops/sec Max throughput per thread = 685.95 ops/sec Avg throughput per thread = 654.33 ops/sec Min xfer = 28093.00 ops CPU utilization: Wall time 47.864 CPU time 291.858 CPU utilization 609.76 % Children see throughput for 32 random readers = 3315.69 ops/sec Parent sees throughput for 32 random readers = 3315.50 ops/sec Min throughput per thread = 102.18 ops/sec Max throughput per thread = 105.06 ops/sec Avg throughput per thread = 103.62 ops/sec Min xfer = 31868.00 ops CPU utilization: Wall time 311.905 CPU time 619.687 CPU utilization 198.68 % who can me please explain that results ? the differences between both file systems are really strange. thanks, daniel From owner-xfs@oss.sgi.com Wed Aug 20 04:13:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 04:14:17 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7KBDoiX017823 for ; Wed, 20 Aug 2008 04:13:50 -0700 X-ASG-Debug-ID: 1219230907-7d0c01eb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B3C5D1A17A75 for ; Wed, 20 Aug 2008 04:15:08 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id XpIP6oeXsLcwBwYX for ; Wed, 20 Aug 2008 04:15:08 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAGuZq0h5LD0w/2dsb2JhbAC1W4FZ X-IronPort-AV: E=Sophos;i="4.32,239,1217773800"; d="scan'208";a="175509841" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Aug 2008 20:45:06 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KVleZ-0006gS-Iz; Wed, 20 Aug 2008 21:15:03 +1000 Date: Wed, 20 Aug 2008 21:15:03 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs@oss.sgi.com, markgw@sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. Subject: Re: TAKE 981498 - Use xfs_idestroy() to cleanup an inode. Message-ID: <20080820111503.GC6061@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs@oss.sgi.com, markgw@sgi.com References: <20080820033302.AF92058C52A8@chook.melbourne.sgi.com> <20080820035642.GB6061@disturbed> <48ABB602.5030404@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48ABB602.5030404@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219230910 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.3192 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17642 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 20, 2008 at 04:13:22PM +1000, Lachlan McIlroy wrote: > This change was part of another patch that you reviewed. This small > change got left out when I merged my changes in with your inode > allocation cleanup which you asked me to do. Yes, I did ask for you to do that and I kinda expected to see the result for review again after that. I did not review the changes that were committed. A second review would have caught the bug you introduced by integrating the bug fix into my patch as I would have suggested that you keep the enhancment and the bug fix as two separare commits. Then the commit logs that would have a 'use init_once' commit and a 'deadlock + memory leak fix' commit.... > I also had to modify > your original patch because it did not apply cleanly due other changes > that you made (the semaphore completion stuff). You could have asked for an updated patch when you found it didn't apply. I had one ready to go and ended up posting it twice before your commit... > I didn't have to take > your cleanup patch - I could have just fixed the bug. Your choice, but either way I kind of expect some kind of dialogue when changes are neceessary. It only takes a few seconds to send a 'doesn't apply - can you update/going with original bugfix' message. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 20 05:49:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 05:49:21 -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 (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 m7KCnGj9028623 for ; Wed, 20 Aug 2008 05:49:18 -0700 X-ASG-Debug-ID: 1219236636-35b8021a0000-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 A3DC4F6567C; Wed, 20 Aug 2008 05:50:36 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id N7HiWZBzqtiZMU2Z; Wed, 20 Aug 2008 05:50:36 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KVn91-0004fX-W6; Wed, 20 Aug 2008 12:50:36 +0000 Date: Wed, 20 Aug 2008 08:50:35 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Fix use-after-free with buffers Subject: Re: [PATCH] Fix use-after-free with buffers Message-ID: <20080820125033.GA29680@infradead.org> References: <48ABA9EC.5040902@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48ABA9EC.5040902@sgi.com> 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: 1219236637 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3199 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17643 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 Wed, Aug 20, 2008 at 03:21:48PM +1000, Lachlan McIlroy wrote: > XB_TRACE(bp, "rele", bp->b_relse); > > + ASSERT(atomic_read(&bp->b_hold) > 0); > + > if (unlikely(!hash)) { > ASSERT(!bp->b_relse); > if (atomic_dec_and_test(&bp->b_hold)) > @@ -838,7 +840,6 @@ xfs_buf_rele( > return; > } > > - ASSERT(atomic_read(&bp->b_hold) > 0); Makes sense, but how is this related to the other bits of the patch? All but log and iozero buffers should always be hashed. > @@ -732,6 +732,7 @@ xfs_buf_item_init( > bip->bli_item.li_ops = &xfs_buf_item_ops; > bip->bli_item.li_mountp = mp; > bip->bli_buf = bp; > + xfs_buf_hold(bp); These refcount changes look good to me. > +void > +xfs_buf_item_free( > + xfs_buf_log_item_t *bip) > +{ > +#ifdef XFS_TRANS_DEBUG > + kmem_free(bip->bli_orig); > + bip->bli_orig = NULL; > + kmem_free(bip->bli_logged); > + bip->bli_logged = NULL; > +#endif /* XFS_TRANS_DEBUG */ > + > +#ifdef XFS_BLI_TRACE > + ktrace_free(bip->bli_trace); > +#endif > + kmem_zone_free(xfs_buf_item_zone, bip); > +} Faktoring this out makes sense, although you might want to remove the zeroing of bip->bli_orig and bip->bli_logged while you're at it, so that slab poisoning can do it's work. From owner-xfs@oss.sgi.com Wed Aug 20 06:14:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 06:14:42 -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=-1.0 required=5.0 tests=BAYES_05,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7KDEcKf030039 for ; Wed, 20 Aug 2008 06:14:39 -0700 X-ASG-Debug-ID: 1219238157-5246036a0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from oss.sgi.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 373411A1820F for ; Wed, 20 Aug 2008 06:15:58 -0700 (PDT) Received: from oss.sgi.com (201-31-184-80.ultrawave.com.br [201.31.184.80]) by cuda.sgi.com with SMTP id LPSmMXsjScILCu12 for ; Wed, 20 Aug 2008 06:15:58 -0700 (PDT) From: hp@de.ibm.com To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: pescaria por kilo Subject: pescaria por kilo Date: Wed, 20 Aug 2008 10:15:49 -0300 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="47872380" X-Barracuda-Connect: 201-31-184-80.ultrawave.com.br[201.31.184.80] X-Barracuda-Start-Time: 1219238159 Message-Id: <20080820131558.373411A1820F@cuda.sgi.com> X-Barracuda-Bayes: INNOCENT GLOBAL 0.0154 1.0000 -1.9205 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=NO_REAL_NAME, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3200 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV 0.91.2/8058/Tue Aug 19 08:20:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17644 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hp@de.ibm.com Precedence: bulk X-list: xfs --47872380 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit me veja peladinha --47872380 Content-Type: application/x-zip-compressed; name="???.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="???.zip" --47872380-- From owner-xfs@oss.sgi.com Wed Aug 20 15:02:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 15:02:07 -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=3.1 required=5.0 tests=BAYES_95,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7KM21JI004423 for ; Wed, 20 Aug 2008 15:02:02 -0700 X-ASG-Debug-ID: 1219269800-180100dd0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.trilifecom.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 642481A1B3E2 for ; Wed, 20 Aug 2008 15:03:20 -0700 (PDT) Received: from mail.trilifecom.com (42.ab.5746.static.theplanet.com [70.87.171.66]) by cuda.sgi.com with ESMTP id ZBjPSl470DLR9A0b for ; Wed, 20 Aug 2008 15:03:20 -0700 (PDT) Received: from C34342-49909 ([127.0.0.1]) by trilifecom.com with MailEnable ESMTP; Wed, 20 Aug 2008 19:32:04 +0800 From: "Professional Customer Service" To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: SDF Approved Achieving Higher Performance Customer Service 8 & 9 Subject: SDF Approved Achieving Higher Performance Customer Service 8 & 9 X-Barracuda-Connect: 42.ab.5746.static.theplanet.com[70.87.171.66] X-Barracuda-Start-Time: 1219269801 Message-Id: <20080820220320.642481A1B3E2@cuda.sgi.com> Date: Wed, 20 Aug 2008 15:03:20 -0700 (PDT) X-Barracuda-Bayes: INNOCENT GLOBAL 0.4575 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.07 X-Barracuda-Spam-Status: No, SCORE=1.07 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MAILTO_TO_SPAM_ADDR, SARE_SXLIFE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3236 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.07 SARE_SXLIFE BODY: Talks about your sex life 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email X-Virus-Scanned: ClamAV 0.91.2/8059/Wed Aug 20 10:33:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17645 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ah20@trilifecom.com Precedence: bulk X-list: xfs Sept Sender: "Professional Customer Service" Mime-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="----=_NextPart_000_22DA2F39_0.43547D3D" Date: Wed, 20 Aug 2008 19:32:04 +0800 Message-ID: <20080820113204548.033610AF700810FA@C34342-49909> Reply-To: "Professional Customer Service" X-Priority: 1 (Highest) Importance: High This is a multipart MIME formatted message. ------=_NextPart_000_22DA2F39_0.43547D3D Content-Type: multipart/alternative; boundary="----=_NextPart_000_22DA2F39_1.43547D3D" ------=_NextPart_000_22DA2F39_1.43547D3D Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable If you can't read this, please visit our website at: http://www.trilifecom.= com. Should you wish to enquire about our courses, change your email addres= s or unsubscribe, please email us only at courses@trilifecom.com. We apolo= gise if you have unsubscribed and are still receiving emails from us. We ne= ed the exact email address to unsubscribe. Thank you. =93No doubt emotional intelligence is more rare than book smarts but my exp= erience says it is more important in the making of a leader.=94 Jack Welch,= Former Chairman and CEO of General Electric What do customers really want? * To be fussed about? * To be treated like royalty? * To be attended to courteously? Our view is that it is none of the above. Customers, like any other human b= eing, wants to be treated with empathy. They want to feel that sales and service people have a genuine concern for = them and are looking for =91real=92 solutions that will solve their problem= s. We train sales and service people achieve these in three ways: a) They learn to be 'real' or 'centred' in order to connect with customers.= At the same time, they maintain their dignity and are happy to serve. b) They experience increase empathy for others by increasing their emotiona= l intelligence quotient (Participants take an online questionnaire, which g= enerates a report on areas participants can improve on, when communicating = with customers. Participants will use this report as a basis to improve the= ir communication skills with customers.) c) They implement these skills and knowledge by role playing likely scenari= os they encounter daily with customers, with a view to improving customer r= elations. This is a life-changing course. Train your Sales and Service people to fully connect with customers in our = two-day course. The fee for the course is $488/- plus an additional $100 for the proprietar= y Emotional Intelligence Report, slides and materials used. SDF provides fu= nding for the course. For full course, registration and SDF funding details, please visit our web= site at: http://www.trilifecom.com. Please also visit our website for information on our other courses. We look forward with great pleasure to welcoming you to our course. Yours sincerely Merle Celine Magness (Ms) TriLife Communications, Singapore Tel: 6581-0970 Email: courses@trilifecom.com website: http://www.trilifecom.com This is a genuine advertisement. Should you wish to enquire about our cours= es, change your email address or unsubscribe, please email us at courses@tr= ilifecom.com. We apologise if you have unsubscribed and are still receiving= emails from us. We need the exact email address to unsubscribe. ------=_NextPart_000_22DA2F39_1.43547D3D Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If you can't read this, please visit ou= r website at: http://www.trilifecom.com= . Should you wish to enquire about our courses, change your email address or unsubsc= ribe, please email us only at  courses@trilifecom.com. We apologise if you have unsubscribed and are still receiving emails from us. We need th= e exact email address to unsubscribe. Thank you.
3D"Your

3D"Achieve

=93No doubt emo= tional intelligence is more rare than book smarts but my experience says it = is more important in the making of a leader.=94 Jack Welch, Former C= hairman and CEO of General Electric

What do customers really wan= t?

*   To be fussed about?

*   To be treated like royalty?

*   To be attended to courteous= ly?

Our view is that it is none of the above. Cust= omers, like any other human being, wants to be treated with empathy.

They want to feel that sales and service people have a genuine conce= rn for them and are looking for =91real=92 solutions that will solv= e their problems.

We train sales and= service people achieve these in three ways:

a) They learn to b= e 'real' or 'centred' in order to connect with customers. At the same time= , they maintain their dignity and are happy to serve.

b) They experie= nce increase empathy for others by increasing their emotional intelli= gence quotient (Participants take an online questionnaire, which generates = a report on areas participants can improve on, when communicating with customers. Participants will use this report as a basis to improve th= eir communication skills with customers.)

c) They impleme= nt these skills and knowledge by role playing likely scenarios they encoun= ter daily with customers, with a view to improving customer relations.

This is a life-changing course.

Train your Sales and Service people to full= y connect with customers in our two-day course.

The fee for the co= urse is $488/- plus an additional $100 for the proprietary Emotional Intellig= ence Report, slides and materials used. SDF provides funding for th= e course.

For full course, registration and SDF funding details, please visit our website at= : http://www.trilifecom.com.

Please also visit our = website for information on our other courses.

We look forward with = great pleasure to welcoming you to our course.

Yours sincerely

Merle Celine Magness (Ms)

TriLife Communication= s, Singapore

Tel: 6581-0970 Email:= courses@trilifecom.com

website: http://www.trilifecom.com

courses@trilifecom.com. We apologise if you have unsubscribed and are still receiving emails from us. We need the exac= t email address to unsubscribe.

------=_NextPart_000_22DA2F39_1.43547D3D-- ------=_NextPart_000_22DA2F39_0.43547D3D-- From owner-xfs@oss.sgi.com Wed Aug 20 20:09:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 20:09:25 -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.6 required=5.0 tests=AWL,BAYES_00,FROM_SALUTATION, J_CHICKENPOX_29,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L39MRe024923 for ; Wed, 20 Aug 2008 20:09:22 -0700 X-ASG-Debug-ID: 1219288241-69e7003e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ns3.baby-dragons.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D207D1A1CEE4 for ; Wed, 20 Aug 2008 20:10:41 -0700 (PDT) Received: from ns3.baby-dragons.com (ns3.baby-dragons.com [204.91.156.41]) by cuda.sgi.com with ESMTP id FhDaHA24gFh56Wsy for ; Wed, 20 Aug 2008 20:10:41 -0700 (PDT) Received: from localhost (ns3.baby-dragons.com [204.91.156.41]) by ns3.baby-dragons.com (8.13.8/8.13.8) with ESMTP id m7L3Ac2m028649; Thu, 21 Aug 2008 03:10:39 GMT Date: Wed, 20 Aug 2008 19:10:38 -0800 (AKDT) From: "Mr. James W. Laferriere" To: xfs@oss.sgi.com cc: linux-raid maillist , Dan Williams X-ASG-Orig-Subj: 5 concurrent bonnie runs failing after first pass . Subject: 5 concurrent bonnie runs failing after first pass . Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.1.8 (ns3.baby-dragons.com [204.91.156.41]); Thu, 21 Aug 2008 03:10:40 +0000 (UTC) X-Barracuda-Connect: ns3.baby-dragons.com[204.91.156.41] X-Barracuda-Start-Time: 1219288242 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.3256 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17646 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: babydr@baby-dragons.com Precedence: bulk X-list: xfs Hello Dave (& Dan & All) , Even with your patch to xfs (49641f1acfdfd437ed9b0a70b86bf36626c02afe) Under some conditions multiple concurrent bonnie runs just halt . No log to dmesg or serial console . But there is a message from something when bonnie halts . Also note the really low I/O . --- Bad Bonnie --- (multiple concurrent processes) filesrv2,136G,,,14389,16,10165,13,,,64722,9,134.3,0,16,212,2,+++++,+++,206,2,226,1,+++++,+++,177,2 semop: semop failed. : Resource temporarily unavailable === Good Bonnie === (single process) filesrv2,256G,,,108938,59,92128,56,,,402852,70,407.6,2,16,1477,10,+++++,+++,1164,10,1518,10,+++++,+++,1166,6 # uname -a Linux filesrv2 2.6.26 #2 SMP Sun Aug 17 05:36:58 UTC 2008 i686 pentium4 i386 GNU/Linux - serial console before , during & after the multiple concurrent bonnie run . Welcome to Linux 2.6.26 (ttyS0) filesrv2 login: dd used greatest stack depth: 3604 bytes left Aug 19 03:51:01 filesrv2 kernel: dd used greatest stack depth: 3604 bytes left Bonnie output Here ... http://www.baby-dragons.com/131072MB-bonnie++-run-md3-xfs-15runs.log-200808200242-2.6.26 Below shows the amount of I/O during that run to all memebers of the array being tested ... http://www.baby-dragons.com/device-thruput-200808200242-2.6.26.log The culprit ... # cat ~/bin/bonniemd3.sh N=5 /root/bonnie++-1.03c/bonnie++ -u0:0 -p${N} SIZE="`echo -en "scale=0\n((717698048-4096)/((1024^2)*${N}))*1024\nquit\n" | bc`k" echo "\${SIZE}=${SIZE}" # Note: add or subtract a line of the below for ${N} > 5 or ${N} < 5 time /root/bonnie++-1.03c/bonnie++ -u 0:0 -y -d /md3 -x 15 -s ${SIZE} -f -y & time /root/bonnie++-1.03c/bonnie++ -u 0:0 -y -d /md3 -x 15 -s ${SIZE} -f -y & time /root/bonnie++-1.03c/bonnie++ -u 0:0 -y -d /md3 -x 15 -s ${SIZE} -f -y & time /root/bonnie++-1.03c/bonnie++ -u 0:0 -y -d /md3 -x 15 -s ${SIZE} -f -y & time /root/bonnie++-1.03c/bonnie++ -u 0:0 -y -d /md3 -x 15 -s ${SIZE} -f -y & The victim ... # mdadm -D /dev/md3 mdadm: metadata format 00.90 unknown, ignored. mdadm: metadata format 00.90 unknown, ignored. mdadm: metadata format 00.90 unknown, ignored. /dev/md3: Version : 00.90 Creation Time : Mon Jul 7 21:42:12 2008 Raid Level : raid6 Array Size : 717829120 (684.58 GiB 735.06 GB) Used Dev Size : 143565824 (136.92 GiB 147.01 GB) Raid Devices : 7 Total Devices : 8 Preferred Minor : 3 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Wed Aug 20 10:06:44 2008 State : active Active Devices : 7 Working Devices : 8 Failed Devices : 0 Spare Devices : 1 Chunk Size : 1024K UUID : 7617aeb3:65870440:a619e7ca:f8a16963 Events : 0.12 Number Major Minor RaidDevice State 0 8 32 0 active sync /dev/sdc 1 8 48 1 active sync /dev/sdd 2 8 64 2 active sync /dev/sde 3 8 80 3 active sync /dev/sdf 4 8 96 4 active sync /dev/sdg 5 8 112 5 active sync /dev/sdh 6 8 128 6 active sync /dev/sdi 7 8 144 - spare /dev/sdj More of the victim ... # cat /proc/mounts | grep md3 /dev/md3 /md3 xfs rw,nobarrier,sunit=2048,swidth=12288,noquota 0 0 -- +------------------------------------------------------------------+ | James W. Laferriere | System Techniques | Give me VMS | | Network&System Engineer | 2133 McCullam Ave | Give me Linux | | babydr@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP | +------------------------------------------------------------------+ From owner-xfs@oss.sgi.com Wed Aug 20 22:13:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 22:14:00 -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,J_CHICKENPOX_34, J_CHICKENPOX_43,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L5DugU004554 for ; Wed, 20 Aug 2008 22:13:56 -0700 X-ASG-Debug-ID: 1219295713-4f1801480000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F3D3E1A1D49F for ; Wed, 20 Aug 2008 22:15:14 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id hZxueCxdH7JJMKLi for ; Wed, 20 Aug 2008 22:15:14 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHiWrEh5LD0w/2dsb2JhbAC1OYFZ X-IronPort-AV: E=Sophos;i="4.32,243,1217773800"; d="scan'208";a="176169646" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Aug 2008 14:45:11 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KW2Vo-0007Fe-WB; Thu, 21 Aug 2008 15:15:08 +1000 Date: Thu, 21 Aug 2008 15:15:08 +1000 From: Dave Chinner To: Szabolcs Szakacsits Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821051508.GB5706@disturbed> Mail-Followup-To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219295716 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.2125 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m7L5DvgU004556 X-archive-position: 17647 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > On Thu, 21 Aug 2008, Dave Chinner wrote: > > On Wed, Aug 20, 2008 at 02:39:16PM -0700, Andrew Morton wrote: > > > On Thu, 21 Aug 2008 00:25:55 +0300 (MET DST) > > > Szabolcs Szakacsits wrote: > > > > I ran compilebench on kernel 2.6.26 with freshly formatted volumes. > > > > The behavior of NILFS2 was interesting. > > > > > > > > Its peformance rapidly degrades to the lowest ever measured level > > > > (< 1 MB/s) but after a while it recovers and gives consistent numbers. > > > > However it's still very far from the current unstable btrfs performance. > > > > The results are reproducible. > > > > > > > > MB/s Runtime (s) > > > > ----- ----------- > > > > btrfs unstable 17.09 572 > > > > ext3 13.24 877 > > > > btrfs 0.16 12.33 793 > > > > nilfs2 2nd+ runs 11.29 674 > > > > ntfs-3g 8.55 865 > > > > reiserfs 8.38 966 > > > > nilfs2 1st run 4.95 3800 > > > > xfs 1.88 3901 > > > > > > err, what the heck happened to xfs? Is this usual? > > > > No, definitely not usual. I suspect it's from an old mkfs and > > barriers being used. What is the output of the xfs.mkfs when > > you make the filesystem and what mount options being used? > > Everything is default. > > % rpm -qf =mkfs.xfs > xfsprogs-2.9.8-7.1 > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is the > latest stable mkfs.xfs. Its output is > > meta-data=/dev/sda8 isize=256 agcount=4, agsize=1221440 blks > = sectsz=512 attr=2 > data = bsize=4096 blocks=4885760, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 > log =internal log bsize=4096 blocks=2560, version=2 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 Ok, I thought it might be the tiny log, but it didn't improve anything here when increased the log size, or the log buffer size. Looking at the block trace, I think elevator merging is somewhat busted. I'm seeing adjacent I/Os being dispatched without having been merged. e.g: 104,48 1 2139 4.803090086 4175 Q W 18540712 + 8 [pdflush] 104,48 1 2140 4.803092492 4175 G W 18540712 + 8 [pdflush] 104,48 1 2141 4.803094875 4175 P N [pdflush] 104,48 1 2142 4.803096205 4175 I W 18540712 + 8 [pdflush] 104,48 1 2143 4.803160324 4175 Q W 18540720 + 40 [pdflush] 104,48 1 2144 4.803162724 4175 M W 18540720 + 40 [pdflush] 104,48 1 2145 4.803231701 4175 Q W 18540760 + 48 [pdflush] 104,48 1 2146 4.803234223 4175 M W 18540760 + 48 [pdflush] ..... 104,48 1 2163 4.803844214 4175 Q W 18541032 + 56 [pdflush] 104,48 1 2164 4.803846694 4175 M W 18541032 + 56 [pdflush] 104,48 1 2165 4.803932321 4175 Q W 18541088 + 48 [pdflush] 104,48 1 2166 4.803937177 4175 G W 18541088 + 48 [pdflush] 104,48 1 2167 4.803940416 4175 I W 18541088 + 48 [pdflush] 104,48 1 2168 4.804005265 4175 Q W 18541136 + 24 [pdflush] 104,48 1 2169 4.804007664 4175 M W 18541136 + 24 [pdflush] ..... 104,48 1 2183 4.804518129 4175 D W 18540712 + 376 [pdflush] 104,48 1 2184 4.804537981 4175 D W 18541088 + 248 [pdflush] In entry 2165, a new request is made rather than merging the existing, adjacent request that is already open. The result is we then dispatch two I/Os instead of one. Also, CFQ appears to not be merging WRITE_SYNC bios or issuing them with any urgency. The result of this is that it stalls the XFS transaction subsystem by capturing all the log buffers in the elevator and not issuing them. e.g.: 104,48 0 149 0.107856547 4160 Q WS 35624860 + 128 [pdflush] 104,48 0 150 0.107861855 4160 G WS 35624860 + 128 [pdflush] 104,48 0 151 0.107865332 4160 I W 35624860 + 128 [pdflush] ... 104,48 0 162 0.120791581 4159 Q WS 35624988 + 128 [python] 104,48 0 163 0.120805714 4159 G WS 35624988 + 128 [python] 104,48 0 164 0.120813427 4159 I W 35624988 + 128 [python] 104,48 0 165 0.132109889 4159 Q WS 35625116 + 128 [python] 104,48 0 166 0.132128642 4159 G WS 35625116 + 128 [python] 104,48 0 167 0.132132988 4159 I W 35625116 + 128 [python] 104,48 0 168 0.143612843 4159 Q WS 35625244 + 128 [python] 104,48 0 169 0.143640248 4159 G WS 35625244 + 128 [python] 104,48 0 170 0.143644697 4159 I W 35625244 + 128 [python] 104,48 0 171 0.158243553 4159 Q WS 35625372 + 128 [python] 104,48 0 172 0.158261652 4159 G WS 35625372 + 128 [python] 104,48 0 173 0.158266233 4159 I W 35625372 + 128 [python] 104,48 0 174 0.171342555 4159 Q WS 35625500 + 128 [python] 104,48 0 175 0.171360707 4159 G WS 35625500 + 128 [python] 104,48 0 176 0.171365036 4159 I W 35625500 + 128 [python] 104,48 0 177 0.183936429 4159 Q WS 35625628 + 128 [python] 104,48 0 178 0.183955172 4159 G WS 35625628 + 128 [python] 104,48 0 179 0.183959726 4159 I W 35625628 + 128 [python] ... 104,48 0 180 0.194008953 4159 Q WS 35625756 + 128 [python] 104,48 0 181 0.194027120 4159 G WS 35625756 + 128 [python] 104,48 0 182 0.194031311 4159 I W 35625756 + 128 [python] ... 104,48 0 191 0.699915104 0 D W 35624860 + 128 [swapper] ... 104,48 0 196 0.700513279 0 C W 35624860 + 128 [0] ... 104,48 0 198 0.711808579 4159 Q WS 35625884 + 128 [python] 104,48 0 199 0.711826259 4159 G WS 35625884 + 128 [python] 104,48 0 200 0.711830589 4159 I W 35625884 + 128 [python] 104,48 0 201 0.711848493 4159 D W 35624988 + 128 [python] 104,48 0 202 0.711861868 4159 D W 35625116 + 128 [python] 104,48 0 203 0.711868531 4159 D W 35625244 + 128 [python] 104,48 0 204 0.711874967 4159 D W 35625372 + 128 [python] .... 104,48 1 72 0.900288147 0 D W 35625500 + 128 [swapper] 104,48 1 73 0.900296058 0 D W 35625628 + 128 [swapper] 104,48 1 74 0.900302401 0 D W 35625756 + 128 [swapper] 104,48 1 75 0.900308516 0 D W 35625884 + 128 [swapper] ..... here we see all 8 log buffers written and queued in ~95ms. At this point (0.194s into the trace) the log stalls because we've used all the log buffers and have to wait for I/O to complete. The filesystem effectively sits idle now for half a second waiting for I/O to be dispatched. At 0.699s, we have a single buffer issued and it completes in 500 *microseconds* (NVRAM on raid controller). We do completion processing, fill and dispatch that buffer in under 10ms (on a 1GHz P3) at which point we dispatch the 4 oldest remaining buffers. 200ms later, we dispatch the remainder. Effectively, the elevator has stalled all transactions in the filesystem for close to 700ms by not dispatching the SYNC_WRITE buffers, and all the bios could have been merged into a single 512k I/O when they were to be dispatched. I guess the only way to prevent this really is to issue explicit unplugs.... On 2.6.24: 104,48 0 975 1.707253442 2761 Q WS 35753545 + 128 [python] 104,48 0 976 1.707268811 2761 G WS 35753545 + 128 [python] 104,48 0 977 1.707275455 2761 I W 35753545 + 128 [python] 104,48 0 978 1.728703316 2761 Q WS 35753673 + 128 [python] 104,48 0 979 1.728714289 2761 M WS 35753673 + 128 [python] 104,48 0 980 1.761603632 2761 Q WS 35753801 + 128 [python] 104,48 0 981 1.761614498 2761 M WS 35753801 + 128 [python] 104,48 0 982 1.784522988 2761 Q WS 35753929 + 128 [python] 104,48 0 983 1.784533351 2761 M WS 35753929 + 128 [python] .... 104,48 0 1125 2.475132431 0 D W 35753545 + 512 [swapper] The I/Os are merged, but there's still that 700ms delay before dispatch. i was looking at this a while back but didn't get to finishing it off. i.e.: http://oss.sgi.com/archives/xfs/2008-01/msg00151.html http://oss.sgi.com/archives/xfs/2008-01/msg00152.html I'll have a bit more of a look at this w.r.t to compilebench performance, because it seems like a similar set of problems that I was seeing back then... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 20 22:58:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 22:58:53 -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.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L5woHT007296 for ; Wed, 20 Aug 2008 22:58:50 -0700 X-ASG-Debug-ID: 1219298410-50e103690000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web34508.mail.mud.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 3AA921A1D9F5 for ; Wed, 20 Aug 2008 23:00:10 -0700 (PDT) Received: from web34508.mail.mud.yahoo.com (web34508.mail.mud.yahoo.com [66.163.178.174]) by cuda.sgi.com with SMTP id HUo0zO6s2sxZrERW for ; Wed, 20 Aug 2008 23:00:10 -0700 (PDT) Received: (qmail 69539 invoked by uid 60001); 21 Aug 2008 06:00:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=5r9SCkn72plnsdxQRs0xpJlZrzvaxetZgzV6pKkSh2zjmQC53tqOVZo6dlA80pfPSqaUCkxB10gq/Sogj2JcRfQzD+NzuC1Mjd1+D7HZLqrZT7F2QBv/uKyz9h78YkvltVP7EKe9tbOmW2T2vWFGdZuct+40ZmsaeriSeV83k3c=; X-YMail-OSG: gMal2EIVM1nqHJ6pLYmPKeWvFsK25Z5VCBFHtUYgKrXWUFZCNEU_wohlJ8Qhh6fCQwLHt6vARMmdrzve_WL12NP3kBCobppiwYo3Zm_YA6jYm7DrPrUDWfeMsRnATcLHoTTPLrhfR2braINm7HpngOw- Received: from [96.13.233.185] by web34508.mail.mud.yahoo.com via HTTP; Wed, 20 Aug 2008 23:00:07 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Wed, 20 Aug 2008 23:00:07 -0700 (PDT) From: gus3 Reply-To: MusicMan529@yahoo.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) To: Szabolcs Szakacsits , Dave Chinner Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com In-Reply-To: <20080821051508.GB5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <684252.68814.qm@web34508.mail.mud.yahoo.com> X-Barracuda-Connect: web34508.mail.mud.yahoo.com[66.163.178.174] X-Barracuda-Start-Time: 1219298411 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.3268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17648 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: musicman529@yahoo.com Precedence: bulk X-list: xfs --- On Wed, 8/20/08, Dave Chinner wrote: > Ok, I thought it might be the tiny log, but it didn't > improve anything > here when increased the log size, or the log buffer size. > > Looking at the block trace, I think elevator merging is > somewhat busted. I'm > seeing adjacent I/Os being dispatched without having been > merged. e.g: [snip] > Also, CFQ appears to not be merging WRITE_SYNC bios or > issuing them > with any urgency. The result of this is that it stalls the > XFS > transaction subsystem by capturing all the log buffers in > the > elevator and not issuing them. e.g.: [snip] > The I/Os are merged, but there's still that 700ms delay > before dispatch. > i was looking at this a while back but didn't get to > finishing it off. > i.e.: > > http://oss.sgi.com/archives/xfs/2008-01/msg00151.html > http://oss.sgi.com/archives/xfs/2008-01/msg00152.html > > I'll have a bit more of a look at this w.r.t to > compilebench performance, > because it seems like a similar set of problems that I was > seeing back > then... I concur your observation, esp. w.r.t. XFS and CFQ clashing: http://gus3.typepad.com/i_am_therefore_i_think/2008/07/finding-the-fas.html CFQ is the default on most Linux systems AFAIK; for decent XFS performance one needs to switch to "noop" or "deadline". I wasn't sure if it was broken code, or simply base assumptions in conflict (XFS vs. CFQ). Your log output sheds light on the matter for me, thanks. From owner-xfs@oss.sgi.com Wed Aug 20 23:03:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 23:03:18 -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,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L63EHU007797 for ; Wed, 20 Aug 2008 23:03:16 -0700 X-ASG-Debug-ID: 1219298673-543f036f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6834D1A1DAEF for ; Wed, 20 Aug 2008 23:04:34 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id rHKV6W0EbiGsq26m for ; Wed, 20 Aug 2008 23:04:34 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAShrEh5LD0w/2dsb2JhbAC1NIFm X-IronPort-AV: E=Sophos;i="4.32,243,1217773800"; d="scan'208";a="176211865" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Aug 2008 15:34:19 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KW3HO-0008Jw-57; Thu, 21 Aug 2008 16:04:18 +1000 Date: Thu, 21 Aug 2008 16:04:18 +1000 From: Dave Chinner To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821060418.GC5706@disturbed> Mail-Followup-To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821051508.GB5706@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219298675 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.3268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17649 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 03:15:08PM +1000, Dave Chinner wrote: > On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > Everything is default. > > > > % rpm -qf =mkfs.xfs > > xfsprogs-2.9.8-7.1 > > > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is the > > latest stable mkfs.xfs. Its output is > > > > meta-data=/dev/sda8 isize=256 agcount=4, agsize=1221440 blks > > = sectsz=512 attr=2 > > data = bsize=4096 blocks=4885760, imaxpct=25 > > = sunit=0 swidth=0 blks > > naming =version 2 bsize=4096 > > log =internal log bsize=4096 blocks=2560, version=2 > > = sectsz=512 sunit=0 blks, lazy-count=0 > > realtime =none extsz=4096 blocks=0, rtextents=0 > > Ok, I thought it might be the tiny log, but it didn't improve anything > here when increased the log size, or the log buffer size. One thing I just found out - my old *laptop* is 4-5x faster than the 10krpm scsi disk behind an old cciss raid controller. I'm wondering if the long delays in dispatch is caused by an interaction with CTQ but I can't change it on the cciss raid controllers. Are you using ctq/ncq on your machine? If so, can you reduce the depth to something less than 4 and see what difference that makes? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 20 23:13:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 23:13:30 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L6DQHb008499 for ; Wed, 20 Aug 2008 23:13:27 -0700 X-ASG-Debug-ID: 1219299286-1831002e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 000C81A1DB7F for ; Wed, 20 Aug 2008 23:14:47 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id vrp7HndiCpaQbKr6 for ; Wed, 20 Aug 2008 23:14:47 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEykrEh5LD0w/2dsb2JhbAC1NIFm X-IronPort-AV: E=Sophos;i="4.32,243,1217773800"; d="scan'208";a="176219912" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Aug 2008 15:44:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KW3RT-00006v-MK; Thu, 21 Aug 2008 16:14:43 +1000 Date: Thu, 21 Aug 2008 16:14:43 +1000 From: Dave Chinner To: gus3 Cc: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821061443.GD5706@disturbed> Mail-Followup-To: gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <684252.68814.qm@web34508.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <684252.68814.qm@web34508.mail.mud.yahoo.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219299288 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.3268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17650 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 20, 2008 at 11:00:07PM -0700, gus3 wrote: > --- On Wed, 8/20/08, Dave Chinner wrote: > > > Ok, I thought it might be the tiny log, but it didn't improve > > anything here when increased the log size, or the log buffer > > size. > > > > Looking at the block trace, I think elevator merging is somewhat > > busted. I'm seeing adjacent I/Os being dispatched without having > > been merged. e.g: > > [snip] > > > Also, CFQ appears to not be merging WRITE_SYNC bios or issuing > > them with any urgency. The result of this is that it stalls the > > XFS transaction subsystem by capturing all the log buffers in > > the elevator and not issuing them. e.g.: > > [snip] > > > The I/Os are merged, but there's still that 700ms delay before > > dispatch. i was looking at this a while back but didn't get to > > finishing it off. i.e.: > > > > http://oss.sgi.com/archives/xfs/2008-01/msg00151.html > > http://oss.sgi.com/archives/xfs/2008-01/msg00152.html > > > > I'll have a bit more of a look at this w.r.t to compilebench > > performance, because it seems like a similar set of problems > > that I was seeing back then... > > I concur your observation, esp. w.r.t. XFS and CFQ clashing: > > http://gus3.typepad.com/i_am_therefore_i_think/2008/07/finding-the-fas.html > > CFQ is the default on most Linux systems AFAIK; for decent XFS > performance one needs to switch to "noop" or "deadline". I wasn't > sure if it was broken code, or simply base assumptions in conflict > (XFS vs. CFQ). Your log output sheds light on the matter for me, > thanks. I'm wondering if these elevators are just getting too smart for their own good. w.r.t to the above test, deadline was about twice as slow as CFQ - it does immediate dispatch on SYNC_WRITE bios and so caused more seeks that CFQ and hence went slower. noop had similar dispatch latency problems to CFQ, so it wasn't any faster either. I think that we need to issue explicit unplugs to get the log I/O dispatched the way we want on all elevators and stop trying to give elevators implicit hints by abusing the bio types and hoping they do the right thing.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 20 23:30:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 20 Aug 2008 23:30:47 -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.2 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 m7L6UiUs009939 for ; Wed, 20 Aug 2008 23:30:44 -0700 X-ASG-Debug-ID: 1219300324-0fe802430000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 77583F8FD63 for ; Wed, 20 Aug 2008 23:32:04 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Z4XqlFJfddPAIA96 for ; Wed, 20 Aug 2008 23:32:04 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 03FC2A9ABCB; Thu, 21 Aug 2008 01:32:03 -0500 (CDT) Message-ID: <48AD0BE3.7020403@sandeen.net> Date: Thu, 21 Aug 2008 01:32:03 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: "Mr. James W. Laferriere" CC: xfs@oss.sgi.com, linux-raid maillist , Dan Williams X-ASG-Orig-Subj: Re: 5 concurrent bonnie runs failing after first pass . Subject: Re: 5 concurrent bonnie runs failing after first pass . References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1219300325 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.3269 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17651 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mr. James W. Laferriere wrote: > Hello Dave (& Dan & All) , > Even with your patch to xfs (49641f1acfdfd437ed9b0a70b86bf36626c02afe) > Under some conditions multiple concurrent bonnie runs just halt . No log to > dmesg or serial console . But there is a message from something when bonnie > halts . that "something" == bonnie ... > Also note the really low I/O . > > > --- Bad Bonnie --- (multiple concurrent processes) > filesrv2,136G,,,14389,16,10165,13,,,64722,9,134.3,0,16,212,2,+++++,+++,206,2,226,1,+++++,+++,177,2 > semop: semop failed. > : Resource temporarily unavailable > Is it unique to xfs? this is an error from bonnie's semop() call; it's not immediately clear that there is a problem with xfs. Is bonnie deadlocking? Is xfs stuck? echo w > /proc/sysrq-trigger to see if there are stuck processes and where they are. -Eric From owner-xfs@oss.sgi.com Thu Aug 21 01:11:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 01:11:14 -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=BAYES_00,J_CHICKENPOX_73, UNPARSEABLE_RELAY autolearn=no 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 m7L8B9TQ022634 for ; Thu, 21 Aug 2008 01:11:10 -0700 X-ASG-Debug-ID: 1219306349-4e9c02280000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from note.orchestra.cse.unsw.EDU.AU (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BDF691252B4C for ; Thu, 21 Aug 2008 01:12:29 -0700 (PDT) Received: from note.orchestra.cse.unsw.EDU.AU (note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by cuda.sgi.com with ESMTP id tOXtGnyL8vziMzOW for ; Thu, 21 Aug 2008 01:12:29 -0700 (PDT) Received: From [10.13.1.111] ([203.143.161.65] == vampire.ken.nicta.com.au) (auth-user aaronc) (cse-authentic-sender aaronc) By note With Smtp ; Thu, 21 Aug 2008 18:07:39 +1000 From: Aaron Carroll To: david@fromorbit.com Date: Thu, 21 Aug 2008 18:07:38 +1000 Message-ID: <48AD224A.7080107@gelato.unsw.edu.au> User-Agent: Thunderbird 2.0.0.14 (X11/20080618) MIME-Version: 1.0 CC: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> In-Reply-To: <20080821060418.GC5706@disturbed> Content-Type: multipart/mixed; boundary="------------040209080705080100020407" X-Barracuda-Connect: note.orchestra.cse.unsw.EDU.AU[129.94.242.24] X-Barracuda-Start-Time: 1219306350 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=UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3277 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17652 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: aaronc@gelato.unsw.edu.au Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------040209080705080100020407 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Dave Chinner wrote: > One thing I just found out - my old *laptop* is 4-5x faster than the > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > if the long delays in dispatch is caused by an interaction with CTQ > but I can't change it on the cciss raid controllers. Are you using > ctq/ncq on your machine? If so, can you reduce the depth to > something less than 4 and see what difference that makes? I've been benchmarking on a cciss card, and patched the driver to control the queue depth via sysfs. Maybe you'll find it useful... The original patch was for 2.6.24, but that won't apply on git head. I fixed it for 2.6.27, and it seems to work fine. Both are attached. -- Aaron --------------040209080705080100020407 Content-Type: text/plain; name="cciss_qdepth-2.6.24.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="cciss_qdepth-2.6.24.patch" ZGlmZiAtLWdpdCBhL2RyaXZlcnMvYmxvY2svY2Npc3MuYyBiL2RyaXZlcnMv YmxvY2svY2Npc3MuYwppbmRleCA1NWJkMzVjLi43MDljNDE5IDEwMDY0NAot LS0gYS9kcml2ZXJzL2Jsb2NrL2NjaXNzLmMKKysrIGIvZHJpdmVycy9ibG9j ay9jY2lzcy5jCkBAIC00NzQsNyArNDc0LDcgQEAgc3RhdGljIENvbW1hbmRM aXN0X3N0cnVjdCAqY21kX2FsbG9jKGN0bHJfaW5mb190ICpoLCBpbnQgZ2V0 X2Zyb21fcG9vbCkKIAogCQlkbyB7CiAJCQlpID0gZmluZF9maXJzdF96ZXJv X2JpdChoLT5jbWRfcG9vbF9iaXRzLCBoLT5ucl9jbWRzKTsKLQkJCWlmIChp ID09IGgtPm5yX2NtZHMpCisJCQlpZiAoaSA+PSBoLT5xZGVwdGhfbWF4KQog CQkJCXJldHVybiBOVUxMOwogCQl9IHdoaWxlICh0ZXN0X2FuZF9zZXRfYml0 CiAJCQkgKGkgJiAoQklUU19QRVJfTE9ORyAtIDEpLApAQCAtMTI1Nyw3ICsx MjU3LDcgQEAgc3RhdGljIHZvaWQgY2Npc3NfY2hlY2tfcXVldWVzKGN0bHJf aW5mb190ICpoKQogCSAqIGluIGNhc2UgdGhlIGludGVycnVwdCB3ZSBzZXJ2 aWNlZCB3YXMgZnJvbSBhbiBpb2N0bCBhbmQgZGlkIG5vdAogCSAqIGZyZWUg YW55IG5ldyBjb21tYW5kcy4KIAkgKi8KLQlpZiAoKGZpbmRfZmlyc3RfemVy b19iaXQoaC0+Y21kX3Bvb2xfYml0cywgaC0+bnJfY21kcykpID09IGgtPm5y X2NtZHMpCisJaWYgKChmaW5kX2ZpcnN0X3plcm9fYml0KGgtPmNtZF9wb29s X2JpdHMsIGgtPm5yX2NtZHMpKSA+PSBoLT5xZGVwdGhfbWF4KQogCQlyZXR1 cm47CiAKIAkvKiBXZSBoYXZlIHJvb20gb24gdGhlIHF1ZXVlIGZvciBtb3Jl IGNvbW1hbmRzLiAgTm93IHdlIG5lZWQgdG8gcXVldWUKQEAgLTEyNzYsNyAr MTI3Niw3IEBAIHN0YXRpYyB2b2lkIGNjaXNzX2NoZWNrX3F1ZXVlcyhjdGxy X2luZm9fdCAqaCkKIAkJLyogY2hlY2sgdG8gc2VlIGlmIHdlIGhhdmUgbWF4 ZWQgb3V0IHRoZSBudW1iZXIgb2YgY29tbWFuZHMKIAkJICogdGhhdCBjYW4g YmUgcGxhY2VkIG9uIHRoZSBxdWV1ZS4KIAkJICovCi0JCWlmICgoZmluZF9m aXJzdF96ZXJvX2JpdChoLT5jbWRfcG9vbF9iaXRzLCBoLT5ucl9jbWRzKSkg PT0gaC0+bnJfY21kcykgeworCQlpZiAoKGZpbmRfZmlyc3RfemVyb19iaXQo aC0+Y21kX3Bvb2xfYml0cywgaC0+bnJfY21kcykpID49IGgtPnFkZXB0aF9t YXgpIHsKIAkJCWlmIChjdXJyX3F1ZXVlID09IHN0YXJ0X3F1ZXVlKSB7CiAJ CQkJaC0+bmV4dF90b19ydW4gPQogCQkJCSAgICAoc3RhcnRfcXVldWUgKyAx KSAlIChoLT5oaWdoZXN0X2x1biArIDEpOwpAQCAtMzA3NSw2ICszMDc1LDcg QEAgc3RhdGljIGludCBfX2RldmluaXQgY2Npc3NfcGNpX2luaXQoY3Rscl9p bmZvX3QgKmMsIHN0cnVjdCBwY2lfZGV2ICpwZGV2KQogCQkJYy0+cHJvZHVj dF9uYW1lID0gcHJvZHVjdHNbaV0ucHJvZHVjdF9uYW1lOwogCQkJYy0+YWNj ZXNzID0gKihwcm9kdWN0c1tpXS5hY2Nlc3MpOwogCQkJYy0+bnJfY21kcyA9 IHByb2R1Y3RzW2ldLm5yX2NtZHM7CisJCQljLT5xZGVwdGhfbWF4ID0gcHJv ZHVjdHNbaV0ubnJfY21kczsKIAkJCWJyZWFrOwogCQl9CiAJfQpAQCAtMzA5 NSw2ICszMDk2LDcgQEAgc3RhdGljIGludCBfX2RldmluaXQgY2Npc3NfcGNp X2luaXQoY3Rscl9pbmZvX3QgKmMsIHN0cnVjdCBwY2lfZGV2ICpwZGV2KQog CQkJYy0+cHJvZHVjdF9uYW1lID0gcHJvZHVjdHNbaS0xXS5wcm9kdWN0X25h bWU7CiAJCQljLT5hY2Nlc3MgPSAqKHByb2R1Y3RzW2ktMV0uYWNjZXNzKTsK IAkJCWMtPm5yX2NtZHMgPSBwcm9kdWN0c1tpLTFdLm5yX2NtZHM7CisJCQlj LT5xZGVwdGhfbWF4ID0gcHJvZHVjdHNbaS0xXS5ucl9jbWRzOwogCQkJcHJp bnRrKEtFUk5fV0FSTklORyAiY2Npc3M6IFRoaXMgaXMgYW4gdW5rbm93biAi CiAJCQkJIlNtYXJ0IEFycmF5IGNvbnRyb2xsZXIuXG4iCiAJCQkJImNjaXNz OiBQbGVhc2UgdXBkYXRlIHRvIHRoZSBsYXRlc3QgZHJpdmVyICIKQEAgLTMz NDYsNiArMzM0OCw0NCBAQCBzdGF0aWMgdm9pZCBmcmVlX2hiYShpbnQgaSkK IAlrZnJlZShwKTsKIH0KIAorc3RhdGljIGlubGluZSBjdGxyX2luZm9fdCAq Y2Npc3NfZ2V0X2N0bHJfaW5mbyhzdHJ1Y3QgZGV2aWNlICpkZXYpCit7CisJ c3RydWN0IHBjaV9kZXYgKnBkZXYgPSBjb250YWluZXJfb2YoZGV2LCBzdHJ1 Y3QgcGNpX2RldiwgZGV2KTsKKwlyZXR1cm4gcGNpX2dldF9kcnZkYXRhKHBk ZXYpOworfQorCitzdGF0aWMgc3NpemVfdCBjY2lzc19zaG93X3F1ZXVlX2Rl cHRoKHN0cnVjdCBkZXZpY2UgKmRldiwKKwkJc3RydWN0IGRldmljZV9hdHRy aWJ1dGUgKmF0dHIsIGNoYXIgKmJ1ZikKK3sKKwljdGxyX2luZm9fdCAqY3Rs ciA9IGNjaXNzX2dldF9jdGxyX2luZm8oZGV2KTsKKwlCVUdfT04oIWN0bHIp OworCisJcmV0dXJuIHNwcmludGYoYnVmLCAiJXVcbiIsIGN0bHItPnFkZXB0 aF9tYXgpOworfQorCitzdGF0aWMgc3NpemVfdCBjY2lzc19zdG9yZV9xdWV1 ZV9kZXB0aChzdHJ1Y3QgZGV2aWNlICpkZXYsCisJCXN0cnVjdCBkZXZpY2Vf YXR0cmlidXRlICphdHRyLCBjb25zdCBjaGFyICpidWYsIHNpemVfdCBjb3Vu dCkKK3sKKwljdGxyX2luZm9fdCAqY3RsciA9IGNjaXNzX2dldF9jdGxyX2lu Zm8oZGV2KTsKKwl1bnNpZ25lZCBsb25nIHFkZXB0aF9tYXg7CisKKwlCVUdf T04oIWN0bHIpOworCXFkZXB0aF9tYXggPSBzaW1wbGVfc3RydG91bChidWYs IE5VTEwsIDEwKTsKKworCWlmIChxZGVwdGhfbWF4IDwgMSkKKwkJcWRlcHRo X21heCA9IDE7CisJZWxzZSBpZiAocWRlcHRoX21heCA+IGN0bHItPm5yX2Nt ZHMpCisJCXFkZXB0aF9tYXggPSBjdGxyLT5ucl9jbWRzOworCisJY3Rsci0+ cWRlcHRoX21heCA9ICh1bnNpZ25lZClxZGVwdGhfbWF4OworCXJldHVybiBj b3VudDsKK30KKworc3RhdGljIHN0cnVjdCBkZXZpY2VfYXR0cmlidXRlIGNj aXNzX3F1ZXVlX2RlcHRoID0KKwkJX19BVFRSKHF1ZXVlX2RlcHRoLCBTX0lS VUdPIHwgU19JV1VTUiwKKwkJCSZjY2lzc19zaG93X3F1ZXVlX2RlcHRoLAor CQkJJmNjaXNzX3N0b3JlX3F1ZXVlX2RlcHRoKTsKKwogLyoKICAqICBUaGlz IGlzIGl0LiAgRmluZCBhbGwgdGhlIGNvbnRyb2xsZXJzIGFuZCByZWdpc3Rl ciB0aGVtLiAgSSByZWFsbHkgaGF0ZQogICogIHN0ZWFsaW5nIGFsbCB0aGVz ZSBtYWpvciBkZXZpY2UgbnVtYmVycy4KQEAgLTM0NTAsNiArMzQ5MCwxMSBA QCBzdGF0aWMgaW50IF9fZGV2aW5pdCBjY2lzc19pbml0X29uZShzdHJ1Y3Qg cGNpX2RldiAqcGRldiwKIAkgICAgICAgKChoYmFbaV0tPm5yX2NtZHMgKyBC SVRTX1BFUl9MT05HIC0KIAkJIDEpIC8gQklUU19QRVJfTE9ORykgKiBzaXpl b2YodW5zaWduZWQgbG9uZykpOwogCisJLyogU2V0dXAgcXVldWVfZGVwdGgg c3lzZnMgZW50cnkgKi8KKwlyYyA9IGRldmljZV9jcmVhdGVfZmlsZSgmcGRl di0+ZGV2LCAmY2Npc3NfcXVldWVfZGVwdGgpOworCWlmIChyYykKKwkJZ290 byBjbGVhbjQ7CisKICNpZmRlZiBDQ0lTU19ERUJVRwogCXByaW50ayhLRVJO X0RFQlVHICJTY2FubmluZyBmb3IgZHJpdmVzIG9uIGNvbnRyb2xsZXIgY2Np c3MlZFxuIiwgaSk7CiAjZW5kaWYJCQkJLyogQ0NJU1NfREVCVUcgKi8KZGlm ZiAtLWdpdCBhL2RyaXZlcnMvYmxvY2svY2Npc3MuaCBiL2RyaXZlcnMvYmxv Y2svY2Npc3MuaAppbmRleCBiNzA5ODhkLi42YTRhMzhhIDEwMDY0NAotLS0g YS9kcml2ZXJzL2Jsb2NrL2NjaXNzLmgKKysrIGIvZHJpdmVycy9ibG9jay9j Y2lzcy5oCkBAIC02MCw2ICs2MCw3IEBAIHN0cnVjdCBjdGxyX2luZm8KIAl2 b2lkIF9faW9tZW0gKnZhZGRyOwogCXVuc2lnbmVkIGxvbmcgcGFkZHI7CiAJ aW50IAlucl9jbWRzOyAvKiBOdW1iZXIgb2YgY29tbWFuZHMgYWxsb3dlZCBv biB0aGlzIGNvbnRyb2xsZXIgKi8KKwl1bnNpZ25lZCBxZGVwdGhfbWF4OyAg LyogdXNlcnNwYWNlIHF1ZXVlIGRlcHRoIGxpbWl0ICovCiAJQ2ZnVGFibGVf c3RydWN0IF9faW9tZW0gKmNmZ3RhYmxlOwogCWludAlpbnRlcnJ1cHRzX2Vu YWJsZWQ7CiAJaW50CW1ham9yOwo= --------------040209080705080100020407 Content-Type: text/plain; name="cciss_qdepth-2.6.27.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="cciss_qdepth-2.6.27.patch" ZGlmZiAtLWdpdCBhL2RyaXZlcnMvYmxvY2svY2Npc3MuYyBiL2RyaXZlcnMv YmxvY2svY2Npc3MuYwppbmRleCBiNzMxMTZlLi4wNjY1NzdmIDEwMDY0NAot LS0gYS9kcml2ZXJzL2Jsb2NrL2NjaXNzLmMKKysrIGIvZHJpdmVycy9ibG9j ay9jY2lzcy5jCkBAIC00ODAsNyArNDgwLDcgQEAgc3RhdGljIENvbW1hbmRM aXN0X3N0cnVjdCAqY21kX2FsbG9jKGN0bHJfaW5mb190ICpoLCBpbnQgZ2V0 X2Zyb21fcG9vbCkKIAogCQlkbyB7CiAJCQlpID0gZmluZF9maXJzdF96ZXJv X2JpdChoLT5jbWRfcG9vbF9iaXRzLCBoLT5ucl9jbWRzKTsKLQkJCWlmIChp ID09IGgtPm5yX2NtZHMpCisJCQlpZiAoaSA+PSBoLT5xZGVwdGhfbWF4KQog CQkJCXJldHVybiBOVUxMOwogCQl9IHdoaWxlICh0ZXN0X2FuZF9zZXRfYml0 CiAJCQkgKGkgJiAoQklUU19QRVJfTE9ORyAtIDEpLApAQCAtMTI1OSw3ICsx MjU5LDcgQEAgc3RhdGljIHZvaWQgY2Npc3NfY2hlY2tfcXVldWVzKGN0bHJf aW5mb190ICpoKQogCSAqIGluIGNhc2UgdGhlIGludGVycnVwdCB3ZSBzZXJ2 aWNlZCB3YXMgZnJvbSBhbiBpb2N0bCBhbmQgZGlkIG5vdAogCSAqIGZyZWUg YW55IG5ldyBjb21tYW5kcy4KIAkgKi8KLQlpZiAoKGZpbmRfZmlyc3RfemVy b19iaXQoaC0+Y21kX3Bvb2xfYml0cywgaC0+bnJfY21kcykpID09IGgtPm5y X2NtZHMpCisJaWYgKChmaW5kX2ZpcnN0X3plcm9fYml0KGgtPmNtZF9wb29s X2JpdHMsIGgtPm5yX2NtZHMpKSA+PSBoLT5xZGVwdGhfbWF4KQogCQlyZXR1 cm47CiAKIAkvKiBXZSBoYXZlIHJvb20gb24gdGhlIHF1ZXVlIGZvciBtb3Jl IGNvbW1hbmRzLiAgTm93IHdlIG5lZWQgdG8gcXVldWUKQEAgLTEyNzgsNyAr MTI3OCw3IEBAIHN0YXRpYyB2b2lkIGNjaXNzX2NoZWNrX3F1ZXVlcyhjdGxy X2luZm9fdCAqaCkKIAkJLyogY2hlY2sgdG8gc2VlIGlmIHdlIGhhdmUgbWF4 ZWQgb3V0IHRoZSBudW1iZXIgb2YgY29tbWFuZHMKIAkJICogdGhhdCBjYW4g YmUgcGxhY2VkIG9uIHRoZSBxdWV1ZS4KIAkJICovCi0JCWlmICgoZmluZF9m aXJzdF96ZXJvX2JpdChoLT5jbWRfcG9vbF9iaXRzLCBoLT5ucl9jbWRzKSkg PT0gaC0+bnJfY21kcykgeworCQlpZiAoKGZpbmRfZmlyc3RfemVyb19iaXQo aC0+Y21kX3Bvb2xfYml0cywgaC0+bnJfY21kcykpID49IGgtPnFkZXB0aF9t YXgpIHsKIAkJCWlmIChjdXJyX3F1ZXVlID09IHN0YXJ0X3F1ZXVlKSB7CiAJ CQkJaC0+bmV4dF90b19ydW4gPQogCQkJCSAgICAoc3RhcnRfcXVldWUgKyAx KSAlIChoLT5oaWdoZXN0X2x1biArIDEpOwpAQCAtMzI1Myw2ICszMjUzLDcg QEAgc3RhdGljIGludCBfX2RldmluaXQgY2Npc3NfcGNpX2luaXQoY3Rscl9p bmZvX3QgKmMsIHN0cnVjdCBwY2lfZGV2ICpwZGV2KQogCQkJYy0+cHJvZHVj dF9uYW1lID0gcHJvZHVjdHNbaV0ucHJvZHVjdF9uYW1lOwogCQkJYy0+YWNj ZXNzID0gKihwcm9kdWN0c1tpXS5hY2Nlc3MpOwogCQkJYy0+bnJfY21kcyA9 IGMtPm1heF9jb21tYW5kcyAtIDQ7CisJCQljLT5xZGVwdGhfbWF4ID0gYy0+ bnJfY21kczsKIAkJCWJyZWFrOwogCQl9CiAJfQpAQCAtMzI3Myw2ICszMjc0 LDcgQEAgc3RhdGljIGludCBfX2RldmluaXQgY2Npc3NfcGNpX2luaXQoY3Rs cl9pbmZvX3QgKmMsIHN0cnVjdCBwY2lfZGV2ICpwZGV2KQogCQkJYy0+cHJv ZHVjdF9uYW1lID0gcHJvZHVjdHNbaS0xXS5wcm9kdWN0X25hbWU7CiAJCQlj LT5hY2Nlc3MgPSAqKHByb2R1Y3RzW2ktMV0uYWNjZXNzKTsKIAkJCWMtPm5y X2NtZHMgPSBjLT5tYXhfY29tbWFuZHMgLSA0OworCQkJYy0+cWRlcHRoX21h eCA9IGMtPm5yX2NtZHM7CiAJCQlwcmludGsoS0VSTl9XQVJOSU5HICJjY2lz czogVGhpcyBpcyBhbiB1bmtub3duICIKIAkJCQkiU21hcnQgQXJyYXkgY29u dHJvbGxlci5cbiIKIAkJCQkiY2Npc3M6IFBsZWFzZSB1cGRhdGUgdG8gdGhl IGxhdGVzdCBkcml2ZXIgIgpAQCAtMzM5Miw2ICszMzk0LDQ0IEBAIHN0YXRp YyB2b2lkIGZyZWVfaGJhKGludCBpKQogCWtmcmVlKHApOwogfQogCitzdGF0 aWMgaW5saW5lIGN0bHJfaW5mb190ICpjY2lzc19nZXRfY3Rscl9pbmZvKHN0 cnVjdCBkZXZpY2UgKmRldikKK3sKKwlzdHJ1Y3QgcGNpX2RldiAqcGRldiA9 IGNvbnRhaW5lcl9vZihkZXYsIHN0cnVjdCBwY2lfZGV2LCBkZXYpOworCXJl dHVybiBwY2lfZ2V0X2RydmRhdGEocGRldik7Cit9CisKK3N0YXRpYyBzc2l6 ZV90IGNjaXNzX3Nob3dfcXVldWVfZGVwdGgoc3RydWN0IGRldmljZSAqZGV2 LAorCQlzdHJ1Y3QgZGV2aWNlX2F0dHJpYnV0ZSAqYXR0ciwgY2hhciAqYnVm KQoreworCWN0bHJfaW5mb190ICpjdGxyID0gY2Npc3NfZ2V0X2N0bHJfaW5m byhkZXYpOworCUJVR19PTighY3Rscik7CisKKwlyZXR1cm4gc3ByaW50Zihi dWYsICIldVxuIiwgY3Rsci0+cWRlcHRoX21heCk7Cit9CisKK3N0YXRpYyBz c2l6ZV90IGNjaXNzX3N0b3JlX3F1ZXVlX2RlcHRoKHN0cnVjdCBkZXZpY2Ug KmRldiwKKwkJc3RydWN0IGRldmljZV9hdHRyaWJ1dGUgKmF0dHIsIGNvbnN0 IGNoYXIgKmJ1Ziwgc2l6ZV90IGNvdW50KQoreworCWN0bHJfaW5mb190ICpj dGxyID0gY2Npc3NfZ2V0X2N0bHJfaW5mbyhkZXYpOworCXVuc2lnbmVkIGxv bmcgcWRlcHRoX21heDsKKworCUJVR19PTighY3Rscik7CisJcWRlcHRoX21h eCA9IHNpbXBsZV9zdHJ0b3VsKGJ1ZiwgTlVMTCwgMTApOworCisJaWYgKHFk ZXB0aF9tYXggPCAxKQorCQlxZGVwdGhfbWF4ID0gMTsKKwllbHNlIGlmIChx ZGVwdGhfbWF4ID4gY3Rsci0+bnJfY21kcykKKwkJcWRlcHRoX21heCA9IGN0 bHItPm5yX2NtZHM7CisKKwljdGxyLT5xZGVwdGhfbWF4ID0gKHVuc2lnbmVk KXFkZXB0aF9tYXg7CisJcmV0dXJuIGNvdW50OworfQorCitzdGF0aWMgc3Ry dWN0IGRldmljZV9hdHRyaWJ1dGUgY2Npc3NfcXVldWVfZGVwdGggPQorCQlf X0FUVFIocXVldWVfZGVwdGgsIFNfSVJVR08gfCBTX0lXVVNSLAorCQkJJmNj aXNzX3Nob3dfcXVldWVfZGVwdGgsCisJCQkmY2Npc3Nfc3RvcmVfcXVldWVf ZGVwdGgpOworCiAvKgogICogIFRoaXMgaXMgaXQuICBGaW5kIGFsbCB0aGUg Y29udHJvbGxlcnMgYW5kIHJlZ2lzdGVyIHRoZW0uICBJIHJlYWxseSBoYXRl CiAgKiAgc3RlYWxpbmcgYWxsIHRoZXNlIG1ham9yIGRldmljZSBudW1iZXJz LgpAQCAtMzQ5Niw2ICszNTM2LDExIEBAIHN0YXRpYyBpbnQgX19kZXZpbml0 IGNjaXNzX2luaXRfb25lKHN0cnVjdCBwY2lfZGV2ICpwZGV2LAogCSAgICAg ICAoKGhiYVtpXS0+bnJfY21kcyArIEJJVFNfUEVSX0xPTkcgLQogCQkgMSkg LyBCSVRTX1BFUl9MT05HKSAqIHNpemVvZih1bnNpZ25lZCBsb25nKSk7CiAK KwkvKiBTZXR1cCBxdWV1ZV9kZXB0aCBzeXNmcyBlbnRyeSAqLworCXJjID0g ZGV2aWNlX2NyZWF0ZV9maWxlKCZwZGV2LT5kZXYsICZjY2lzc19xdWV1ZV9k ZXB0aCk7CisJaWYgKHJjKQorCQlnb3RvIGNsZWFuNDsKKwogCWhiYVtpXS0+ bnVtX2x1bnMgPSAwOwogCWhiYVtpXS0+aGlnaGVzdF9sdW4gPSAtMTsKIAlm b3IgKGogPSAwOyBqIDwgQ0lTU19NQVhfTFVOOyBqKyspIHsKZGlmZiAtLWdp dCBhL2RyaXZlcnMvYmxvY2svY2Npc3MuaCBiL2RyaXZlcnMvYmxvY2svY2Np c3MuaAppbmRleCAyNGE3ZWZhLi45MWRjYWM2IDEwMDY0NAotLS0gYS9kcml2 ZXJzL2Jsb2NrL2NjaXNzLmgKKysrIGIvZHJpdmVycy9ibG9jay9jY2lzcy5o CkBAIC02Miw2ICs2Miw3IEBAIHN0cnVjdCBjdGxyX2luZm8KIAl2b2lkIF9f aW9tZW0gKnZhZGRyOwogCXVuc2lnbmVkIGxvbmcgcGFkZHI7CiAJaW50IAlu cl9jbWRzOyAvKiBOdW1iZXIgb2YgY29tbWFuZHMgYWxsb3dlZCBvbiB0aGlz IGNvbnRyb2xsZXIgKi8KKwl1bnNpZ25lZCBxZGVwdGhfbWF4OyAgLyogdXNl cnNwYWNlIHF1ZXVlIGRlcHRoIGxpbWl0ICovCiAJQ2ZnVGFibGVfc3RydWN0 IF9faW9tZW0gKmNmZ3RhYmxlOwogCWludAlpbnRlcnJ1cHRzX2VuYWJsZWQ7 CiAJaW50CW1ham9yOwo= --------------040209080705080100020407-- From owner-xfs@oss.sgi.com Thu Aug 21 01:24:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 01:24:20 -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,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7L8OGkW023839 for ; Thu, 21 Aug 2008 01:24:16 -0700 X-ASG-Debug-ID: 1219307135-6ca801860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7BC171A1E8D3 for ; Thu, 21 Aug 2008 01:25:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id fiD5QcvCjlu8oUDQ for ; Thu, 21 Aug 2008 01:25:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAK3ArEh5LD0w/2dsb2JhbAC1XoFm X-IronPort-AV: E=Sophos;i="4.32,244,1217773800"; d="scan'208";a="176319339" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Aug 2008 17:55:34 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KW5U4-00033t-VK; Thu, 21 Aug 2008 18:25:32 +1000 Date: Thu, 21 Aug 2008 18:25:32 +1000 From: Dave Chinner To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821082532.GE5706@disturbed> Mail-Followup-To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821060418.GC5706@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219307137 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.3278 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17653 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > On Thu, Aug 21, 2008 at 03:15:08PM +1000, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > Everything is default. > > > > > > % rpm -qf =mkfs.xfs > > > xfsprogs-2.9.8-7.1 > > > > > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is the > > > latest stable mkfs.xfs. Its output is > > > > > > meta-data=/dev/sda8 isize=256 agcount=4, agsize=1221440 blks > > > = sectsz=512 attr=2 > > > data = bsize=4096 blocks=4885760, imaxpct=25 > > > = sunit=0 swidth=0 blks > > > naming =version 2 bsize=4096 > > > log =internal log bsize=4096 blocks=2560, version=2 > > > = sectsz=512 sunit=0 blks, lazy-count=0 > > > realtime =none extsz=4096 blocks=0, rtextents=0 > > > > Ok, I thought it might be the tiny log, but it didn't improve anything > > here when increased the log size, or the log buffer size. > > One thing I just found out - my old *laptop* is 4-5x faster than the > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > if the long delays in dispatch is caused by an interaction with CTQ > but I can't change it on the cciss raid controllers. Are you using > ctq/ncq on your machine? If so, can you reduce the depth to > something less than 4 and see what difference that makes? Just to point out - this is not a new problem - I can reproduce it on 2.6.24 as well as 2.6.26. Likewise, my laptop shows XFS being faster than ext3 on both 2.6.24 and 2.6.26. So the difference is something related to the disk subsystem on the server.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 01:52:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 01:52:55 -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 m7L8qptR025753 for ; Thu, 21 Aug 2008 01:52:51 -0700 X-ASG-Debug-ID: 1219308850-14aa02ba0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 48BE43BA0CB for ; Thu, 21 Aug 2008 01:54:11 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id t6XEShzHaP7OquvJ for ; Thu, 21 Aug 2008 01:54:11 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALDHrEh5LD0w/2dsb2JhbAC1WoFm X-IronPort-AV: E=Sophos;i="4.32,244,1217773800"; d="scan'208";a="176333807" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Aug 2008 18:23:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KW5vC-0003gF-4h; Thu, 21 Aug 2008 18:53:34 +1000 Date: Thu, 21 Aug 2008 18:53:32 +1000 From: Dave Chinner To: Nick Piggin Cc: gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821085332.GG5706@disturbed> Mail-Followup-To: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <684252.68814.qm@web34508.mail.mud.yahoo.com> <20080821061443.GD5706@disturbed> <200808211700.39584.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808211700.39584.nickpiggin@yahoo.com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219308852 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.3280 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17654 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 05:00:39PM +1000, Nick Piggin wrote: > On Thursday 21 August 2008 16:14, Dave Chinner wrote: > > > I think that we need to issue explicit unplugs to get the log I/O > > dispatched the way we want on all elevators and stop trying to > > give elevators implicit hints by abusing the bio types and hoping > > they do the right thing.... > > FWIW, my explicit plugging idea is still hanging around in one of > Jens' block trees (actually he refreshed it a couple of months ago). > > It provides an API for VM or filesystems to plug and unplug > requests coming out of the current process, and it can reduce the > need to idle the queue. Needs more performance analysis and tuning > though. We've already got plenty of explicit unplugs in XFS to get stuff moving quickly - I'll just have to add another.... > But existing plugging is below the level of the elevators, and should > only kick in for at most tens of ms at queue idle events, so it sounds > like it may not be your problem. Elevators will need some hint to give > priority to specific requests -- either via the current threads's io > priority, or information attached to bios. It's getting too bloody complex, IMO. What is right for one elevator is wrong for another, so as a filesystem developer I have to pick one to target. With the way the elevators have been regressing, improving and changing behaviour, I am starting to think that I should be picking the noop scheduler. Any 'advanced' scheduler that is slower than the same test on the noop scheduler needs fixing... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 04:01:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 04:01:28 -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,J_CHICKENPOX_43 autolearn=no 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 m7LB1Nev032624 for ; Thu, 21 Aug 2008 04:01:24 -0700 X-ASG-Debug-ID: 1219316563-7ac401520000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7D7FF92166 for ; Thu, 21 Aug 2008 04:02:44 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id 8Llyq4mWlQTn9raf for ; Thu, 21 Aug 2008 04:02:44 -0700 (PDT) Received: from shambhala.lichtvoll.local (DSL01.83.171.151.249.ip-pool.NEFkom.net [83.171.151.249]) by mail.lichtvoll.de (Postfix) with ESMTP id 841DC5AE0D; Thu, 21 Aug 2008 13:02:42 +0200 (CEST) From: Martin Steigerwald To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Date: Thu, 21 Aug 2008 13:02:50 +0200 User-Agent: KMail/1.9.9 References: <20080820004326.519405a2.akpm@linux-foundation.org> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> (sfid-20080821_113328_880260_8C88CA66) In-Reply-To: <20080821082532.GE5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808211302.51633.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1219316564 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.3287 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17655 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Donnerstag 21 August 2008 schrieb Dave Chinner: > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 03:15:08PM +1000, Dave Chinner wrote: > > > On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > > > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > > Everything is default. > > > > > > > > % rpm -qf =mkfs.xfs > > > > xfsprogs-2.9.8-7.1 > > > > > > > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is > > > > the latest stable mkfs.xfs. Its output is > > > > > > > > meta-data=/dev/sda8 isize=256 agcount=4, > > > > agsize=1221440 blks = sectsz=512 attr=2 > > > > data = bsize=4096 blocks=4885760, > > > > imaxpct=25 = sunit=0 swidth=0 blks > > > > naming =version 2 bsize=4096 > > > > log =internal log bsize=4096 blocks=2560, > > > > version=2 = sectsz=512 sunit=0 blks, > > > > lazy-count=0 realtime =none extsz=4096 > > > > blocks=0, rtextents=0 > > > > > > Ok, I thought it might be the tiny log, but it didn't improve > > > anything here when increased the log size, or the log buffer size. > > > > One thing I just found out - my old *laptop* is 4-5x faster than the > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > if the long delays in dispatch is caused by an interaction with CTQ > > but I can't change it on the cciss raid controllers. Are you using > > ctq/ncq on your machine? If so, can you reduce the depth to > > something less than 4 and see what difference that makes? > > Just to point out - this is not a new problem - I can reproduce > it on 2.6.24 as well as 2.6.26. Likewise, my laptop shows XFS > being faster than ext3 on both 2.6.24 and 2.6.26. So the difference > is something related to the disk subsystem on the server.... Interesting. I switched from cfq to deadline some time ago, due to abysmal XFS performance on parallel IO - aptitude upgrade and doing desktop stuff. Just my subjective perception, but I have seen it crawl, even stall for 5-10 seconds easily at times. I found deadline to be way faster initially, but then it rarely happened that IO for desktop tasks is basically stalled for even longer, say 15 seconds or more, on parallel IO. However I can't remember having this problem with the last kernel 2.6.26.2. I am now testing with cfq again. On a ThinkPad T42 internal 160 GB harddisk with barriers enabled. But you tell, it only happens on certain servers, so I might have seen something different. Thus I had the rough feeling that something is wrong with at least CFQ and XFS together, but I couldn't prove it back then. I have no idea how to easily do a reproducable test case. Maybe having a script that unpacks kernel source archives while I try to use the desktop... -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Thu Aug 21 04:04:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 04:04:07 -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=BAYES_00,J_CHICKENPOX_43 autolearn=no 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 m7LB428s000575 for ; Thu, 21 Aug 2008 04:04:04 -0700 X-ASG-Debug-ID: 1219316723-2de401100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web32606.mail.mud.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 2E6513BA71F for ; Thu, 21 Aug 2008 04:05:23 -0700 (PDT) Received: from web32606.mail.mud.yahoo.com (web32606.mail.mud.yahoo.com [68.142.207.233]) by cuda.sgi.com with SMTP id B2p9cZn5gq3AVKEE for ; Thu, 21 Aug 2008 04:05:23 -0700 (PDT) Received: (qmail 51343 invoked by uid 60001); 21 Aug 2008 11:05:23 -0000 X-YMail-OSG: qetMBQEVM1lk4mM2hvvjt.H5l1qV92z60H59hMYWaKUZRPSYRrkO2f4_Y4Efh1cRkg-- Received: from [91.12.110.126] by web32606.mail.mud.yahoo.com via HTTP; Thu, 21 Aug 2008 04:05:21 PDT X-RocketYMMF: knobi.rm X-Mailer: YahooMailRC/1042.48 YahooMailWebService/0.7.218.2 Date: Thu, 21 Aug 2008 04:05:21 -0700 (PDT) From: Martin Knoblauch X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) To: Dave Chinner , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <293210.50030.qm@web32606.mail.mud.yahoo.com> X-Barracuda-Connect: web32606.mail.mud.yahoo.com[68.142.207.233] X-Barracuda-Start-Time: 1219316724 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.3288 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17656 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: knobi@knobisoft.de Precedence: bulk X-list: xfs ----- Original Message ---- > From: Dave Chinner > To: Szabolcs Szakacsits ; Andrew Morton ; linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; xfs@oss.sgi.com > Sent: Thursday, August 21, 2008 10:25:32 AM > Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) > > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 03:15:08PM +1000, Dave Chinner wrote: > > > On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > > > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > > Everything is default. > > > > > > > > % rpm -qf =mkfs.xfs > > > > xfsprogs-2.9.8-7.1 > > > > > > > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is the > > > > latest stable mkfs.xfs. Its output is > > > > > > > > meta-data=/dev/sda8 isize=256 agcount=4, agsize=1221440 > blks > > > > = sectsz=512 attr=2 > > > > data = bsize=4096 blocks=4885760, imaxpct=25 > > > > = sunit=0 swidth=0 blks > > > > naming =version 2 bsize=4096 > > > > log =internal log bsize=4096 blocks=2560, version=2 > > > > = sectsz=512 sunit=0 blks, lazy-count=0 > > > > realtime =none extsz=4096 blocks=0, rtextents=0 > > > > > > Ok, I thought it might be the tiny log, but it didn't improve anything > > > here when increased the log size, or the log buffer size. > > > > One thing I just found out - my old *laptop* is 4-5x faster than the > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > if the long delays in dispatch is caused by an interaction with CTQ > > but I can't change it on the cciss raid controllers. Are you using > > ctq/ncq on your machine? If so, can you reduce the depth to > > something less than 4 and see what difference that makes? > > Just to point out - this is not a new problem - I can reproduce > it on 2.6.24 as well as 2.6.26. Likewise, my laptop shows XFS > being faster than ext3 on both 2.6.24 and 2.6.26. So the difference > is something related to the disk subsystem on the server.... > Hi Dave, just curious - which CCISS controller and and what kind of disk configuration are you using. Cheers Martin From owner-xfs@oss.sgi.com Thu Aug 21 04:52:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 04:52:05 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7LBq06H008208 for ; Thu, 21 Aug 2008 04:52:01 -0700 X-ASG-Debug-ID: 1219319601-1b5001020000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.parisc-linux.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 164DC1A1F5C3 for ; Thu, 21 Aug 2008 04:53:21 -0700 (PDT) Received: from mail.parisc-linux.org (palinux.external.hp.com [192.25.206.14]) by cuda.sgi.com with ESMTP id pXIeVyabms5p6uo0 for ; Thu, 21 Aug 2008 04:53:21 -0700 (PDT) Received: by mail.parisc-linux.org (Postfix, from userid 26919) id B34DC494005; Thu, 21 Aug 2008 05:53:10 -0600 (MDT) Date: Thu, 21 Aug 2008 05:53:10 -0600 From: Matthew Wilcox To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821115310.GP8318@parisc-linux.org> References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821060418.GC5706@disturbed> User-Agent: Mutt/1.5.13 (2006-08-11) X-Barracuda-Connect: palinux.external.hp.com[192.25.206.14] X-Barracuda-Start-Time: 1219319602 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.3292 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17657 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: matthew@wil.cx Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > One thing I just found out - my old *laptop* is 4-5x faster than the > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > if the long delays in dispatch is caused by an interaction with CTQ > but I can't change it on the cciss raid controllers. Are you using > ctq/ncq on your machine? If so, can you reduce the depth to > something less than 4 and see what difference that makes? I don't think that's going to make a difference when using CFQ. I did some tests that showed that CFQ would never issue more than one IO at a time to a drive. This was using sixteen userspace threads, each doing a 4k direct I/O to the same location. When using noop, I would get 70k IOPS and when using CFQ I'd get around 40k IOPS. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." From owner-xfs@oss.sgi.com Thu Aug 21 07:54:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 07:54:29 -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.6 required=5.0 tests=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 m7LEsLHa018339 for ; Thu, 21 Aug 2008 07:54:21 -0700 X-ASG-Debug-ID: 1219330539-572d03300000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rgminet01.oracle.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E7FE3BBB8C for ; Thu, 21 Aug 2008 07:55:39 -0700 (PDT) Received: from rgminet01.oracle.com (rgminet01.oracle.com [148.87.113.118]) by cuda.sgi.com with ESMTP id WyBCY3dWbWOSR3nj for ; Thu, 21 Aug 2008 07:55:39 -0700 (PDT) Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m7LEsgvm026500; Thu, 21 Aug 2008 08:54:43 -0600 Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m7LEsEH0014937; Thu, 21 Aug 2008 08:54:14 -0600 Received: from inet-141-146-46-1.oracle.com by acsmt356.oracle.com with ESMTP id 11619062871219330369; Thu, 21 Aug 2008 07:52:49 -0700 Received: from [192.168.1.15] (/72.225.43.119) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Aug 2008 07:52:45 -0700 X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) From: Chris Mason To: Dave Chinner Cc: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com In-Reply-To: <20080821085332.GG5706@disturbed> References: <20080821051508.GB5706@disturbed> <684252.68814.qm@web34508.mail.mud.yahoo.com> <20080821061443.GD5706@disturbed> <200808211700.39584.nickpiggin@yahoo.com.au> <20080821085332.GG5706@disturbed> Content-Type: text/plain; charset=utf-8 Date: Thu, 21 Aug 2008 10:52:44 -0400 Message-Id: <1219330364.7854.68.camel@think.oraclecorp.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Barracuda-Connect: rgminet01.oracle.com[148.87.113.118] X-Barracuda-Start-Time: 1219330541 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.02, rules version 3.0.84541 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m7LEsLHa018341 X-archive-position: 17658 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chris.mason@oracle.com Precedence: bulk X-list: xfs On Thu, 2008-08-21 at 18:53 +1000, Dave Chinner wrote: > On Thu, Aug 21, 2008 at 05:00:39PM +1000, Nick Piggin wrote: > > On Thursday 21 August 2008 16:14, Dave Chinner wrote: > > > > > I think that we need to issue explicit unplugs to get the log I/O > > > dispatched the way we want on all elevators and stop trying to > > > give elevators implicit hints by abusing the bio types and hoping > > > they do the right thing.... > > > > FWIW, my explicit plugging idea is still hanging around in one of > > Jens' block trees (actually he refreshed it a couple of months ago). > > > > It provides an API for VM or filesystems to plug and unplug > > requests coming out of the current process, and it can reduce the > > need to idle the queue. Needs more performance analysis and tuning > > though. > > We've already got plenty of explicit unplugs in XFS to get stuff > moving quickly - I'll just have to add another.... > I did some compilebench runs with xfs this morning, creating 30 kernel trees on the same machine I posted btrfs and xfs numbers with last week. Btrfs gets between 60 and 75MB/s average depending on the mount options used, ext4 gets around 60MB/s This is a single sata drive that can run at 100MB/s streaming writes. The numbers show XFS is largely log bound, and that turning off barriers makes a huge difference. I'd be happy to try another run with explicit unplugging somewhere in the transaction commit path. I think the most relevant number is the count of MB written at the end of blkparse. I'm not sure why the 4ag XFS writes less, but the numbers do include calling sync at the end. None of the filesystems were doing barriers in these numbers: Ext4 9036MiB Btrfs metadata dup 9190MiB Btrfs metadata dup no inline files 10280MiB XFS 4ag, nobarrier 14299MiB XFS 1ag, nobarrier 17836MiB This is a long way of saying the xfs log isn't optimal for these kinds of operations, which isn't really news. I'm not ripping on xfs here, this is just one tiny benchmark. I uploaded some graphs of the IO here: http://oss.oracle.com/~mason/seekwatcher/compilebench-30/xfs XFS: *** 4ag, 128m log, logbsize=256k intial create total runs 30 avg 7.48 MB/s (user 0.52s sys 1.04s) *** 4ag, 128m log, logbsize=256k, nobarrier intial create total runs 30 avg 21.58 MB/s (user 0.51s sys 1.04s) http://oss.oracle.com/~mason/seekwatcher/compilebench-30/xfs/xfs-4ag-nobarrier.png *** 1ag, 128m log, logbsize=256k, nobarrier intial create total runs 30 avg 26.28 MB/s (user 0.50s sys 1.15s) http://oss.oracle.com/~mason/seekwatcher/compilebench-30/xfs/xfs-nobarrier-1ag.png It is hard to see in the graph, but it looks like the log is in the first 128MB of the drive. If we give XFS an external log device: *** 1ag 128m external log, logbsize=256k, nobarrier intial create total runs 30 avg 38.44 MB/s (user 0.51s sys 1.09s) This graph shows that log is running more or less seek free between 30-60MB/s for the whole run. I'd expect the explicit unplugging to help the most in this config? http://oss.oracle.com/~mason/seekwatcher/compilebench-30/xfs/xfs-external-log-disk.png Here is the main disk during the run: http://oss.oracle.com/~mason/seekwatcher/compilebench-30/xfs/xfs-external-log-main-disk.png *** 1ag 128m external log, logbsize=256k, nobarrier, deadline intial create total runs 30 avg 34.00 MB/s (user 0.51s sys 1.07s) Deadline didn't help on this box. -chris From owner-xfs@oss.sgi.com Thu Aug 21 07:59:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 07:59:12 -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,J_CHICKENPOX_28, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45 autolearn=no 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 m7LEx8KH018972 for ; Thu, 21 Aug 2008 07:59:09 -0700 X-ASG-Debug-ID: 1219330821-571203840000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 91AA03BBC7B; Thu, 21 Aug 2008 08:00:22 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id 3v24ZEhKKNjKBx2n; Thu, 21 Aug 2008 08:00:22 -0700 (PDT) Received: from shambhala.lichtvoll.local (DSL01.83.171.151.249.ip-pool.NEFkom.net [83.171.151.249]) by mail.lichtvoll.de (Postfix) with ESMTP id 92FF95AE0D; Thu, 21 Aug 2008 17:00:20 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Date: Thu, 21 Aug 2008 17:00:29 +0200 User-Agent: KMail/1.9.9 Cc: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080820004326.519405a2.akpm@linux-foundation.org> <20080821082532.GE5706@disturbed> <200808211302.51633.Martin@lichtvoll.de> (sfid-20080821_130438_618949_A1D25F54) In-Reply-To: <200808211302.51633.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_OMYrIFmVJEzwDPr" Message-Id: <200808211700.30380.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1219330823 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.02, rules version 3.0.84541 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17659 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs --Boundary-00=_OMYrIFmVJEzwDPr Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Am Donnerstag 21 August 2008 schrieb Martin Steigerwald: > Am Donnerstag 21 August 2008 schrieb Dave Chinner: > > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > > On Thu, Aug 21, 2008 at 03:15:08PM +1000, Dave Chinner wrote: > > > > On Thu, Aug 21, 2008 at 05:46:00AM +0300, Szabolcs Szakacsits wrote: > > > > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > > > Everything is default. > > > > > > > > > > % rpm -qf =mkfs.xfs > > > > > xfsprogs-2.9.8-7.1 > > > > > > > > > > which, according to ftp://oss.sgi.com/projects/xfs/cmd_tars, is > > > > > the latest stable mkfs.xfs. Its output is > > > > > > > > > > meta-data=/dev/sda8 isize=256 agcount=4, > > > > > agsize=1221440 blks = sectsz=512 attr=2 > > > > > data = bsize=4096 blocks=4885760, > > > > > imaxpct=25 = sunit=0 swidth=0 blks > > > > > naming =version 2 bsize=4096 > > > > > log =internal log bsize=4096 blocks=2560, > > > > > version=2 = sectsz=512 sunit=0 blks, > > > > > lazy-count=0 realtime =none extsz=4096 > > > > > blocks=0, rtextents=0 > > > > > > > > Ok, I thought it might be the tiny log, but it didn't improve > > > > anything here when increased the log size, or the log buffer > > > > size. > > > > > > One thing I just found out - my old *laptop* is 4-5x faster than > > > the 10krpm scsi disk behind an old cciss raid controller. I'm > > > wondering if the long delays in dispatch is caused by an > > > interaction with CTQ but I can't change it on the cciss raid > > > controllers. Are you using ctq/ncq on your machine? If so, can you > > > reduce the depth to something less than 4 and see what difference > > > that makes? > > > > Just to point out - this is not a new problem - I can reproduce > > it on 2.6.24 as well as 2.6.26. Likewise, my laptop shows XFS > > being faster than ext3 on both 2.6.24 and 2.6.26. So the difference > > is something related to the disk subsystem on the server.... > > Interesting. I switched from cfq to deadline some time ago, due to > abysmal XFS performance on parallel IO - aptitude upgrade and doing > desktop stuff. Just my subjective perception, but I have seen it crawl, > even stall for 5-10 seconds easily at times. I found deadline to be way > faster initially, but then it rarely happened that IO for desktop tasks > is basically stalled for even longer, say 15 seconds or more, on > parallel IO. However I can't remember having this problem with the last > kernel 2.6.26.2. > > I am now testing with cfq again. On a ThinkPad T42 internal 160 GB > harddisk with barriers enabled. But you tell, it only happens on > certain servers, so I might have seen something different. > > Thus I had the rough feeling that something is wrong with at least CFQ > and XFS together, but I couldn't prove it back then. I have no idea how > to easily do a reproducable test case. Maybe having a script that > unpacks kernel source archives while I try to use the desktop... Okay, some numbers attached: - On XFS: Barrier versus Nobarrier makes quite a difference with compilebench. Also on rm -rf'ing the large directory tree it leaves behind. While I did not measure the first barrier related compilebench directory deletion I am pretty sure it took way longer. Also vmstat throughput it higher without nobarriers. - On XFS: CFQ versus NOOP does not seem to make that much of a difference, at least not with barriers enabled (didn't test without). With NOOP responsiveness was even weaker than with CFQ. Opening a context menu on a webpage link displayed in Konqueror could take easily a minute or more. I think it shall never ever take that long for the OS to respond to user input. - Ext3, NILFS, BTRFS with CFQ: Perform quite well. Especially btrfs. nilfs text isn't complete, cause likely due to checkpoints those 4G I dedicated to it were not enough for the compilebench test to complete. So at least here performance degration with XFS seems more related to barriers than scheduler decision - least when it comes to the two choices CFQ and NOOP. But no, I won't switch barriers off permanently on my laptop. ;) Would be fine if performance impact of barriers could be reduced a bit tough. At last I appear to see something different than the I/O scheduler issue discussed here. Anyway subjectively I am quite happy with XFS performance nonetheless. But then since I can't switch from XFS to ext3 or btrfs in a second I can't really compare subjective impressions. Maybe desktop would respond faster with ext3 or btrfs? Who knows? I think a script which does extensive automated testing would be fine: - have some basic settings like SCRATCH_DEV=/dev/sda8 (this should be a real partition in order to be able to test barriers which do not work over LVM / device mapper) SCRATCH_MNT=/mnt/test - have an array of pre-pre-test setups like [ echo "cfq" >/sys/block/sda/queue/scheduler ] [ echo "deadline" >/sys/block/sda/queue/scheduler ] [ echo "anticipatory" >/sys/block/sda/queue/scheduler ] [ echo "noop" >/sys/block/sda/queue/scheduler ] - have an array of pre-test setups like [ mkfs.xfs -f $SCRATCH_DEV mount $SCRATCH_DEV $SCRATCH_MNT ] [ mkfs.xfs -f $SCRATCH_DEV mount -o nobarrier $SCRATCH_DEV $SCRATCH_MNT ] [ mkfs.xfs -f $SCRATCH_DEV mount -o logbsize=256k $SCRATCH_DEV $SCRATCH_MNT ] [ mkfs.btrfs $SCRATCH_DEV mount $SCRATCH_DEV $SCRATCH_MNT ] - have an array of tests like [ ./compilebench -D /mnt/zeit-btrfs -i 5 -r 10 ] [ postmark whatever ] [ iozone whatever ] - and let it run every combination of those array elements unattended (over night;-) - have any results collected with settings for each patch and basic machine info in one easy to share text file - then as additional feature let it test responsiveness during each running test. Let it makes sure there are some files that are not in the cache and let it access one of those files once in a while and measure how long it takes the filesystem to respond Ciao, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 --Boundary-00=_OMYrIFmVJEzwDPr Content-Type: text/plain; charset="iso 8859-15"; name="filesystem-benchmarks-compilebench-2008-08-21.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="filesystem-benchmarks-compilebench-2008-08-21.txt" martin@shambhala:~> date Do 21. Aug 13:27:49 CEST 2008 shambhala:~> cat /proc/version Linux version 2.6.26.2-tp42-toi-3.0-rc7a-xfs-ticket-patch (martin@shambala) (gcc version 4.3.1 (Debian 4.3.1-8) ) #1 PREEMPT Wed Aug 13 10:10:11 CEST 2008 shambhala:~> apt-show-versions | egrep "(btrfs|nilfs)" btrfs-modules-2.6.26.2-tp42-toi-3.0-rc7a-xfs-ticket-patch 0.15-1+1 installed: No available version in archive btrfs-source/lenny uptodate 0.15-1 btrfs-tools/lenny uptodate 0.15-2 nilfs2-modules-2.6.26.2-tp42-toi-3.0-rc7a-xfs-ticket-patch 2.0.4-1+1 installed: No available version in archive nilfs2-source/sid uptodate 2.0.4-1 nilfs2-tools/lenny uptodate 2.0.5-1 shambhala:~> cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 13 model name : Intel(R) Pentium(R) M processor 1.80GHz stepping : 6 cpu MHz : 600.000 cache size : 2048 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe bts est tm2 bogomips : 1197.54 clflush size : 64 power management: martin@shambhala:~> cat /proc/mounts | tail -4 /dev/mapper/shambala-ext3 /mnt/zeit-ext3 ext3 rw,errors=continue,data=ordered 0 0 /dev/mapper/shambala-nilfs /mnt/zeit-nilfs2 nilfs2 rw 0 0 /dev/mapper/shambala-btrfs /mnt/zeit-btrfs btrfs rw 0 0 /dev/mapper/shambala-xfs /mnt/zeit-xfs xfs rw,attr2,nobarrier,logbufs=8,logbsize=256k,noquota 0 0 martin@shambhala:~> df -hT | tail -8 /dev/mapper/shambala-ext3 ext3 4,0G 137M 3,7G 4% /mnt/zeit-ext3 /dev/mapper/shambala-nilfs nilfs2 4,0G 16M 3,8G 1% /mnt/zeit-nilfs2 /dev/mapper/shambala-btrfs btrfs 4,0G 40K 4,0G 1% /mnt/zeit-btrfs /dev/mapper/shambala-xfs xfs 4,0G 4,2M 4,0G 1% /mnt/zeit-xfs shambhala:~> xfs_info /mnt/zeit-xfs meta-data=/dev/mapper/shambala-xfs isize=256 agcount=4, agsize=262144 blks = sectsz=512 attr=2 data = bsize=4096 blocks=1048576, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 martin@shambhala:~> cat /sys/block/sda/queue/scheduler noop anticipatory deadline [cfq] XFS without barriers, since device mapper doesn't support barrier requests (http://bugzilla.kernel.org/show_bug.cgi?id=9554): shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /mnt/zeit-xfs -i 5 -r 10 using working directory /mnt/zeit-xfs, 5 intial dirs 10 runs native unpatched native-0 222MB in 25.88 seconds (8.59 MB/s) native patched native-0 109MB in 5.82 seconds (18.84 MB/s) native patched compiled native-0 691MB in 33.69 seconds (20.53 MB/s) create dir kernel-0 222MB in 20.38 seconds (10.91 MB/s) create dir kernel-1 222MB in 27.27 seconds (8.15 MB/s) create dir kernel-2 222MB in 26.69 seconds (8.33 MB/s) create dir kernel-3 222MB in 25.17 seconds (8.83 MB/s) create dir kernel-4 222MB in 29.52 seconds (7.53 MB/s) patch dir kernel-2 109MB in 38.54 seconds (2.85 MB/s) compile dir kernel-2 691MB in 41.60 seconds (16.62 MB/s) compile dir kernel-4 680MB in 49.46 seconds (13.76 MB/s) patch dir kernel-4 691MB in 118.19 seconds (5.85 MB/s) read dir kernel-4 in 77.09 11.89 MB/s read dir kernel-3 in 30.91 7.19 MB/s create dir kernel-3116 222MB in 42.73 seconds (5.20 MB/s) clean kernel-4 691MB in 6.48 seconds (106.73 MB/s) read dir kernel-1 in 32.08 6.93 MB/s stat dir kernel-0 in 6.94 seconds run complete: ======================================================================== == intial create total runs 5 avg 8.75 MB/s (user 2.05s sys 3.72s) create total runs 1 avg 5.20 MB/s (user 2.40s sys 5.34s) patch total runs 2 avg 4.35 MB/s (user 0.83s sys 3.93s) compile total runs 2 avg 15.19 MB/s (user 0.56s sys 2.90s) clean total runs 1 avg 106.73 MB/s (user 0.07s sys 0.40s) read tree total runs 2 avg 7.06 MB/s (user 1.93s sys 3.94s) read compiled tree total runs 1 avg 11.89 MB/s (user 2.29s sys 6.22s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 6.94 seconds (user 1.13s sys 0.94s) no runs for stat compiled tree With barriers on an already heavily populated filesystem - I don't have an empty one on a raw partition at hand at the moment and I for sure won't empty this one: martin@shambhala:~> df -hT | grep /home /dev/sda5 xfs 112G 104G 8,2G 93% /home shambhala:~> df -hiT | grep /home /dev/sda5 xfs 34M 751K 33M 3% /home shambhala:~> xfs_db -rx /dev/sda5 xfs_db> frag actual 726986, ideal 703687, fragmentation factor 3.20% xfs_db> quit shambhala:~> martin@shambhala:~> cat /proc/mounts | grep "/home " /dev/sda5 /home xfs rw,relatime,attr2,logbufs=8,logbsize=256k,noquota 0 0 shambhala:~> xfs_info /home meta-data=/dev/sda5 isize=256 agcount=6, agsize=4883256 blks = sectsz=512 attr=2 data = bsize=4096 blocks=29299536, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /home/martin/Zeit/compilebench -i 5 -r 10 using working directory /home/martin/Zeit/compilebench, 5 intial dirs 10 runs native unpatched native-0 222MB in 117.37 seconds (1.89 MB/s) native patched native-0 109MB in 27.46 seconds (3.99 MB/s) native patched compiled native-0 691MB in 48.03 seconds (14.40 MB/s) create dir kernel-0 222MB in 83.55 seconds (2.66 MB/s) create dir kernel-1 222MB in 86.01 seconds (2.59 MB/s) create dir kernel-2 222MB in 71.61 seconds (3.11 MB/s) create dir kernel-3 222MB in 71.73 seconds (3.10 MB/s) create dir kernel-4 222MB in 61.61 seconds (3.61 MB/s) patch dir kernel-2 109MB in 63.14 seconds (1.74 MB/s) compile dir kernel-2 691MB in 45.61 seconds (15.16 MB/s) compile dir kernel-4 680MB in 50.13 seconds (13.58 MB/s) patch dir kernel-4 691MB in 154.38 seconds (4.48 MB/s) read dir kernel-4 in 95.04 9.65 MB/s read dir kernel-3 in 49.49 4.49 MB/s create dir kernel-3116 222MB in 79.44 seconds (2.80 MB/s) clean kernel-4 691MB in 8.64 seconds (80.05 MB/s) read dir kernel-1 in 71.40 3.11 MB/s stat dir kernel-0 in 14.44 seconds run complete: ======================================================================== == intial create total runs 5 avg 3.01 MB/s (user 2.34s sys 4.30s) create total runs 1 avg 2.80 MB/s (user 2.36s sys 4.12s) patch total runs 2 avg 3.11 MB/s (user 0.91s sys 4.07s) compile total runs 2 avg 14.37 MB/s (user 0.60s sys 2.76s) clean total runs 1 avg 80.05 MB/s (user 0.09s sys 0.45s) read tree total runs 2 avg 3.80 MB/s (user 2.00s sys 4.05s) read compiled tree total runs 1 avg 9.65 MB/s (user 2.36s sys 6.42s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 14.44 seconds (user 1.17s sys 1.07s) no runs for stat compiled tree shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> rm -rf /home/martin/Zeit/compilebench I didn't measure it, but it took *ages* while rm -rf was mostly in D state. According to harddisk noise a lot of seeks where involved. vmstat 1 during the rm -rf: 0 0 2784 748048 20 247160 0 0 160 4628 352 1224 15 14 71 0 0 0 2784 748056 20 247308 0 0 148 3848 298 442 11 10 79 0 0 0 2784 747996 20 247428 0 0 120 3377 260 449 9 9 82 0 0 0 2784 747764 20 247580 0 0 152 4364 324 1094 20 10 70 0 1 0 2784 747452 20 247736 0 0 156 4356 279 814 15 11 74 0 0 0 2784 747408 20 247900 0 0 164 4112 360 1131 13 13 74 0 0 0 2784 747136 20 248064 0 0 164 5128 318 855 16 10 74 0 0 0 2784 746780 20 248208 0 0 144 4353 305 1066 20 12 68 0 0 0 2784 746204 20 248336 0 0 128 5388 275 966 14 11 75 0 1 0 2784 748352 20 248468 0 0 132 5384 314 1234 22 11 67 0 0 0 2784 748104 20 248604 0 0 136 4873 284 807 16 11 73 0 Same game on same productively used partition, but now without barriers: shambhala:~> mount -o remount,nobarrier /home shambhala:~> cat /proc/mounts | grep "/home " /dev/sda5 /home xfs rw,relatime,attr2,nobarrier,logbufs=8,logbsize=256k,noquota 0 0 shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> mkdir /home/martin/Zeit/compilebench shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /home/martin/Zeit/compilebench -i 5 -r 10 using working directory /home/martin/Zeit/compilebench, 5 intial dirs 10 runs native unpatched native-0 222MB in 51.44 seconds (4.32 MB/s) native patched native-0 109MB in 12.69 seconds (8.64 MB/s) native patched compiled native-0 691MB in 51.75 seconds (13.36 MB/s) create dir kernel-0 222MB in 47.64 seconds (4.67 MB/s) create dir kernel-1 222MB in 53.40 seconds (4.16 MB/s) create dir kernel-2 222MB in 48.04 seconds (4.63 MB/s) create dir kernel-3 222MB in 38.26 seconds (5.81 MB/s) create dir kernel-4 222MB in 34.15 seconds (6.51 MB/s) patch dir kernel-2 109MB in 50.61 seconds (2.17 MB/s) compile dir kernel-2 691MB in 37.94 seconds (18.23 MB/s) compile dir kernel-4 680MB in 45.32 seconds (15.02 MB/s) patch dir kernel-4 691MB in 107.27 seconds (6.45 MB/s) read dir kernel-4 in 82.18 11.16 MB/s read dir kernel-3 in 42.35 5.25 MB/s create dir kernel-3116 222MB in 38.27 seconds (5.81 MB/s) clean kernel-4 691MB in 5.92 seconds (116.82 MB/s) read dir kernel-1 in 73.63 3.02 MB/s stat dir kernel-0 in 13.77 seconds run complete: ======================================================================== == intial create total runs 5 avg 5.16 MB/s (user 2.21s sys 4.23s) create total runs 1 avg 5.81 MB/s (user 2.18s sys 4.89s) patch total runs 2 avg 4.31 MB/s (user 0.90s sys 4.05s) compile total runs 2 avg 16.62 MB/s (user 0.59s sys 3.05s) clean total runs 1 avg 116.82 MB/s (user 0.09s sys 0.41s) read tree total runs 2 avg 4.14 MB/s (user 1.90s sys 4.02s) read compiled tree total runs 1 avg 11.16 MB/s (user 2.28s sys 6.36s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 13.77 seconds (user 1.19s sys 1.01s) no runs for stat compiled tree Not as fast as on the clean XFS LV, but still almost everytime almost twice as fast as with barriers. shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> time rm -rf /home/martin/Zeit/compilebench rm -rf /home/martin/Zeit/compilebench 0,32s user 19,19s system 15% cpu 2:09,79 total This is definately faster than before. I didn't measure exact time on first occasion, but it took ages. vmstat 1 during the rm -rf indicated much higher metadata throughput: 3 0 2780 827696 20 162492 0 0 280 11109 449 865 31 15 52 2 0 0 2780 827304 20 162816 0 0 324 6656 468 1009 57 8 7 28 2 0 2636 828992 20 163364 0 0 540 5317 350 545 30 10 30 31 2 1 2636 837488 20 164020 0 0 656 7691 394 650 39 12 0 49 0 0 2224 960360 20 164516 0 0 496 12060 420 549 13 26 56 5 0 0 2224 959988 20 164904 0 0 388 13704 425 792 16 23 61 0 0 0 2224 959864 20 165128 0 0 224 6209 363 503 12 10 78 0 1 0 2224 959376 20 165540 0 0 412 14886 392 513 12 22 66 0 Now with barriers again, but with "noop" as scheduler: shambhala:~> mount -o remount,barrier /home shambhala:~> cat /proc/mounts | grep /home /dev/sda5 /home xfs rw,relatime,attr2,logbufs=8,logbsize=256k,noquota 0 0 shambhala:~> echo "noop" >/sys/block/sda/queue/scheduler shambhala:~> cat /sys/block/sda/queue/scheduler [noop] anticipatory deadline cfq shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> mkdir /home/martin/Zeit/compilebench shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /home/martin/Zeit/compilebench -i 5 -r 10 using working directory /home/martin/Zeit/compilebench, 5 intial dirs 10 runs native unpatched native-0 222MB in 97.42 seconds (2.28 MB/s) native patched native-0 109MB in 20.72 seconds (5.29 MB/s) native patched compiled native-0 691MB in 46.37 seconds (14.91 MB/s) create dir kernel-0 222MB in 84.12 seconds (2.64 MB/s) create dir kernel-1 222MB in 95.18 seconds (2.34 MB/s) create dir kernel-2 222MB in 74.57 seconds (2.98 MB/s) create dir kernel-3 222MB in 71.81 seconds (3.10 MB/s) create dir kernel-4 222MB in 64.77 seconds (3.43 MB/s) patch dir kernel-2 109MB in 81.22 seconds (1.35 MB/s) compile dir kernel-2 691MB in 41.87 seconds (16.52 MB/s) compile dir kernel-4 680MB in 50.35 seconds (13.52 MB/s) patch dir kernel-4 691MB in 151.03 seconds (4.58 MB/s) read dir kernel-4 in 82.83 11.07 MB/s read dir kernel-3 in 48.49 4.59 MB/s create dir kernel-3116 222MB in 79.43 seconds (2.80 MB/s) clean kernel-4 691MB in 15.51 seconds (44.59 MB/s) read dir kernel-1 in 75.36 2.95 MB/s stat dir kernel-0 in 14.65 seconds run complete: ======================================================================== == intial create total runs 5 avg 2.90 MB/s (user 2.35s sys 4.56s) create total runs 1 avg 2.80 MB/s (user 2.18s sys 3.92s) patch total runs 2 avg 2.96 MB/s (user 0.87s sys 4.07s) compile total runs 2 avg 15.02 MB/s (user 0.60s sys 2.73s) clean total runs 1 avg 44.59 MB/s (user 0.07s sys 0.44s) read tree total runs 2 avg 3.77 MB/s (user 2.03s sys 3.82s) read compiled tree total runs 1 avg 11.07 MB/s (user 2.29s sys 6.24s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 14.65 seconds (user 1.12s sys 1.00s) no runs for stat compiled tree Some tests run a bit faster, but on cost of responsiveness to out of line I/Os (opening a new webpage in Konqueror). Some do not run faster at all. Seems that write barriers on/off make the bigger difference here. As last XFS thing: vmstat 1 during a rm -rf while switching of XFS from nobarrier to barrier: 0 0 1976 422236 1784 516840 0 0 508 17160 410 540 7 23 70 0 1 0 1976 420624 1784 517576 0 0 736 26904 539 1032 14 35 51 0 0 0 1976 419176 1784 518152 0 0 576 23842 486 1060 17 33 50 0 0 0 1976 418316 1784 518460 0 0 308 12812 317 552 6 18 76 0 2 0 1976 417392 1784 518776 0 0 316 16689 360 882 2 23 75 0 8 0 1976 432948 1784 519252 0 0 476 16710 452 630 8 39 53 0 0 0 1976 432892 1784 519392 0 0 140 4146 371 1564 14 26 60 0 0 0 1976 432628 1784 519572 0 0 180 3844 340 660 11 10 79 0 0 0 1976 432496 1784 519736 0 0 164 3852 328 534 9 8 83 0 0 0 1976 432372 1784 519920 0 0 176 4100 359 788 19 11 70 0 Its obvious, where it was switched to barrier ;) Now the other filesystems with CFQ enabled. Ext3: shambhala:~> echo "cfq" >/sys/block/sda/queue/scheduler shambhala:~> cat /sys/block/sda/queue/scheduler noop anticipatory deadline [cfq] shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /mnt/zeit-ext3 -i 5 -r 10 using working directory /mnt/zeit-ext3, 5 intial dirs 10 runs native unpatched native-0 222MB in 16.90 seconds (13.16 MB/s) native patched native-0 109MB in 4.63 seconds (23.69 MB/s) native patched compiled native-0 691MB in 39.78 seconds (17.39 MB/s) create dir kernel-0 222MB in 12.24 seconds (18.17 MB/s) create dir kernel-1 222MB in 16.71 seconds (13.31 MB/s) create dir kernel-2 222MB in 18.50 seconds (12.02 MB/s) create dir kernel-3 222MB in 18.25 seconds (12.18 MB/s) create dir kernel-4 222MB in 27.24 seconds (8.16 MB/s) patch dir kernel-2 109MB in 29.26 seconds (3.75 MB/s) compile dir kernel-2 691MB in 53.41 seconds (12.95 MB/s) compile dir kernel-4 680MB in 55.24 seconds (12.32 MB/s) patch dir kernel-4 691MB in 108.66 seconds (6.36 MB/s) read dir kernel-4 in 79.38 11.55 MB/s read dir kernel-3 in 21.65 10.27 MB/s create dir kernel-3116 222MB in 28.22 seconds (7.88 MB/s) clean kernel-4 691MB in 17.05 seconds (40.56 MB/s) read dir kernel-1 in 23.67 9.39 MB/s stat dir kernel-0 in 9.63 seconds run complete: ======================================================================== == intial create total runs 5 avg 12.77 MB/s (user 1.96s sys 3.24s) create total runs 1 avg 7.88 MB/s (user 1.57s sys 2.39s) patch total runs 2 avg 5.06 MB/s (user 0.78s sys 3.92s) compile total runs 2 avg 12.64 MB/s (user 0.54s sys 3.75s) clean total runs 1 avg 40.56 MB/s (user 0.08s sys 0.36s) read tree total runs 2 avg 9.83 MB/s (user 1.82s sys 4.32s) read compiled tree total runs 1 avg 11.55 MB/s (user 2.32s sys 7.02s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 9.63 seconds (user 1.11s sys 0.89s) no runs for stat compiled tree nilfs2: shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /mnt/zeit-nilfs2 -i 5 -r 10 using working directory /mnt/zeit-nilfs2, 5 intial dirs 10 runs native unpatched native-0 222MB in 20.28 seconds (10.97 MB/s) native patched native-0 109MB in 8.83 seconds (12.42 MB/s) native patched compiled native-0 691MB in 42.44 seconds (16.30 MB/s) create dir kernel-0 222MB in 20.89 seconds (10.65 MB/s) create dir kernel-1 222MB in 21.13 seconds (10.52 MB/s) create dir kernel-2 222MB in 20.22 seconds (11.00 MB/s) create dir kernel-3 222MB in 21.60 seconds (10.30 MB/s) create dir kernel-4 222MB in 20.63 seconds (10.78 MB/s) patch dir kernel-2 109MB in 20.97 seconds (5.23 MB/s) compile dir kernel-2 691MB in 44.40 seconds (15.58 MB/s) Traceback (most recent call last): File "./compilebench", line 631, in total_runs += func(dset, rnd) File "./compilebench", line 368, in compile_one_dir mbs = run_directory(ch[0], dir, "compile dir") File "./compilebench", line 241, in run_directory fp.write(buf[:cur]) IOError: [Errno 28] No space left on device Okay, possibly due to those 11 checkpoints it stored. Seems I would need more than 4 GB for the test to complete. But enough testing for today ;). btrfs 0.15: shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /mnt/zeit-btrfs -i 5 -r 10 using working directory /mnt/zeit-btrfs, 5 intial dirs 10 runs native unpatched native-0 222MB in 13.61 seconds (16.34 MB/s) native patched native-0 109MB in 3.12 seconds (35.15 MB/s) native patched compiled native-0 691MB in 28.84 seconds (23.98 MB/s) create dir kernel-0 222MB in 10.99 seconds (20.23 MB/s) create dir kernel-1 222MB in 13.95 seconds (15.94 MB/s) create dir kernel-2 222MB in 14.99 seconds (14.83 MB/s) create dir kernel-3 222MB in 15.00 seconds (14.82 MB/s) create dir kernel-4 222MB in 16.16 seconds (13.76 MB/s) patch dir kernel-2 109MB in 30.09 seconds (3.64 MB/s) compile dir kernel-2 691MB in 58.05 seconds (11.91 MB/s) compile dir kernel-4 680MB in 55.23 seconds (12.32 MB/s) patch dir kernel-4 691MB in 134.20 seconds (5.15 MB/s) read dir kernel-4 in 108.58 8.44 MB/s read dir kernel-3 in 43.47 5.12 MB/s create dir kernel-3116 222MB in 27.81 seconds (8.00 MB/s) clean kernel-4 691MB in 17.63 seconds (39.23 MB/s) read dir kernel-1 in 70.31 3.16 MB/s stat dir kernel-0 in 32.85 seconds run complete: ======================================================================== == intial create total runs 5 avg 15.92 MB/s (user 1.06s sys 5.43s) create total runs 1 avg 8.00 MB/s (user 1.17s sys 7.41s) patch total runs 2 avg 4.40 MB/s (user 0.88s sys 10.55s) compile total runs 2 avg 12.12 MB/s (user 0.56s sys 5.34s) clean total runs 1 avg 39.23 MB/s (user 0.05s sys 2.30s) read tree total runs 2 avg 4.14 MB/s (user 1.85s sys 10.00s) read compiled tree total runs 1 avg 8.44 MB/s (user 2.19s sys 16.50s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 32.85 seconds (user 1.01s sys 3.35s) no runs for stat compiled tree --Boundary-00=_OMYrIFmVJEzwDPr-- From owner-xfs@oss.sgi.com Thu Aug 21 08:55:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 08:55:19 -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 m7LFtDt5027548 for ; Thu, 21 Aug 2008 08:55:13 -0700 X-ASG-Debug-ID: 1219334193-2c5c024d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D3E0D3BBF42 for ; Thu, 21 Aug 2008 08:56:33 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id edXGClifseeyIhb1 for ; Thu, 21 Aug 2008 08:56:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEACAqrUh5LD0w/2dsb2JhbAC2JYFm X-IronPort-AV: E=Sophos;i="4.32,246,1217773800"; d="scan'208";a="176601402" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Aug 2008 01:26:31 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KWCWU-0004x4-10; Fri, 22 Aug 2008 01:56:30 +1000 Date: Fri, 22 Aug 2008 01:56:29 +1000 From: Dave Chinner To: Matthew Wilcox Cc: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821155629.GH5706@disturbed> Mail-Followup-To: Matthew Wilcox , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821115310.GP8318@parisc-linux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821115310.GP8318@parisc-linux.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219334194 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.3308 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17660 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 05:53:10AM -0600, Matthew Wilcox wrote: > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > One thing I just found out - my old *laptop* is 4-5x faster than the > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > if the long delays in dispatch is caused by an interaction with CTQ > > but I can't change it on the cciss raid controllers. Are you using > > ctq/ncq on your machine? If so, can you reduce the depth to > > something less than 4 and see what difference that makes? > > I don't think that's going to make a difference when using CFQ. I did > some tests that showed that CFQ would never issue more than one IO at a > time to a drive. This was using sixteen userspace threads, each doing a > 4k direct I/O to the same location. When using noop, I would get 70k > IOPS and when using CFQ I'd get around 40k IOPS. Not obviously the same sort of issue. The traces clearly show multiple nested dispatches and completions so CTQ is definitely active... Anyway, after a teeth-pulling equivalent exercise of finding the latest firmware for the machine in a format I could apply, I upgraded the firmware throughout the machine (disks, raid controller, system, etc) and XFS is a *lot* faster. In fact - mostly back to +/- a small amount compared to ext3. run complete: ========================================================================== avg MB/s user sys runs xfs ext3 xfs ext3 xfs ext3 intial create total 30 6.36 6.29 4.48 3.79 7.03 5.22 create total 7 5.20 5.68 4.47 3.69 7.34 5.23 patch total 6 4.53 5.87 2.26 1.96 6.27 4.86 compile total 9 16.46 9.61 1.74 1.72 9.02 9.74 clean total 4 478.50 553.22 0.09 0.06 0.92 0.70 read tree total 2 13.07 15.62 2.39 2.19 3.68 3.44 read compiled tree 1 53.94 60.91 2.57 2.71 7.35 7.27 delete tree total 3 15.94s 6.82s 1.38 1.06 4.10 1.49 delete compiled tree 1 24.07s 8.70s 1.58 1.18 5.56 2.30 stat tree total 5 3.30s 3.22s 1.09 1.07 0.61 0.53 stat compiled tree total 3 2.93s 3.85s 1.17 1.22 0.59 0.55 The blocktrace looks very regular, too. All the big bursts of dispatch and completion are gone as are the latencies on log I/Os. It would appear that ext3 is not sensitive to concurrent I/O latency like XFS is... At this point, I'm still interested to know if the original results were had ctq/ncq enabled and if it is whether it is introducing latencies are not. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 08:58:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 08:58:09 -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,J_CHICKENPOX_14 autolearn=no 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 m7LFw65h028013 for ; Thu, 21 Aug 2008 08:58:06 -0700 X-ASG-Debug-ID: 1219334367-35c101f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 38B933BBFCC for ; Thu, 21 Aug 2008 08:59:27 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Iyfd4XvKWcYAy1zq for ; Thu, 21 Aug 2008 08:59:27 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKMtrUh5LD0w/2dsb2JhbAC2MYFm X-IronPort-AV: E=Sophos;i="4.32,246,1217773800"; d="scan'208";a="176604568" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Aug 2008 01:29:26 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KWCZJ-00050q-BZ; Fri, 22 Aug 2008 01:59:25 +1000 Date: Fri, 22 Aug 2008 01:59:25 +1000 From: Dave Chinner To: Martin Knoblauch Cc: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821155925.GI5706@disturbed> Mail-Followup-To: Martin Knoblauch , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <293210.50030.qm@web32606.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <293210.50030.qm@web32606.mail.mud.yahoo.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219334368 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.3308 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8061/Wed Aug 20 17:00:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17661 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 04:05:21AM -0700, Martin Knoblauch wrote: > just curious - which CCISS controller and and what kind of disk configuration are you using. Smart Array 5300, using a single 36GB 10krpm U3SCSI disk. Looks like most of the problems were caused by the firmware, and are not driver related. An upgrade to a newer (2002!) firmware appears to have fixed the worst of the problems. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 10:07:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 10:07:40 -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 m7LH7bMt000550 for ; Thu, 21 Aug 2008 10:07:37 -0700 X-ASG-Debug-ID: 1219338537-4b8f02d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C06383BCC33 for ; Thu, 21 Aug 2008 10:08:57 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id p5eEGFCfGOWcPYkb for ; Thu, 21 Aug 2008 10:08:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMw7rUh5LD0w/2dsb2JhbAC2Y4Fm X-IronPort-AV: E=Sophos;i="4.32,246,1217773800"; d="scan'208";a="176645432" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Aug 2008 02:38:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KWDeY-0006WS-TO; Fri, 22 Aug 2008 03:08:54 +1000 Date: Fri, 22 Aug 2008 03:08:54 +1000 From: Dave Chinner To: Nick Piggin Cc: gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080821170854.GJ5706@disturbed> Mail-Followup-To: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <200808211700.39584.nickpiggin@yahoo.com.au> <20080821085332.GG5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200808211933.34565.nickpiggin@yahoo.com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219338538 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.3312 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8068/Thu Aug 21 08:50:39 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17663 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 07:33:34PM +1000, Nick Piggin wrote: > > > But existing plugging is below the level of the elevators, and should > > > only kick in for at most tens of ms at queue idle events, so it sounds > > > like it may not be your problem. Elevators will need some hint to give > > > priority to specific requests -- either via the current threads's io > > > priority, or information attached to bios. > > > > It's getting too bloody complex, IMO. What is right for one elevator > > is wrong for another, so as a filesystem developer I have to pick > > one to target. > > I don't really see it as too complex. If you know how you want the > request to be handled, then it should be possible to implement. That is the problem in a nutshell. Nobody can keep up with all the shiny new stuff that is being implemented,let alone the subtle behavioural differences that accumulate through such change... > > With the way the elevators have been regressing, > > improving and changing behaviour, > > AFAIK deadline, AS, and noop haven't significantly changed for years. Yet they've regularly shown performance regressions because other stuff has been changing around them, right? > > I am starting to think that I > > should be picking the noop scheduler. > > Any 'advanced' scheduler that > > is slower than the same test on the noop scheduler needs fixing... > > I disagree. On devices with no seek penalty or their own queueing, > noop is often the best choice. Same for specialized apps that do > their own disk scheduling. A filesystem is nothing but a complex disk scheduler that has to handle vastly larger queues than an elevator. Іf the filesystem doesn't get it's disk scheduling right, then the elevator is irrelevant because nothing will fix the I/O problems in the filesystem algorithms..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 10:06:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 10:06:22 -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.6 required=5.0 tests=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 m7LH6Hoh032755 for ; Thu, 21 Aug 2008 10:06:17 -0700 X-ASG-Debug-ID: 1219338456-2e1e00180000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from emh03.mail.saunalahti.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3A8103BCC03 for ; Thu, 21 Aug 2008 10:07:37 -0700 (PDT) Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) by cuda.sgi.com with ESMTP id AQV4zSItXDYh2ye8 for ; Thu, 21 Aug 2008 10:07:37 -0700 (PDT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh03-2.mail.saunalahti.fi (Postfix) with SMTP id 8C894EC5E8; Thu, 21 Aug 2008 20:07:35 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A0693E6D969; Thu, 21 Aug 2008 20:07:35 +0300 Received: from dhcppc2 (a91-153-142-188.elisa-laajakaista.fi [91.153.142.188]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 9C45CE5214; Thu, 21 Aug 2008 20:07:28 +0300 (EEST) Date: Thu, 21 Aug 2008 20:10:08 +0300 (MET DST) From: Szabolcs Szakacsits X-X-Sender: szaka@dhcppc2 To: Dave Chinner cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: <20080821082532.GE5706@disturbed> Message-ID: References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Antivirus: VAMS X-Barracuda-Connect: emh03.mail.saunalahti.fi[62.142.5.109] X-Barracuda-Start-Time: 1219338458 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.3312 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8068/Thu Aug 21 08:50:39 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17662 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: szaka@ntfs-3g.org Precedence: bulk X-list: xfs On Thu, 21 Aug 2008, Dave Chinner wrote: > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > > > One thing I just found out - my old *laptop* is 4-5x faster than the > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > if the long delays in dispatch is caused by an interaction with CTQ > > but I can't change it on the cciss raid controllers. Are you using > > ctq/ncq on your machine? It's a laptop and has NCQ. It makes no difference if NCQ is enabled or disabled. The problem seems to be XFS only. > > If so, can you reduce the depth to something less than 4 and see what > > difference that makes? > > Just to point out - this is not a new problem - I can reproduce > it on 2.6.24 as well as 2.6.26. Likewise, my laptop shows XFS > being faster than ext3 on both 2.6.24 and 2.6.26. So the difference > is something related to the disk subsystem on the server.... XFS definitely stalls somewhere: stats show virtually no CPU usage and no time spent waiting for IO. No file system produces similar output. procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 3146180 7848 600868 0 0 0 4128 790 549 0 2 98 0 0 0 0 3145200 7848 601524 0 0 0 2372 766 516 0 2 98 0 1 0 0 3144328 7848 602260 0 0 0 2924 792 542 1 2 98 0 0 1 0 3143824 7856 602664 0 0 0 4116 732 426 0 2 53 45 1 0 0 3143068 7856 603136 0 0 0 4676 756 534 0 3 95 1 0 0 0 3142652 7856 603540 0 0 0 6577 756 436 0 0 100 0 0 0 0 3141952 7856 604100 0 0 0 5840 764 498 1 3 96 0 0 0 0 3141424 7856 604544 0 0 0 4752 761 386 0 0 99 0 0 0 0 3140860 7856 604916 0 0 0 6477 785 495 0 1 98 0 0 0 0 3139980 7856 605468 0 0 0 2840 743 370 1 2 97 0 0 0 0 3138464 7856 606884 0 0 0 4902 795 421 0 4 96 0 0 0 0 3137636 7856 607696 0 0 0 4364 739 395 0 1 99 0 0 0 0 3136520 7856 608220 0 0 0 6160 774 566 0 2 97 0 Szaka -- NTFS-3G: http://ntfs-3g.org From owner-xfs@oss.sgi.com Thu Aug 21 10:23:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 10:24:00 -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=3.3 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_31,J_CHICKENPOX_43,J_CHICKENPOX_54 autolearn=no 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 m7LHNuNf001758 for ; Thu, 21 Aug 2008 10:23:56 -0700 X-ASG-Debug-ID: 1219339516-4c2b00260000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail-gx0-f28.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8ED4B3BCA1C for ; Thu, 21 Aug 2008 10:25:17 -0700 (PDT) Received: from mail-gx0-f28.google.com (mail-gx0-f28.google.com [209.85.217.28]) by cuda.sgi.com with ESMTP id 3L5QbpDHcNZ4DbVK for ; Thu, 21 Aug 2008 10:25:17 -0700 (PDT) Received: by gxk9 with SMTP id 9so205239gxk.20 for ; Thu, 21 Aug 2008 10:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=ts7vZfwSyL+ELg8Mzc2fVBPImfm4p23Ox/Mnda/HvRs=; b=vCnxYf5YZcAVm3yMvqwKMhtY182UzN0q7G8qKLHFd9QMRg1TIiiOCiZzKqupD/ANCR evgX4wB0KIByBOC+llaGoEzC4SfViZNds5sW7froFp3O7o7Yq7bwyaI53k+Xjuc34xSm JGmQcDZq/jEcCk/bUQWNz5Po8gHNXP92UNYTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=M2XbmfcQsObKLSNiJU9FUJg5VpW1IZ+srD9m7gBpZpvJswls15+2WJkybbSFxQHawh mV3Ie2DdtejztxbnBodRzsZ8MiTQn61YXdbUs4k1E/+FSyNQ+9Z4eA9wiOaG9v8QhElH QCG2hsyUTgBtGk5rtcNDnl9DvIGyMkNj/oQUA= Received: by 10.150.137.8 with SMTP id k8mr155283ybd.79.1219339513675; Thu, 21 Aug 2008 10:25:13 -0700 (PDT) Received: by 10.150.149.11 with HTTP; Thu, 21 Aug 2008 10:25:13 -0700 (PDT) Message-ID: <8719a1ee0808211025k577dfc9bj6100b38229d16ee7@mail.gmail.com> Date: Thu, 21 Aug 2008 19:25:13 +0200 From: "silvia diarra" To: silvia_4love@yahoo.com X-ASG-Orig-Subj: HI Subject: HI MIME-Version: 1.0 X-Barracuda-Connect: mail-gx0-f28.google.com[209.85.217.28] X-Barracuda-Start-Time: 1219339517 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4998 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3313 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/8068/Thu Aug 21 08:50:39 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 546 X-archive-position: 17664 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: silvia.diarra8@gmail.com Precedence: bulk X-list: xfs Dearest Love, My name is miss silvia i saw your profile today and became interested in you,i will also like to know you the more,and i want you to send a mail to my email address so that i can give you my picture for you to know whom l am.Here is my email address ( silvia_4love@yahoo.com ) I believe we can move from here.I am waiting for your mail to my email address above.miss silvia.(Remeber the distance or colour does not matter but love matters alot in life) Best Wishes, Waiting your Lovely Reply [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 21 10:29:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 10:30:02 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7LHTwvw002380 for ; Thu, 21 Aug 2008 10:29:59 -0700 X-ASG-Debug-ID: 1219339877-7add00760000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from emh01.mail.saunalahti.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 69DE71A20C91 for ; Thu, 21 Aug 2008 10:31:17 -0700 (PDT) Received: from emh01.mail.saunalahti.fi (emh01.mail.saunalahti.fi [62.142.5.107]) by cuda.sgi.com with ESMTP id N8Y6JDXyySqF4ECJ for ; Thu, 21 Aug 2008 10:31:17 -0700 (PDT) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh01-2.mail.saunalahti.fi (Postfix) with SMTP id 8AFBB1AE8D; Thu, 21 Aug 2008 20:31:16 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A020AB87479; Thu, 21 Aug 2008 20:31:16 +0300 Received: from dhcppc2 (a91-153-142-188.elisa-laajakaista.fi [91.153.142.188]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 297A9E5212; Thu, 21 Aug 2008 20:31:10 +0300 (EEST) Date: Thu, 21 Aug 2008 20:33:50 +0300 (MET DST) From: Szabolcs Szakacsits X-X-Sender: szaka@dhcppc2 To: Dave Chinner cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: Message-ID: References: <20080820004326.519405a2.akpm@linux-foundation.org> <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Antivirus: VAMS X-Barracuda-Connect: emh01.mail.saunalahti.fi[62.142.5.107] X-Barracuda-Start-Time: 1219339879 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.3314 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8068/Thu Aug 21 08:50:39 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17665 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: szaka@ntfs-3g.org Precedence: bulk X-list: xfs On Thu, 21 Aug 2008, Szabolcs Szakacsits wrote: > On Thu, 21 Aug 2008, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > > > > > One thing I just found out - my old *laptop* is 4-5x faster than the > > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > > if the long delays in dispatch is caused by an interaction with CTQ > > > but I can't change it on the cciss raid controllers. Are you using > > > ctq/ncq on your machine? > > It's a laptop and has NCQ. It makes no difference if NCQ is enabled or > disabled. The problem seems to be XFS only. The 'nobarrier' mount option made a big improvement: MB/s Runtime (s) ----- ----------- btrfs unstable 17.09 572 ext3 13.24 877 btrfs 0.16 12.33 793 nilfs2 2nd+ runs 11.29 674 ntfs-3g 8.55 865 reiserfs 8.38 966 xfs nobarrier 7.89 949 nilfs2 1st run 4.95 3800 xfs 1.88 3901 Szaka -- NTFS-3G: http://ntfs-3g.org From owner-xfs@oss.sgi.com Thu Aug 21 11:21:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 11:21:36 -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=0.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PSBL autolearn=no 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 m7LILWZ8006259 for ; Thu, 21 Aug 2008 11:21:33 -0700 X-ASG-Debug-ID: 1219342971-3fa902cd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ogre.sisk.pl (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E5B7F9BFEE for ; Thu, 21 Aug 2008 11:22:52 -0700 (PDT) Received: from ogre.sisk.pl (ogre.sisk.pl [217.79.144.158]) by cuda.sgi.com with ESMTP id PzrJNlCcEfo7ldgl for ; Thu, 21 Aug 2008 11:22:52 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 53BEAF205C; Thu, 21 Aug 2008 18:52:45 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07168-09; Thu, 21 Aug 2008 18:52:37 +0200 (CEST) Received: from [192.168.100.100] (86-68-N1.aster.pl [85.222.86.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 52F0EF1F99; Thu, 21 Aug 2008 18:52:37 +0200 (CEST) From: "Rafael J. Wysocki" To: David Greaves X-ASG-Orig-Subj: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. Subject: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. Date: Thu, 21 Aug 2008 20:26:16 +0200 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) Cc: "'linux-kernel@vger.kernel.org'" , xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, Dave Chinner , Andrew Morton References: <48AD3921.5090709@dgreaves.com> In-Reply-To: <48AD3921.5090709@dgreaves.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808212026.17590.rjw@sisk.pl> X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux X-Barracuda-Connect: ogre.sisk.pl[217.79.144.158] X-Barracuda-Start-Time: 1219342973 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3317 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Status: Clean X-archive-position: 17666 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: rjw@sisk.pl Precedence: bulk X-list: xfs [Adding CCs] [The issue is probably present in 2.6.26 too] On Thursday, 21 of August 2008, David Greaves wrote: > I have a desktop system that has started having problems booting up in the morning. > > It appears to just happen on more recent kernels. > I was having unrelated CDROM problems with a driver in an old kernel and decided > to test 2.6.27-rcX > The CDROM problem is fine now. > > However I started having problems on -rc1. I found that the machine was hanging > soon after booting and needed a reboot. After a reboot it would work fine for > the rest of the day. > When -rc3 came out I tried that and the problem still appears to be there. > > The normal process is now to boot to single-user, ctrl-alt-sysreq-SUB and then > reboot to multi-user. This isn't ideal. > > > If I cold boot 2.6.25.3 the problem doesn't occur. > I will try different versions over the next few days. > > Sample log from a few days back. (2.6.27-rc1 I think) > > The problem does cause filesystem crashes so I'm cautious about messing around > unguided. > > Happy to try any suggestions. > > David > PS I've run memtest and it's fine. > > > Aug 12 09:49:10 (none) syslogd 1.5.0#5: restart. > Aug 12 09:49:10 (none) kernel: klogd 1.5.0#5, log source = /proc/kmsg started. > Aug 12 09:49:10 (none) kernel: ddr 00:04:e2:cd:ac:db > Aug 12 09:49:10 (none) kernel: via-rhine.c:v1.10-LK1.4.3 2007-03-06 Written by > Donald Becker > Aug 12 09:49:10 (none) kernel: via-rhine 0000:00:12.0: PCI INT A -> GSI 23 > (level, low) -> IRQ 23 > Aug 12 09:49:10 (none) kernel: eth1: VIA Rhine II at 0xdd000000, > 00:11:2f:cd:d0:b6, IRQ 23. > Aug 12 09:49:10 (none) kernel: eth1: MII PHY found at address 1, status 0x7849 > advertising 01e1 Link 0000. > Aug 12 09:49:10 (none) kernel: netconsole: local port 6665 > Aug 12 09:49:10 (none) kernel: netconsole: local IP 10.0.0.74 > Aug 12 09:49:10 (none) kernel: netconsole: interface eth0 > Aug 12 09:49:10 (none) kernel: netconsole: remote port 6666 > Aug 12 09:49:10 (none) kernel: netconsole: remote IP 10.0.0.7 > Aug 12 09:49:10 (none) kernel: netconsole: remote ethernet address 00:13:20:55:b6:60 > Aug 12 09:49:10 (none) kernel: netconsole: device eth0 not up yet, forcing it > Aug 12 09:49:10 (none) kernel: skge eth0: enabling interface > Aug 12 09:49:10 (none) kernel: skge eth0: Link is up at 1000 Mbps, full duplex, > flow control both > Aug 12 09:49:10 (none) kernel: console [netcon0] enabled > Aug 12 09:49:10 (none) kernel: netconsole: network logging started > Aug 12 09:49:10 (none) kernel: Driver 'sd' needs updating - please use bus_type > methods > Aug 12 09:49:10 (none) kernel: Driver 'sr' needs updating - please use bus_type > methods > Aug 12 09:49:10 (none) kernel: sata_sil 0000:00:0a.0: version 2.3 > Aug 12 09:49:10 (none) kernel: sata_sil 0000:00:0a.0: PCI INT A -> GSI 16 > (level, low) -> IRQ 16 > Aug 12 09:49:10 (none) kernel: scsi0 : sata_sil > Aug 12 09:49:10 (none) kernel: scsi1 : sata_sil > Aug 12 09:49:10 (none) kernel: ata1: SATA max UDMA/100 mmio m512@0xde800000 tf > 0xde800080 irq 16 > Aug 12 09:49:10 (none) kernel: ata2: SATA max UDMA/100 mmio m512@0xde800000 tf > 0xde8000c0 irq 16 > Aug 12 09:49:10 (none) kernel: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl > 310) > Aug 12 09:49:10 (none) kernel: ata1.00: ATA-7: ST3320620AS, 3.AAJ, max UDMA/133 > Aug 12 09:49:10 (none) kernel: ata1.00: 625142448 sectors, multi 0: LBA48 NCQ > (depth 0/32) > Aug 12 09:49:10 (none) kernel: ata1.00: configured for UDMA/100 > Aug 12 09:49:10 (none) kernel: ata2: SATA link up 1.5 Gbps (SStatus 113 SControl > 310) > Aug 12 09:49:10 (none) kernel: ata2.00: ATA-7: ST3320620AS, 3.AAE, max UDMA/133 > Aug 12 09:49:10 (none) kernel: ata2.00: 625142448 sectors, multi 0: LBA48 NCQ > (depth 0/32) > Aug 12 09:49:10 (none) kernel: ata2.00: configured for UDMA/100 > Aug 12 09:49:10 (none) kernel: scsi 0:0:0:0: Direct-Access ATA > ST3320620AS 3.AA PQ: 0 ANSI: 5 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] 625142448 512-byte hardware > sectors (320073 MB) > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] 625142448 512-byte hardware > sectors (320073 MB) > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sda: sda1 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Attached SCSI disk > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0 > Aug 12 09:49:10 (none) kernel: scsi 1:0:0:0: Direct-Access ATA > ST3320620AS 3.AA PQ: 0 ANSI: 5 > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] 625142448 512-byte hardware > sectors (320073 MB) > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sda: sda1 > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: [sda] Attached SCSI disk > Aug 12 09:49:10 (none) kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0 > Aug 12 09:49:10 (none) kernel: scsi 1:0:0:0: Direct-Access ATA > ST3320620AS 3.AA PQ: 0 ANSI: 5 > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] 625142448 512-byte hardware > sectors (320073 MB) > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] 625142448 512-byte hardware > sectors (320073 MB) > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sdb: sdb1 sdb2 > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: [sdb] Attached SCSI disk > Aug 12 09:49:10 (none) kernel: sd 1:0:0:0: Attached scsi generic sg1 type 0 > Aug 12 09:49:10 (none) kernel: sata_via 0000:00:0f.0: version 2.3 > Aug 12 09:49:10 (none) kernel: sata_via 0000:00:0f.0: PCI INT B -> GSI 20 > (level, low) -> IRQ 20 > Aug 12 09:49:10 (none) kernel: sata_via 0000:00:0f.0: routed to hard irq line 0 > Aug 12 09:49:10 (none) kernel: scsi2 : sata_via > Aug 12 09:49:10 (none) kernel: scsi3 : sata_via > Aug 12 09:49:10 (none) kernel: ata3: SATA max UDMA/133 cmd 0x9800 ctl 0x9400 > bmdma 0x8400 irq 20 > Aug 12 09:49:10 (none) kernel: ata4: SATA max UDMA/133 cmd 0x9000 ctl 0x8800 > bmdma 0x8408 irq 20 > Aug 12 09:49:10 (none) kernel: ata3: SATA link up 1.5 Gbps (SStatus 113 SControl > 300) > Aug 12 09:49:10 (none) kernel: ata3.00: ATA-7: Maxtor 6L300S0, BANC1E00, max > UDMA/133 > Aug 12 09:49:10 (none) kernel: ata3.00: 586114704 sectors, multi 16: LBA48 NCQ > (not used) > Aug 12 09:49:10 (none) kernel: ata3.00: configured for UDMA/133 > Aug 12 09:49:10 (none) kernel: ata4: SATA link up 1.5 Gbps (SStatus 113 SControl > 300) > Aug 12 09:49:10 (none) kernel: ata4.00: ATA-7: ST3320620AS, 3.AAC, max UDMA/133 > Aug 12 09:49:10 (none) kernel: ata4.00: 625134827 sectors, multi 16: LBA48 NCQ > (depth 0/32) > Aug 12 09:49:10 (none) kernel: ata4.00: configured for UDMA/133 > Aug 12 09:49:10 (none) kernel: scsi 2:0:0:0: Direct-Access ATA Maxtor > 6L300S0 BANC PQ: 0 ANSI: 5 > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] 586114704 512-byte hardware > sectors (300091 MB) > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] 586114704 512-byte hardware > sectors (300091 MB) > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sdc: sdc1 sdc2 > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: [sdc] Attached SCSI disk > Aug 12 09:49:10 (none) kernel: sd 2:0:0:0: Attached scsi generic sg2 type 0 > Aug 12 09:49:10 (none) kernel: scsi 3:0:0:0: Direct-Access ATA > ST3320620AS 3.AA PQ: 0 ANSI: 5 > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] 625134827 512-byte hardware > sectors (320069 MB) > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] 625134827 512-byte hardware > sectors (320069 MB) > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Write Protect is off > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Write cache: enabled, read > cache: enabled, doesn't support DPO or FUA > Aug 12 09:49:10 (none) kernel: sdd: sdd1 sdd2 sdd3 > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: [sdd] Attached SCSI disk > Aug 12 09:49:10 (none) kernel: sd 3:0:0:0: Attached scsi generic sg3 type 0 > Aug 12 09:49:10 (none) kernel: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] > at 0x60,0x64 irq 1,12 > Aug 12 09:49:10 (none) kernel: serio: i8042 KBD port at 0x60,0x64 irq 1 > Aug 12 09:49:10 (none) kernel: serio: i8042 AUX port at 0x60,0x64 irq 12 > Aug 12 09:49:10 (none) kernel: mice: PS/2 mouse device common for all mice > Aug 12 09:49:10 (none) kernel: input: AT Translated Set 2 keyboard as > /class/input/input2 > Aug 12 09:49:10 (none) kernel: md: raid1 personality registered for level 1 > Aug 12 09:49:10 (none) kernel: raid6: int32x1 925 MB/s > Aug 12 09:49:10 (none) kernel: raid6: int32x2 972 MB/s > Aug 12 09:49:10 (none) kernel: raid6: int32x4 789 MB/s > Aug 12 09:49:10 (none) kernel: raid6: int32x8 636 MB/s > Aug 12 09:49:10 (none) kernel: raid6: mmxx1 1753 MB/s > Aug 12 09:49:10 (none) kernel: raid6: mmxx2 3128 MB/s > Aug 12 09:49:10 (none) kernel: raid6: sse1x1 1644 MB/s > Aug 12 09:49:10 (none) kernel: raid6: sse1x2 2781 MB/s > Aug 12 09:49:10 (none) kernel: raid6: using algorithm sse1x2 (2781 MB/s) > Aug 12 09:49:10 (none) kernel: md: raid6 personality registered for level 6 > Aug 12 09:49:10 (none) kernel: md: raid5 personality registered for level 5 > Aug 12 09:49:10 (none) kernel: md: raid4 personality registered for level 4 > Aug 12 09:49:10 (none) kernel: TCP cubic registered > Aug 12 09:49:10 (none) kernel: Using IPI Shortcut mode > Aug 12 09:49:10 (none) kernel: PM: Resume from partition /dev/sdd3 > Aug 12 09:49:10 (none) kernel: PM: Checking hibernation image. > Aug 12 09:49:10 (none) kernel: PM: Resume from disk failed. > Aug 12 09:49:10 (none) kernel: input: ImExPS/2 Generic Explorer Mouse as > /class/input/input3 > Aug 12 09:49:10 (none) kernel: md: Autodetecting RAID arrays. > Aug 12 09:49:10 (none) kernel: md: Scanned 2 and added 2 devices. > Aug 12 09:49:10 (none) kernel: md: autorun ... > Aug 12 09:49:10 (none) kernel: md: considering sdc2 ... > Aug 12 09:49:10 (none) kernel: md: adding sdc2 ... > Aug 12 09:49:10 (none) kernel: md: adding sdb2 ... > Aug 12 09:49:10 (none) kernel: md: created md0 > Aug 12 09:49:10 (none) kernel: md: bind > Aug 12 09:49:10 (none) kernel: md: bind > Aug 12 09:49:10 (none) kernel: md: running: > Aug 12 09:49:10 (none) kernel: raid1: raid set md0 active with 2 out of 2 mirrors > Aug 12 09:49:10 (none) kernel: md: ... autorun DONE. > Aug 12 09:49:10 (none) kernel: Filesystem "md0": Disabling barriers, not > supported by the underlying device > Aug 12 09:49:10 (none) kernel: XFS mounting filesystem md0 > Aug 12 09:49:10 (none) kernel: Ending clean XFS mount for filesystem: md0 > Aug 12 09:49:10 (none) kernel: VFS: Mounted root (xfs filesystem) readonly. > Aug 12 09:49:10 (none) kernel: Freeing unused kernel memory: 248k freed > Aug 12 09:49:10 (none) kernel: uname[892]: segfault at ffffffbf ip ffffffbf sp > bfb4b09c error 4 > Aug 12 09:49:10 (none) kernel: cat[894]: segfault at ffffffbf ip ffffffbf sp > bfb121ec error 4 > Aug 12 09:49:10 (none) kernel: uname[898]: segfault at ffffffbf ip ffffffbf sp > bfccc22c error 4 > Aug 12 09:49:10 (none) kernel: uname[903]: segfault at ffffffbf ip ffffffbf sp > bfb8a0ec error 4 > Aug 12 09:49:10 (none) kernel: uname[910]: segfault at ffffffbf ip ffffffbf sp > bfd7f2ec error 4 > Aug 12 09:49:10 (none) kernel: uname[922]: segfault at ffffffbf ip ffffffbf sp > bffbe51c error 4 > Aug 12 09:49:10 (none) kernel: uname[923]: segfault at ffffffbf ip ffffffbf sp > bf8dae3c error 4 > Aug 12 09:49:10 (none) kernel: uname[1004]: segfault at ffffffbf ip ffffffbf sp > bff2dc8c error 4 > Aug 12 09:49:10 (none) kernel: uname[1005]: segfault at ffffffbf ip ffffffbf sp > bfd86adc error 4 > Aug 12 09:49:10 (none) kernel: Adding 2048276k swap on /dev/sdd3. Priority:-1 > extents:1 across:2048276k > Aug 12 09:49:10 (none) kernel: Filesystem "md0": Disabling barriers, not > supported by the underlying device > Aug 12 09:49:10 (none) kernel: uname[1032]: segfault at ffffffbf ip ffffffbf sp > bffd453c error 4 > Aug 12 09:49:10 (none) kernel: device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) > initialised: dm-devel@redhat.com > Aug 12 09:49:10 (none) kernel: Filesystem "md0": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xc01f51fa > Aug 12 09:49:10 (none) kernel: Pid: 1113, comm: sh Not tainted 2.6.27-rc1 #10 > Aug 12 09:49:10 (none) kernel: [] ? xfs_cmn_err+0x34/0x60 > Aug 12 09:49:10 (none) kernel: [] xfs_error_report+0x4e/0x50 > Aug 12 09:49:10 (none) kernel: [] ? xfs_inobt_lookup+0xfa/0x3a0 > Aug 12 09:49:10 (none) kernel: [] xfs_btree_check_sblock+0x56/0xd0 From owner-xfs@oss.sgi.com Thu Aug 21 12:58:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 12:58:23 -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,J_CHICKENPOX_53 autolearn=no 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 m7LJwD9u017762 for ; Thu, 21 Aug 2008 12:58:13 -0700 X-ASG-Debug-ID: 1219348774-16d1037f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE493F9DDAF for ; Thu, 21 Aug 2008 12:59:34 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id KHFXnshXhkfp7qvy for ; Thu, 21 Aug 2008 12:59:34 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m7LJwh4V015419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Aug 2008 12:58:44 -0700 Received: from akpm.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m7LJwfhJ023137; Thu, 21 Aug 2008 12:58:42 -0700 Date: Thu, 21 Aug 2008 12:58:41 -0700 From: Andrew Morton To: Takashi Sato Cc: linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, hch@infradead.org, axboe@kernel.dk, mtk.manpages@googlemail.com, linux-kernel@vger.kernel.org X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature Message-Id: <20080821125841.a04a706f.akpm@linux-foundation.org> In-Reply-To: <20080818212819t-sato@mail.jp.nec.com> References: <20080818212819t-sato@mail.jp.nec.com> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1219348774 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3323 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17667 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Mon, 18 Aug 2008 21:28:19 +0900 Takashi Sato wrote: > The ioctls for the generic freeze feature are below. > o Freeze the filesystem > int ioctl(int fd, int FIFREEZE, arg) > fd: The file descriptor of the mountpoint > FIFREEZE: request code for the freeze > arg: Ignored > Return value: 0 if the operation succeeds. Otherwise, -1 > > o Unfreeze the filesystem > int ioctl(int fd, int FITHAW, arg) > fd: The file descriptor of the mountpoint > FITHAW: request code for unfreeze > arg: Ignored > Return value: 0 if the operation succeeds. Otherwise, -1 > > > ... > > --- linux-2.6.27-rc2.org/include/linux/fs.h 2008-08-06 13:49:54.000000000 +0900 > +++ linux-2.6.27-rc2-freeze/include/linux/fs.h 2008-08-07 08:59:54.000000000 +0900 > @@ -226,6 +226,8 @@ extern int dir_notify_enable; > #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ > #define FIBMAP _IO(0x00,1) /* bmap access */ > #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ > +#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ > +#define FITHAW _IOWR('X', 120, int) /* Thaw */ FIFREEZE is 119, but a few lines above we have #define BLKDISCARD _IO(0x12,119) Should we be using 120 and 121 here? > #define FS_IOC_GETFLAGS _IOR('f', 1, long) > #define FS_IOC_SETFLAGS _IOW('f', 2, long) > @@ -574,6 +576,10 @@ struct block_device { > * care to not mess up bd_private for that case. > */ > unsigned long bd_private; > + /* The counter of freeze processes */ > + int bd_freeze_count; > + /* Semaphore for freeze */ > + struct semaphore bd_freeze_sem; "freeze" is not an adequate description of what this protects. I think it's only the modification and testing of bd_freeze_count, isn't it? If so, all this could be done more neatly by removing the lock, switching to atomic_t and using our (rich) atomic_t operations. otoh, perhaps it protects more than this, in which case the lock can/should be switched to a `struct mutex'? From owner-xfs@oss.sgi.com Thu Aug 21 13:18:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 13:19:00 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_53 autolearn=no 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 m7LKIs6h019576 for ; Thu, 21 Aug 2008 13:18:54 -0700 X-ASG-Debug-ID: 1219350014-7c1600080000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 64802F9D862 for ; Thu, 21 Aug 2008 13:20:14 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id W2XFXplkzFyCvIOH for ; Thu, 21 Aug 2008 13:20:14 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m7LKK7IS017293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Aug 2008 13:20:08 -0700 Received: from akpm.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m7LKK6lM024045; Thu, 21 Aug 2008 13:20:06 -0700 Date: Thu, 21 Aug 2008 13:20:06 -0700 From: Andrew Morton To: Takashi Sato Cc: linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, hch@infradead.org, axboe@kernel.dk, mtk.manpages@googlemail.com, linux-kernel@vger.kernel.org, Oleg Nesterov X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-Id: <20080821132006.9949101c.akpm@linux-foundation.org> In-Reply-To: <20080818212856t-sato@mail.jp.nec.com> References: <20080818212856t-sato@mail.jp.nec.com> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1219350015 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.3325 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17668 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Mon, 18 Aug 2008 21:28:56 +0900 Takashi Sato wrote: > The timeout feature is added to freeze ioctl. And new ioctl > to reset the timeout period is added. > o Freeze the filesystem > int ioctl(int fd, int FIFREEZE, long *timeout_sec) > fd: The file descriptor of the mountpoint > FIFREEZE: request code for the freeze > timeout_sec: the timeout period in seconds > If it's 0 or 1, the timeout isn't set. > This special case of "1" is implemented to keep > the compatibility with XFS applications. > Return value: 0 if the operation succeeds. Otherwise, -1 > > o Reset the timeout period > int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) > fd:file descriptor of mountpoint > FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period > timeout_sec: new timeout period in seconds > Return value: 0 if the operation succeeds. Otherwise, -1 > Error number: If the filesystem has already been unfrozen, > errno is set to EINVAL. I don't think the changelogs actually explained why this feature is being added? Which userspace tools are expected to send these ioctls? Something in util-linux? dm-utils? Are patches to those packages planned? > > ... > > /* > + * ioctl_freeze_reset_timeout - Reset timeout for freeze. > + * > + * @filp: target file > + * @argp: timeout value(sec) > + * > + * Reset timeout for freeze. > + */ > +static int > +ioctl_freeze_reset_timeout(struct file *filp, int __user *argp) > +{ > + int timeout_sec; > + unsigned int timeout_msec; > + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; > + struct block_device *bdev = sb->s_bdev; > + int error; > + > + if (!capable(CAP_SYS_ADMIN)) > + return -EPERM; > + > + /* If a regular file or a directory isn't specified, return EINVAL. */ > + if (bdev == NULL) > + return -EINVAL; > + > + /* arg(sec) to tick value */ > + error = get_user(timeout_sec, argp); > + if (error) > + return error; > + > + if (timeout_sec <= 0 || timeout_sec > UINT_MAX/1000) > + return -EINVAL; > + > + timeout_msec = timeout_sec * 1000; > + > + down(&bdev->bd_freeze_sem); > + if (!bdev->bd_freeze_count) { > + up(&bdev->bd_freeze_sem); > + return -EINVAL; > + } > + /* setup unfreeze timer */ > + add_freeze_timeout(bdev, timeout_msec); > + up(&bdev->bd_freeze_sem); > + > + return 0; > +} This duplicates quite a bit of code from ioctl_freeze(). Can this be cleaned up? > +/* > * When you add any new common ioctls to the switches above and below > * please update compat_sys_ioctl() too. > * > @@ -235,13 +302,17 @@ int do_vfs_ioctl(struct file *filp, unsi > break; > > case FIFREEZE: > - error = ioctl_freeze(filp); > + error = ioctl_freeze(filp, argp); > break; > > case FITHAW: > error = ioctl_thaw(filp); > break; > > + case FIFREEZE_RESET_TIMEOUT: > + error = ioctl_freeze_reset_timeout(filp, argp); > + break; > + > default: > if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) > error = file_ioctl(filp, cmd, arg); > > ... > > EXPORT_SYMBOL_GPL(kern_mount_data); > + > +/* > + * freeze_timeout - Thaw the filesystem. > + * > + * @work: work queue (delayed_work.work) > + * > + * Called by the delayed work when elapsing the timeout period. > + * Thaw the filesystem. > + */ > +void freeze_timeout(struct work_struct *work) > +{ > + struct block_device *bd = container_of(work, > + struct block_device, bd_freeze_timeout.work); > + struct super_block *sb = get_super(bd); > + > + thaw_bdev(bd, sb); > + > + if (sb) > + drop_super(sb); > +} > +EXPORT_SYMBOL_GPL(freeze_timeout); I can't see why this was exported. > +/* > + * add_freeze_timeout - Add timeout for freeze. > + * > + * @bdev: block device struct > + * @timeout_msec: timeout period > + * > + * Add the delayed work for freeze timeout to the delayed work queue. > + */ > +void add_freeze_timeout(struct block_device *bdev, unsigned int timeout_msec) > +{ > + s64 timeout_jiffies = msecs_to_jiffies(timeout_msec); > + > + /* Set delayed work queue */ > + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); > + schedule_delayed_work(&bdev->bd_freeze_timeout, timeout_jiffies); > +} I don't particularly like the names of these new global symbols. The kernel already has a "freezer" thing, part of power-management. Introducing another one is a bit confusing. otoh, freezer seems to have consistently used "freezer", so the 'r' arguable saves us. Still, I'd have thought that "fsfreeze" would have been a clearer, more specific identifier for the whole project. > +/* > + * del_freeze_timeout - Delete timeout for freeze. > + * > + * @bdev: block device struct > + * > + * Delete the delayed work for freeze timeout from the delayed work queue. > + */ > +void del_freeze_timeout(struct block_device *bdev) > +{ > + /* > + * It's possible that the delayed work task (freeze_timeout()) calls > + * del_freeze_timeout(). If the delayed work task calls > + * cancel_delayed_work_sync((), the deadlock will occur. > + * So we need this check (delayed_work_pending()). > + */ > + if (delayed_work_pending(&bdev->bd_freeze_timeout)) > + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); > +} So if the calling task is keventd via run_workqueue() then delayed_work_pending() should return false due to run_workqueue() ordering, so we avoid the deadlock. Seems a bit racy if some other process starts the delayed-work while this function is running but I guess the new semaphore prevents that. Perhaps cancel_delayed_work_sync() shouldn't hang up if called from the work handler? From owner-xfs@oss.sgi.com Thu Aug 21 18:38:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 18:39:04 -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 (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 m7M1cYDM024823 for ; Thu, 21 Aug 2008 18:38:36 -0700 X-ASG-Debug-ID: 1219369194-7eef02920000-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 05F623BEF96 for ; Thu, 21 Aug 2008 18:39:54 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ORqEtRSAiHnIDsVv for ; Thu, 21 Aug 2008 18:39:54 -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 m7M1dtIF010766 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 22 Aug 2008 03:39:55 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7M1dtku010764 for xfs@oss.sgi.com; Fri, 22 Aug 2008 03:39:55 +0200 Date: Fri, 22 Aug 2008 03:39:55 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: generic btree implementation, version 4 Subject: Re: generic btree implementation, version 4 Message-ID: <20080822013955.GA10720@lst.de> References: <20080807215551.GA11084@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080807215551.GA11084@lst.de> 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: 1219369196 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3345 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17669 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 Thu, Aug 07, 2008 at 11:55:51PM +0200, Christoph Hellwig wrote: > As the mainlinglist seems to have some problems with the large number of > patches and I don't want to monopolize it anyway there is just this > announcement with a link to the patches: > > http://verein.lst.de/~hch/xfs/patches.btree.tgz Rediffed to apply against the current tree, but without any other patches now at th same location. From owner-xfs@oss.sgi.com Thu Aug 21 18:40:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 18:40:47 -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 (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 m7M1ehQO025169 for ; Thu, 21 Aug 2008 18:40:43 -0700 X-ASG-Debug-ID: 1219369324-7ef102bb0000-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 414603BEFB1 for ; Thu, 21 Aug 2008 18:42:04 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id wU5xcJ3NxUBCKIy1 for ; Thu, 21 Aug 2008 18:42:04 -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 m7M1g5IF010860 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 22 Aug 2008 03:42:05 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7M1g5mr010858 for xfs@oss.sgi.com; Fri, 22 Aug 2008 03:42:05 +0200 Date: Fri, 22 Aug 2008 03:42:05 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] use XFS_I and VFS_I in xfs_dm.c Subject: [PATCH] use XFS_I and VFS_I in xfs_dm.c Message-ID: <20080822014205.GA10805@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1219369325 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.3345 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17670 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 Convert xfs_dm.c to use the XFS_I and VFI_I helper, or in some cases IHOLD/IRELE so that it still compiles with Dave's inode unification patch. It's only really required for the latter, but also a nice cleanup without it, so it should probably go in before that patch series. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-08-19 22:42:31.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-08-19 22:45:17.000000000 -0300 @@ -140,7 +140,7 @@ xfs_dm_send_data_event( int flags, int *lock_flags) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); int error; uint16_t dmstate; @@ -468,7 +468,7 @@ xfs_dm_bulkall_iget_one( return error; xfs_ip_to_stat(mp, ino, ip, &xbuf->dx_statinfo); - dm_ip_to_handle(ip->i_vnode, &handle); + dm_ip_to_handle(VFS_I(ip), &handle); xfs_dm_handle_to_xstat(xbuf, xstat_sz, &handle, sizeof(handle)); /* Drop ILOCK_SHARED for call to xfs_attr_get */ @@ -476,7 +476,7 @@ xfs_dm_bulkall_iget_one( memset(&xbuf->dx_attrdata, 0, sizeof(dm_vardata_t)); error = xfs_attr_get(ip, attr_name, attr_buf, &value_len, ATTR_ROOT); - iput(ip->i_vnode); + IRELE(ip); DM_EA_XLATE_ERR(error); if (error && (error != ENOATTR)) { @@ -726,7 +726,7 @@ xfs_dm_bulkattr_iget_one( return error; xfs_ip_to_stat(mp, ino, ip, sbuf); - dm_ip_to_handle(ip->i_vnode, &handle); + dm_ip_to_handle(VFS_I(ip), &handle); xfs_dm_handle_to_stat(sbuf, stat_sz, &handle, sizeof(handle)); xfs_iput(ip, XFS_ILOCK_SHARED); @@ -907,7 +907,7 @@ xfs_dm_f_set_eventlist( ip->i_d.di_dmevmask = (eventset & max_mask) | (ip->i_d.di_dmevmask & ~max_mask); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - igrab(ip->i_vnode); + IHOLD(ip); xfs_trans_commit(tp, 0); return(0); @@ -2731,7 +2731,7 @@ xfs_dm_send_destroy_event( dm_right_t vp_right) /* always DM_RIGHT_NULL */ { /* Returns positive errors to XFS */ - return -dm_send_destroy_event(ip->i_vnode, vp_right); + return -dm_send_destroy_event(VFS_I(ip), vp_right); } @@ -2751,8 +2751,8 @@ xfs_dm_send_namesp_event( { /* Returns positive errors to XFS */ return -dm_send_namesp_event(event, mp ? mp->m_super : NULL, - ip1->i_vnode, vp1_right, - ip2 ? ip2->i_vnode : NULL, vp2_right, + VFS_I(ip1), vp1_right, + ip2 ? VFS_I(ip2) : NULL, vp2_right, name1, name2, mode, retcode, flags); } @@ -2779,7 +2779,7 @@ xfs_dm_send_unmount_event( int retcode, /* errno, if unmount failed */ int flags) { - dm_send_unmount_event(mp->m_super, ip ? ip->i_vnode : NULL, + dm_send_unmount_event(mp->m_super, ip ? VFS_I(ip) : NULL, vfsp_right, mode, retcode, flags); } @@ -2822,9 +2822,8 @@ xfs_dm_fh_to_inode( if (!dmfid->dm_fid_len) { /* filesystem handle */ - *inode = igrab(mp->m_rootip->i_vnode); - if (!*inode) - return -ENOENT; + IHOLD(mp->m_rootip); + *inode = VFS_I(mp->m_rootip); return 0; } @@ -2849,7 +2848,7 @@ xfs_dm_fh_to_inode( return -ENOENT; } - *inode = ip->i_vnode; + *inode = VFS_I(ip); xfs_iunlock(ip, XFS_ILOCK_SHARED); return 0; } From owner-xfs@oss.sgi.com Thu Aug 21 18:42:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 18:42:52 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7M1glN1025664 for ; Thu, 21 Aug 2008 18:42:49 -0700 X-ASG-Debug-ID: 1219369448-50d503a60000-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 E83F71A2A9CC for ; Thu, 21 Aug 2008 18:44:08 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id uTp8s4eZyxABohZO for ; Thu, 21 Aug 2008 18:44:08 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KWLhA-0005hM-2U for xfs@oss.sgi.com; Fri, 22 Aug 2008 01:44:08 +0000 Date: Thu, 21 Aug 2008 21:44:08 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/28] XFS: sync and reclaim rework Subject: Re: [PATCH 0/28] XFS: sync and reclaim rework Message-ID: <20080822014407.GA21740@infradead.org> References: <1219151804-30749-1-git-send-email-david@fromorbit.com> <20080819235920.GK24344@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080819235920.GK24344@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: 1219369448 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.3345 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17671 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 Wed, Aug 20, 2008 at 09:59:20AM +1000, Dave Chinner wrote: > On Tue, Aug 19, 2008 at 11:16:16PM +1000, Dave Chinner wrote: > > > > Multiple patch sets, all in one patch bomb against a current > > git tree. This includes all outstanding patches I have previously > > sent that are not committed plus a bunch more... > > A bunch of ppl (including me) have not seen the entire patchset > come through the list yet [*], so I've tarred up the patch set and > attached it below. Thanks, the patches looks good to me modulo the consmetic comments pointed out on IRC. They also survive xfsqs ontop of my btree patches. From owner-xfs@oss.sgi.com Thu Aug 21 19:23:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 19:23:49 -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 m7M2NiwF027943 for ; Thu, 21 Aug 2008 19:23:44 -0700 X-ASG-Debug-ID: 1219371904-3724015f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 978C23BF03B for ; Thu, 21 Aug 2008 19:25:04 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id PXA0wAJNdLhgjFGy for ; Thu, 21 Aug 2008 19:25:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMDAMC2rUh5LD0wiGdsb2JhbACSIAEBAQ8gpEWBaA X-IronPort-AV: E=Sophos;i="4.32,248,1217773800"; d="scan'208";a="177029559" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Aug 2008 11:55:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KWMKh-0001fP-4F; Fri, 22 Aug 2008 12:24:59 +1000 Date: Fri, 22 Aug 2008 12:24:59 +1000 From: Dave Chinner To: Szabolcs Szakacsits Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080822022459.GL5706@disturbed> Mail-Followup-To: Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219371905 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.3349 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8069/Thu Aug 21 10:36:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17672 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Aug 21, 2008 at 08:33:50PM +0300, Szabolcs Szakacsits wrote: > > On Thu, 21 Aug 2008, Szabolcs Szakacsits wrote: > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > > > > > > > One thing I just found out - my old *laptop* is 4-5x faster than the > > > > 10krpm scsi disk behind an old cciss raid controller. I'm wondering > > > > if the long delays in dispatch is caused by an interaction with CTQ > > > > but I can't change it on the cciss raid controllers. Are you using > > > > ctq/ncq on your machine? > > > > It's a laptop and has NCQ. It makes no difference if NCQ is enabled or > > disabled. The problem seems to be XFS only. > > The 'nobarrier' mount option made a big improvement: > > MB/s Runtime (s) > ----- ----------- > btrfs unstable 17.09 572 > ext3 13.24 877 > btrfs 0.16 12.33 793 > nilfs2 2nd+ runs 11.29 674 > ntfs-3g 8.55 865 > reiserfs 8.38 966 > xfs nobarrier 7.89 949 > nilfs2 1st run 4.95 3800 > xfs 1.88 3901 INteresting. Barriers make only a little difference on my laptop; 10-20% slower. But yes, barriers will have this effect on XFS. If you've got NCQ, then you'd do better to turn off write caching on the drive, turn off barriers and use NCQ to give you back the performance that the write cache used to. That is, of course, assuming the NCQ implementation doesn't suck.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Aug 21 23:49:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 21 Aug 2008 23:49:31 -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,J_CHICKENPOX_28, J_CHICKENPOX_53,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7M6nQWA017541 for ; Thu, 21 Aug 2008 23:49:26 -0700 X-ASG-Debug-ID: 1219387845-4f8303160000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3AA131A2B31F; Thu, 21 Aug 2008 23:50:45 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id rBYuGD1tc5Nl4XJX; Thu, 21 Aug 2008 23:50:45 -0700 (PDT) Received: from shambhala.lichtvoll.local (DSL01.83.171.182.204.ip-pool.NEFkom.net [83.171.182.204]) by mail.lichtvoll.de (Postfix) with ESMTP id C877D5AEF9; Fri, 22 Aug 2008 08:50:44 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Date: Fri, 22 Aug 2008 08:49:37 +0200 User-Agent: KMail/1.9.9 Cc: Dave Chinner , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080822022459.GL5706@disturbed> (sfid-20080822_083254_078192_2EA5658F) In-Reply-To: <20080822022459.GL5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808220849.38775.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1219387847 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.3367 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8070/Thu Aug 21 22:34:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17673 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Freitag 22 August 2008 schrieb Dave Chinner: > On Thu, Aug 21, 2008 at 08:33:50PM +0300, Szabolcs Szakacsits wrote: > > On Thu, 21 Aug 2008, Szabolcs Szakacsits wrote: > > > On Thu, 21 Aug 2008, Dave Chinner wrote: > > > > On Thu, Aug 21, 2008 at 04:04:18PM +1000, Dave Chinner wrote: > > > > > One thing I just found out - my old *laptop* is 4-5x faster > > > > > than the 10krpm scsi disk behind an old cciss raid controller. > > > > > I'm wondering if the long delays in dispatch is caused by an > > > > > interaction with CTQ but I can't change it on the cciss raid > > > > > controllers. Are you using ctq/ncq on your machine? > > > > > > It's a laptop and has NCQ. It makes no difference if NCQ is enabled > > > or disabled. The problem seems to be XFS only. > > > > The 'nobarrier' mount option made a big improvement: > > > > MB/s Runtime (s) > > ----- ----------- > > btrfs unstable 17.09 572 > > ext3 13.24 877 > > btrfs 0.16 12.33 793 > > nilfs2 2nd+ runs 11.29 674 > > ntfs-3g 8.55 865 > > reiserfs 8.38 966 > > xfs nobarrier 7.89 949 > > nilfs2 1st run 4.95 3800 > > xfs 1.88 3901 > > INteresting. Barriers make only a little difference on my laptop; > 10-20% slower. But yes, barriers will have this effect on XFS. > > If you've got NCQ, then you'd do better to turn off write caching > on the drive, turn off barriers and use NCQ to give you back the > performance that the write cache used to. That is, of course, > assuming the NCQ implementation doesn't suck.... See my other post with performance numbers: Barriers appear to make more than 50% difference on my laptop for some operations on some other operations it hardly makes a difference at all - I bet it goes slow mainly when creating or deleting lots of small files. Looking at vmstat 1 during a rm -rf of a compilebench leftover directory while switching off barriers shows a difference of even more than 50% in metadata throughput. It has this controller 00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01) and this drive --------------------------------------------------------------------- shambhala:~> hdparm -I /dev/sda /dev/sda: ATA device, with non-removable media Model Number: Hitachi HTS541616J9AT00 Serial Number: SB0442SJDVDDHH Firmware Revision: SB4OA70H Standards: Used: ATA/ATAPI-7 T13 1532D revision 1 Supported: 7 6 5 4 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 312581808 device size with M = 1024*1024: 152627 MBytes device size with M = 1000*1000: 160041 MBytes (160 GB) Capabilities: LBA, IORDY(can be disabled) Standby timer values: spec'd by Vendor, no device specific minimum R/W multiple sector transfer: Max = 16 Current = 16 Advanced power management level: 254 Recommended acoustic management value: 128, current value: 128 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=240ns IORDY flow control=120ns Commands/features: Enabled Supported: * SMART feature set Security Mode feature set * Power Management feature set * Write cache * Look-ahead * Host Protected Area feature set * WRITE_BUFFER command * READ_BUFFER command * NOP cmd * DOWNLOAD_MICROCODE * Advanced Power Management feature set Power-Up In Standby feature set * SET_FEATURES required to spinup after power up Address Offset Reserved Area Boot * SET_MAX security extension * Automatic Acoustic Management feature set * 48-bit Address feature set * Device Configuration Overlay feature set * Mandatory FLUSH_CACHE * FLUSH_CACHE_EXT * SMART error logging * SMART self-test * General Purpose Logging feature set * WRITE_{DMA|MULTIPLE}_FUA_EXT * 64-bit World wide name * IDLE_IMMEDIATE with UNLOAD Security: Master password revision code = 65534 supported not enabled not locked frozen not expired: security count not supported: enhanced erase 82min for SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: 5000cca525da17b6 NAA : 5 IEEE OUI : cca Unique ID : 525da17b6 HW reset results: CBLID- above Vih Device num = 0 determined by the jumper --------------------------------------------------------------------- with libata driver which doesn't use FUA while its advertised above: --------------------------------------------------------------------- sd 0:0:0:0: [sda] Synchronizing SCSI cache sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] Starting disk --------------------------------------------------------------------- So AFAIK that should be without NCQ since its not a SATA drive and apparently its also without FUA (maybe due to controller?). Maybe the bad results are due to lack of NCQ and FUA? Here the relevant parts from my other mail: --------------------------------------------------------------------- With barriers on an already heavily populated filesystem - I don't have an empty one on a raw partition at hand at the moment and I for sure won't empty this one: martin@shambhala:~> df -hT | grep /home /dev/sda5 xfs 112G 104G 8,2G 93% /home shambhala:~> df -hiT | grep /home /dev/sda5 xfs 34M 751K 33M 3% /home shambhala:~> xfs_db -rx /dev/sda5 xfs_db> frag actual 726986, ideal 703687, fragmentation factor 3.20% xfs_db> quit shambhala:~> martin@shambhala:~> cat /proc/mounts | grep "/home " /dev/sda5 /home xfs rw,relatime,attr2,logbufs=8,logbsize=256k,noquota 0 0 shambhala:~> xfs_info /home meta-data=/dev/sda5 isize=256 agcount=6, agsize=4883256 blks = sectsz=512 attr=2 data = bsize=4096 blocks=29299536, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /home/martin/Zeit/compilebench -i 5 -r 10 using working directory /home/martin/Zeit/compilebench, 5 intial dirs 10 runs native unpatched native-0 222MB in 117.37 seconds (1.89 MB/s) native patched native-0 109MB in 27.46 seconds (3.99 MB/s) native patched compiled native-0 691MB in 48.03 seconds (14.40 MB/s) create dir kernel-0 222MB in 83.55 seconds (2.66 MB/s) create dir kernel-1 222MB in 86.01 seconds (2.59 MB/s) create dir kernel-2 222MB in 71.61 seconds (3.11 MB/s) create dir kernel-3 222MB in 71.73 seconds (3.10 MB/s) create dir kernel-4 222MB in 61.61 seconds (3.61 MB/s) patch dir kernel-2 109MB in 63.14 seconds (1.74 MB/s) compile dir kernel-2 691MB in 45.61 seconds (15.16 MB/s) compile dir kernel-4 680MB in 50.13 seconds (13.58 MB/s) patch dir kernel-4 691MB in 154.38 seconds (4.48 MB/s) read dir kernel-4 in 95.04 9.65 MB/s read dir kernel-3 in 49.49 4.49 MB/s create dir kernel-3116 222MB in 79.44 seconds (2.80 MB/s) clean kernel-4 691MB in 8.64 seconds (80.05 MB/s) read dir kernel-1 in 71.40 3.11 MB/s stat dir kernel-0 in 14.44 seconds run complete: ======================================================================== == intial create total runs 5 avg 3.01 MB/s (user 2.34s sys 4.30s) create total runs 1 avg 2.80 MB/s (user 2.36s sys 4.12s) patch total runs 2 avg 3.11 MB/s (user 0.91s sys 4.07s) compile total runs 2 avg 14.37 MB/s (user 0.60s sys 2.76s) clean total runs 1 avg 80.05 MB/s (user 0.09s sys 0.45s) read tree total runs 2 avg 3.80 MB/s (user 2.00s sys 4.05s) read compiled tree total runs 1 avg 9.65 MB/s (user 2.36s sys 6.42s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 14.44 seconds (user 1.17s sys 1.07s) no runs for stat compiled tree shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> rm -rf /home/martin/Zeit/compilebench I didn't measure it, but it took *ages* while rm -rf was mostly in D state. According to harddisk noise a lot of seeks where involved. vmstat 1 during the rm -rf: 0 0 2784 748048 20 247160 0 0 160 4628 352 1224 15 14 71 0 0 0 2784 748056 20 247308 0 0 148 3848 298 442 11 10 79 0 0 0 2784 747996 20 247428 0 0 120 3377 260 449 9 9 82 0 0 0 2784 747764 20 247580 0 0 152 4364 324 1094 20 10 70 0 1 0 2784 747452 20 247736 0 0 156 4356 279 814 15 11 74 0 0 0 2784 747408 20 247900 0 0 164 4112 360 1131 13 13 74 0 0 0 2784 747136 20 248064 0 0 164 5128 318 855 16 10 74 0 0 0 2784 746780 20 248208 0 0 144 4353 305 1066 20 12 68 0 0 0 2784 746204 20 248336 0 0 128 5388 275 966 14 11 75 0 1 0 2784 748352 20 248468 0 0 132 5384 314 1234 22 11 67 0 0 0 2784 748104 20 248604 0 0 136 4873 284 807 16 11 73 0 Same game on same productively used partition, but now without barriers: shambhala:~> mount -o remount,nobarrier /home shambhala:~> cat /proc/mounts | grep "/home " /dev/sda5 /home xfs rw,relatime,attr2,nobarrier,logbufs=8,logbsize=256k,noquota 0 0 shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> mkdir /home/martin/Zeit/compilebench shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> ./compilebench -D /home/martin/Zeit/compilebench -i 5 -r 10 using working directory /home/martin/Zeit/compilebench, 5 intial dirs 10 runs native unpatched native-0 222MB in 51.44 seconds (4.32 MB/s) native patched native-0 109MB in 12.69 seconds (8.64 MB/s) native patched compiled native-0 691MB in 51.75 seconds (13.36 MB/s) create dir kernel-0 222MB in 47.64 seconds (4.67 MB/s) create dir kernel-1 222MB in 53.40 seconds (4.16 MB/s) create dir kernel-2 222MB in 48.04 seconds (4.63 MB/s) create dir kernel-3 222MB in 38.26 seconds (5.81 MB/s) create dir kernel-4 222MB in 34.15 seconds (6.51 MB/s) patch dir kernel-2 109MB in 50.61 seconds (2.17 MB/s) compile dir kernel-2 691MB in 37.94 seconds (18.23 MB/s) compile dir kernel-4 680MB in 45.32 seconds (15.02 MB/s) patch dir kernel-4 691MB in 107.27 seconds (6.45 MB/s) read dir kernel-4 in 82.18 11.16 MB/s read dir kernel-3 in 42.35 5.25 MB/s create dir kernel-3116 222MB in 38.27 seconds (5.81 MB/s) clean kernel-4 691MB in 5.92 seconds (116.82 MB/s) read dir kernel-1 in 73.63 3.02 MB/s stat dir kernel-0 in 13.77 seconds run complete: ======================================================================== == intial create total runs 5 avg 5.16 MB/s (user 2.21s sys 4.23s) create total runs 1 avg 5.81 MB/s (user 2.18s sys 4.89s) patch total runs 2 avg 4.31 MB/s (user 0.90s sys 4.05s) compile total runs 2 avg 16.62 MB/s (user 0.59s sys 3.05s) clean total runs 1 avg 116.82 MB/s (user 0.09s sys 0.41s) read tree total runs 2 avg 4.14 MB/s (user 1.90s sys 4.02s) read compiled tree total runs 1 avg 11.16 MB/s (user 2.28s sys 6.36s) no runs for delete tree no runs for delete compiled tree stat tree total runs 1 avg 13.77 seconds (user 1.19s sys 1.01s) no runs for stat compiled tree Not as fast as on the clean XFS LV, but still almost everytime almost twice as fast as with barriers. shambhala:/home/martin/Linux/Dateisysteme/Performance-Messung/ compilebench/compilebench-0.6> time rm -rf /home/martin/Zeit/compilebench rm -rf /home/martin/Zeit/compilebench 0,32s user 19,19s system 15% cpu 2:09,79 total This is definately faster than before. I didn't measure exact time on first occasion, but it took ages. vmstat 1 during the rm -rf indicated much higher metadata throughput: 3 0 2780 827696 20 162492 0 0 280 11109 449 865 31 15 52 2 0 0 2780 827304 20 162816 0 0 324 6656 468 1009 57 8 7 28 2 0 2636 828992 20 163364 0 0 540 5317 350 545 30 10 30 31 2 1 2636 837488 20 164020 0 0 656 7691 394 650 39 12 0 49 0 0 2224 960360 20 164516 0 0 496 12060 420 549 13 26 56 5 0 0 2224 959988 20 164904 0 0 388 13704 425 792 16 23 61 0 0 0 2224 959864 20 165128 0 0 224 6209 363 503 12 10 78 0 1 0 2224 959376 20 165540 0 0 412 14886 392 513 12 22 66 0 [...] As last XFS thing: vmstat 1 during a rm -rf while switching of XFS from nobarrier to barrier: 0 0 1976 422236 1784 516840 0 0 508 17160 410 540 7 23 70 0 1 0 1976 420624 1784 517576 0 0 736 26904 539 1032 14 35 51 0 0 0 1976 419176 1784 518152 0 0 576 23842 486 1060 17 33 50 0 0 0 1976 418316 1784 518460 0 0 308 12812 317 552 6 18 76 0 2 0 1976 417392 1784 518776 0 0 316 16689 360 882 2 23 75 0 8 0 1976 432948 1784 519252 0 0 476 16710 452 630 8 39 53 0 0 0 1976 432892 1784 519392 0 0 140 4146 371 1564 14 26 60 0 0 0 1976 432628 1784 519572 0 0 180 3844 340 660 11 10 79 0 0 0 1976 432496 1784 519736 0 0 164 3852 328 534 9 8 83 0 0 0 1976 432372 1784 519920 0 0 176 4100 359 788 19 11 70 0 Its obvious, where it was switched to barrier ;) --------------------------------------------------------------------- Ciao, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Fri Aug 22 00:08:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 00:08:54 -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.6 required=5.0 tests=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 m7M78n9x021047 for ; Fri, 22 Aug 2008 00:08:50 -0700 X-ASG-Debug-ID: 1219389004-12a300570000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sca-es-mail-1.sun.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0319EF9E0DC for ; Fri, 22 Aug 2008 00:10:04 -0700 (PDT) Received: from sca-es-mail-1.sun.com (sca-es-mail-1.Sun.COM [192.18.43.132]) by cuda.sgi.com with ESMTP id sSI1lOk99utbSCBb for ; Fri, 22 Aug 2008 00:10:04 -0700 (PDT) Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m7M7A4BD002352 for ; Fri, 22 Aug 2008 00:10:04 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K5Z00001QK32R00@fe-sfbay-09.sun.com> (original mail from adilger@sun.com) for xfs@oss.sgi.com; Fri, 22 Aug 2008 00:10:04 -0700 (PDT) Received: from webber.adilger.int ([68.147.167.155]) by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K5Z00M9LQKORZ00@fe-sfbay-09.sun.com>; Fri, 22 Aug 2008 00:10:04 -0700 (PDT) Date: Fri, 22 Aug 2008 01:09:58 -0600 From: Andreas Dilger X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature In-reply-to: <20080821125841.a04a706f.akpm@linux-foundation.org> To: Andrew Morton Cc: Takashi Sato , linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, hch@infradead.org, axboe@kernel.dk, mtk.manpages@googlemail.com, linux-kernel@vger.kernel.org Message-id: <20080822070958.GU3392@webber.adilger.int> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline X-GPG-Key: 1024D/0D35BED6 X-GPG-Fingerprint: 7A37 5D79 BF1B CECA D44F 8A29 A488 39F5 0D35 BED6 References: <20080818212819t-sato@mail.jp.nec.com> <20080821125841.a04a706f.akpm@linux-foundation.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: sca-es-mail-1.Sun.COM[192.18.43.132] X-Barracuda-Start-Time: 1219389011 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3368 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8070/Thu Aug 21 22:34:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17674 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: adilger@sun.com Precedence: bulk X-list: xfs On Aug 21, 2008 12:58 -0700, Andrew Morton wrote: > > #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ > > +#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ > > +#define FITHAW _IOWR('X', 120, int) /* Thaw */ > > FIFREEZE is 119, but a few lines above we have > > #define BLKDISCARD _IO(0x12,119) > > Should we be using 120 and 121 here? No, because 'X' != 0x12... The 'X' is used because this ioctl is compatible with the XFS implementation of this feature. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. From owner-xfs@oss.sgi.com Fri Aug 22 03:02:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 03:02:23 -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.1 required=5.0 tests=BAYES_00,J_CHICKENPOX_43, MIME_8BIT_HEADER,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7MA2Kcu007261 for ; Fri, 22 Aug 2008 03:02:20 -0700 X-ASG-Debug-ID: 1219399421-596a030b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 29BA21A2CEEC for ; Fri, 22 Aug 2008 03:03:41 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.174]) by cuda.sgi.com with ESMTP id 6fHuzWFH9CffDC9O for ; Fri, 22 Aug 2008 03:03:41 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so369020wfd.32 for ; Fri, 22 Aug 2008 03:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=wG31hPA5iXNIR8BhjHdme+DErcBwC9Zy+ltYhdZFsCU=; b=PTsJPxR3bUTm/gjNoGGbzcWFc387BqmffRSlfHJjHxQxvEd1vcxeZkZ2hrc8rwdHVk G9moJVx7m/Gos2pASP/Q3mLHMb9qBbipLeYlDe9yykle+t5liGays1HdtLHlNRRIt8p/ 8FJAO6Y5/mEActTZX0VuM2bCJM+ZUR7h+UESU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=PONG0GX+FzqZjvUG6Xx3VwIVwgEPtjyI66b7zfmpk4HI0GfgH8xsZk/04ppEcNc+7T AoyYjoteSPMNV+8qjGLBsNm6jqdIIpTnk0Tf5dtoheaGyARVh7I8VYlZR9rduvR1wWh5 dSY3fuXrAGi0UKZPKJ1NH3sj0wyIo0feO5m1A= Received: by 10.142.142.14 with SMTP id p14mr339947wfd.114.1219399420681; Fri, 22 Aug 2008 03:03:40 -0700 (PDT) Received: by 10.142.112.10 with HTTP; Fri, 22 Aug 2008 03:03:40 -0700 (PDT) Message-ID: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> Date: Fri, 22 Aug 2008 12:03:40 +0200 From: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS issue under 2.6.25.13 kernel Subject: XFS issue under 2.6.25.13 kernel MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.174] X-Barracuda-Start-Time: 1219399422 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.3379 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8071/Fri Aug 22 00:53:11 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17675 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nailman23@gmail.com Precedence: bulk X-list: xfs Dear All, We have a problem with implementing xfs file system for Linux. The problem appears after mounting xfs file system on 2.6.25.13 kernel that is created on 2.6.17.13 kernel. File system is created on logical volume in the following way: lvcreate -L 4G volume1 -n test mkfs.xfs /dev/volume1/test mount /dev/volume1/test /mnt/x After mounting it on 2.6.17.13 kernel "df -B 1" output looks like this: /dev/volume1/test 4284481536 147456 4284334080 1% /mnt/x but in case of 2.6.25.13 kernel: /dev/volume1/test 4284481536 4489216 4279992320 1% /mnt/x The same happens in case of 2.6.26.3 kernel. As it is shown after mounting the volume in newer kernel size of file system is visible smaller. The problem appears when on this volume exists one big file, occupying all available space. After trying to mount it under newer kernel, the file is cut because available free space is smaller. Is it known issue and/or does solution or workaround exists? Thank you in advance for your help. Best Regards Roland From owner-xfs@oss.sgi.com Fri Aug 22 05:37:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 05:37:17 -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=-0.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7MCbCSr024139 for ; Fri, 22 Aug 2008 05:37:13 -0700 X-ASG-Debug-ID: 1219408712-0c9402ce0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.ukfsn.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D7B0F1A2F112 for ; Fri, 22 Aug 2008 05:38:32 -0700 (PDT) Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by cuda.sgi.com with ESMTP id 002HP3cxoyzNaOw5 for ; Fri, 22 Aug 2008 05:38:32 -0700 (PDT) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id 8325CDEF5A; Fri, 22 Aug 2008 13:38:34 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id hewcE-f8XFoA; Fri, 22 Aug 2008 12:02:04 +0100 (BST) Received: from elm.dgreaves.com (78-32-229-233.no-dns-yet.enta.net [78.32.229.233]) by mail.ukfsn.org (Postfix) with ESMTP id 53203DECF8; Fri, 22 Aug 2008 13:38:34 +0100 (BST) Received: from ash.dgreaves.com ([10.0.0.90]) by elm.dgreaves.com with esmtp (Exim 4.62) (envelope-from ) id 1KWVuR-00043b-JK; Fri, 22 Aug 2008 13:38:31 +0100 Message-ID: <48AEB347.2000200@dgreaves.com> Date: Fri, 22 Aug 2008 13:38:31 +0100 From: David Greaves User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: "'linux-kernel@vger.kernel.org'" , xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, Dave Chinner , Andrew Morton X-ASG-Orig-Subj: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. Subject: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. References: <48AD3921.5090709@dgreaves.com> <200808212026.17590.rjw@sisk.pl> In-Reply-To: <200808212026.17590.rjw@sisk.pl> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail.ukfsn.org[77.75.108.10] X-Barracuda-Start-Time: 1219408713 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.3389 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8072/Fri Aug 22 02:20:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17676 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@dgreaves.com Precedence: bulk X-list: xfs Rafael J. Wysocki wrote: > [Adding CCs] > > [The issue is probably present in 2.6.26 too] > > On Thursday, 21 of August 2008, David Greaves wrote: >> I have a desktop system that has started having problems booting up in the morning. >> >> It appears to just happen on more recent kernels. >> I was having unrelated CDROM problems with a driver in an old kernel and decided >> to test 2.6.27-rcX >> The CDROM problem is fine now. >> >> However I started having problems on -rc1. I found that the machine was hanging >> soon after booting and needed a reboot. After a reboot it would work fine for >> the rest of the day. >> When -rc3 came out I tried that and the problem still appears to be there. >> >> The normal process is now to boot to single-user, ctrl-alt-sysreq-SUB and then >> reboot to multi-user. This isn't ideal. >> >> >> If I cold boot 2.6.25.3 the problem doesn't occur. >> I will try different versions over the next few days. As promised, I tried 2.6.26.3 this morning and didn't have the problem. I will try again a few times to confirm. Nb Although the log had an XFS failure, I think the real issue is the segfaults; I think XFS is a casuality, not a cause. Th problem almost always results in an XFS crash at some point - but usually preceded by many segfaults in random binaries. David From owner-xfs@oss.sgi.com Fri Aug 22 05:40:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 05:40:45 -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.6 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 m7MCeeO7024938 for ; Fri, 22 Aug 2008 05:40:40 -0700 X-ASG-Debug-ID: 1219408917-1ac801ec0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from emh06.mail.saunalahti.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4AC821253B1B for ; Fri, 22 Aug 2008 05:41:58 -0700 (PDT) Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by cuda.sgi.com with ESMTP id w1uOgfPpgLFUxBbb for ; Fri, 22 Aug 2008 05:41:58 -0700 (PDT) Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 31161C8971; Fri, 22 Aug 2008 15:41:57 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A0126E15587; Fri, 22 Aug 2008 15:41:57 +0300 Received: from dhcppc2 (a91-153-142-188.elisa-laajakaista.fi [91.153.142.188]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id D4008E5204; Fri, 22 Aug 2008 15:41:49 +0300 (EEST) Date: Fri, 22 Aug 2008 15:44:29 +0300 (MET DST) From: Szabolcs Szakacsits X-X-Sender: szaka@dhcppc2 To: Dave Chinner cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: <20080822022459.GL5706@disturbed> Message-ID: References: <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> <20080822022459.GL5706@disturbed> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Antivirus: VAMS X-Barracuda-Connect: emh06.mail.saunalahti.fi[62.142.5.116] X-Barracuda-Start-Time: 1219408919 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.3390 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8072/Fri Aug 22 02:20:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17677 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: szaka@ntfs-3g.org Precedence: bulk X-list: xfs On Fri, 22 Aug 2008, Dave Chinner wrote: > On Thu, Aug 21, 2008 at 08:33:50PM +0300, Szabolcs Szakacsits wrote: > > > The 'nobarrier' mount option made a big improvement: > > INteresting. Barriers make only a little difference on my laptop; > 10-20% slower. But yes, barriers will have this effect on XFS. > > If you've got NCQ, then you'd do better to turn off write caching > on the drive, turn off barriers and use NCQ to give you back the > performance that the write cache used to. That is, of course, > assuming the NCQ implementation doesn't suck.... Write cache off, nobarrier and AHCI NCQ lowered the XFS result: MB/s Runtime (s) ----- ----------- btrfs unstable 17.09 572 ext3 13.24 877 btrfs 0.16 12.33 793 ntfs-3g unstable 11.52 673 nilfs2 2nd+ runs 11.29 674 reiserfs 8.38 966 xfs nobarrier 7.89 949 nilfs2 1st run 4.95 3800 xfs nobarrier, ncq, wc off 3.81 1973 xfs 1.88 3901 Szaka -- NTFS-3G: http://ntfs-3g.org From owner-xfs@oss.sgi.com Fri Aug 22 09:34:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 09:34:39 -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.2 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 m7MGYXgZ013066 for ; Fri, 22 Aug 2008 09:34:34 -0700 X-ASG-Debug-ID: 1219422954-645b01f80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 817E93C29D5 for ; Fri, 22 Aug 2008 09:35:55 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 24SfyMdZL8ZyujPU for ; Fri, 22 Aug 2008 09:35:55 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5A15EA9ABF8 for ; Fri, 22 Aug 2008 11:35:54 -0500 (CDT) Message-ID: <48AEEAEA.9050706@sandeen.net> Date: Fri, 22 Aug 2008 11:35:54 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: xfsprogs-2.10.0? Subject: xfsprogs-2.10.0? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1219422955 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.3405 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8073/Fri Aug 22 05:48:21 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17678 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Hey, since it looks like xfsprogs-2.10.0 is in cvs... ASCII case-insensitive support for xfsprogs Merge of master-melb:xfs-cmds:31229a by kenmcd. Bump to 2.10.0 is there any chance you guys can push out some tarballs? thanks, -Eric From owner-xfs@oss.sgi.com Fri Aug 22 11:13:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 11:13:56 -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 m7MIDk1u021105 for ; Fri, 22 Aug 2008 11:13:49 -0700 X-ASG-Debug-ID: 1219428908-6679003b0000-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 B37B03C3139 for ; Fri, 22 Aug 2008 11:15:08 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id laAd4llGGzHrPc0V for ; Fri, 22 Aug 2008 11:15:08 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KWbA2-0000Wl-VN; Fri, 22 Aug 2008 18:14:59 +0000 Date: Fri, 22 Aug 2008 14:14:58 -0400 From: Christoph Hellwig To: Takashi Sato Cc: Andrew Morton , "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" , "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature Message-ID: <20080822181458.GA15469@infradead.org> References: <20080818212819t-sato@mail.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080818212819t-sato@mail.jp.nec.com> 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: 1219428908 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3411 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8074/Fri Aug 22 10:40:18 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17679 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 Mon, Aug 18, 2008 at 09:28:19PM +0900, Takashi Sato wrote: > + down(&bdev->bd_freeze_sem); > + bdev->bd_freeze_count++; > + if (bdev->bd_freeze_count > 1) { > + sb = get_super(bdev); > + drop_super(sb); > + up(&bdev->bd_freeze_sem); > + return sb; > + } > + > down(&bdev->bd_mount_sem); Now you have a reference counter of freezes which actually is pretty sensible, but also needs some documentation. What I don't understand here at all is why you do the get_super/drop_super in the already frozen case. Now that the freeze_count has replaced one of the uses of bd_mount_sem you should also replace the other use in the unmount path by simply checking for the freez_count and abort if it's set. To do so you'll need to hold the bd_mount_sem over the whole unmount operation to prevent new frezes from coming in. As others noted it should be a mutex and not a semaphore. > /* > + * ioctl_freeze - Freeze the filesystem. > + * > + * @filp: target file > + * > + * Call freeze_bdev() to freeze the filesystem. > + */ > +static int ioctl_freeze(struct file *filp) This is not quite kerneldcoc format, which would ne a /** as commnt start. But I don't think the comment is actually needed, it's a pretty obvious file scope function. (Same commnt also applies to ioctl_thaw) > + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; > + > + if (!capable(CAP_SYS_ADMIN)) > + return -EPERM; > + > + /* If filesystem doesn't support freeze feature, return. */ > + if (sb->s_op->write_super_lockfs == NULL) > + return -EOPNOTSUPP; > + > + /* If a regular file or a directory isn't specified, return. */ > + if (sb->s_bdev == NULL) > + return -EINVAL; I don't understand this commnt. What you are checking is that the filesystem has a non-NULL s_bdev, which implies a not blockdevice-backed filesystem. From owner-xfs@oss.sgi.com Fri Aug 22 11:15:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 11:15:45 -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 m7MIFe0n021534 for ; Fri, 22 Aug 2008 11:15:41 -0700 X-ASG-Debug-ID: 1219429022-62e500610000-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 818B03C319D for ; Fri, 22 Aug 2008 11:17:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id CBtroc2XMUUrNTsj for ; Fri, 22 Aug 2008 11:17:02 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KWbBw-0005j6-U1; Fri, 22 Aug 2008 18:16:56 +0000 Date: Fri, 22 Aug 2008 14:16:56 -0400 From: Christoph Hellwig To: Andrew Morton Cc: Takashi Sato , linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, hch@infradead.org, axboe@kernel.dk, mtk.manpages@googlemail.com, linux-kernel@vger.kernel.org, Oleg Nesterov X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080822181656.GB15469@infradead.org> References: <20080818212856t-sato@mail.jp.nec.com> <20080821132006.9949101c.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821132006.9949101c.akpm@linux-foundation.org> 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: 1219429022 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.3411 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8074/Fri Aug 22 10:40:18 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17680 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 Thu, Aug 21, 2008 at 01:20:06PM -0700, Andrew Morton wrote: > I don't think the changelogs actually explained why this feature is > being added? > > Which userspace tools are expected to send these ioctls? Something in > util-linux? dm-utils? Are patches to those packages planned? Currently the only surspace using freeze and thaw is xfs_freeze from xfsprogs, which would work for various other filesystems that implement ->write_super_lockfs now instead of just XFS with patch 1. The freeze stuff in this third patch isn't and won't be used by xfs_freeze and doesn't make all that much sense (and we already had a lot of previous discussion on this..) From owner-xfs@oss.sgi.com Fri Aug 22 14:11:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 14:11:42 -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.6 required=5.0 tests=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 m7MLBc6v007191 for ; Fri, 22 Aug 2008 14:11:39 -0700 X-ASG-Debug-ID: 1219439579-4f2401d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from py-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A14E51203D7F for ; Fri, 22 Aug 2008 14:13:00 -0700 (PDT) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by cuda.sgi.com with ESMTP id eQXKZzPf9Jebqvzu for ; Fri, 22 Aug 2008 14:13:00 -0700 (PDT) Received: by py-out-1112.google.com with SMTP id f31so433803pyh.4 for ; Fri, 22 Aug 2008 14:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=vNdVB30ok3LJ/2yEnbiNA95kFpbyIrJ45A5Skpfjj3Q=; b=bw7AmOZd34Y9rNqs8JnURgCkkBvhqQA5nFznDj/YwvnX1KDaPy1XOnEjSo5o5m/U7f 2waiUP2LJOp0K/yDKuobBozob/J1m6G/FzgfiuzGMwgOhSU+eIlEWq/0wsuh31KsJRqF cucYP3zS63SVkNn9QOJvY3V7djXL9XEU669UU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=KSImIORA/uTVHDdhCD4fikn8ATWAS88Klwo0rIB0zrJe9LYrlbrlp0g/+ewCz9mrZR 56KwboZ6chAvszHnoNHjXk1pMSthT2a0RJ1mebrjHjVKQbm9va/eCsXmNSjs1vAC7TUp HOfrM+hXB7FzSErGyHA5r5zkQRRRydNdCGAQU= Received: by 10.65.54.9 with SMTP id g9mr1870886qbk.55.1219439579364; Fri, 22 Aug 2008 14:12:59 -0700 (PDT) Received: by 10.65.159.4 with HTTP; Fri, 22 Aug 2008 14:12:59 -0700 (PDT) Message-ID: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> Date: Fri, 22 Aug 2008 22:12:59 +0100 From: "Daniel J Blueman" To: "Linux Kernel" , xfs@oss.sgi.com X-ASG-Orig-Subj: [2.6.27-rc4] XFS i_lock vs i_iolock... Subject: [2.6.27-rc4] XFS i_lock vs i_iolock... Cc: "Christoph Lameter" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: py-out-1112.google.com[64.233.166.177] X-Barracuda-Start-Time: 1219439580 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3424 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8074/Fri Aug 22 10:40:18 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17681 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: daniel.blueman@gmail.com Precedence: bulk X-list: xfs On 2.6.27-rc4 with various debug options enabled, lockdep claims lock ordering issues with XFS [1] - easiest reproducer is just running xfs_fsr. Mount options I was using were 'nobarrier,noatime,nodiratime'. Thanks, Daniel --- [1] ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.27-rc4-224c #1 ------------------------------------------------------- xfs_fsr/5763 is trying to acquire lock: (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 but task is already holding lock: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0xa5/0xb0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&(&ip->i_iolock)->mr_lock/3){--..}: [] __lock_acquire+0xdb1/0x1150 [] lock_acquire+0x91/0xc0 [] down_write_nested+0x57/0x90 [] xfs_ilock+0xa5/0xb0 [] xfs_lock_two_inodes+0x106/0x120 [] xfs_swap_extents+0x70/0x5b0 [] xfs_swapext+0x148/0x150 [] xfs_ioctl+0x6a5/0x810 [] xfs_file_ioctl_invis+0x3d/0x80 [] vfs_ioctl+0x36/0xb0 [] do_vfs_ioctl+0x28b/0x2f0 [] sys_ioctl+0x4f/0x80 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff -> #0 (&(&ip->i_lock)->mr_lock/2){--..}: [] __lock_acquire+0xe95/0x1150 [] lock_acquire+0x91/0xc0 [] down_write_nested+0x57/0x90 [] xfs_ilock+0x8c/0xb0 [] xfs_lock_two_inodes+0x70/0x120 [] xfs_swap_extents+0x293/0x5b0 [] xfs_swapext+0x148/0x150 [] xfs_ioctl+0x6a5/0x810 [] xfs_file_ioctl_invis+0x3d/0x80 [] vfs_ioctl+0x36/0xb0 [] do_vfs_ioctl+0x28b/0x2f0 [] sys_ioctl+0x4f/0x80 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff other info that might help us debug this: 2 locks held by xfs_fsr/5763: #0: (&(&ip->i_iolock)->mr_lock/2){--..}, at: [] xfs_ilock+0xa5/0xb0 #1: (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] xfs_ilock+0xa5/0xb0 stack backtrace: Pid: 5763, comm: xfs_fsr Not tainted 2.6.27-rc4-224c #1 Call Trace: [] print_circular_bug_tail+0x9f/0xe0 [] __lock_acquire+0xe95/0x1150 [] lock_acquire+0x91/0xc0 [] ? xfs_ilock+0x8c/0xb0 [] down_write_nested+0x57/0x90 [] ? xfs_ilock+0x8c/0xb0 [] xfs_ilock+0x8c/0xb0 [] xfs_lock_two_inodes+0x70/0x120 [] xfs_swap_extents+0x293/0x5b0 [] xfs_swapext+0x148/0x150 [] xfs_ioctl+0x6a5/0x810 [] ? native_sched_clock+0x70/0xa0 [] ? mnt_drop_write+0x62/0x140 [] xfs_file_ioctl_invis+0x3d/0x80 [] vfs_ioctl+0x36/0xb0 [] do_vfs_ioctl+0x28b/0x2f0 [] ? trace_hardirqs_on_thunk+0x3a/0x3f [] sys_ioctl+0x4f/0x80 [] system_call_fastpath+0x16/0x1b -- Daniel J Blueman From owner-xfs@oss.sgi.com Fri Aug 22 15:25:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 15:25:30 -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.6 required=5.0 tests=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 m7MMPQsq013901 for ; Fri, 22 Aug 2008 15:25:26 -0700 X-ASG-Debug-ID: 1219444007-6daf02110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A3D71FA98C3 for ; Fri, 22 Aug 2008 15:26:47 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by cuda.sgi.com with ESMTP id zLmW3juRy2cQTgKq for ; Fri, 22 Aug 2008 15:26:47 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis) id 0MKwh2-1KWf5i3vFx-000770; Sat, 23 Aug 2008 00:26:47 +0200 Date: Sat, 23 Aug 2008 00:26:46 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: xfs@oss.sgi.com X-ASG-Orig-Subj: agi unlinked bucket Subject: agi unlinked bucket Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Provags-ID: V01U2FsdGVkX18sIsU3X/xL3jcKnCny6CiJs0tXqlh7c7zJbZ6 5pIP3+7WYc3cPTHjXwAt3AjZShZ5eoZ2IcgCuM90UI5xCbfk/2 qYZiugoLfx4WZm899vl6g== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.188] X-Barracuda-Start-Time: 1219444008 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.3428 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8075/Fri Aug 22 14:23:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17682 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs Hi there, there's an XFS here (and since it's mounted on top of a dm-crypt device, it's not checked regulary. Checking the filesystem just now gave: ---------------------- # xfs_repair -V xfs_repair version 2.9.8 # blockdev --getsize64 /dev/mapper/md3 147445706752 # xfs_check /dev/mapper/md3 agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) link count mismatch for inode 128 (name ?), nlink 333, counted 334 link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 Command exited with non-zero status 3 ---------------------- Should I worry? Would it be safe to run xfs_repair on it? Searching for these errors in the archives only brings up scenarios with kernel oopses involved. Not here, the box is running fine (2.6.27-rc3, i386) and the filesystem is doing its job. Thanks, Christian. -- BOFH excuse #198: Post-it Note Sludge leaked into the monitor. From owner-xfs@oss.sgi.com Fri Aug 22 16:36:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 16:37:00 -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.6 required=5.0 tests=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 m7MNavTo024644 for ; Fri, 22 Aug 2008 16:36:57 -0700 X-ASG-Debug-ID: 1219448298-6dab00700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from chef.nerp.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 200A73C4659 for ; Fri, 22 Aug 2008 16:38:18 -0700 (PDT) Received: from chef.nerp.net (chef.nerp.net [199.199.210.160]) by cuda.sgi.com with ESMTP id zHEKpi9SqmpVaLEs for ; Fri, 22 Aug 2008 16:38:18 -0700 (PDT) Received: from chef.nerp.net (localhost [127.0.0.1]) by chef.nerp.net (Postfix) with ESMTP id 0FF1C140254A for ; Fri, 22 Aug 2008 18:38:17 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nerp.net; s=mail; t=1219448297; bh=+sqZoSJUge3NNhUWGwU/9HilrO9f2r4xgGyhE2pR+VI=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding:X-Virus-Scanned; b=Mx5ifN+J fNwEz7e/ACKP2R7Bzj8W2mqWfHOqr/xuxQzJ8dxnmZKEaFZFHl10wZZTCw6xwtYjT6O ev433SkL7LYfUL0/N7dkpqqH3fJ6fYkmk0EphhHTtgq9E2TS41SZe61vr0MV2ES4ij0 pPYehM2hTz1QF7yewZFXnx6ILiT5g= Received: from [75.209.92.19] (19.sub-75-209-92.myvzw.com [75.209.92.19]) by chef.nerp.net (Postfix) with ESMTPA id 1D5C6140253E for ; Fri, 22 Aug 2008 18:38:14 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nerp.net; s=mail; t=1219448296; bh=+sqZoSJUge3NNhUWGwU/9HilrO9f2r4xgGyhE2pR+VI=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding; b=bmW5dL7+iZKWV6AIrNa1+YmG locxAtccc5E51h3eODUdEceyYCg3MbEYEpziFfYdPJqWjOa4f/of5Yv+Ak2svBibmhJ 3FgHRcj1Arw7CAoOrKdsaduOMgAN0jsGI3ZuF5Io/hyDmoGqB0yGfJ6786jgxmD+3Gy 2Ikxry90RW3TI= Message-ID: <48AF4DD1.5080603@nerp.net> Date: Fri, 22 Aug 2008 13:37:53 -1000 From: Dan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_quota free Subject: xfs_quota free Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8075/Fri Aug 22 14:23:45 2008 on oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP X-Barracuda-Connect: chef.nerp.net[199.199.210.160] X-Barracuda-Start-Time: 1219448299 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0027 1.0000 -2.0035 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.40 X-Barracuda-Spam-Status: No, SCORE=-1.40 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3429 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Status: Clean X-archive-position: 17683 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dan@nerp.net Precedence: bulk X-list: xfs Hi, Some time ago I needed to determine the free space on a real time device. Nate indicated to use xfs_quota free. I've read the man pages and tried many iterations of this command but I cannot get any results. One potential problem is I'm uncertain of the folder or device to point the command at. My filesystem is mounted to /mnt, the rtdev is /dev/md0 and meta data is on /dev/sdb. Basically it boils down to xfs_quota -c 'free -r -h' /mnt I think but I get the following error: XFS_IOC_FSGEOMETRY_V1: Invalid argument How do you use this? Thanks, Dan From owner-xfs@oss.sgi.com Fri Aug 22 17:39:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 17:39:19 -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.6 required=5.0 tests=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 m7N0dGQD030003 for ; Fri, 22 Aug 2008 17:39:16 -0700 X-ASG-Debug-ID: 1219452036-6d7c03350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0D3103C474A for ; Fri, 22 Aug 2008 17:40:37 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by cuda.sgi.com with ESMTP id esyCYF2BbGURaexf for ; Fri, 22 Aug 2008 17:40:37 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1KWhBC2xIL-000376; Sat, 23 Aug 2008 02:40:35 +0200 Date: Sat, 23 Aug 2008 02:40:34 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: Dan cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_quota free Subject: Re: xfs_quota free In-Reply-To: <48AF4DD1.5080603@nerp.net> Message-ID: References: <48AF4DD1.5080603@nerp.net> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX1/zu7n9FhH0/93+qKTQ2EQJpuJfWqE+TVI/Dqq u8Xk/n9P9gpG8yEK9iMYmUKe7xbOjiUIfEv6hylLV7svzIJzUU nbrztqctL4HN9Ui1EHpbA== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.177] X-Barracuda-Start-Time: 1219452038 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3437 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8076/Fri Aug 22 15:15:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17684 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Fri, 22 Aug 2008, Dan wrote: > data is on /dev/sdb. Basically it boils down to xfs_quota -c 'free -r -h' > /mnt I think but I get the following error: > > XFS_IOC_FSGEOMETRY_V1: Invalid argument A similar issue has been reported in http://lists.xensource.com/archives/html/xen-users/2007-10/msg00577.html Which kernel are you running? C. -- BOFH excuse #266: All of the packets are empty. From owner-xfs@oss.sgi.com Fri Aug 22 18:10:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 18:10:18 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, MIME_8BIT_HEADER autolearn=no 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 m7N1AFfc032007 for ; Fri, 22 Aug 2008 18:10:15 -0700 X-ASG-Debug-ID: 1219453895-67f9002d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 26025FAA9F1 for ; Fri, 22 Aug 2008 18:11:36 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id MTOI1P5cG8wS2lIW for ; Fri, 22 Aug 2008 18:11:36 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucCALP9rkh5LD0wiGdsb2JhbACSKgEBAQ8golKBaA X-IronPort-AV: E=Sophos;i="4.32,255,1217773800"; d="scan'208";a="177851129" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Aug 2008 10:35:26 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KWhZE-00065B-Di; Sat, 23 Aug 2008 11:05:24 +1000 Date: Sat, 23 Aug 2008 11:05:24 +1000 From: Dave Chinner To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel Message-ID: <20080823010524.GM5706@disturbed> Mail-Followup-To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski , xfs@oss.sgi.com References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219453897 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0008 1.0000 -2.0161 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.3438 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8076/Fri Aug 22 15:15:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17685 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 22, 2008 at 12:03:40PM +0200, SÅ‚awomir Nowakowski wrote: > Dear All, > > We have a problem with implementing xfs file system for Linux. The problem > appears after mounting xfs file system on 2.6.25.13 kernel that is created on > 2.6.17.13 kernel. > > File system is created on logical volume in the following way: > > lvcreate -L 4G volume1 -n test > mkfs.xfs /dev/volume1/test > mount /dev/volume1/test /mnt/x > > After mounting it on 2.6.17.13 kernel "df -B 1" output looks like this: > > /dev/volume1/test 4284481536 147456 4284334080 1% /mnt/x > > but in case of 2.6.25.13 kernel: > > /dev/volume1/test 4284481536 4489216 4279992320 1% /mnt/x > > The same happens in case of 2.6.26.3 kernel. Yeah, we reserved 4MB of space for unreserved delayed metadata allocations to allow transactions to succeed when at ENOSPC. That reservation is accounted as 'used space' to prevent it being used by data. > As it is shown after mounting the volume in newer kernel size of file system > is visible smaller. The problem appears when on this volume exists one big > file, occupying all available space. After trying to mount it under newer > kernel, the file is cut because available free space is smaller. What is on disk will not change - the reservation is purely an in-memory construct. i.e. if the file already exists then it won't change on upgrade. Can you show how the file changes just by booting a different kernel (e.g. ls -l output, md5sums, etc). > Is it known issue and/or does solution or workaround exists? $ sudo xfs_io -x -c 'resblks 0' will remove the reservation. This means your filesystem can shutdown or lose data at ENOSPC in certain circumstances.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Aug 22 19:09:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 19:09:24 -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.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7N29KJC002724 for ; Fri, 22 Aug 2008 19:09:22 -0700 X-ASG-Debug-ID: 1219457439-25f3019d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E8D281A35FD1 for ; Fri, 22 Aug 2008 19:10:40 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id PGGm51jvNMzshD8s for ; Fri, 22 Aug 2008 19:10:40 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 8767AA9ABC8; Fri, 22 Aug 2008 21:10:39 -0500 (CDT) Message-ID: <48AF719F.8010903@sandeen.net> Date: Fri, 22 Aug 2008 21:10:39 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Dan CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_quota free Subject: Re: xfs_quota free References: <48AF4DD1.5080603@nerp.net> In-Reply-To: <48AF4DD1.5080603@nerp.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1219457441 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3443 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8076/Fri Aug 22 15:15:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17686 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dan wrote: > Hi, > > Some time ago I needed to determine the free space on a real time > device. Nate indicated to use xfs_quota free. I've read the man pages > and tried many iterations of this command but I cannot get any results. > > One potential problem is I'm uncertain of the folder or device to point > the command at. My filesystem is mounted to /mnt, the rtdev is /dev/md0 > and meta data is on /dev/sdb. Basically it boils down to xfs_quota -c > 'free -r -h' /mnt I think but I get the following error: > > XFS_IOC_FSGEOMETRY_V1: Invalid argument > > How do you use this? > > Thanks, > > Dan > > Do you happen to have 32-bit userspace on a 64-bit kernel? Could be an ioctl translation problem if so. Otherwise maybe a quota-savvy person knows ;) -Eric From owner-xfs@oss.sgi.com Fri Aug 22 21:00:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 22 Aug 2008 21:01:22 -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.6 required=5.0 tests=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 m7N40Ncj013384 for ; Fri, 22 Aug 2008 21:00:25 -0700 X-ASG-Debug-ID: 1219464105-343703770000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from chef.nerp.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D47353C4B54 for ; Fri, 22 Aug 2008 21:01:45 -0700 (PDT) Received: from chef.nerp.net (chef.nerp.net [199.199.210.160]) by cuda.sgi.com with ESMTP id eVhsx75TCVuoUPuY for ; Fri, 22 Aug 2008 21:01:45 -0700 (PDT) Received: from chef.nerp.net (localhost [127.0.0.1]) by chef.nerp.net (Postfix) with ESMTP id 0CE5D1402559; Fri, 22 Aug 2008 23:01:45 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nerp.net; s=mail; t=1219464105; bh=IN8B+RCOvpKdGRgiWE8z4ORSRzfdyrIaIesgMrk7Czs=; h=From:Subject:Date:To:X-Mailer:Message-ID:CC:X-Virus-Scanned; b=QK OtoBcRQtOAxR+Ihw/ysLV1QC+mI1Zwn/+1vKrXhZ/Kz4H4gYd05C1vIfZ7EMnc2LJvK wOh00+cRBlfo/CktSzE6/v+CbRtN29fJpPqFToSgN8eXGvVCyMhNYLmqVguKltyZa7F yFzd1azU5axp1awaR/7Al8V9swc9p+AbmPI= Received: from [75.209.255.213] (213.sub-75-209-255.myvzw.com [75.209.255.213]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by chef.nerp.net (Postfix) with ESMTPSA id 2593D140254F; Fri, 22 Aug 2008 23:01:39 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nerp.net; s=mail; t=1219464104; bh=IN8B+RCOvpKdGRgiWE8z4ORSRzfdyrIaIesgMrk7Czs=; h=From:Subject:Date:To:X-Mailer:Message-ID:CC; b=D2fs7CIY/g9qZVLkpe gU8KzPrkqSE3DwHo3ohNjs1WGYOg2YP5E/k54ZsMGSOo+6wObiQwghIGyLtwxwD9KCp JX/+UPcW6x0xiU4vMWi9l95zwWE4Sh2oSmP/pOooDmazLVURq+BY6Ub6JovpX0Po4+V NKFAZWPf6JkD86z3jWs= From: "Dan Redig" X-ASG-Orig-Subj: Re: xfs_quota free Subject: Re: xfs_quota free Date: 22 Aug 2008 18:01:00 -1000 To: X-Mailer: ChatterEmail+ for Treo 6xx/700p (3.0.6.3+) Message-ID: <3302272903.2274591@chef.nerp.net> CC: , X-Virus-Scanned: ClamAV 0.91.2/8076/Fri Aug 22 15:15:54 2008 on oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP X-Barracuda-Connect: chef.nerp.net[199.199.210.160] X-Barracuda-Start-Time: 1219464105 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3451 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Status: Clean X-archive-position: 17687 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dan@nerp.net Precedence: bulk X-list: xfs Hi, I'm running 2.6.22 on CentOS 4.4. I don't have the version of XFS tools on me right now. I do believe I got the right package. Would the 32 bit binaries format and manipulate he other features of XFS properly and only fail on free blocks? thanks!! Dan -----Original Message----- From: Christian Kujau Date: Friday, Aug 22, 2008 2:40 pm Subject: Re: xfs_quota free To: Dan CC: xfs@oss.sgi.com On Fri, 22 Aug 2008, Dan wrote: data is on /dev/sdb. Basically it boils down to xfs_quota -c 'free -r -h' /mnt I think but I get the following error: > XFS_IOC_FSGEOMETRY_V1: Invalid argument A similar issue has been reported in http://lists.xensource.com/archives/html/xen-users/2007-10/msg00577.html Which kernel are you running? C. -- BOFH excuse #266: All of the packets are empty. From owner-xfs@oss.sgi.com Sat Aug 23 02:47:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 23 Aug 2008 02:47:18 -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=-0.6 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 m7N9lA5r003046 for ; Sat, 23 Aug 2008 02:47:11 -0700 X-ASG-Debug-ID: 1219484910-070d01740000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.ukfsn.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1131A3C2FDB for ; Sat, 23 Aug 2008 02:48:30 -0700 (PDT) Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.10]) by cuda.sgi.com with ESMTP id t7TaMJEBntuLM4Ce for ; Sat, 23 Aug 2008 02:48:30 -0700 (PDT) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id F22DFDEF06; Sat, 23 Aug 2008 10:48:30 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id fgGTBXIE3DoM; Sat, 23 Aug 2008 09:11:25 +0100 (BST) Received: from elm.dgreaves.com (78-32-229-233.no-dns-yet.enta.net [78.32.229.233]) by mail.ukfsn.org (Postfix) with ESMTP id 9F741DEF6A; Sat, 23 Aug 2008 10:48:29 +0100 (BST) Received: from ash.dgreaves.com ([10.0.0.90]) by elm.dgreaves.com with esmtp (Exim 4.62) (envelope-from ) id 1KWpjL-0002bx-Fe; Sat, 23 Aug 2008 10:48:23 +0100 Message-ID: <48AFDCE7.7010508@dgreaves.com> Date: Sat, 23 Aug 2008 10:48:23 +0100 From: David Greaves User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: "'linux-kernel@vger.kernel.org'" , xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, Dave Chinner , Andrew Morton X-ASG-Orig-Subj: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. Subject: Re: Regression? 2.6.27-rc3 segfault on cold boot; not on warm boot. References: <48AD3921.5090709@dgreaves.com> <200808212026.17590.rjw@sisk.pl> In-Reply-To: <200808212026.17590.rjw@sisk.pl> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail.ukfsn.org[77.75.108.10] X-Barracuda-Start-Time: 1219484912 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3472 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8077/Sat Aug 23 00:28:12 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17688 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@dgreaves.com Precedence: bulk X-list: xfs Rafael J. Wysocki wrote: > [Adding CCs] > > [The issue is probably present in 2.6.26 too] Yes, below is a netconsole boot of 2.26.6.3 I cold booted - lots of segfaults. I then did a ctrl-Alt-SysRq-S-U-B to a warm boot. No segfaults (lots of #### mark the split) I've just started 2.6.25.14 building for tomorrow to confirm how far back it goes. (I'm 99% sure 2.6.25 is OK) David elm:~# netcat -u -l -p 6666 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata1.00: ATA-7: ST3320620AS, 3.AAJ, max UDMA/133 ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 0/32) ata1.00: configured for UDMA/100 ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata2.00: ATA-7: ST3320620AS, 3.AAE, max UDMA/133 ata2.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 0/32) ata2.00: configured for UDMA/100 scsi 0:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sd 0:0:0:0: [sda] Attached SCSI disk sd 0:0:0:0: Attached scsi generic sg0 type 0 scsi 1:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 1:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 1:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdb: sdb1 sdb2 sd 1:0:0:0: [sdb] Attached SCSI disk sd 1:0:0:0: Attached scsi generic sg1 type 0 ACPI: PCI Interrupt 0000:00:0f.0[B] -> GSI 20 (level, low) -> IRQ 20 sata_via 0000:00:0f.0: routed to hard irq line 0 scsi2 : sata_via scsi3 : sata_via ata3: SATA max UDMA/133 cmd 0x9800 ctl 0x9400 bmdma 0x8400 irq 20 ata4: SATA max UDMA/133 cmd 0x9000 ctl 0x8800 bmdma 0x8408 irq 20 ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300) ata3.00: ATA-7: Maxtor 6L300S0, BANC1E00, max UDMA/133 ata3.00: 586114704 sectors, multi 16: LBA48 NCQ (not used) ata3.00: configured for UDMA/133 ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300) ata4.00: ATA-7: ST3320620AS, 3.AAC, max UDMA/133 ata4.00: 625134827 sectors, multi 16: LBA48 NCQ (depth 0/32) ata4.00: configured for UDMA/133 scsi 2:0:0:0: Direct-Access ATA Maxtor 6L300S0 BANC PQ: 0 ANSI: 5 sd 2:0:0:0: [sdc] 586114704 512-byte hardware sectors (300091 MB) sd 2:0:0:0: [sdc] Write Protect is off sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 2:0:0:0: [sdc] 586114704 512-byte hardware sectors (300091 MB) sd 2:0:0:0: [sdc] Write Protect is off sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdc: sdc1 sdc2 sd 2:0:0:0: [sdc] Attached SCSI disk sd 2:0:0:0: Attached scsi generic sg2 type 0 scsi 3:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 3:0:0:0: [sdd] 625134827 512-byte hardware sectors (320069 MB) sd 3:0:0:0: [sdd] Write Protect is off sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 3:0:0:0: [sdd] 625134827 512-byte hardware sectors (320069 MB) sd 3:0:0:0: [sdd] Write Protect is off sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdd: sdd1 sdd2 sdd3 sd 3:0:0:0: [sdd] Attached SCSI disk sd 3:0:0:0: Attached scsi generic sg3 type 0 PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12 serio: i8042 KBD port at 0x60,0x64 irq 1 serio: i8042 AUX port at 0x60,0x64 irq 12 mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard as /class/input/input2 md: raid1 personality registered for level 1 raid6: int32x1 925 MB/s raid6: int32x2 972 MB/s raid6: int32x4 777 MB/s raid6: int32x8 601 MB/s raid6: mmxx1 1730 MB/s raid6: mmxx2 3105 MB/s raid6: sse1x1 1644 MB/s raid6: sse1x2 2789 MB/s raid6: using algorithm sse1x2 (2789 MB/s) md: raid6 personality registered for level 6 md: raid5 personality registered for level 5 md: raid4 personality registered for level 4 TCP cubic registered Using IPI Shortcut mode input: ImExPS/2 Generic Explorer Mouse as /class/input/input3 md: Autodetecting RAID arrays. md: Scanned 2 and added 2 devices. md: autorun ... md: considering sdc2 ... md: adding sdc2 ... md: adding sdb2 ... md: created md0 md: bind md: bind md: running: raid1: raid set md0 active with 2 out of 2 mirrors md: ... autorun DONE. Filesystem "md0": Disabling barriers, not supported by the underlying device XFS mounting filesystem md0 VFS: Mounted root (xfs filesystem) readonly. Freeing unused kernel memory: 228k freed Linux agpgart interface v0.103 agpgart: Detected VIA KT400/KT400A/KT600 chipset agpgart: AGP aperture is 32M @ 0xfc000000 ACPI: PCI Interrupt 0000:00:0f.1[A] -> GSI 20 (level, low) -> IRQ 20 scsi4 : pata_via scsi5 : pata_via ata5: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0x7800 irq 14 ata6: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x7808 irq 15 usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb USB Universal Host Controller Interface driver v3.0 ata5.00: ATAPI: PLEXTOR DVDR PX-708A, 1.02, max UDMA/33 ata5.01: ATAPI: TSSTcorpCD/DVDW SH-W162C, TS10, max UDMA/33 ata5.00: configured for UDMA/33 ata5.01: configured for UDMA/33 ata6.00: ATAPI: PLEXTOR CD-R PX-W2410A, 1.02, max UDMA/33 ata6.00: configured for UDMA/33 scsi 4:0:0:0: CD-ROM PLEXTOR DVDR PX-708A 1.02 PQ: 0 ANSI: 5 sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray Uniform CD-ROM driver Revision: 3.20 sr 4:0:0:0: Attached scsi generic sg4 type 5 scsi 4:0:1:0: CD-ROM TSSTcorp CD/DVDW SH-W162C TS10 PQ: 0 ANSI: 5 sr1: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray sr 4:0:1:0: Attached scsi generic sg5 type 5 scsi 5:0:0:0: CD-ROM PLEXTOR CD-R PX-W2410A 1.02 PQ: 0 ANSI: 5 sr2: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray sr 5:0:0:0: Attached scsi generic sg6 type 5 ACPI: PCI Interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.0: UHCI Host Controller uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 1 uhci_hcd 0000:00:10.0: irq 21, io base 0x00007400 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.1[A] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.1: UHCI Host Controller uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 2 uhci_hcd 0000:00:10.1: irq 21, io base 0x00007000 usb usb2: configuration #1 chosen from 1 choice hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.2[B] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.2: UHCI Host Controller uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 3 uhci_hcd 0000:00:10.2: irq 21, io base 0x00006800 usb usb3: configuration #1 chosen from 1 choice hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.3[B] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.3: UHCI Host Controller uhci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 4 uhci_hcd 0000:00:10.3: irq 21, io base 0x00006400 usb usb4: configuration #1 chosen from 1 choice hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.4[C] -> GSI 21 (level, low) -> IRQ 21 ehci_hcd 0000:00:10.4: EHCI Host Controller ehci_hcd 0000:00:10.4: new USB bus registered, assigned bus number 5 ehci_hcd 0000:00:10.4: irq 21, io mem 0xdd800000 ehci_hcd 0000:00:10.4: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 usb usb5: configuration #1 chosen from 1 choice hub 5-0:1.0: USB hub found hub 5-0:1.0: 8 ports detected ACPI: PCI Interrupt 0000:00:11.5[C] -> GSI 22 (level, low) -> IRQ 22 codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] Adding 2048276k swap on /dev/sdd3. Priority:-1 extents:1 across:2048276k Filesystem "md0": Disabling barriers, not supported by the underlying device device-mapper: ioctl: 4.13.0-ioctl (2007-10-18) initialised: dm-devel@redhat.com md: md1 stopped. md: bind md: bind md: bind md: bind raid5: device sdd1 operational as raid disk 0 raid5: device sda1 operational as raid disk 3 raid5: device sdb1 operational as raid disk 2 raid5: device sdc1 operational as raid disk 1 raid5: allocated 4203kB for md1 raid5: raid level 5 set md1 active with 4 out of 4 devices, algorithm 2 RAID5 conf printout: --- rd:4 wd:4 disk 0, o:1, dev:sdd1 disk 1, o:1, dev:sdc1 disk 2, o:1, dev:sdb1 disk 3, o:1, dev:sda1 md1: bitmap initialized from disk: read 9/9 pages, set 0 bits created bitmap (135 pages) for device md1 Filesystem "dm-0": Disabling barriers, not supported by the underlying device XFS mounting filesystem dm-0 NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. acpid[2800]: segfault at ffffffbf ip ffffffbf sp bfe7839c error 4 warning: `avahi-daemon' uses 32-bit capabilities (legacy support in use) Installing knfsd (copyright (C) 1996 okir@monad.swb.de). env[3550]: segfault at ffffffbf ip ffffffbf sp bf92962c error 4 env[3551]: segfault at ffffffbf ip ffffffbf sp bff9648c error 4 env[3558]: segfault at ffffffbf ip ffffffbf sp bfb3683c error 4 [drm] Initialized drm 1.1.0 20060810 ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 16 [drm] Initialized radeon 1.29.0 20080528 on minor 0 agpgart: Found an AGP 3.5 compliant device at 0000:00:00.0. agpgart: Putting AGP V3 device at 0000:00:00.0 into 8x mode agpgart: Putting AGP V3 device at 0000:01:00.0 into 8x mode [drm] Setting GART location based on new memory map [drm] Loading R200 Microcode [drm] writeback test succeeded in 1 usecs kdm_greet[3710]: segfault at ffffffbf ip ffffffbf sp bfc5a3ac error 4 Filesystem "md0": XFS internal error xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. Caller 0xc01ddfa1 Pid: 161, comm: pdflush Not tainted 2.6.26.3 #12 [] ? xfs_cmn_err+0x34/0x60 [] xfs_error_report+0x4e/0x50 [] ? xfs_bmbt_lookup+0x2c1/0x4f0 [] xfs_btree_check_lblock+0x4d/0x150 [] ? xfs_bmbt_lookup+0x2c1/0x4f0 [] xfs_bmbt_lookup+0x2c1/0x4f0 [] xfs_bmbt_lookup_eq+0x25/0x30 [] xfs_bmap_add_extent_delay_real+0x72f/0x11b0 [] ? xfs_trans_log_buf+0x70/0x80 [] ? xfs_alloc_search_busy+0xb2/0xe0 [] ? xfs_alloc_vextent+0x33e/0x450 [] ? xfs_bmap_btalloc+0x743/0xa80 [] ? xfs_iext_bno_to_ext+0x89/0x1a0 [] ? get_page_from_freelist+0x239/0x4e0 [] xfs_bmap_add_extent+0x427/0x450 [] ? xfs_btree_init_cursor+0x28/0x1d0 [] xfs_bmapi+0xd12/0x12e0 [] ? kmem_zone_alloc+0x80/0xc0 [] xfs_iomap_write_allocate+0x254/0x3e0 [] ? xfs_trans_unlocked_item+0x38/0x50 [] xfs_iomap+0x327/0x370 [] ? submit_bio+0x6d/0x110 [] xfs_map_blocks+0x3e/0x90 [] xfs_page_state_convert+0x41a/0x810 [] ? blk_done_softirq+0x5a/0x70 [] xfs_vm_writepage+0x5a/0xf0 [] __writepage+0xb/0x40 [] write_cache_pages+0x17e/0x330 [] ? __writepage+0x0/0x40 [] ? xfs_bdstrat_cb+0x37/0x70 [] ? xfs_buf_iostart+0x42/0xb0 [] ? xfs_iflush+0x288/0x2f0 [] generic_writepages+0x23/0x30 [] xfs_vm_writepages+0x55/0x70 [] ? xfs_vm_writepages+0x0/0x70 [] do_writepages+0x2e/0x50 [] __writeback_single_inode+0x93/0x490 [] ? dm_table_any_congested+0x33/0x80 [dm_mod] [] ? raid1_congested+0x7c/0xb0 [] sync_sb_inodes+0x242/0x390 [] ? xfs_sync+0x3d/0x60 [] writeback_inodes+0x5e/0x140 [] wb_kupdate+0x7b/0xf0 [] ? pdflush+0x0/0x210 [] pdflush+0x110/0x210 [] ? wb_kupdate+0x0/0xf0 [] kthread+0x3a/0x70 [] ? kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 ======================= Filesystem "md0": XFS internal error xfs_trans_cancel at line 1163 of file fs/xfs/xfs_trans.c. Caller 0xc01fd04c Pid: 161, comm: pdflush Not tainted 2.6.26.3 #12 [] ? xfs_cmn_err+0x34/0x60 [] xfs_error_report+0x4e/0x50 [] ? xfs_iomap_write_allocate+0x35c/0x3e0 [] xfs_trans_cancel+0xca/0xf0 [] ? xfs_iomap_write_allocate+0x35c/0x3e0 [] xfs_iomap_write_allocate+0x35c/0x3e0 [] ? xfs_trans_unlocked_item+0x38/0x50 [] xfs_iomap+0x327/0x370 [] ? submit_bio+0x6d/0x110 [] xfs_map_blocks+0x3e/0x90 [] xfs_page_state_convert+0x41a/0x810 [] ? blk_done_softirq+0x5a/0x70 [] xfs_vm_writepage+0x5a/0xf0 [] __writepage+0xb/0x40 [] write_cache_pages+0x17e/0x330 [] ? __writepage+0x0/0x40 [] ? xfs_bdstrat_cb+0x37/0x70 [] ? xfs_buf_iostart+0x42/0xb0 [] ? xfs_iflush+0x288/0x2f0 [] generic_writepages+0x23/0x30 [] xfs_vm_writepages+0x55/0x70 [] ? xfs_vm_writepages+0x0/0x70 [] do_writepages+0x2e/0x50 [] __writeback_single_inode+0x93/0x490 [] ? dm_table_any_congested+0x33/0x80 [dm_mod] [] ? raid1_congested+0x7c/0xb0 [] sync_sb_inodes+0x242/0x390 [] ? xfs_sync+0x3d/0x60 [] writeback_inodes+0x5e/0x140 [] wb_kupdate+0x7b/0xf0 [] ? pdflush+0x0/0x210 [] pdflush+0x110/0x210 [] ? wb_kupdate+0x0/0xf0 [] kthread+0x3a/0x70 [] ? kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 ======================= xfs_force_shutdown(md0,0x8) called from line 1164 of file fs/xfs/xfs_trans.c. Return address = 0xc020e402 Filesystem "md0": Corruption of in-memory data detected. Shutting down filesystem: md0 Please umount the filesystem, and rectify the problem(s) SysRq : Emergency Sync Filesystem "md0": xfs_log_force: error 5 returned. Emergency Sync complete SysRq : Emergency Remount R/O Filesystem "md0": xfs_log_force: error 5 returned. Filesystem "md0": xfs_log_force: error 5 returned. xfs_force_shutdown(md0,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xc021880c Filesystem "md0": xfs_log_force: error 5 returned. Filesystem "md0": xfs_log_force: error 5 returned. xfs_force_shutdown(md0,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xc021880c Filesystem "md0": xfs_log_force: error 5 returned. Filesystem "md0": xfs_log_force: error 5 returned. Emergency Remount complete SysRq : Resetting ################################################################################## ################################################################################## ################################################################################## ################################################################################## ################################################################################## ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata1.00: ATA-7: ST3320620AS, 3.AAJ, max UDMA/133 ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 0/32) ata1.00: configured for UDMA/100 ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata2.00: ATA-7: ST3320620AS, 3.AAE, max UDMA/133 ata2.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 0/32) ata2.00: configured for UDMA/100 scsi 0:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sd 0:0:0:0: [sda] Attached SCSI disk sd 0:0:0:0: Attached scsi generic sg0 type 0 scsi 1:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 1:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 1:0:0:0: [sdb] 625142448 512-byte hardware sectors (320073 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdb: sdb1 sdb2 sd 1:0:0:0: [sdb] Attached SCSI disk sd 1:0:0:0: Attached scsi generic sg1 type 0 ACPI: PCI Interrupt 0000:00:0f.0[B] -> GSI 20 (level, low) -> IRQ 20 sata_via 0000:00:0f.0: routed to hard irq line 0 scsi2 : sata_via scsi3 : sata_via ata3: SATA max UDMA/133 cmd 0x9800 ctl 0x9400 bmdma 0x8400 irq 20 ata4: SATA max UDMA/133 cmd 0x9000 ctl 0x8800 bmdma 0x8408 irq 20 ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300) ata3.00: ATA-7: Maxtor 6L300S0, BANC1E00, max UDMA/133 ata3.00: 586114704 sectors, multi 16: LBA48 NCQ (not used) ata3.00: configured for UDMA/133 ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300) ata4.00: ATA-7: ST3320620AS, 3.AAC, max UDMA/133 ata4.00: 625134827 sectors, multi 16: LBA48 NCQ (depth 0/32) ata4.00: configured for UDMA/133 scsi 2:0:0:0: Direct-Access ATA Maxtor 6L300S0 BANC PQ: 0 ANSI: 5 sd 2:0:0:0: [sdc] 586114704 512-byte hardware sectors (300091 MB) sd 2:0:0:0: [sdc] Write Protect is off sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 2:0:0:0: [sdc] 586114704 512-byte hardware sectors (300091 MB) sd 2:0:0:0: [sdc] Write Protect is off sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdc: sdc1 sdc2 sd 2:0:0:0: [sdc] Attached SCSI disk sd 2:0:0:0: Attached scsi generic sg2 type 0 scsi 3:0:0:0: Direct-Access ATA ST3320620AS 3.AA PQ: 0 ANSI: 5 sd 3:0:0:0: [sdd] 625134827 512-byte hardware sectors (320069 MB) sd 3:0:0:0: [sdd] Write Protect is off sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 3:0:0:0: [sdd] 625134827 512-byte hardware sectors (320069 MB) sd 3:0:0:0: [sdd] Write Protect is off sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdd: sdd1 sdd2 sdd3 sd 3:0:0:0: [sdd] Attached SCSI disk sd 3:0:0:0: Attached scsi generic sg3 type 0 PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12 serio: i8042 KBD port at 0x60,0x64 irq 1 serio: i8042 AUX port at 0x60,0x64 irq 12 mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard as /class/input/input2 md: raid1 personality registered for level 1 raid6: int32x1 925 MB/s raid6: int32x2 972 MB/s raid6: int32x4 777 MB/s raid6: int32x8 601 MB/s raid6: mmxx1 1730 MB/s raid6: mmxx2 3105 MB/s raid6: sse1x1 1644 MB/s raid6: sse1x2 2789 MB/s raid6: using algorithm sse1x2 (2789 MB/s) md: raid6 personality registered for level 6 md: raid5 personality registered for level 5 md: raid4 personality registered for level 4 TCP cubic registered Using IPI Shortcut mode input: ImExPS/2 Generic Explorer Mouse as /class/input/input3 md: Autodetecting RAID arrays. md: Scanned 2 and added 2 devices. md: autorun ... md: considering sdc2 ... md: adding sdc2 ... md: adding sdb2 ... md: created md0 md: bind md: bind md: running: raid1: raid set md0 active with 2 out of 2 mirrors md: ... autorun DONE. Filesystem "md0": Disabling barriers, not supported by the underlying device XFS mounting filesystem md0 Starting XFS recovery on filesystem: md0 (logdev: internal) Ending XFS recovery on filesystem: md0 (logdev: internal) VFS: Mounted root (xfs filesystem) readonly. Freeing unused kernel memory: 228k freed Linux agpgart interface v0.103 agpgart: Detected VIA KT400/KT400A/KT600 chipset agpgart: AGP aperture is 32M @ 0xfc000000 ACPI: PCI Interrupt 0000:00:0f.1[A] -> GSI 20 (level, low) -> IRQ 20 scsi4 : pata_via scsi5 : pata_via ata5: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0x7800 irq 14 ata6: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x7808 irq 15 usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb USB Universal Host Controller Interface driver v3.0 ata5.00: ATAPI: PLEXTOR DVDR PX-708A, 1.02, max UDMA/33 ata5.01: ATAPI: TSSTcorpCD/DVDW SH-W162C, TS10, max UDMA/33 ata5.00: configured for UDMA/33 ata5.01: configured for UDMA/33 ata6.00: ATAPI: PLEXTOR CD-R PX-W2410A, 1.02, max UDMA/33 ata6.00: configured for UDMA/33 scsi 4:0:0:0: CD-ROM PLEXTOR DVDR PX-708A 1.02 PQ: 0 ANSI: 5 sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray Uniform CD-ROM driver Revision: 3.20 sr 4:0:0:0: Attached scsi generic sg4 type 5 scsi 4:0:1:0: CD-ROM TSSTcorp CD/DVDW SH-W162C TS10 PQ: 0 ANSI: 5 sr1: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray sr 4:0:1:0: Attached scsi generic sg5 type 5 scsi 5:0:0:0: CD-ROM PLEXTOR CD-R PX-W2410A 1.02 PQ: 0 ANSI: 5 sr2: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray sr 5:0:0:0: Attached scsi generic sg6 type 5 ACPI: PCI Interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.0: UHCI Host Controller uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 1 uhci_hcd 0000:00:10.0: irq 21, io base 0x00007400 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.1[A] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.1: UHCI Host Controller uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 2 uhci_hcd 0000:00:10.1: irq 21, io base 0x00007000 usb usb2: configuration #1 chosen from 1 choice hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.2[B] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.2: UHCI Host Controller uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 3 uhci_hcd 0000:00:10.2: irq 21, io base 0x00006800 usb usb3: configuration #1 chosen from 1 choice hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.3[B] -> GSI 21 (level, low) -> IRQ 21 uhci_hcd 0000:00:10.3: UHCI Host Controller uhci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 4 uhci_hcd 0000:00:10.3: irq 21, io base 0x00006400 usb usb4: configuration #1 chosen from 1 choice hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected ACPI: PCI Interrupt 0000:00:10.4[C] -> GSI 21 (level, low) -> IRQ 21 ehci_hcd 0000:00:10.4: EHCI Host Controller ehci_hcd 0000:00:10.4: new USB bus registered, assigned bus number 5 ehci_hcd 0000:00:10.4: irq 21, io mem 0xdd800000 ehci_hcd 0000:00:10.4: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 usb usb5: configuration #1 chosen from 1 choice hub 5-0:1.0: USB hub found hub 5-0:1.0: 8 ports detected ACPI: PCI Interrupt 0000:00:11.5[C] -> GSI 22 (level, low) -> IRQ 22 codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] codec_read: codec 0 is not valid [0xfe0000] Adding 2048276k swap on /dev/sdd3. Priority:-1 extents:1 across:2048276k Filesystem "md0": Disabling barriers, not supported by the underlying device device-mapper: ioctl: 4.13.0-ioctl (2007-10-18) initialised: dm-devel@redhat.com md: md1 stopped. md: bind md: bind md: bind md: bind raid5: device sdd1 operational as raid disk 0 raid5: device sda1 operational as raid disk 3 raid5: device sdb1 operational as raid disk 2 raid5: device sdc1 operational as raid disk 1 raid5: allocated 4203kB for md1 raid5: raid level 5 set md1 active with 4 out of 4 devices, algorithm 2 RAID5 conf printout: --- rd:4 wd:4 disk 0, o:1, dev:sdd1 disk 1, o:1, dev:sdc1 disk 2, o:1, dev:sdb1 disk 3, o:1, dev:sda1 md1: bitmap initialized from disk: read 9/9 pages, set 2 bits created bitmap (135 pages) for device md1 Filesystem "dm-0": Disabling barriers, not supported by the underlying device XFS mounting filesystem dm-0 NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. warning: `avahi-daemon' uses 32-bit capabilities (legacy support in use) Installing knfsd (copyright (C) 1996 okir@monad.swb.de). [drm] Initialized drm 1.1.0 20060810 ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 16 [drm] Initialized radeon 1.29.0 20080528 on minor 0 agpgart: Found an AGP 3.5 compliant device at 0000:00:00.0. agpgart: Putting AGP V3 device at 0000:00:00.0 into 8x mode agpgart: Putting AGP V3 device at 0000:01:00.0 into 8x mode [drm] Setting GART location based on new memory map [drm] Loading R200 Microcode [drm] writeback test succeeded in 1 usecs From owner-xfs@oss.sgi.com Sat Aug 23 05:10:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 23 Aug 2008 05:11:00 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7NCAuIr014710 for ; Sat, 23 Aug 2008 05:10:57 -0700 X-ASG-Debug-ID: 1219493537-413c02f40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CA1581A3BEEF for ; Sat, 23 Aug 2008 05:12:18 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by cuda.sgi.com with ESMTP id WjE5NDLCXwtcgtKz for ; Sat, 23 Aug 2008 05:12:18 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis) id 0MKxQS-1KWryW2LZF-0000N7; Sat, 23 Aug 2008 14:12:13 +0200 Date: Sat, 23 Aug 2008 14:12:12 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: Dan Redig cc: xfs@oss.sgi.com, burgwalds@saic.com X-ASG-Orig-Subj: Re: xfs_quota free Subject: Re: xfs_quota free In-Reply-To: <3302272903.2274591@chef.nerp.net> Message-ID: References: <3302272903.2274591@chef.nerp.net> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX18ML5oaM/cwMnhpfwxzOGlO8hhkFSvLLC83ggH tbvPi5v/3xMmvfrUQ3+HzGvCYbVvEZk06WHSJmnQyEyPcXalUK YDxkc/gmOb8CJ7J0h/rDg== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.187] X-Barracuda-Start-Time: 1219493538 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3480 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8077/Sat Aug 23 00:28:12 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17689 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Sat, 22 Aug 2008, Dan Redig wrote: > I'm running 2.6.22 on CentOS 4.4. I don't have the version of The post I mentioned was just one of a few search results. It said that this would be fixed in "recent kernels". The post is from 10/2007, where kernel 2.6.23 was "current", so the statement is rather vague :-\ > XFS tools on me right now. I do believe I got the right package. Would > the 32 bit binaries format and manipulate he other features of XFS > properly and only fail on free blocks? Please see Eric's post; what system (kernel, userland) are you on? C. -- BOFH excuse #301: appears to be a Slow/Narrow SCSI-0 Interface problem From owner-xfs@oss.sgi.com Sat Aug 23 05:12:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 23 Aug 2008 05:12:49 -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.6 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 m7NCCjW5015007 for ; Sat, 23 Aug 2008 05:12:46 -0700 X-ASG-Debug-ID: 1219493647-6386027c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4A2F83C54BC for ; Sat, 23 Aug 2008 05:14:07 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by cuda.sgi.com with ESMTP id HadlLCPMpmJhyu9l for ; Sat, 23 Aug 2008 05:14:07 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis) id 0MKwh2-1KWs0M1RzI-0007KW; Sat, 23 Aug 2008 14:14:06 +0200 Date: Sat, 23 Aug 2008 14:14:06 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX1+KlGgLHCcvqg+HgoQCoO/us0ua8950Mue9TAD 8+aHMCNhOnSzVUijU/zdegdRDh86v9aKcKTW/UH2KDCBwSSCWO 4TvEth3BjGAhguH/V1I4A== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.188] X-Barracuda-Start-Time: 1219493648 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.3480 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8077/Sat Aug 23 00:28:12 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17690 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Sat, 23 Aug 2008, Christian Kujau wrote: > # xfs_repair -V > xfs_repair version 2.9.8 The same errors occur when running with xfs_check from the latest CVS checkout :-\ > # blockdev --getsize64 /dev/mapper/md3 > 147445706752 > # xfs_check /dev/mapper/md3 > agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) > link count mismatch for inode 128 (name ?), nlink 333, counted 334 > link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 > Command exited with non-zero status 3 Anybody? Thanks, Christian. -- BOFH excuse #301: appears to be a Slow/Narrow SCSI-0 Interface problem From owner-xfs@oss.sgi.com Sat Aug 23 05:48:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 23 Aug 2008 05:48:47 -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.6 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 m7NCmfjt016729 for ; Sat, 23 Aug 2008 05:48:42 -0700 X-ASG-Debug-ID: 1219495801-368c039b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from emh02.mail.saunalahti.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0AB8FACC0A for ; Sat, 23 Aug 2008 05:50:02 -0700 (PDT) Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) by cuda.sgi.com with ESMTP id lhlGEiLCXMeYanwA for ; Sat, 23 Aug 2008 05:50:02 -0700 (PDT) Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh02-2.mail.saunalahti.fi (Postfix) with SMTP id 8D122EF33C; Sat, 23 Aug 2008 15:50:00 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A077AB8F109; Sat, 23 Aug 2008 15:50:00 +0300 Received: from dhcppc2 (a91-153-142-188.elisa-laajakaista.fi [91.153.142.188]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 1B215E51E0; Sat, 23 Aug 2008 15:49:51 +0300 (EEST) Date: Sat, 23 Aug 2008 15:52:31 +0300 (MET DST) From: Szabolcs Szakacsits X-X-Sender: szaka@dhcppc2 To: Dave Chinner cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: Message-ID: References: <200808201613.AA00212@capsicum.lab.ntt.co.jp> <20080820143916.1a7eddab.akpm@linux-foundation.org> <20080821021259.GA5706@disturbed> <20080821051508.GB5706@disturbed> <20080821060418.GC5706@disturbed> <20080821082532.GE5706@disturbed> <20080822022459.GL5706@disturbed> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Antivirus: VAMS X-Barracuda-Connect: emh02.mail.saunalahti.fi[62.142.5.108] X-Barracuda-Start-Time: 1219495802 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0200 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.3483 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8077/Sat Aug 23 00:28:12 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17691 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: szaka@ntfs-3g.org Precedence: bulk X-list: xfs On Fri, 22 Aug 2008, Szabolcs Szakacsits wrote: > On Fri, 22 Aug 2008, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 08:33:50PM +0300, Szabolcs Szakacsits wrote: > > > > > The 'nobarrier' mount option made a big improvement: > > > > INteresting. Barriers make only a little difference on my laptop; > > 10-20% slower. But yes, barriers will have this effect on XFS. > > > > If you've got NCQ, then you'd do better to turn off write caching > > on the drive, turn off barriers and use NCQ to give you back the > > performance that the write cache used to. That is, of course, > > assuming the NCQ implementation doesn't suck.... > > Write cache off, nobarrier and AHCI NCQ lowered the XFS result: > > MB/s Runtime (s) > ----- ----------- > btrfs unstable 17.09 572 > ext3 13.24 877 > btrfs 0.16 12.33 793 > ntfs-3g unstable 11.52 673 > nilfs2 2nd+ runs 11.29 674 > reiserfs 8.38 966 > xfs nobarrier 7.89 949 > nilfs2 1st run 4.95 3800 > xfs nobarrier, ncq, wc off 3.81 1973 > xfs 1.88 3901 Retested with a different disk, SATA-II, NCQ, capable of 70-110 MB/s read/write: MB/s Runtime (s) ----- ----------- btrfs unstable, no dup 51.42 168 btrfs unstable 42.67 197 ext4 2.6.26 35.63 245 nilfs2 2nd+ runs 26.43 287 ntfs-3g unstable 21.41 370 ext3 19.92 559 xfs nobarrier 14.17 562 reiserfs 13.11 595 nilfs2 1st run 12.06 3719 xfs nobarrier, ncq, wc off 6.89 1070 xfs 1.95 3786 Szaka -- NTFS-3G: http://ntfs-3g.org From owner-xfs@oss.sgi.com Sun Aug 24 09:58:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 09:58:53 -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.6 required=5.0 tests=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 m7OGwGAH014408 for ; Sun, 24 Aug 2008 09:58:16 -0700 X-ASG-Debug-ID: 1219597176-2f3900ec0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.screens.ru (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9DBB6FAE441 for ; Sun, 24 Aug 2008 09:59:37 -0700 (PDT) Received: from mail.screens.ru (x346.tv-sign.ru [89.108.83.215]) by cuda.sgi.com with ESMTP id nKCoONIdWMSxqgr0 for ; Sun, 24 Aug 2008 09:59:37 -0700 (PDT) Received: from [89.175.178.74] (helo=oleg) by mail.screens.ru with smtp (Exim 4.66) (envelope-from ) id 1KXIvj-0001v0-DA; Sun, 24 Aug 2008 20:59:07 +0400 Received: by oleg (nbSMTP-1.00) for uid 1001 oleg@tv-sign.ru; Sun, 24 Aug 2008 21:03:57 +0400 (MSD) Date: Sun, 24 Aug 2008 21:03:57 +0400 From: Oleg Nesterov To: Andrew Morton Cc: Takashi Sato , linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, hch@infradead.org, axboe@kernel.dk, mtk.manpages@googlemail.com, linux-kernel@vger.kernel.org X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080824170357.GC3792@tv-sign.ru> References: <20080818212856t-sato@mail.jp.nec.com> <20080821132006.9949101c.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080821132006.9949101c.akpm@linux-foundation.org> User-Agent: Mutt/1.5.11 X-Barracuda-Connect: x346.tv-sign.ru[89.108.83.215] X-Barracuda-Start-Time: 1219597178 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.3595 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8081/Sun Aug 24 06:41:12 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17692 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: oleg@tv-sign.ru Precedence: bulk X-list: xfs On 08/21, Andrew Morton wrote: > > On Mon, 18 Aug 2008 21:28:56 +0900 > Takashi Sato wrote: > > > +void del_freeze_timeout(struct block_device *bdev) > > +{ > > + /* > > + * It's possible that the delayed work task (freeze_timeout()) calls > > + * del_freeze_timeout(). If the delayed work task calls > > + * cancel_delayed_work_sync((), the deadlock will occur. > > + * So we need this check (delayed_work_pending()). > > + */ > > + if (delayed_work_pending(&bdev->bd_freeze_timeout)) > > + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); > > +} I don't understand this patch, but the code above looks strange to me... Let's suppose del_freeze_timeout() is called by ioctl_thaw()->thaw_bdev(). Now, IF delayed_work_pending() == T we can deadlock if the timer expires before cancel_delayed_work_sync() cancels it? in that case we are going to wait for this work, but freeze_timeout()->thaw_bdev() will block on ->bd_freeze_sem, no? ELSE we don't really flush the work, it is possible the timer has already expired and the work is pending. It will run later. Perhaps this all is correct, but in that case, why can't we just do void del_freeze_timeout(struct block_device *bdev) { cancel_delayed_work(&bdev->bd_freeze_timeout); } ? > Perhaps cancel_delayed_work_sync() shouldn't hang up if called from the > work handler? This is trivial, --- kernel/workqueue.c +++ kernel/workqueue.c @@ -516,6 +516,9 @@ static void wait_on_cpu_work(struct cpu_ struct wq_barrier barr; int running = 0; + if (cwq->thread == current) + return; + spin_lock_irq(&cwq->lock); if (unlikely(cwq->current_work == work)) { insert_wq_barrier(cwq, &barr, cwq->worklist.next); but do we really need this? We have a similar hack in flush_cpu_workqueue(), and we are going to kill it once we fix the callers. I dunno. Oleg. From owner-xfs@oss.sgi.com Sun Aug 24 14:59:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 14:59:52 -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.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23 autolearn=no 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 m7OLxlXa032633 for ; Sun, 24 Aug 2008 14:59:48 -0700 X-ASG-Debug-ID: 1219615267-7783025e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx3.mail.elte.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 746ECFAF148 for ; Sun, 24 Aug 2008 15:01:07 -0700 (PDT) Received: from mx3.mail.elte.hu (mx3.mail.elte.hu [157.181.1.138]) by cuda.sgi.com with ESMTP id omBjLlXPlK4xf1sl for ; Sun, 24 Aug 2008 15:01:07 -0700 (PDT) Received: from hermes.teteny.elte.hu ([157.181.96.2] helo=hermes.teteny.bme.hu) by mx3.mail.elte.hu with esmtp (Exim) id 1KXNdq-00054W-1a from for ; Mon, 25 Aug 2008 00:01:06 +0200 Received: from localhost (localhost [127.0.0.1]) by hermes.teteny.bme.hu (Postfix) with ESMTP id A5C501E0003FF for ; Mon, 25 Aug 2008 00:05:25 +0200 (CEST) X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at teteny.bme.hu Received: from hermes.teteny.bme.hu ([127.0.0.1]) by localhost (hermes.teteny.bme.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZemFTzHVQOP0 for ; Mon, 25 Aug 2008 00:05:14 +0200 (CEST) Received: from [152.66.235.6] (revana.teteny.bme.hu [152.66.235.6]) by hermes.teteny.bme.hu (Postfix) with ESMTP id 89C3A1E0003FE for ; Mon, 25 Aug 2008 00:05:04 +0200 (CEST) Message-ID: <48B1D9FC.4090203@bteam.hu> Date: Mon, 25 Aug 2008 00:00:28 +0200 From: Nagy Zoltan User-Agent: Thunderbird 2.0.0.16 (X11/20080807) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs shutdown with 2.6.27-rc4 Subject: xfs shutdown with 2.6.27-rc4 X-Enigmail-Version: 0.95.6 Content-Type: multipart/mixed; boundary="------------080804060204060506030502" X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] X-Barracuda-Connect: mx3.mail.elte.hu[157.181.1.138] X-Barracuda-Start-Time: 1219615269 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3615 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Status: Clean X-archive-position: 17693 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: kirk@bteam.hu Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------080804060204060506030502 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hello, i'm having a strange problem with our new storage cluster, i've read nearly every xfs related threads (which contained:"called from line 1164 of file fs/xfs/xfs_trans.c" - i've surprised that the line number gives very accurate results - and helps to omit old problems ) i've rsynced more than 4T of data into the system (and i've hit the xfs-rsync bug, but it's working now without any problems) problem occurs when copying simultaniously from windows/linux boxes to the filesystem thru samba causes the crashes. with older kernels the whole system crashed, with circular locking problems (similar:http://oss.sgi.com/archives/xfs/2008-08/msg00354.html ) but with 2.6.27-rc4, it's just shutdows the filesystem, and i'm able to remount it. the biggest problem is that i can't cause the system to crash with tests - i'm currently copying kernel trees in parrallel i'm not sure that this is an xfs bug, because: rsync worked, and when i tweaked the proc values and run test after test, it doesn't crashed. the setup is: node:(x8) kernel:2.6.27-rc4 raid5 dmcrypt iscsi_target (0.4.16) master: kernel:2.6.27-rc4 openiscsid (2.0-870) raid5 xfs samba (3.0.24-6etch10) $ xfs_info /dev/md3 meta-data=/dev/md3 isize=256 agcount=128, agsize=26718592 blks = sectsz=4096 attr=1 data = bsize=4096 blocks=3418704352, imaxpct=25 = sunit=128 swidth=896 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=2 = sectsz=4096 sunit=1 blks realtime =none extsz=458752 blocks=0, rtextents=0 - -- Nagy Zoltan (kirk) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkix2fsACgkQLcjF8xTqkoBrvwCg22IjkGT3WRVNCRBIDp56CTNw uZYAoK7pImMY7efqaxwKqhV0H5hDYdUT =Zg5Z -----END PGP SIGNATURE----- --------------080804060204060506030502 Content-Type: text/plain; name="wiki.trace3" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wiki.trace3" XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1736 of file fs/xfs/xfs_bmap.c. Caller 0xc034b05f Pid: 18801, comm: pdflush Not tainted 2.6.27-rc4 #4 [] xfs_bmap_add_extent_unwritten_real+0x1498/0x16a0 [] xfs_bmap_add_extent+0x45f/0x560 [] xfs_alloc_vextent+0x267/0x4f0 [] xfs_trans_log_inode+0x1c/0x50 [] xfs_bmap_add_extent+0x45f/0x560 [] xfs_bmapi+0x9db/0x15f0 [] xfs_bmap_search_multi_extents+0x98/0xe0 [] xfs_iomap_write_allocate+0x2de/0x490 [] xfs_iomap+0x334/0x410 [] xfs_map_blocks+0x44/0x90 [] xfs_page_state_convert+0x536/0x790 [] xfs_vm_writepage+0x60/0x100 [] __writepage+0x8/0x30 [] write_cache_pages+0x225/0x340 [] __writepage+0x0/0x30 [] submit_bio+0x63/0xf0 [] generic_writepages+0x20/0x30 [] do_writepages+0x2b/0x50 [] __writeback_single_inode+0x86/0x310 [] xfs_trans_first_ail+0x16/0x30 [] xfs_log_need_covered+0x6a/0xb0 [] generic_sync_sb_inodes+0x1de/0x2c0 [] writeback_inodes+0x87/0xb0 [] wb_kupdate+0x85/0xf0 [] pdflush+0x0/0x1b0 [] pdflush+0xee/0x1b0 [] wb_kupdate+0x0/0xf0 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x1c ======================= Filesystem "md3": XFS internal error xfs_trans_cancel at line 1164 of file fs/xfs/xfs_trans.c. Caller 0xc0373074 Pid: 18801, comm: pdflush Not tainted 2.6.27-rc4 #4 [] xfs_trans_cancel+0xe9/0x110 [] xfs_iomap_write_allocate+0x3a4/0x490 [] xfs_iomap_write_allocate+0x3a4/0x490 [] xfs_iomap+0x334/0x410 [] xfs_map_blocks+0x44/0x90 [] xfs_page_state_convert+0x536/0x790 [] xfs_vm_writepage+0x60/0x100 [] __writepage+0x8/0x30 [] write_cache_pages+0x225/0x340 [] __writepage+0x0/0x30 [] submit_bio+0x63/0xf0 [] generic_writepages+0x20/0x30 [] do_writepages+0x2b/0x50 [] __writeback_single_inode+0x86/0x310 [] xfs_trans_first_ail+0x16/0x30 [] xfs_log_need_covered+0x6a/0xb0 [] generic_sync_sb_inodes+0x1de/0x2c0 [] writeback_inodes+0x87/0xb0 [] wb_kupdate+0x85/0xf0 [] pdflush+0x0/0x1b0 [] pdflush+0xee/0x1b0 [] wb_kupdate+0x0/0xf0 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x1c ======================= xfs_force_shutdown(md3,0x8) called from line 1165 of file fs/xfs/xfs_trans.c. Return address = 0xc0385451 Filesystem "md3": Corruption of in-memory data detected. Shutting down filesystem: md3 Please umount the filesystem, and rectify the problem(s) Filesystem "md3": xfs_log_force: error 5 returned. Filesystem "md3": xfs_log_force: error 5 returned. --------------080804060204060506030502 Content-Type: text/plain; name="wiki.trace2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wiki.trace2" Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1af Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1af Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1af Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1ac Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1ac Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1ac Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1a9 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1a9 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 1a9 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f4 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f4 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f5 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f5 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f6 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f6 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f7 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f7 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f8 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f8 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f9 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f9 Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fa Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fa Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fb Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fb Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fc Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fc Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fd Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fd Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fe Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: fe Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: ff Filesystem "md3": Access to block zero in inode 537262150 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: ff Filesystem "md3": XFS internal error xfs_trans_cancel at line 1163 of file fs/xfs/xfs_trans.c. Caller 0xc035db84 Pid: 18598, comm: pdflush Not tainted 2.6.26.3 #2 [] xfs_trans_cancel+0xe9/0x110 [] xfs_iomap_write_allocate+0x3a4/0x490 [] xfs_iomap_write_allocate+0x3a4/0x490 [] xfs_iomap+0x334/0x410 [] xfs_map_blocks+0x44/0x90 [] xfs_page_state_convert+0x53f/0x7a0 [] xfs_vm_writepage+0x60/0x100 [] __writepage+0x8/0x30 [] write_cache_pages+0x215/0x300 [] __writepage+0x0/0x30 [] generic_writepages+0x20/0x30 [] do_writepages+0x2b/0x50 [] __writeback_single_inode+0x86/0x310 [] hrtick_set+0x67/0x110 [] get_dirty_limits+0x16/0x2c0 [] sync_sb_inodes+0x1ce/0x2b0 [] writeback_inodes+0x91/0xc0 [] background_writeout+0x93/0xc0 [] pdflush+0x0/0x1b0 [] pdflush+0xee/0x1b0 [] background_writeout+0x0/0xc0 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x14 ======================= xfs_force_shutdown(md3,0x8) called from line 1164 of file fs/xfs/xfs_trans.c. Return address = 0xc0370131 Filesystem "md3": Corruption of in-memory data detected. Shutting down filesystem: md3 Please umount the filesystem, and rectify the problem(s) BUG: unable to handle kernel NULL pointer dereference at 00000000 IP: [] xfs_buf_delwri_split+0x59/0xf0 *pdpt = 00000000334b0001 *pde = 0000000000000000 Oops: 0000 [#1] SMP Modules linked in: iscsi_tcp libiscsi scsi_transport_iscsi Pid: 927, comm: xfsbufd Not tainted (2.6.26.3 #2) EIP: 0060:[] EFLAGS: 00010282 CPU: 1 EIP is at xfs_buf_delwri_split+0x59/0xf0 EAX: 00000000 EBX: f5037cc0 ECX: 00000000 EDX: 00000000 ESI: ffffffdc EDI: f2501fbc EBP: f35003b0 ESP: f2501f98 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Process xfsbufd (pid: 927, ti=f2500000 task=f30cd440 task.ti=f2500000) Stack: 00001194 f35003b8 00000001 00000000 00001194 00000000 f2501fbc f3500380 c037ecf0 f2501fbc f2501fbc fffffffc f3500380 c037ec90 00000000 c0137062 c0137020 00000000 00000000 c0103aa3 f24ffdc0 00000000 00000000 00000000 Call Trace: [] xfsbufd+0x60/0x100 [] xfsbufd+0x0/0x100 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x14 ======================= Code: 7e e3 2e 00 8b 43 30 31 c9 8d 58 dc 39 c5 8b 53 24 89 4c 24 08 0f 84 7e 00 00 00 8d 72 dc eb 15 89 f6 ff 44 24 08 8d 46 24 39 c5 <8b> 56 24 74 69 89 f3 8d 72 dc 89 d8 e8 96 f1 ff ff 85 c0 75 e2 EIP: [] xfs_buf_delwri_split+0x59/0xf0 SS:ESP 0068:f2501f98 ---[ end trace 6879b7e6cabe4008 ]--- Filesystem "md3": xfs_log_force: error 5 returned. Filesystem "md3": xfs_log_force: error 5 returned. --------------080804060204060506030502-- From owner-xfs@oss.sgi.com Sun Aug 24 17:38:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 17:38:18 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7P0cDgS013286 for ; Sun, 24 Aug 2008 17:38:14 -0700 X-ASG-Debug-ID: 1219624774-411b023b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 543291A3F06E for ; Sun, 24 Aug 2008 17:39:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id W3Xjz6Yhd4Lf3rFl for ; Sun, 24 Aug 2008 17:39:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEEAKuZsUh5LD0wiGdsb2JhbACSLgEBDyCfZIFq X-IronPort-AV: E=Sophos;i="4.32,264,1217773800"; d="scan'208";a="179358124" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Aug 2008 10:09:31 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXQ7F-0006lH-Ts; Mon, 25 Aug 2008 10:39:29 +1000 Date: Mon, 25 Aug 2008 10:39:29 +1000 From: Dave Chinner To: Christian Kujau Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket Message-ID: <20080825003929.GN5706@disturbed> Mail-Followup-To: Christian Kujau , xfs@oss.sgi.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219624776 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.3626 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17694 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sat, Aug 23, 2008 at 02:14:06PM +0200, Christian Kujau wrote: > On Sat, 23 Aug 2008, Christian Kujau wrote: >> # xfs_repair -V >> xfs_repair version 2.9.8 > > The same errors occur when running with xfs_check from the latest CVS > checkout :-\ > >> # blockdev --getsize64 /dev/mapper/md3 >> 147445706752 >> # xfs_check /dev/mapper/md3 >> agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) >> link count mismatch for inode 128 (name ?), nlink 333, counted 334 >> link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 >> Command exited with non-zero status 3 > > Anybody? If you do a mount then unmount then rerun xfs-check, does it go away? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 24 18:00:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 18:01:02 -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 m7P10uYW014355 for ; Sun, 24 Aug 2008 18:00:56 -0700 X-ASG-Debug-ID: 1219626137-3842005c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B61BA3C87CE for ; Sun, 24 Aug 2008 18:02:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id qZ31Q5lNVk3zqj3H for ; Sun, 24 Aug 2008 18:02:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEEALOgsUh5LD0wiGdsb2JhbACSLgEBDyCfaYFq X-IronPort-AV: E=Sophos;i="4.32,264,1217773800"; d="scan'208";a="179393358" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Aug 2008 10:32:16 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXQTF-0007FR-OO; Mon, 25 Aug 2008 11:02:13 +1000 Date: Mon, 25 Aug 2008 11:02:13 +1000 From: Dave Chinner To: Daniel J Blueman Cc: 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: <20080825010213.GO5706@disturbed> Mail-Followup-To: Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@lst.de References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219626138 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.3628 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17695 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: > On 2.6.27-rc4 with various debug options enabled, lockdep claims lock > ordering issues with XFS [1] - easiest reproducer is just running > xfs_fsr. Mount options I was using were > 'nobarrier,noatime,nodiratime'. > > Thanks, > Daniel > > --- [1] > > ======================================================= > [ INFO: possible circular locking dependency detected ] > 2.6.27-rc4-224c #1 > ------------------------------------------------------- > xfs_fsr/5763 is trying to acquire lock: > (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 > > but task is already holding lock: > (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] > xfs_ilock+0xa5/0xb0 False positive. We do: xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); ..... xfs_iunlock(ip, XFS_ILOCK_EXCL); xfs_iunlock(tip, XFS_ILOCK_EXCL); ..... xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); Which is a perfectly valid thing to do. The problem is that lockdep is complaining about the second call to xfs_lock_two_inodes(), which uses the subclasses 2 and 3. effectively it is seeing: xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); iolock/2 ilock/2 iolock/3 ilock/3 ..... xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); ilock/2 ilock/3 But because the original lock order was ilock/2->iolock/3, the second call to xfs_lock_two_inodes is seeing iolock/3->ilock/2 which it then complains about.... Christoph - I think we're going to need to pass a lockdep 'order' flag into xfs_lock_two_inodes() to avoid this so the second call can use different classes to the first call. Or perhaps a '_nested' variant of the call... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 24 18:04:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 18:04:06 -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,J_CHICKENPOX_26 autolearn=no 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 m7P144TE014772 for ; Sun, 24 Aug 2008 18:04:04 -0700 X-ASG-Debug-ID: 1219626325-382400a40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C52933C87C0 for ; Sun, 24 Aug 2008 18:05:26 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by cuda.sgi.com with ESMTP id WfOCcTrGqGhMTusv for ; Sun, 24 Aug 2008 18:05:26 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1KXQWK3wpV-00070u; Mon, 25 Aug 2008 03:05:25 +0200 Date: Mon, 25 Aug 2008 03:05:24 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: Dave Chinner cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket In-Reply-To: <20080825003929.GN5706@disturbed> Message-ID: References: <20080825003929.GN5706@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX19HoZjP7cIy6TBgsHfEry9Yh5W1sGMob3bpI6Q JVwo1AR3ChWbtUt0BIkqtmcYtug70vgILzBX+JOAu2E16zFLvH 5MP6JP5NZ1Rpxbvcx7kzg== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.171] X-Barracuda-Start-Time: 1219626326 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.3628 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17696 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Mon, 25 Aug 2008, Dave Chinner wrote: > If you do a mount then unmount then rerun xfs-check, does it go > away? Did that a few times already, and the fs is getting mounted during boot anyway, but xfs_check still complains: -------------------------------------- # xfs_check /dev/mapper/md3 2>&1 | tee fsck_md3.log agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) link count mismatch for inode 128 (name ?), nlink 335, counted 336 link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 # mount /mnt/md3 # dmesg | tail -2 XFS mounting filesystem dm-3 Ending clean XFS mount for filesystem: dm-3 # grep xfs /proc/mounts /dev/mapper/md3 /mnt/md3 xfs ro,nosuid,nodev,noexec,nobarrier,noquota 0 0 -------------------------------------- The fs is ~138 GB in size. I shall run a backup and then just let xfs_repair have its way. I just thought you guys might have an idea what these messages are about and why mounting the fs (Thanks, Dave) does not seem to care. Christian. PS: Oh, I have: # zgrep _XFS /proc/config.gz CONFIG_XFS_FS=y # CONFIG_XFS_QUOTA is not set CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set # CONFIG_XFS_DEBUG is not set # cat /proc/fs/xfs/stat extent_alloc 49861 4503856 59412 3630353 abt 330869 3104741 117011 112751 blk_map 20948849 4520363 70729 4520363 70691 25570632 0 bmbt 9891 55289 3082 3852 dir 4844751 1337704 1509503 1036737 trans 0 3382656 12629 ig 3587165 210696 9 3376469 0 3299999 339798 log 342228 21840599 37111 18208 431 push_ail 3395311 0 22899 221180 5029793 934 97749 0 109 308 xstrat 13215 0 rw 953959 114144832 attr 105442 0 187 0 icluster 3519204 185118 2636028 vnodes 2 3379149 0 5676810 3379147 3379147 3379147 0 buf 18315811 8423133 9892813 4805 5035453 0 0 12242072 247641 xpc 18295668736 18285136116 146158324151 debug 0 -- BOFH excuse #452: Somebody ran the operating system through a spelling checker. From owner-xfs@oss.sgi.com Sun Aug 24 18:58:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 18:58:19 -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 m7P1wCYK017030 for ; Sun, 24 Aug 2008 18:58:13 -0700 X-ASG-Debug-ID: 1219629573-383d039d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8F7923C88DB for ; Sun, 24 Aug 2008 18:59:33 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 4wkOXg62WmJqG5oE for ; Sun, 24 Aug 2008 18:59:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkDAMOusUh5LD0wiGdsb2JhbACSLQEBAQ8gn3mBaw X-IronPort-AV: E=Sophos;i="4.32,264,1217773800"; d="scan'208";a="179453348" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Aug 2008 11:29:24 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXRMY-0008QV-2M; Mon, 25 Aug 2008 11:59:22 +1000 Date: Mon, 25 Aug 2008 11:59:22 +1000 From: Dave Chinner To: Nick Piggin Cc: gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080825015922.GP5706@disturbed> Mail-Followup-To: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808221229.11069.nickpiggin@yahoo.com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219629574 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.3632 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17697 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 22, 2008 at 12:29:10PM +1000, Nick Piggin wrote: > On Friday 22 August 2008 03:08, Dave Chinner wrote: > > On Thu, Aug 21, 2008 at 07:33:34PM +1000, Nick Piggin wrote: > > > > I don't really see it as too complex. If you know how you want the > > > request to be handled, then it should be possible to implement. > > > > That is the problem in a nutshell. Nobody can keep up with all > > the shiny new stuff that is being implemented,let alone the > > subtle behavioural differences that accumulate through such > > change... > > I'm not sure exactly what you mean.. I certainly have not been keeping > up with all the changes here as I'm spending most of my time on other > things lately... > > But from what I see, you've got a fairly good handle on analysing the > elevator behaviour (if only the end result). Only from having to do this analysis over and over again trying to understand what has changed in the elevator that has negated the effect of some previous optimisation.... > So if you were to tell > Jens that "these blocks" need more priority, or not to contribute to > a process's usage quota, etc. then I'm sure improvements could be > made. It's exactly this sort of complexity that is the problem. When the behaviour of such things change, filesystems that are optimised for the previous behaviour are not updated - we're not even aware that the elevator has been changed in some subtle manner that breaks the optimisations that have been done. To keep on top of this, we keep adding new variations and types and expect the filesystems to make best use of them (without documentation) to optimise for certain situations. Example - the new(ish) BIO_META tag that only CFQ understands. I can change the way XFS issues bios to use this tag to make CFQ behave the same way it used to w.r.t. metadata I/O from XFS, but then the deadline and AS will probably regress because they don't understand that tag and still need the old optimisations that just got removed. Ditto for prioritised bio dispatch - CFQ supports it but none of the others do. IOWs, I am left with a choice - optimise for a specific elevator (CFQ) to the detriment of all others (noop, as, deadline), or make the filesystem work best with the simple elevator (noop) and consider the smarter schedulers deficient if they are slower than the noop elevator.... > Or am I completely misunderstanding you? :) You're suggesting that I add complexity to solve the too much complexity problem.... ;) > > > > With the way the elevators have been regressing, > > > > improving and changing behaviour, > > > > > > AFAIK deadline, AS, and noop haven't significantly changed for years. > > > > Yet they've regularly shown performance regressions because other > > stuff has been changing around them, right? > > Is this rhetorical? Because I don't see how *they* could be showing > regular performance regressions. I get private email fairly often asking questions as to why XFS is slower going from, say, 2.6.23 to 2.6.24 and then speeds back up in 2.6.25. I seen a number of cases where the answer to this was that elevator 'x' with XFS in 2.6.x because for some reason it is much, much slower than the others on that workload on that hardware. As seen earlier in this thread, this can be caused by a problem with the hardware, firmware, configuration, driver bugs, etc - there are so many combinations of variables that can cause performance issues that often the only 'macro' level change that you can make to avoid them is to switch schedulers. IOWs, while a specific scheduler has not changed, the code around it has changed sufficiently for a specific elevator to show a regression compared to the otherr elevators..... Basically, the complexity of the interactions between the filesystems, elevators and the storage devices is such that there are transient second order effects occurring that are not reported widely because they are easily worked around by switching elevators. > Deadline literally had its last > behaviour change nearly a year ago, and before that was before > recorded (git) history. > > AS hasn't changed much more frequently, although I will grant that it > and CFS add a lot more complexity. So I would always compare results > with deadline or noop. Which can still change by things like changing merging behaviour. Granted, it is less complex, but still we can have subtle changes having major impact in less commonly run workloads... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 24 19:01:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 19:01:22 -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,J_CHICKENPOX_26 autolearn=no 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 m7P21LcJ017487 for ; Sun, 24 Aug 2008 19:01:21 -0700 X-ASG-Debug-ID: 1219629763-5ca400940000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1093A3C893F for ; Sun, 24 Aug 2008 19:02:43 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id vM4uyYfHy0rhGJzj for ; Sun, 24 Aug 2008 19:02:43 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkDAMOusUh5LD0wiGdsb2JhbACSLQEBAQ8gn3mBaw X-IronPort-AV: E=Sophos;i="4.32,264,1217773800"; d="scan'208";a="179456295" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Aug 2008 11:32:40 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXRPj-0008VK-36; Mon, 25 Aug 2008 12:02:39 +1000 Date: Mon, 25 Aug 2008 12:02:39 +1000 From: Dave Chinner To: Christian Kujau Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket Message-ID: <20080825020239.GQ5706@disturbed> Mail-Followup-To: Christian Kujau , xfs@oss.sgi.com References: <20080825003929.GN5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219629764 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.3632 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17698 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 03:05:24AM +0200, Christian Kujau wrote: > On Mon, 25 Aug 2008, Dave Chinner wrote: >> If you do a mount then unmount then rerun xfs-check, does it go >> away? > > Did that a few times already, and the fs is getting mounted during boot > anyway, but xfs_check still complains: Ok, so if you do a 'ls -i /' do you see an inode numbered 20208090? i.e. is it the unlinked bucket that is incorrect, or the root directory. > -------------------------------------- > # xfs_check /dev/mapper/md3 2>&1 | tee fsck_md3.log > agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) > link count mismatch for inode 128 (name ?), nlink 335, counted 336 > link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 > # mount /mnt/md3 > # dmesg | tail -2 > XFS mounting filesystem dm-3 > Ending clean XFS mount for filesystem: dm-3 > # grep xfs /proc/mounts > /dev/mapper/md3 /mnt/md3 xfs ro,nosuid,nodev,noexec,nobarrier,noquota 0 0 You are not using barriers. Are you using write caching? The problems with filesystem corruption on powerloss when using volatile write caching have traditionally shown up in directory corruptions... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 24 19:03:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 19:03:58 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7P23rUo017915 for ; Sun, 24 Aug 2008 19:03:53 -0700 X-ASG-Debug-ID: 1219629912-0419035f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from larry.melbourne.sgi.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 494531A3F32B for ; Sun, 24 Aug 2008 19:05:13 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by cuda.sgi.com with SMTP id qZNeEBS2hvgbUg7p for ; Sun, 24 Aug 2008 19:05:13 -0700 (PDT) Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA17792; Mon, 25 Aug 2008 12:05:07 +1000 Message-ID: <48B21507.9050708@sgi.com> Date: Mon, 25 Aug 2008 12:12:23 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: 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... References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> In-Reply-To: <20080825010213.GO5706@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: larry.melbourne.sgi.com[134.14.52.130] X-Barracuda-Start-Time: 1219629916 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.3632 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8082/Sun Aug 24 09:40:03 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17699 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: >> On 2.6.27-rc4 with various debug options enabled, lockdep claims lock >> ordering issues with XFS [1] - easiest reproducer is just running >> xfs_fsr. Mount options I was using were >> 'nobarrier,noatime,nodiratime'. >> >> Thanks, >> Daniel >> >> --- [1] >> >> ======================================================= >> [ INFO: possible circular locking dependency detected ] >> 2.6.27-rc4-224c #1 >> ------------------------------------------------------- >> xfs_fsr/5763 is trying to acquire lock: >> (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 >> >> but task is already holding lock: >> (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] >> xfs_ilock+0xa5/0xb0 > > False positive. We do: > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); Why not just change the above line to two lines: xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > ..... > xfs_iunlock(ip, XFS_ILOCK_EXCL); > xfs_iunlock(tip, XFS_ILOCK_EXCL); > ..... > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > > Which is a perfectly valid thing to do. > > The problem is that lockdep is complaining about the second call > to xfs_lock_two_inodes(), which uses the subclasses 2 and 3. > effectively it is seeing: > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > iolock/2 > ilock/2 > iolock/3 > ilock/3 > ..... > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > ilock/2 > ilock/3 > > > But because the original lock order was ilock/2->iolock/3, the > second call to xfs_lock_two_inodes is seeing iolock/3->ilock/2 > which it then complains about.... > > Christoph - I think we're going to need to pass a lockdep 'order' > flag into xfs_lock_two_inodes() to avoid this so the second call > can use different classes to the first call. Or perhaps a '_nested' > variant of the call... > > Cheers, > > Dave. From owner-xfs@oss.sgi.com Sun Aug 24 20:25:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 20:25:04 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_26 autolearn=no 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 m7P3P1N2028282 for ; Sun, 24 Aug 2008 20:25:01 -0700 X-ASG-Debug-ID: 1219634782-5a86020e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from larry.melbourne.sgi.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id CC3A3FAF57F for ; Sun, 24 Aug 2008 20:26:22 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by cuda.sgi.com with SMTP id x9BU1go9UiRBbiFJ for ; Sun, 24 Aug 2008 20:26:22 -0700 (PDT) Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA18902; Mon, 25 Aug 2008 13:26:17 +1000 Message-ID: <48B22659.9050301@sgi.com> Date: Mon, 25 Aug 2008 13:26:17 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christian Kujau CC: Dave Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket References: <20080825003929.GN5706@disturbed> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: larry.melbourne.sgi.com[134.14.52.130] X-Barracuda-Start-Time: 1219634783 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.3637 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8083/Sun Aug 24 17:48:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17700 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christian Kujau wrote: > On Mon, 25 Aug 2008, Dave Chinner wrote: >> If you do a mount then unmount then rerun xfs-check, does it go >> away? > > Did that a few times already, and the fs is getting mounted during boot > anyway, but xfs_check still complains: > > -------------------------------------- > # xfs_check /dev/mapper/md3 2>&1 | tee fsck_md3.log > agi unlinked bucket 26 is 20208090 in ag 0 (inode=20208090) > link count mismatch for inode 128 (name ?), nlink 335, counted 336 > link count mismatch for inode 20208090 (name ?), nlink 0, counted 1 > # mount /mnt/md3 > # dmesg | tail -2 > XFS mounting filesystem dm-3 > Ending clean XFS mount for filesystem: dm-3 > # grep xfs /proc/mounts > /dev/mapper/md3 /mnt/md3 xfs ro,nosuid,nodev,noexec,nobarrier,noquota 0 0 > -------------------------------------- > > > The fs is ~138 GB in size. I shall run a backup and then just let > xfs_repair have its way. I just thought you guys might have an idea what > these messages are about and why mounting the fs (Thanks, Dave) does not > seem to care. > The file systems is divided up into allocation groups, AGs. In each AG we have an unlinked list which is a hash table array whose elements (often called buckets) can point to a linked list of inodes. There is a next unlinked pointer in each inode. The list is used to represent unlinked inodes (inodes removed from directories) but are still referenced by processes. If we don't have a clean unmount then the unlinked lists may not be empty and we have to remove the inodes on the next mount (done at the same stage as log replay) by traversing the lists. So in your case, it looks like in AG#0 on the 26th element of the array it is pointing to inode# 20208090. Which would infer that inode#20208090 was unlinked but still had references to it at the time the filesystem was not cleanly unmounted (power loss, crash etc..). It looks like for the root directory inode #128 it has a count of 335 but it is finding 336 entries. And for inode#20208090 it has a link count of 0 and yet it has 1 entry in the directory. It's as if the inode was deleted (its link count decremented to zero and its parent directory decremented, unlinked list updated) but the directory wasn't updated properly. Hence Dave's comments: > Ok, so if you do a 'ls -i /' do you see an inode numbered 20208090? > i.e. is it the unlinked bucket that is incorrect, or the root > directory. > You are not using barriers. Are you using write caching? The > problems with filesystem corruption on powerloss when using volatile > write caching have traditionally shown up in directory > corruptions... --Tim From owner-xfs@oss.sgi.com Sun Aug 24 20:54:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 20:54:28 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7P3sP25030847 for ; Sun, 24 Aug 2008 20:54:25 -0700 X-ASG-Debug-ID: 1219636546-30f603380000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 48C521A3F54F for ; Sun, 24 Aug 2008 20:55:47 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id DTjUunKGlkAswP0S for ; Sun, 24 Aug 2008 20:55:47 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkDACTHsUh5LD0wiGdsb2JhbACSLQEBAQ8goAuBaw X-IronPort-AV: E=Sophos;i="4.32,264,1217773800"; d="scan'208";a="179554997" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Aug 2008 13:25:45 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXTB8-0002ds-La; Mon, 25 Aug 2008 13:55:42 +1000 Date: Mon, 25 Aug 2008 13:55:42 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: 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: <20080825035542.GR5706@disturbed> Mail-Followup-To: Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@lst.de References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> <48B21507.9050708@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48B21507.9050708@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219636548 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.3640 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8083/Sun Aug 24 17:48:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17701 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 12:12:23PM +1000, Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: >>> On 2.6.27-rc4 with various debug options enabled, lockdep claims lock >>> ordering issues with XFS [1] - easiest reproducer is just running >>> xfs_fsr. Mount options I was using were >>> 'nobarrier,noatime,nodiratime'. >>> >>> Thanks, >>> Daniel >>> >>> --- [1] >>> >>> ======================================================= >>> [ INFO: possible circular locking dependency detected ] >>> 2.6.27-rc4-224c #1 >>> ------------------------------------------------------- >>> xfs_fsr/5763 is trying to acquire lock: >>> (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 >>> >>> but task is already holding lock: >>> (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] >>> xfs_ilock+0xa5/0xb0 >> >> False positive. We do: >> >> xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > > Why not just change the above line to two lines: > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); Yeah, that'd work, but it implllies that we no longer allow xfs_lock_two_inodes() to take both inode locks at once. It would need a comment blaming^Wexplaining why lockdep requires us to do this, and then debug code in xfs_lock_two_inodes() to catch this when someone makes this mistake again in the future. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Aug 24 23:57:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 23:58:14 -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.6 required=5.0 tests=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 m7P6veDb009950 for ; Sun, 24 Aug 2008 23:57:42 -0700 X-ASG-Debug-ID: 1219647541-17f4028a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 220973C918E for ; Sun, 24 Aug 2008 23:59:01 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id YuffSWvGxSGAOYaH for ; Sun, 24 Aug 2008 23:59:01 -0700 (PDT) Received: from g229025.upc-g.chello.nl ([80.57.229.25] helo=[192.168.0.111]) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KXW1W-0002MW-7r; Mon, 25 Aug 2008 06:57:58 +0000 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... From: Peter Zijlstra To: Dave Chinner Cc: Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@lst.de In-Reply-To: <20080825010213.GO5706@disturbed> References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> Content-Type: text/plain Date: Mon, 25 Aug 2008 08:57:44 +0200 Message-Id: <1219647464.20732.25.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1219647543 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.3652 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8083/Sun Aug 24 17:48:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17702 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: peterz@infradead.org Precedence: bulk X-list: xfs On Mon, 2008-08-25 at 11:02 +1000, Dave Chinner wrote: > On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: > > On 2.6.27-rc4 with various debug options enabled, lockdep claims lock > > ordering issues with XFS [1] - easiest reproducer is just running > > xfs_fsr. Mount options I was using were > > 'nobarrier,noatime,nodiratime'. > > > > Thanks, > > Daniel > > > > --- [1] > > > > ======================================================= > > [ INFO: possible circular locking dependency detected ] > > 2.6.27-rc4-224c #1 > > ------------------------------------------------------- > > xfs_fsr/5763 is trying to acquire lock: > > (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 > > > > but task is already holding lock: > > (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] > > xfs_ilock+0xa5/0xb0 > > False positive. We do: > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > ..... > xfs_iunlock(ip, XFS_ILOCK_EXCL); > xfs_iunlock(tip, XFS_ILOCK_EXCL); > ..... > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > > Which is a perfectly valid thing to do. > > The problem is that lockdep is complaining about the second call > to xfs_lock_two_inodes(), which uses the subclasses 2 and 3. > effectively it is seeing: > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > iolock/2 > ilock/2 > iolock/3 > ilock/3 > ..... > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > ilock/2 > ilock/3 > > > But because the original lock order was ilock/2->iolock/3, the > second call to xfs_lock_two_inodes is seeing iolock/3->ilock/2 > which it then complains about.... Does the annotation I used for double_lock_balance()/double_unlock_balance() work? Basically, it assumes the held lock (this_rq) has subclass 0, but because double_lock_balance() can unlock and relock, depending on order, it can end up being 1 at the end. So what we do is reset the subclass (after unlocking the now 0 lock) to 0 using lock_set_subclass(). From owner-xfs@oss.sgi.com Sun Aug 24 23:59:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 24 Aug 2008 23:59:28 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7P6xPcO010190 for ; Sun, 24 Aug 2008 23:59:25 -0700 X-ASG-Debug-ID: 1219647647-3f0900730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 688D01A3FCC5; Mon, 25 Aug 2008 00:00:47 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id zsbEbVrSbcUC6knO; Mon, 25 Aug 2008 00:00:47 -0700 (PDT) Received: from g229025.upc-g.chello.nl ([80.57.229.25] helo=[192.168.0.111]) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KXW3H-0002O5-HR; Mon, 25 Aug 2008 06:59:47 +0000 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... From: Peter Zijlstra To: Dave Chinner Cc: Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@lst.de In-Reply-To: <20080825035542.GR5706@disturbed> References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> <48B21507.9050708@sgi.com> <20080825035542.GR5706@disturbed> Content-Type: text/plain Date: Mon, 25 Aug 2008 08:59:33 +0200 Message-Id: <1219647573.20732.28.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1219647648 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0029 1.0000 -2.0022 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.00 X-Barracuda-Spam-Status: No, SCORE=-2.00 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.3652 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8083/Sun Aug 24 17:48:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17703 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: peterz@infradead.org Precedence: bulk X-list: xfs On Mon, 2008-08-25 at 13:55 +1000, Dave Chinner wrote: > On Mon, Aug 25, 2008 at 12:12:23PM +1000, Lachlan McIlroy wrote: > > Dave Chinner wrote: > >> On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: > >>> On 2.6.27-rc4 with various debug options enabled, lockdep claims lock > >>> ordering issues with XFS [1] - easiest reproducer is just running > >>> xfs_fsr. Mount options I was using were > >>> 'nobarrier,noatime,nodiratime'. > >>> > >>> Thanks, > >>> Daniel > >>> > >>> --- [1] > >>> > >>> ======================================================= > >>> [ INFO: possible circular locking dependency detected ] > >>> 2.6.27-rc4-224c #1 > >>> ------------------------------------------------------- > >>> xfs_fsr/5763 is trying to acquire lock: > >>> (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 > >>> > >>> but task is already holding lock: > >>> (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] > >>> xfs_ilock+0xa5/0xb0 > >> > >> False positive. We do: > >> > >> xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > > > > Why not just change the above line to two lines: > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); > > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > > Yeah, that'd work, but it implllies that we no longer allow > xfs_lock_two_inodes() to take both inode locks at once. 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. Of course it could be that doesn't matter, because there is another serializing lock, but that isn't clear from this context. > It > would need a comment blaming^Wexplaining why lockdep requires > us to do this, and then debug code in xfs_lock_two_inodes() to > catch this when someone makes this mistake again in the future. From owner-xfs@oss.sgi.com Mon Aug 25 04:07:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 04:07:11 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, MIME_8BIT_HEADER autolearn=no 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 m7PB78mq000588 for ; Mon, 25 Aug 2008 04:07:08 -0700 X-ASG-Debug-ID: 1219662510-73b6037b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E8685FB10CA for ; Mon, 25 Aug 2008 04:08:30 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by cuda.sgi.com with ESMTP id 36kOpZz17RqIeNvC for ; Mon, 25 Aug 2008 04:08:30 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so1600820wfd.32 for ; Mon, 25 Aug 2008 04:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=6vnFexblZNkboH/KbxKI8KDc0tvzcnZ/srz8bUezBko=; b=de3nYplGFoOnp6mC1jmGMxY3+cYr5its3zUHSqDKikMNDDImfzaPGYh+KZWtbpAkYO D4D1ADI3L1XyuDQ4doOJbYaudFh673CrsRBpC9hMTQHZrlPcJUWOysGbs5/n9Xh2re68 y4dGDBHqxLJpXiZ4UCJwOYk2Q8di1B4CZ+bv0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=D1k2F+xPV+RT3M9kXXn6hcjKjt92qh81I1K8WtFRY8GV2hFYcEH7xGyIGmiBILXD/E MyhIpgfwZLU7hLpcNmQXfUItnnP8PYgvEmEJVFdYaR6KQmahRF/58BVogXGFVGbpFef+ 7jWmk0KzNeExeaz7n5XY8rLHzWkSGTk3wUBxA= Received: by 10.142.125.4 with SMTP id x4mr1472034wfc.324.1219662509754; Mon, 25 Aug 2008 04:08:29 -0700 (PDT) Received: by 10.142.112.10 with HTTP; Mon, 25 Aug 2008 04:08:29 -0700 (PDT) Message-ID: <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> Date: Mon, 25 Aug 2008 13:08:29 +0200 From: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" To: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel In-Reply-To: <20080823010524.GM5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Disposition: inline References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.168] X-Barracuda-Start-Time: 1219662510 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0203 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=MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email X-Virus-Scanned: ClamAV 0.91.2/8084/Mon Aug 25 01:02:23 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m7PB78mq000590 X-archive-position: 17704 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nailman23@gmail.com Precedence: bulk X-list: xfs 2008/8/23 Dave Chinner : > On Fri, Aug 22, 2008 at 12:03:40PM +0200, S³awomir Nowakowski wrote: >> Dear All, >> >> We have a problem with implementing xfs file system for Linux. The problem >> appears after mounting xfs file system on 2.6.25.13 kernel that is created on >> 2.6.17.13 kernel. >> >> File system is created on logical volume in the following way: >> >> lvcreate -L 4G volume1 -n test >> mkfs.xfs /dev/volume1/test >> mount /dev/volume1/test /mnt/x >> >> After mounting it on 2.6.17.13 kernel "df -B 1" output looks like this: >> >> /dev/volume1/test 4284481536 147456 4284334080 1% /mnt/x >> >> but in case of 2.6.25.13 kernel: >> >> /dev/volume1/test 4284481536 4489216 4279992320 1% /mnt/x >> >> The same happens in case of 2.6.26.3 kernel. > > Yeah, we reserved 4MB of space for unreserved delayed metadata > allocations to allow transactions to succeed when at ENOSPC. That > reservation is accounted as 'used space' to prevent it being used by > data. > Thank you for information. >> As it is shown after mounting the volume in newer kernel size of file system >> is visible smaller. The problem appears when on this volume exists one big >> file, occupying all available space. After trying to mount it under newer >> kernel, the file is cut because available free space is smaller. > > What is on disk will not change - the reservation is purely an > in-memory construct. i.e. if the file already exists then it > won't change on upgrade. Can you show how the file changes just > by booting a different kernel (e.g. ls -l output, md5sums, etc). > For tests we have used two kernels: 2.6.17.13 and 2.6.25.13 We have created following partition map: Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 123 987966 83 Linux /dev/sda2 124 155 257040 83 Linux /dev/sda3 156 778 5004247+ 83 Linux Next under kernel 2.6.17.1e we have created XFS partition onto sda3: # mkfs.xfs /dev/sda3 and have mounted it: # mount /dev/sda3 /mnt/z Next we have created some files: -one big file called "bigfile" and size of 5109497856 bytes -two small text files called: "file1" and "file2" At this stage it looked as follows: root@localhost:~# ls -la /mnt/z; df total 4989773 drwxr-xr-x 2 root root 44 Aug 25 09:35 . drwxr-xr-x 25 root root 1024 Aug 25 08:30 .. -rw-r--r-- 1 root root 5109497856 Aug 25 08:33 bigfile -rw-r--r-- 1 root root 15132 May 30 15:04 file1 -rw------- 1 root root 7537 Aug 7 15:32 file2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 4993984 4989916 4068 100% /mnt/z Then we have run system with 2.6.25.13 kernel and checked how it looks: root@localhost:~# ls -la /mnt/z; df total 4989773 drwxr-xr-x 2 root root 44 Aug 25 09:35 . drwxr-xr-x 25 root root 1024 Aug 25 08:30 .. -rw-r--r-- 1 root root 5109497856 Aug 25 08:33 bigfile -rw-r--r-- 1 root root 15132 May 30 15:04 file1 -rw------- 1 root root 7537 Aug 7 15:32 file2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 4993984 4993984 0 100% /mnt/z As it shown in case of 2.6.25.13 kernel system reports no free space, but under 2.6.17.13 kernel there is 4068kB of free space. At this stage when editing file file1 with i.e. mcedit and trying to write changes, the system cuts this file to 0 bytes! The same situation does not happen when we use: cat file2 >> file1 In this case the system connects two files properly. >> Is it known issue and/or does solution or workaround exists? > > $ sudo xfs_io -x -c 'resblks 0' > > will remove the reservation. This means your filesystem can shutdown > or lose data at ENOSPC in certain circumstances.... A question: does using the command: $ sudo xfs_io -x -c 'resblks 0' for 2.6.25.13 kernel gives higher risk of losing data then in case of 2.6.17.13 kernel. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > Thank you very much for your help Roland nailman23@gmail.com From owner-xfs@oss.sgi.com Mon Aug 25 04:44:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 04:44:18 -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.0 required=5.0 tests=BAYES_50,RCVD_IN_PSBL autolearn=no 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 m7PBiGro008802 for ; Mon, 25 Aug 2008 04:44:16 -0700 X-ASG-Debug-ID: 1219664738-77d301d90001-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ims-e1q2pamt99i (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 62DE03C87B9 for ; Mon, 25 Aug 2008 04:45:38 -0700 (PDT) Received: from ims-e1q2pamt99i (unassigned.calpop.com [64.69.41.116]) by cuda.sgi.com with SMTP id UAlenfHLctMawYCQ for ; Mon, 25 Aug 2008 04:45:38 -0700 (PDT) From: "Walter Morris" To: "Linux-xfs" X-ASG-Orig-Subj: your website Subject: your website Date: Mon, 25 Aug 2008 04:45:33 -0700 Reply-To: "Walter Morris" Message-ID: <91602149.20080825044533@giantleaplistings.com> X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" X-Barracuda-Connect: unassigned.calpop.com[64.69.41.116] X-Barracuda-Start-Time: 1219664739 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5162 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.57 X-Barracuda-Spam-Status: No, SCORE=1.57 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MIME_QP_LONG_LINE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.82 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars X-Virus-Scanned: ClamAV 0.91.2/8084/Mon Aug 25 01:02:23 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m7PBiGro008804 X-archive-position: 17705 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: walter@giantleaplistings.com Precedence: bulk X-list: xfs If you're interested in getting your site to the top of a search engines listing, please reply with the web address you want to promote and the best way to contact you with some options. Just an offer, there's no cost for a review. Thanks in advance, Walter Morris From owner-xfs@oss.sgi.com Mon Aug 25 04:52:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 04:52:47 -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.6 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 m7PBqioS009673 for ; Mon, 25 Aug 2008 04:52:44 -0700 X-ASG-Debug-ID: 1219665245-7e8b022f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CDB6C125526F for ; Mon, 25 Aug 2008 04:54:05 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by cuda.sgi.com with ESMTP id PtnmMQhxBOIaMfyC for ; Mon, 25 Aug 2008 04:54:05 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1KXadu2SEP-0006dQ; Mon, 25 Aug 2008 13:53:55 +0200 Date: Mon, 25 Aug 2008 13:53:54 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: Dave Chinner cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket In-Reply-To: <20080825020239.GQ5706@disturbed> Message-ID: References: <20080825003929.GN5706@disturbed> <20080825020239.GQ5706@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX19wbMSXlCNzXqeHosjLzvNWVz8RfyVxUv9oPZn JpdxNFbfx1pQZjcQKRFHh0IpRI0PEaUqhDhEgHG5wLvNbBGfL3 m5Hk/TQL9ZMAKPlUrPcpg== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.188] X-Barracuda-Start-Time: 1219665246 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.3669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8084/Mon Aug 25 01:02:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17706 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Mon, 25 Aug 2008, Dave Chinner wrote: > Ok, so if you do a 'ls -i /' do you see an inode numbered 20208090? > i.e. is it the unlinked bucket that is incorrect, or the root > directory. I see inode 128 (the mountpoint), but I don't see inode 20208090 (I've used find). > You are not using barriers. I think, I can't, as I am using XFS on top of dm-crypt. And barriers are not supported for dm, right? > Are you using write caching? Just check with hdparm on the underlying hdb...yes, write caching is active. > The problems with filesystem corruption on powerloss when using > volatile write caching have traditionally shown up in directory > corruptions... Hm, I see. Still strange, that it does not complain during mount(8). But I guess things like these are just not checked during mount. Thanks, Christian. -- BOFH excuse #57: Groundskeepers stole the root password From owner-xfs@oss.sgi.com Mon Aug 25 05:00:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 05:00:41 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7PC0as0010517 for ; Mon, 25 Aug 2008 05:00:37 -0700 X-ASG-Debug-ID: 1219665718-522f01ec0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail2.shareable.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B24121A4086F for ; Mon, 25 Aug 2008 05:01:59 -0700 (PDT) Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by cuda.sgi.com with ESMTP id ZFumiwm7MYYbUxtw for ; Mon, 25 Aug 2008 05:01:59 -0700 (PDT) Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1KXalX-0005dI-FS; Mon, 25 Aug 2008 13:01:47 +0100 Date: Mon, 25 Aug 2008 13:01:47 +0100 From: Jamie Lokier To: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080825120146.GC20960@shareable.org> References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080825015922.GP5706@disturbed> User-Agent: Mutt/1.5.13 (2006-08-11) X-Barracuda-Connect: mail2.shareable.org[80.68.89.115] X-Barracuda-Start-Time: 1219665719 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.3672 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8084/Mon Aug 25 01:02:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17707 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jamie@shareable.org Precedence: bulk X-list: xfs Dave Chinner wrote: > To keep on top of this, we keep adding new variations and types and > expect the filesystems to make best use of them (without > documentation) to optimise for certain situations. Example - the > new(ish) BIO_META tag that only CFQ understands. I can change the > way XFS issues bios to use this tag to make CFQ behave the same way > it used to w.r.t. metadata I/O from XFS, but then the deadline and > AS will probably regress because they don't understand that tag and > still need the old optimisations that just got removed. Ditto for > prioritised bio dispatch - CFQ supports it but none of the others > do. There's nothing wrong with adding BIO_META (for example) and other hints in _principle_. You should be able to ignore it with no adverse effects. If its not used by a filesystem (and there's nothing else competing to use the same disk), I would hope to see the same performance as other kernels which don't have it. If the elevators are being changed in such a way that old filesystem code which doesn't use new hint bits is running significantly slower, surely that's blatant elevator regression, and that's where the bugs should be reported and fixed? -- Jamie From owner-xfs@oss.sgi.com Mon Aug 25 08:01:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 08:01:36 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7PF1Yhp022445 for ; Mon, 25 Aug 2008 08:01:34 -0700 X-ASG-Debug-ID: 1219676575-45b9012b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from moutng.kundenserver.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C40C91A41EBB for ; Mon, 25 Aug 2008 08:02:55 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by cuda.sgi.com with ESMTP id pVAmPogpOOlCHI4E for ; Mon, 25 Aug 2008 08:02:55 -0700 (PDT) Received: from ppp-88-217-67-116.dynamic.mnet-online.de (ppp-88-217-67-116.dynamic.mnet-online.de [88.217.67.116]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1KXdan3IAA-0003UA; Mon, 25 Aug 2008 17:02:54 +0200 Date: Mon, 25 Aug 2008 17:02:53 +0200 (CEST) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: Timothy Shimmin cc: Dave Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: agi unlinked bucket Subject: Re: agi unlinked bucket In-Reply-To: <48B22659.9050301@sgi.com> Message-ID: References: <20080825003929.GN5706@disturbed> <48B22659.9050301@sgi.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Provags-ID: V01U2FsdGVkX18+D6p9dLUjLoyzgO3e+QLvW4Fx9YTPKQrfiCo 53t1QuDOnPz9xyokLBYYx8SNmd0AEpOWmOCphTLrTzxwSuQ7Em 8zrhQKVljFj8YmSbw5k2g== X-Barracuda-Connect: moutng.kundenserver.de[212.227.126.187] X-Barracuda-Start-Time: 1219676575 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.3684 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8086/Mon Aug 25 05:20:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17708 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs On Mon, 25 Aug 2008, Timothy Shimmin wrote: > So in your case, it looks like in AG#0 on the 26th element of the array it is pointing > to inode# 20208090. Which would infer that inode#20208090 was unlinked > but still had references to it at the time the filesystem was not cleanly > unmounted (power loss, crash etc..). It looks like for the root directory inode #128 > it has a count of 335 but it is finding 336 entries. Thanks for this very interesting explanation, Timothy. I finally ran xfs_repair on the filesystem, twice, now everything seems to be in good shape. If you guys are interested: http://nerdbynature.de/bits/2.6.27-rc3/fsck_md3.log Thanks, Christian. -- BOFH excuse #363: Out of cards on drive D: From owner-xfs@oss.sgi.com Mon Aug 25 08:38:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 08:38:41 -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.3 required=5.0 tests=BAYES_00,J_CHICKENPOX_65, J_CHICKENPOX_66,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7PFcaL3030171 for ; Mon, 25 Aug 2008 08:38:37 -0700 X-ASG-Debug-ID: 1219678797-553b02320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coraid.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CCDD91A42421 for ; Mon, 25 Aug 2008 08:39:57 -0700 (PDT) Received: from coraid.com (baron.coraid.com [12.51.113.4]) by cuda.sgi.com with ESMTP id ZVaGiWTdLls5gbHq for ; Mon, 25 Aug 2008 08:39:57 -0700 (PDT) Received: from kokone.coraid.com ([68.16.104.79]) by coraid.com; Mon Aug 25 11:38:48 EDT 2008 Date: Mon, 25 Aug 2008 11:39:31 -0400 From: Ed Cashin To: Dave Chinner Cc: xfs@oss.sgi.com, Adrian Bunk X-ASG-Orig-Subj: xfs_growfs fix backport for 2.6.16.y Subject: xfs_growfs fix backport for 2.6.16.y Message-ID: <20080825153931.GD7575@coraid.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-11) X-Barracuda-Connect: baron.coraid.com[12.51.113.4] X-Barracuda-Start-Time: 1219678798 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3686 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8086/Mon Aug 25 05:20:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17709 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ecashin@coraid.com Precedence: bulk X-list: xfs --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Dave Chinner, hello. Your fix for the counters that had been preventing an XFS from growing by more than two terabytes went into 2.6.21, after the introduction of the per-cpu in-core superblock counters. The per-cpu in-core superblock counters are not in the latest version of the long-lived stable kernel 2.6.16.y, maintained by Adrian Bunk. The problem with growing by more than two terabytes appears to be there, though. The 2.6.16.62 kernel will not allow me to grow an XFS by, e.g., 10 terabytes, so xfs_growfs does not report any change in the data blocks. I backported your fix, commit 20f4ebf2bf2f57c1a9abb3655391336cc90314b3 Author: David Chinner Date: Sat Feb 10 18:36:10 2007 +1100 [XFS] Make growfs work for amounts greater than 2TB The free block modification code has a 32bit interface, limiting the size the filesystem can be grown even on 64 bit machines. On 32 bit machines, there are other 32bit variables in transaction structures and interfaces that need to be expanded to allow this to work. SGI-PV: 959978 SGI-Modid: xfs-linux-melb:xfs-kern:27894a Signed-off-by: David Chinner Signed-off-by: Christoph Hellwig Signed-off-by: Tim Shimmin ... to the 2.6.16.y git tree, and the result is included below. When I apply this backported fix to 2.6.16.62, I can grow an online XFS by 10 terabytes without any trouble. Do you see any problems with this backport? If not, I will submit it for inclusion in the next 2.6.16.y release. ------------- merge 20f4ebf2: [XFS] Make growfs work for amounts greater than 2TB This is a fix from David Chinner that went into 2.6.21. It followed the introduction of the per-cpu superblock counters, but 2.6.16.y does not have those. The free block modification code has a 32bit interface, limiting the size the filesystem can be grown even on 64 bit machines. On 32 bit machines, there are other 32bit variables in transaction structures and interfaces that need to be expanded to allow this to work. SGI-PV: 959978 SGI-Modid: xfs-linux-melb:xfs-kern:27894a diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 70625e5..18e57b6 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -687,7 +687,7 @@ xfs_bmap_add_extent( ASSERT(nblks <= da_old); if (nblks < da_old) xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, - (int)(da_old - nblks), rsvd); + (int64_t)(da_old - nblks), rsvd); } /* * Clear out the allocated field, done with it now in any case. @@ -1180,7 +1180,7 @@ xfs_bmap_add_extent_delay_real( diff = (int)(temp + temp2 - STARTBLOCKVAL(PREV.br_startblock) - (cur ? cur->bc_private.b.allocated : 0)); if (diff > 0 && - xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -diff, rsvd)) { + xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) { /* * Ick gross gag me with a spoon. */ @@ -1191,7 +1191,7 @@ xfs_bmap_add_extent_delay_real( diff--; if (!diff || !xfs_mod_incore_sb(ip->i_mount, - XFS_SBS_FDBLOCKS, -diff, rsvd)) + XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) break; } if (temp2) { @@ -1199,7 +1199,7 @@ xfs_bmap_add_extent_delay_real( diff--; if (!diff || !xfs_mod_incore_sb(ip->i_mount, - XFS_SBS_FDBLOCKS, -diff, rsvd)) + XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) break; } } @@ -1916,7 +1916,7 @@ xfs_bmap_add_extent_hole_delay( if (oldlen != newlen) { ASSERT(oldlen > newlen); xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, - (int)(oldlen - newlen), rsvd); + (int64_t)(oldlen - newlen), rsvd); /* * Nothing to do for disk quota accounting here. */ @@ -3187,7 +3187,7 @@ xfs_bmap_del_extent( */ ASSERT(da_old >= da_new); if (da_old > da_new) - xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int)(da_old - da_new), + xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int64_t)(da_old - da_new), rsvd); done: *logflagsp = flags; @@ -4875,24 +4875,24 @@ xfs_bmapi( if (rt) { error = xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - -(extsz), rsvd); + -((int64_t)extsz), rsvd); } else { error = xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - -(alen), rsvd); + -((int64_t)alen), rsvd); } if (!error) { error = xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - -(indlen), rsvd); + -((int64_t)indlen), rsvd); if (error && rt) xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - extsz, rsvd); + (int64_t)extsz, rsvd); else if (error) xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - alen, rsvd); + (int64_t)alen, rsvd); } if (error) { @@ -5538,13 +5538,13 @@ xfs_bunmapi( rtexts = XFS_FSB_TO_B(mp, del.br_blockcount); do_div(rtexts, mp->m_sb.sb_rextsize); xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - (int)rtexts, rsvd); + (int64_t)rtexts, rsvd); (void)XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, NULL, ip, -((long)del.br_blockcount), 0, XFS_QMOPT_RES_RTBLKS); } else { xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - (int)del.br_blockcount, rsvd); + (int64_t)del.br_blockcount, rsvd); (void)XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, NULL, ip, -((long)del.br_blockcount), 0, XFS_QMOPT_RES_REGBLKS); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 62188ea..ab3d014 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1238,8 +1238,11 @@ xfs_mod_sb(xfs_trans_t *tp, __int64_t fields) * The SB_LOCK must be held when this routine is called. */ STATIC int -xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field, - int delta, int rsvd) +xfs_mod_incore_sb_unlocked( + xfs_mount_t *mp, + xfs_sb_field_t field, + int64_t delta, + int rsvd) { int scounter; /* short counter for 32 bit fields */ long long lcounter; /* long counter for 64 bit fields */ @@ -1401,7 +1404,11 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field, * routine to do the work. */ int -xfs_mod_incore_sb(xfs_mount_t *mp, xfs_sb_field_t field, int delta, int rsvd) +xfs_mod_incore_sb( + xfs_mount_t *mp, + xfs_sb_field_t field, + int64_t delta, + int rsvd) { unsigned long s; int status; diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index cd3cf96..100d5b9 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -526,10 +526,11 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) /* * This structure is for use by the xfs_mod_incore_sb_batch() routine. + * xfs_growfs can specify a few fields which are more than int limit */ typedef struct xfs_mod_sb { xfs_sb_field_t msb_field; /* Field to modify, see below */ - int msb_delta; /* Change to make to specified field */ + int64_t msb_delta; /* Change to make to specified field */ } xfs_mod_sb_t; #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) @@ -547,7 +548,7 @@ extern int xfs_unmountfs(xfs_mount_t *, struct cred *); extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *); extern int xfs_unmountfs_writesb(xfs_mount_t *); extern int xfs_unmount_flush(xfs_mount_t *, int); -extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int); +extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int); extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, uint, int); extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index d3d714e..68b5895 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -232,7 +232,7 @@ xfs_trans_reserve( */ if (blocks > 0) { error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, - -blocks, rsvd); + -((int64_t)blocks), rsvd); if (error != 0) { PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); return (XFS_ERROR(ENOSPC)); @@ -273,7 +273,7 @@ xfs_trans_reserve( */ if (rtextents > 0) { error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FREXTENTS, - -rtextents, rsvd); + -((int64_t)rtextents), rsvd); if (error) { error = XFS_ERROR(ENOSPC); goto undo_log; @@ -303,7 +303,7 @@ undo_log: undo_blocks: if (blocks > 0) { (void) xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, - blocks, rsvd); + (int64_t)blocks, rsvd); tp->t_blk_res = 0; } @@ -325,7 +325,7 @@ void xfs_trans_mod_sb( xfs_trans_t *tp, uint field, - long delta) + int64_t delta) { switch (field) { @@ -556,62 +556,62 @@ xfs_trans_unreserve_and_mod_sb( if (tp->t_flags & XFS_TRANS_SB_DIRTY) { if (tp->t_icount_delta != 0) { msbp->msb_field = XFS_SBS_ICOUNT; - msbp->msb_delta = (int)tp->t_icount_delta; + msbp->msb_delta = tp->t_icount_delta; msbp++; } if (tp->t_ifree_delta != 0) { msbp->msb_field = XFS_SBS_IFREE; - msbp->msb_delta = (int)tp->t_ifree_delta; + msbp->msb_delta = tp->t_ifree_delta; msbp++; } if (tp->t_fdblocks_delta != 0) { msbp->msb_field = XFS_SBS_FDBLOCKS; - msbp->msb_delta = (int)tp->t_fdblocks_delta; + msbp->msb_delta = tp->t_fdblocks_delta; msbp++; } if (tp->t_frextents_delta != 0) { msbp->msb_field = XFS_SBS_FREXTENTS; - msbp->msb_delta = (int)tp->t_frextents_delta; + msbp->msb_delta = tp->t_frextents_delta; msbp++; } if (tp->t_dblocks_delta != 0) { msbp->msb_field = XFS_SBS_DBLOCKS; - msbp->msb_delta = (int)tp->t_dblocks_delta; + msbp->msb_delta = tp->t_dblocks_delta; msbp++; } if (tp->t_agcount_delta != 0) { msbp->msb_field = XFS_SBS_AGCOUNT; - msbp->msb_delta = (int)tp->t_agcount_delta; + msbp->msb_delta = tp->t_agcount_delta; msbp++; } if (tp->t_imaxpct_delta != 0) { msbp->msb_field = XFS_SBS_IMAX_PCT; - msbp->msb_delta = (int)tp->t_imaxpct_delta; + msbp->msb_delta = tp->t_imaxpct_delta; msbp++; } if (tp->t_rextsize_delta != 0) { msbp->msb_field = XFS_SBS_REXTSIZE; - msbp->msb_delta = (int)tp->t_rextsize_delta; + msbp->msb_delta = tp->t_rextsize_delta; msbp++; } if (tp->t_rbmblocks_delta != 0) { msbp->msb_field = XFS_SBS_RBMBLOCKS; - msbp->msb_delta = (int)tp->t_rbmblocks_delta; + msbp->msb_delta = tp->t_rbmblocks_delta; msbp++; } if (tp->t_rblocks_delta != 0) { msbp->msb_field = XFS_SBS_RBLOCKS; - msbp->msb_delta = (int)tp->t_rblocks_delta; + msbp->msb_delta = tp->t_rblocks_delta; msbp++; } if (tp->t_rextents_delta != 0) { msbp->msb_field = XFS_SBS_REXTENTS; - msbp->msb_delta = (int)tp->t_rextents_delta; + msbp->msb_delta = tp->t_rextents_delta; msbp++; } if (tp->t_rextslog_delta != 0) { msbp->msb_field = XFS_SBS_REXTSLOG; - msbp->msb_delta = (int)tp->t_rextslog_delta; + msbp->msb_delta = tp->t_rextslog_delta; msbp++; } } diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index d77901c..e4ca245 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -358,23 +358,23 @@ typedef struct xfs_trans { xfs_trans_callback_t t_callback; /* transaction callback */ void *t_callarg; /* callback arg */ unsigned int t_flags; /* misc flags */ - long t_icount_delta; /* superblock icount change */ - long t_ifree_delta; /* superblock ifree change */ - long t_fdblocks_delta; /* superblock fdblocks chg */ - long t_res_fdblocks_delta; /* on-disk only chg */ - long t_frextents_delta;/* superblock freextents chg*/ - long t_res_frextents_delta; /* on-disk only chg */ - long t_ag_freeblks_delta; /* debugging counter */ - long t_ag_flist_delta; /* debugging counter */ - long t_ag_btree_delta; /* debugging counter */ - long t_dblocks_delta;/* superblock dblocks change */ - long t_agcount_delta;/* superblock agcount change */ - long t_imaxpct_delta;/* superblock imaxpct change */ - long t_rextsize_delta;/* superblock rextsize chg */ - long t_rbmblocks_delta;/* superblock rbmblocks chg */ - long t_rblocks_delta;/* superblock rblocks change */ - long t_rextents_delta;/* superblocks rextents chg */ - long t_rextslog_delta;/* superblocks rextslog chg */ + int64_t t_icount_delta; /* superblock icount change */ + int64_t t_ifree_delta; /* superblock ifree change */ + int64_t t_fdblocks_delta; /* superblock fdblocks chg */ + int64_t t_res_fdblocks_delta; /* on-disk only chg */ + int64_t t_frextents_delta;/* superblock freextents chg*/ + int64_t t_res_frextents_delta; /* on-disk only chg */ + int64_t t_ag_freeblks_delta; /* debugging counter */ + int64_t t_ag_flist_delta; /* debugging counter */ + int64_t t_ag_btree_delta; /* debugging counter */ + int64_t t_dblocks_delta;/* superblock dblocks change */ + int64_t t_agcount_delta;/* superblock agcount change */ + int64_t t_imaxpct_delta;/* superblock imaxpct change */ + int64_t t_rextsize_delta;/* superblock rextsize chg */ + int64_t t_rbmblocks_delta;/* superblock rbmblocks chg */ + int64_t t_rblocks_delta;/* superblock rblocks change */ + int64_t t_rextents_delta;/* superblocks rextents chg */ + int64_t t_rextslog_delta;/* superblocks rextslog chg */ unsigned int t_items_free; /* log item descs free */ xfs_log_item_chunk_t t_items; /* first log item desc chunk */ xfs_trans_header_t t_header; /* header for in-log trans */ @@ -941,9 +941,9 @@ typedef struct xfs_trans { #define xfs_trans_set_sync(tp) ((tp)->t_flags |= XFS_TRANS_SYNC) #ifdef DEBUG -#define xfs_trans_agblocks_delta(tp, d) ((tp)->t_ag_freeblks_delta += (long)d) -#define xfs_trans_agflist_delta(tp, d) ((tp)->t_ag_flist_delta += (long)d) -#define xfs_trans_agbtree_delta(tp, d) ((tp)->t_ag_btree_delta += (long)d) +#define xfs_trans_agblocks_delta(tp, d) ((tp)->t_ag_freeblks_delta += (int64_t)d) +#define xfs_trans_agflist_delta(tp, d) ((tp)->t_ag_flist_delta += (int64_t)d) +#define xfs_trans_agbtree_delta(tp, d) ((tp)->t_ag_btree_delta += (int64_t)d) #else #define xfs_trans_agblocks_delta(tp, d) #define xfs_trans_agflist_delta(tp, d) @@ -959,7 +959,7 @@ xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *xfs_trans_dup(xfs_trans_t *); int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, uint, uint); -void xfs_trans_mod_sb(xfs_trans_t *, uint, long); +void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_daddr_t, int, uint); int xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *, -- Ed Cashin --cNdxnHkX5QqsyA0e Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="growfix.diff" commit b4558635478e0c4d0f0761fc6287c7616f8f271f Author: Ed L. Cashin Date: Fri Aug 22 16:46:49 2008 -0400 merge 20f4ebf2: [XFS] Make growfs work for amounts greater than 2TB This is a fix from David Chinner that went into 2.6.21. It followed the introduction of the per-cpu superblock counters, but 2.6.16.y does not have those. The free block modification code has a 32bit interface, limiting the size the filesystem can be grown even on 64 bit machines. On 32 bit machines, there are other 32bit variables in transaction structures and interfaces that need to be expanded to allow this to work. SGI-PV: 959978 SGI-Modid: xfs-linux-melb:xfs-kern:27894a diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 70625e5..18e57b6 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -687,7 +687,7 @@ xfs_bmap_add_extent( ASSERT(nblks <= da_old); if (nblks < da_old) xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, - (int)(da_old - nblks), rsvd); + (int64_t)(da_old - nblks), rsvd); } /* * Clear out the allocated field, done with it now in any case. @@ -1180,7 +1180,7 @@ xfs_bmap_add_extent_delay_real( diff = (int)(temp + temp2 - STARTBLOCKVAL(PREV.br_startblock) - (cur ? cur->bc_private.b.allocated : 0)); if (diff > 0 && - xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -diff, rsvd)) { + xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) { /* * Ick gross gag me with a spoon. */ @@ -1191,7 +1191,7 @@ xfs_bmap_add_extent_delay_real( diff--; if (!diff || !xfs_mod_incore_sb(ip->i_mount, - XFS_SBS_FDBLOCKS, -diff, rsvd)) + XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) break; } if (temp2) { @@ -1199,7 +1199,7 @@ xfs_bmap_add_extent_delay_real( diff--; if (!diff || !xfs_mod_incore_sb(ip->i_mount, - XFS_SBS_FDBLOCKS, -diff, rsvd)) + XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) break; } } @@ -1916,7 +1916,7 @@ xfs_bmap_add_extent_hole_delay( if (oldlen != newlen) { ASSERT(oldlen > newlen); xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, - (int)(oldlen - newlen), rsvd); + (int64_t)(oldlen - newlen), rsvd); /* * Nothing to do for disk quota accounting here. */ @@ -3187,7 +3187,7 @@ xfs_bmap_del_extent( */ ASSERT(da_old >= da_new); if (da_old > da_new) - xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int)(da_old - da_new), + xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int64_t)(da_old - da_new), rsvd); done: *logflagsp = flags; @@ -4875,24 +4875,24 @@ xfs_bmapi( if (rt) { error = xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - -(extsz), rsvd); + -((int64_t)extsz), rsvd); } else { error = xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - -(alen), rsvd); + -((int64_t)alen), rsvd); } if (!error) { error = xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - -(indlen), rsvd); + -((int64_t)indlen), rsvd); if (error && rt) xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - extsz, rsvd); + (int64_t)extsz, rsvd); else if (error) xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - alen, rsvd); + (int64_t)alen, rsvd); } if (error) { @@ -5538,13 +5538,13 @@ xfs_bunmapi( rtexts = XFS_FSB_TO_B(mp, del.br_blockcount); do_div(rtexts, mp->m_sb.sb_rextsize); xfs_mod_incore_sb(mp, XFS_SBS_FREXTENTS, - (int)rtexts, rsvd); + (int64_t)rtexts, rsvd); (void)XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, NULL, ip, -((long)del.br_blockcount), 0, XFS_QMOPT_RES_RTBLKS); } else { xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, - (int)del.br_blockcount, rsvd); + (int64_t)del.br_blockcount, rsvd); (void)XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, NULL, ip, -((long)del.br_blockcount), 0, XFS_QMOPT_RES_REGBLKS); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 62188ea..ab3d014 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1238,8 +1238,11 @@ xfs_mod_sb(xfs_trans_t *tp, __int64_t fields) * The SB_LOCK must be held when this routine is called. */ STATIC int -xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field, - int delta, int rsvd) +xfs_mod_incore_sb_unlocked( + xfs_mount_t *mp, + xfs_sb_field_t field, + int64_t delta, + int rsvd) { int scounter; /* short counter for 32 bit fields */ long long lcounter; /* long counter for 64 bit fields */ @@ -1401,7 +1404,11 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field, * routine to do the work. */ int -xfs_mod_incore_sb(xfs_mount_t *mp, xfs_sb_field_t field, int delta, int rsvd) +xfs_mod_incore_sb( + xfs_mount_t *mp, + xfs_sb_field_t field, + int64_t delta, + int rsvd) { unsigned long s; int status; diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index cd3cf96..100d5b9 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -526,10 +526,11 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) /* * This structure is for use by the xfs_mod_incore_sb_batch() routine. + * xfs_growfs can specify a few fields which are more than int limit */ typedef struct xfs_mod_sb { xfs_sb_field_t msb_field; /* Field to modify, see below */ - int msb_delta; /* Change to make to specified field */ + int64_t msb_delta; /* Change to make to specified field */ } xfs_mod_sb_t; #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) @@ -547,7 +548,7 @@ extern int xfs_unmountfs(xfs_mount_t *, struct cred *); extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *); extern int xfs_unmountfs_writesb(xfs_mount_t *); extern int xfs_unmount_flush(xfs_mount_t *, int); -extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int, int); +extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int); extern int xfs_mod_incore_sb_batch(xfs_mount_t *, xfs_mod_sb_t *, uint, int); extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index d3d714e..68b5895 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -232,7 +232,7 @@ xfs_trans_reserve( */ if (blocks > 0) { error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, - -blocks, rsvd); + -((int64_t)blocks), rsvd); if (error != 0) { PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); return (XFS_ERROR(ENOSPC)); @@ -273,7 +273,7 @@ xfs_trans_reserve( */ if (rtextents > 0) { error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FREXTENTS, - -rtextents, rsvd); + -((int64_t)rtextents), rsvd); if (error) { error = XFS_ERROR(ENOSPC); goto undo_log; @@ -303,7 +303,7 @@ undo_log: undo_blocks: if (blocks > 0) { (void) xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, - blocks, rsvd); + (int64_t)blocks, rsvd); tp->t_blk_res = 0; } @@ -325,7 +325,7 @@ void xfs_trans_mod_sb( xfs_trans_t *tp, uint field, - long delta) + int64_t delta) { switch (field) { @@ -556,62 +556,62 @@ xfs_trans_unreserve_and_mod_sb( if (tp->t_flags & XFS_TRANS_SB_DIRTY) { if (tp->t_icount_delta != 0) { msbp->msb_field = XFS_SBS_ICOUNT; - msbp->msb_delta = (int)tp->t_icount_delta; + msbp->msb_delta = tp->t_icount_delta; msbp++; } if (tp->t_ifree_delta != 0) { msbp->msb_field = XFS_SBS_IFREE; - msbp->msb_delta = (int)tp->t_ifree_delta; + msbp->msb_delta = tp->t_ifree_delta; msbp++; } if (tp->t_fdblocks_delta != 0) { msbp->msb_field = XFS_SBS_FDBLOCKS; - msbp->msb_delta = (int)tp->t_fdblocks_delta; + msbp->msb_delta = tp->t_fdblocks_delta; msbp++; } if (tp->t_frextents_delta != 0) { msbp->msb_field = XFS_SBS_FREXTENTS; - msbp->msb_delta = (int)tp->t_frextents_delta; + msbp->msb_delta = tp->t_frextents_delta; msbp++; } if (tp->t_dblocks_delta != 0) { msbp->msb_field = XFS_SBS_DBLOCKS; - msbp->msb_delta = (int)tp->t_dblocks_delta; + msbp->msb_delta = tp->t_dblocks_delta; msbp++; } if (tp->t_agcount_delta != 0) { msbp->msb_field = XFS_SBS_AGCOUNT; - msbp->msb_delta = (int)tp->t_agcount_delta; + msbp->msb_delta = tp->t_agcount_delta; msbp++; } if (tp->t_imaxpct_delta != 0) { msbp->msb_field = XFS_SBS_IMAX_PCT; - msbp->msb_delta = (int)tp->t_imaxpct_delta; + msbp->msb_delta = tp->t_imaxpct_delta; msbp++; } if (tp->t_rextsize_delta != 0) { msbp->msb_field = XFS_SBS_REXTSIZE; - msbp->msb_delta = (int)tp->t_rextsize_delta; + msbp->msb_delta = tp->t_rextsize_delta; msbp++; } if (tp->t_rbmblocks_delta != 0) { msbp->msb_field = XFS_SBS_RBMBLOCKS; - msbp->msb_delta = (int)tp->t_rbmblocks_delta; + msbp->msb_delta = tp->t_rbmblocks_delta; msbp++; } if (tp->t_rblocks_delta != 0) { msbp->msb_field = XFS_SBS_RBLOCKS; - msbp->msb_delta = (int)tp->t_rblocks_delta; + msbp->msb_delta = tp->t_rblocks_delta; msbp++; } if (tp->t_rextents_delta != 0) { msbp->msb_field = XFS_SBS_REXTENTS; - msbp->msb_delta = (int)tp->t_rextents_delta; + msbp->msb_delta = tp->t_rextents_delta; msbp++; } if (tp->t_rextslog_delta != 0) { msbp->msb_field = XFS_SBS_REXTSLOG; - msbp->msb_delta = (int)tp->t_rextslog_delta; + msbp->msb_delta = tp->t_rextslog_delta; msbp++; } } diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index d77901c..e4ca245 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -358,23 +358,23 @@ typedef struct xfs_trans { xfs_trans_callback_t t_callback; /* transaction callback */ void *t_callarg; /* callback arg */ unsigned int t_flags; /* misc flags */ - long t_icount_delta; /* superblock icount change */ - long t_ifree_delta; /* superblock ifree change */ - long t_fdblocks_delta; /* superblock fdblocks chg */ - long t_res_fdblocks_delta; /* on-disk only chg */ - long t_frextents_delta;/* superblock freextents chg*/ - long t_res_frextents_delta; /* on-disk only chg */ - long t_ag_freeblks_delta; /* debugging counter */ - long t_ag_flist_delta; /* debugging counter */ - long t_ag_btree_delta; /* debugging counter */ - long t_dblocks_delta;/* superblock dblocks change */ - long t_agcount_delta;/* superblock agcount change */ - long t_imaxpct_delta;/* superblock imaxpct change */ - long t_rextsize_delta;/* superblock rextsize chg */ - long t_rbmblocks_delta;/* superblock rbmblocks chg */ - long t_rblocks_delta;/* superblock rblocks change */ - long t_rextents_delta;/* superblocks rextents chg */ - long t_rextslog_delta;/* superblocks rextslog chg */ + int64_t t_icount_delta; /* superblock icount change */ + int64_t t_ifree_delta; /* superblock ifree change */ + int64_t t_fdblocks_delta; /* superblock fdblocks chg */ + int64_t t_res_fdblocks_delta; /* on-disk only chg */ + int64_t t_frextents_delta;/* superblock freextents chg*/ + int64_t t_res_frextents_delta; /* on-disk only chg */ + int64_t t_ag_freeblks_delta; /* debugging counter */ + int64_t t_ag_flist_delta; /* debugging counter */ + int64_t t_ag_btree_delta; /* debugging counter */ + int64_t t_dblocks_delta;/* superblock dblocks change */ + int64_t t_agcount_delta;/* superblock agcount change */ + int64_t t_imaxpct_delta;/* superblock imaxpct change */ + int64_t t_rextsize_delta;/* superblock rextsize chg */ + int64_t t_rbmblocks_delta;/* superblock rbmblocks chg */ + int64_t t_rblocks_delta;/* superblock rblocks change */ + int64_t t_rextents_delta;/* superblocks rextents chg */ + int64_t t_rextslog_delta;/* superblocks rextslog chg */ unsigned int t_items_free; /* log item descs free */ xfs_log_item_chunk_t t_items; /* first log item desc chunk */ xfs_trans_header_t t_header; /* header for in-log trans */ @@ -941,9 +941,9 @@ typedef struct xfs_trans { #define xfs_trans_set_sync(tp) ((tp)->t_flags |= XFS_TRANS_SYNC) #ifdef DEBUG -#define xfs_trans_agblocks_delta(tp, d) ((tp)->t_ag_freeblks_delta += (long)d) -#define xfs_trans_agflist_delta(tp, d) ((tp)->t_ag_flist_delta += (long)d) -#define xfs_trans_agbtree_delta(tp, d) ((tp)->t_ag_btree_delta += (long)d) +#define xfs_trans_agblocks_delta(tp, d) ((tp)->t_ag_freeblks_delta += (int64_t)d) +#define xfs_trans_agflist_delta(tp, d) ((tp)->t_ag_flist_delta += (int64_t)d) +#define xfs_trans_agbtree_delta(tp, d) ((tp)->t_ag_btree_delta += (int64_t)d) #else #define xfs_trans_agblocks_delta(tp, d) #define xfs_trans_agflist_delta(tp, d) @@ -959,7 +959,7 @@ xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *xfs_trans_dup(xfs_trans_t *); int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, uint, uint); -void xfs_trans_mod_sb(xfs_trans_t *, uint, long); +void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); struct xfs_buf *xfs_trans_get_buf(xfs_trans_t *, struct xfs_buftarg *, xfs_daddr_t, int, uint); int xfs_trans_read_buf(struct xfs_mount *, xfs_trans_t *, --cNdxnHkX5QqsyA0e-- From owner-xfs@oss.sgi.com Mon Aug 25 10:56:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 10:56:51 -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=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no 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 m7PHum94007529 for ; Mon, 25 Aug 2008 10:56:49 -0700 X-ASG-Debug-ID: 1219687088-0c5b00bc0002-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from d820 (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 55DB7FB443B for ; Mon, 25 Aug 2008 10:58:11 -0700 (PDT) Received: from d820 (adsl-76-240-253-30.dsl.lsan03.sbcglobal.net [76.240.253.30]) by cuda.sgi.com with SMTP id vmqMdso5lAbeLk4n for ; Mon, 25 Aug 2008 10:58:11 -0700 (PDT) Received: from d820[127.0.0.1] by d820[127.0.0.1] (SMTPD32); Mon, 25 Aug 2008 10:58:11 -0700 Organization: Performance Local Listings Reply-To: toddz@inbox.com Message-ID: <58bb5b9b636b98d59cd8662b001b2865@inbox.com> From: "Todd Zimmerman" To: X-ASG-Orig-Subj: Hardwood Flooring Services Subject: Hardwood Flooring Services Date: Mon, 25 Aug 2008 10:21:35 -0700 MIME-Version: 1.0 X-Barracuda-Connect: adsl-76-240-253-30.dsl.lsan03.sbcglobal.net[76.240.253.30] X-Barracuda-Start-Time: 1219687091 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4999 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.39 X-Barracuda-Spam-Status: No, SCORE=0.39 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=DYN_RDNS_SHORT_HELO_HTML, HTML_MESSAGE, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3695 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS 0.29 DYN_RDNS_SHORT_HELO_HTML Sent by dynamic rDNS, short HELO, and HTML X-Virus-Scanned: ClamAV 0.91.2/8086/Mon Aug 25 05:20:55 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 498 X-archive-position: 17710 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: toddz@inbox.com Precedence: bulk X-list: xfs Today over 60% of new customers are coming from online searches for local= =20 businesses. =A0 Over 90% of those searches are done on Google (and 93% of these=A0never go = beyond=20 the=A0first page) =A0 We can position your business on the=A01st page of Google for all the terms= your=20 customers are searching. =A0 For more information, please call me at the number below: =A0 Sincerely, Todd Zimmerman =A0 Please call me! (949) 859-6158 x105 [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Aug 25 11:56:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 11:56:50 -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.6 required=5.0 tests=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 m7PIulV3010797 for ; Mon, 25 Aug 2008 11:56:47 -0700 X-ASG-Debug-ID: 1219690689-100803510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.myoutlookonlinE.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 613A7FB4CEA for ; Mon, 25 Aug 2008 11:58:09 -0700 (PDT) Received: from mx1.myoutlookonlinE.com (mx1.myoutlookonline.com [69.25.74.52]) by cuda.sgi.com with ESMTP id mGYtVUL38pgCVOWT for ; Mon, 25 Aug 2008 11:58:09 -0700 (PDT) Received: from BE130.mail.lan ([10.109.208.130]) by mx1.myoutlookonlinE.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 Aug 2008 14:58:09 -0400 Received: from HUB012.mail.lan ([10.109.208.62]) by BE130.mail.lan with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 Aug 2008 14:58:08 -0400 Received: from BE181.mail.lan ([10.109.208.181]) by HUB012.mail.lan ([10.109.208.62]) with mapi; Mon, 25 Aug 2008 14:58:08 -0400 From: Allan Haywood To: Andreas Kotes , David Chinner CC: "xfs@oss.sgi.com" Date: Mon, 25 Aug 2008 14:58:06 -0400 X-ASG-Orig-Subj: RE: XFS internal error Subject: RE: XFS internal error Thread-Topic: XFS internal error Thread-Index: AciE2pRU3vLlKD7TQGa7C+Lncszr5iCCajkQ Message-ID: References: <470831E6.4030704@fastmail.co.uk> <20071008001452.GX995458@sgi.com> <20080310122216.GG14256@slop.flatline.de> <20080310223018.GA155407@sgi.com> <20080310225927.GP14256@slop.flatline.de> <20080310234539.GC155407@sgi.com> <20080311134746.GQ14256@slop.flatline.de> <20080312175050.GD14256@slop.flatline.de> <20080313000121.GU155407@sgi.com> <20080313071445.GA30874@slop.flatline.de> <20080313071744.GB30874@slop.flatline.de> In-Reply-To: <20080313071744.GB30874@slop.flatline.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginalArrivalTime: 25 Aug 2008 18:58:08.0853 (UTC) FILETIME=[83B18850:01C906E4] X-Barracuda-Connect: mx1.myoutlookonline.com[69.25.74.52] X-Barracuda-Start-Time: 1219690690 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.3699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8086/Mon Aug 25 05:20:55 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m7PIulV3010799 X-archive-position: 17711 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ahaywood@datallegro.com Precedence: bulk X-list: xfs Sorry for top posting on this reply, but I was wondering if there was any resolution to your problem below. We seem to be running into a similar problem. A few hours before the error in this thread occurred the filesystem was filled up to 100%, we had to clean things up to continue running. Any additional information would be great. Thanks. -Allan Haywood -----Original Message----- From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of Andreas Kotes Sent: Thursday, March 13, 2008 12:18 AM To: David Chinner Cc: xfs@oss.sgi.com Subject: Re: XFS internal error Hello, * Andreas Kotes [20080313 08:14]: > * David Chinner [20080313 01:01]: > > On Wed, Mar 12, 2008 at 06:50:50PM +0100, Andreas Kotes wrote: > > > * Andreas Kotes [20080311 14:47]: > > > > I basically build a PXE image which does an xfs_repair -L /dev/sda2 from > > > > initrd - and the problem persists. Sigh. Exactly no change. > > > > Do you do this on every boot? > > no, I did this on a6b and a7b so far, where the problems I mentioned > occur, and only after I saw these in-memory problems. in general, XFS > proves to be realiable for us. > > would you recommend running an xfs_check before running an xfs_repair in > case of problems? oh, btw - running xfs_check doesn't work most of the time, as the log usually contains entries, and isn't replayed before shutdown .. I figure running this on every boot would leave me killing my log all of the time, if the shutdown didn't leave time to write the changes to disk? ;) Andreas -- flatline IT services - Andreas Kotes - Tailored solutions for your IT needs From owner-xfs@oss.sgi.com Mon Aug 25 14:54:25 2008 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. From owner-xfs@oss.sgi.com Mon Aug 25 15:11:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 15:11:20 -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.6 required=5.0 tests=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 m7PMBHDL029601 for ; Mon, 25 Aug 2008 15:11:18 -0700 X-ASG-Debug-ID: 1219702359-2468015f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from millhouse.houseofnate.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C821F3CCD0E for ; Mon, 25 Aug 2008 15:12:39 -0700 (PDT) Received: from millhouse.houseofnate.net (dsl092-086-237.bos1.dsl.speakeasy.net [66.92.86.237]) by cuda.sgi.com with ESMTP id yZAtmLfHoIgB0TFq for ; Mon, 25 Aug 2008 15:12:39 -0700 (PDT) Received: from [172.20.3.239] (port.exagrid.com [::ffff:64.69.114.146]) (AUTH: LOGIN nturner, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by millhouse.houseofnate.net with esmtp; Mon, 25 Aug 2008 18:12:37 -0400 id 000000000026418A.0000000048B32E56.00003D14 Message-ID: <48B32E36.7060305@houseofnate.net> Date: Mon, 25 Aug 2008 18:12:06 -0400 From: "Nathaniel W. Turner" User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Subject: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: dsl092-086-237.bos1.dsl.speakeasy.net[66.92.86.237] X-Barracuda-Start-Time: 1219702360 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0121 1.0000 -1.9419 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.84 X-Barracuda-Spam-Status: No, SCORE=-1.84 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3712 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17713 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nate@houseofnate.net Precedence: bulk X-list: xfs Hi folks, While doing a little light reading, I noticed the following in fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree). Am I missing something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED in this check? nate /* * If the ordered flag has been removed by a lower * layer, it means the underlyin device no longer supports * barrier I/O. Warn loudly and turn off barriers. */ if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ORDERED(bp)) { l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; xfs_fs_cmn_err(CE_WARN, l->l_mp, "xlog_iodone: Barriers are no longer supported" " by device. Disabling barriers\n"); xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp); } From owner-xfs@oss.sgi.com Mon Aug 25 16:14:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 16:14: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.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7PNEthI032437 for ; Mon, 25 Aug 2008 16:14:55 -0700 X-ASG-Debug-ID: 1219706177-198702ec0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6662D1A478FB for ; Mon, 25 Aug 2008 16:16:17 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 0DyGWs45AkPo4idO for ; Mon, 25 Aug 2008 16:16:17 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id A6794AC3591; Mon, 25 Aug 2008 18:16:16 -0500 (CDT) Message-ID: <48B33D40.6020104@sandeen.net> Date: Mon, 25 Aug 2008 18:16:16 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: "Nathaniel W. Turner" CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Subject: Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? References: <48B32E36.7060305@houseofnate.net> In-Reply-To: <48B32E36.7060305@houseofnate.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1219706178 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.3716 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17714 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Nathaniel W. Turner wrote: > Hi folks, > > While doing a little light reading, I noticed the following in > fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree). Am I missing > something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED > in this check? > > nate > > > /* > * If the ordered flag has been removed by a lower > * layer, it means the underlyin device no longer supports > * barrier I/O. Warn loudly and turn off barriers. > */ > if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && > !XFS_BUF_ORDERED(bp)) { > l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; > xfs_fs_cmn_err(CE_WARN, l->l_mp, > "xlog_iodone: Barriers are no longer > supported" > " by device. Disabling barriers\n"); > xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp); > } > > wow, I think you're right. Fortunately I dont' think this does much harm in most cases - the buffer is usually ordered here anyway, and we're re-setting it instead of testing it, as you noticed. But it's making this whole dynamic-lack-of-barrier detection pointless/broken. modest proposal: change the macro (and friends) to XFS_BUF_SETORDERED or somesuch. :) -Eric From owner-xfs@oss.sgi.com Mon Aug 25 18:40:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 18:40:18 -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,MIME_8BIT_HEADER autolearn=no 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 m7Q1eG5w011497 for ; Mon, 25 Aug 2008 18:40:16 -0700 X-ASG-Debug-ID: 1219714897-573602070000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 11E823CD3C9 for ; Mon, 25 Aug 2008 18:41:38 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id EYBOOwfciBtJt642 for ; Mon, 25 Aug 2008 18:41:38 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAD35skh5LD0wiGdsb2JhbACSLAEBAQ8gpDuBaw X-IronPort-AV: E=Sophos;i="4.32,266,1217773800"; d="scan'208";a="180288845" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 11:11:36 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXnYr-00054B-Gp; Tue, 26 Aug 2008 11:41:33 +1000 Date: Tue, 26 Aug 2008 11:41:33 +1000 From: Dave Chinner To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel Message-ID: <20080826014133.GS5706@disturbed> Mail-Followup-To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski , xfs@oss.sgi.com References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219714899 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0066 1.0000 -1.9780 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.98 X-Barracuda-Spam-Status: No, SCORE=-1.98 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.3726 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17715 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 01:08:29PM +0200, SÅ‚awomir Nowakowski wrote: > 2008/8/23 Dave Chinner : > Next we have created some files: > -one big file called "bigfile" and size of 5109497856 bytes > -two small text files called: "file1" and "file2" > > At this stage it looked as follows: .... > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/sda3 4993984 4989916 4068 100% /mnt/z > > Then we have run system with 2.6.25.13 kernel and checked how it looks: ..... > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/sda3 4993984 4993984 0 100% /mnt/z > > As it shown in case of 2.6.25.13 kernel system reports no free space, > but under 2.6.17.13 kernel there is 4068kB of free space. > > At this stage when editing file file1 with i.e. mcedit and trying to > write changes, the system cuts this file to 0 bytes! Oh, look, yet another editor that doesn't safely handle ENOSPC and trashes files when it can't overwrite them. That's not an XFS problem - I suggest raising a bug against the editor.... > >> Is it known issue and/or does solution or workaround exists? > > > > $ sudo xfs_io -x -c 'resblks 0' > > > > will remove the reservation. This means your filesystem can shutdown > > or lose data at ENOSPC in certain circumstances.... > > A question: does using the command: > > $ sudo xfs_io -x -c 'resblks 0' > > for 2.6.25.13 kernel gives higher risk of losing data then in case of > 2.6.17.13 kernel. Hard to say. If you don't run to ENOSPC then there is no difference. If you do run to ENOSPC then I think that there is a slightly higher risk of tripping problems on 2.6.25.x because of other ENOSPC fixes that have been included since 2.6.17.13. This really is a safety net in that it allows the system to continue without problems in conditions where it would have previously done a bad thing... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 25 18:54:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 18:54:37 -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 m7Q1sUEX012342 for ; Mon, 25 Aug 2008 18:54:31 -0700 X-ASG-Debug-ID: 1219715752-4cf603540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0DC713CD48C for ; Mon, 25 Aug 2008 18:55:53 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Dv77OX9UipMuZOGW for ; Mon, 25 Aug 2008 18:55:53 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAPz8skh5LD0wiGdsb2JhbACSLAEBAQ8gpC+Baw X-IronPort-AV: E=Sophos;i="4.32,266,1217773800"; d="scan'208";a="180299290" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 11:25:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXnmf-0005NY-Ah; Tue, 26 Aug 2008 11:55:49 +1000 Date: Tue, 26 Aug 2008 11:55:49 +1000 From: Dave Chinner To: Peter Zijlstra Cc: 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: <20080826015549.GT5706@disturbed> Mail-Followup-To: Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com, hch@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.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219715754 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.3728 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17716 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 08:59:33AM +0200, Peter Zijlstra wrote: > On Mon, 2008-08-25 at 13:55 +1000, Dave Chinner wrote: > > On Mon, Aug 25, 2008 at 12:12:23PM +1000, Lachlan McIlroy wrote: > > > Dave Chinner wrote: > > >> On Fri, Aug 22, 2008 at 10:12:59PM +0100, Daniel J Blueman wrote: > > >>> ======================================================= > > >>> [ INFO: possible circular locking dependency detected ] > > >>> 2.6.27-rc4-224c #1 > > >>> ------------------------------------------------------- > > >>> xfs_fsr/5763 is trying to acquire lock: > > >>> (&(&ip->i_lock)->mr_lock/2){--..}, at: [] xfs_ilock+0x8c/0xb0 > > >>> > > >>> but task is already holding lock: > > >>> (&(&ip->i_iolock)->mr_lock/3){--..}, at: [] > > >>> xfs_ilock+0xa5/0xb0 > > >> > > >> False positive. We do: > > >> > > >> xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); > > > > > > Why not just change the above line to two lines: > > > xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); > > > xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > > > > Yeah, that'd work, but it implllies that we no longer allow > > xfs_lock_two_inodes() to take both inode locks at once. > > 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. It doesn't take them both inode locks in one go - it does them separately in a given order via xfs_ilock(). Basically there are two layers of constraints here - xfs_ilock() handles the order withing a given inode, xfs_lock_two_inodes() handles order and deadlock prevention between inodes. What lockdep is complaining about is a difference in the lock order between different locks in different inodes - a situation that does not result in a deadlock... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 25 18:59:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 18:59:49 -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 m7Q1xhiR012950 for ; Mon, 25 Aug 2008 18:59:47 -0700 X-ASG-Debug-ID: 1219716065-635001fd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 119DF3CD562 for ; Mon, 25 Aug 2008 19:01:06 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id NBTMVWAWeRhna07t for ; Mon, 25 Aug 2008 19:01:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAFwAs0h5LD0wiGdsb2JhbACSLAEBAQ8gpC2Baw X-IronPort-AV: E=Sophos;i="4.32,267,1217773800"; d="scan'208";a="180302742" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 11:31:02 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXnrh-0005hA-Ky; Tue, 26 Aug 2008 12:01:01 +1000 Date: Tue, 26 Aug 2008 12:01:01 +1000 From: Dave Chinner To: Ed Cashin Cc: xfs@oss.sgi.com, Adrian Bunk X-ASG-Orig-Subj: Re: xfs_growfs fix backport for 2.6.16.y Subject: Re: xfs_growfs fix backport for 2.6.16.y Message-ID: <20080826020101.GU5706@disturbed> Mail-Followup-To: Ed Cashin , xfs@oss.sgi.com, Adrian Bunk References: <20080825153931.GD7575@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080825153931.GD7575@coraid.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219716067 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0254 1.0000 -1.8565 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.86 X-Barracuda-Spam-Status: No, SCORE=-1.86 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.3728 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17717 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 11:39:31AM -0400, Ed Cashin wrote: > Dave Chinner, hello. > > Your fix for the counters that had been preventing an XFS from growing > by more than two terabytes went into 2.6.21, after the introduction of > the per-cpu in-core superblock counters. The per-cpu in-core > superblock counters are not in the latest version of the long-lived > stable kernel 2.6.16.y, maintained by Adrian Bunk. > > The problem with growing by more than two terabytes appears to be > there, though. The 2.6.16.62 kernel will not allow me to grow an XFS > by, e.g., 10 terabytes, so xfs_growfs does not report any change in > the data blocks. > > I backported your fix, > > commit 20f4ebf2bf2f57c1a9abb3655391336cc90314b3 > Author: David Chinner > Date: Sat Feb 10 18:36:10 2007 +1100 > > [XFS] Make growfs work for amounts greater than 2TB > > The free block modification code has a 32bit interface, limiting the size > the filesystem can be grown even on 64 bit machines. On 32 bit machines, > there are other 32bit variables in transaction structures and interfaces > that need to be expanded to allow this to work. > > SGI-PV: 959978 > SGI-Modid: xfs-linux-melb:xfs-kern:27894a > > Signed-off-by: David Chinner > Signed-off-by: Christoph Hellwig > Signed-off-by: Tim Shimmin > > ... to the 2.6.16.y git tree, and the result is included below. When > I apply this backported fix to 2.6.16.62, I can grow an online XFS by > 10 terabytes without any trouble. > > Do you see any problems with this backport? If not, I will submit it > for inclusion in the next 2.6.16.y release. I suggest you make sure it passes test 078 in the xfsqa suite (part of the xfs-cmds tree) as that tests all the nasty growfs corner cases. You'll need to test it on 32 bit and 64 bit machines.... If it passes that then I don't see any problems - SGI backported this for sles10 which is based on 2.6.16 a long time ago. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 25 19:05:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:05:27 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7Q25M7o013596 for ; Mon, 25 Aug 2008 19:05:23 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA13531 for ; Tue, 26 Aug 2008 12:06:45 +1000 Date: Tue, 26 Aug 2008 12:07:45 +1000 To: "xfs@oss.sgi.com" Subject: Re: REVIEW: xfs_metadump improvements From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17718 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Ping? (This is why no new xfsprogs tarball has been released yet Eric!) On Mon, 30 Jun 2008 17:53:53 +1000, Barry Naujok wrote: > Based on what I found in xfs_check, I fixed up xfs_metadump in the > same way. > > Also, I've increased the default maximum expected extent size for > a directory, as in practice, 400 block extents for directory > structures is not rare. > > -- > > --- a/xfsprogs/db/metadump.c 2008-06-30 17:51:10.000000000 +1000 > +++ b/xfsprogs/db/metadump.c 2008-06-30 17:45:59.609352130 +1000 > @@ -27,6 +27,8 @@ > #include "sig.h" > #include "xfs_metadump.h" > > +#define DEFAULT_MAX_EXT_SIZE 1000 > + > /* copy all metadata structures to/from a file */ > > static int metadump_f(int argc, char **argv); > @@ -58,7 +60,7 @@ static xfs_ino_t cur_ino; > > static int show_progress = 0; > static int stop_on_read_error = 0; > -static int max_extent_size = 20; > +static int max_extent_size = DEFAULT_MAX_EXT_SIZE; > static int dont_obfuscate = 0; > static int show_warnings = 0; > static int progress_since_warning = 0; > @@ -80,10 +82,10 @@ metadump_help(void) > " Options:\n" > " -e -- Ignore read errors and keep going\n" > " -g -- Display dump progress\n" > -" -m -- Specify max extent size in blocks to copy (default = 20 > blocks)\n" > +" -m -- Specify max extent size in blocks to copy (default = %d > blocks)\n" > " -o -- Don't obfuscate names and extended attributes\n" > " -w -- Show warnings of bad metadata information\n" > -"\n"); > +"\n", DEFAULT_MAX_EXT_SIZE); > } > > static void > @@ -186,22 +188,26 @@ scan_btree( > typnm_t btype, > void *arg)) > { > + int rval = 0; > + > push_cur(); > set_cur(&typtab[btype], XFS_AGB_TO_DADDR(mp, agno, agbno), blkbb, > DB_RING_IGN, NULL); > if (iocur_top->data == NULL) { > print_warning("cannot read %s block %u/%u", typtab[btype].name, > agno, agbno); > - return !stop_on_read_error; > + rval = !stop_on_read_error; > + goto pop_out; > } > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > > if (!(*func)(iocur_top->data, agno, agbno, level - 1, btype, arg)) > - return 0; > - > + goto pop_out; > + rval = 1; > +pop_out: > pop_cur(); > - return 1; > + return rval; > } > > /* free space tree copy routines */ > @@ -949,8 +955,10 @@ process_bmbt_reclist( > if (iocur_top->data == NULL) { > print_warning("cannot read %s block %u/%u (%llu)", > typtab[btype].name, agno, agbno, s); > - if (stop_on_read_error) > + if (stop_on_read_error) { > + pop_cur(); > return 0; > + } > } else { > if (!dont_obfuscate) > switch (btype) { > @@ -973,8 +981,10 @@ process_bmbt_reclist( > > default: ; > } > - if (!write_buf(iocur_top)) > + if (!write_buf(iocur_top)) { > + pop_cur(); > return 0; > + } > } > pop_cur(); > } > @@ -1238,6 +1248,7 @@ copy_inode_chunk( > int off; > xfs_agblock_t agbno; > int i; > + int rval = 0; > > agino = be32_to_cpu(rp->ir_startino); > agbno = XFS_AGINO_TO_AGBNO(mp, agino); > @@ -1258,7 +1269,8 @@ copy_inode_chunk( > DB_RING_IGN, NULL); > if (iocur_top->data == NULL) { > print_warning("cannot read inode block %u/%u", agno, agbno); > - return !stop_on_read_error; > + rval = !stop_on_read_error; > + goto pop_out; > } > > /* > @@ -1291,11 +1303,11 @@ copy_inode_chunk( > ((off + i) << mp->m_sb.sb_inodelog)); > > if (!process_inode(agno, agino + i, dip)) > - return 0; > + goto pop_out; > } > skip_processing: > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > > inodes_copied += XFS_INODES_PER_CHUNK; > > @@ -1303,10 +1315,10 @@ skip_processing: > print_progress("Copied %u of %u inodes (%u of %u AGs)", > inodes_copied, mp->m_sb.sb_icount, agno, > mp->m_sb.sb_agcount); > - > + rval = 1; > +pop_out: > pop_cur(); > - > - return 1; > + return rval; > } > > static int > @@ -1401,61 +1413,66 @@ scan_ag( > { > xfs_agf_t *agf; > xfs_agi_t *agi; > + int stack_count = 0; > + int rval = 0; > > /* copy the superblock of the AG */ > push_cur(); > + stack_count++; > set_cur(&typtab[TYP_SB], XFS_AG_DADDR(mp, agno, XFS_SB_DADDR), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > if (!iocur_top->data) { > print_warning("cannot read superblock for ag %u", agno); > if (stop_on_read_error) > - return 0; > + goto pop_out; > } else { > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > } > > /* copy the AG free space btree root */ > push_cur(); > + stack_count++; > set_cur(&typtab[TYP_AGF], XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > agf = iocur_top->data; > if (iocur_top->data == NULL) { > print_warning("cannot read agf block for ag %u", agno); > if (stop_on_read_error) > - return 0; > + goto pop_out; > } else { > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > } > > /* copy the AG inode btree root */ > push_cur(); > + stack_count++; > set_cur(&typtab[TYP_AGI], XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > agi = iocur_top->data; > if (iocur_top->data == NULL) { > print_warning("cannot read agi block for ag %u", agno); > if (stop_on_read_error) > - return 0; > + goto pop_out; > } else { > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > } > > /* copy the AG free list header */ > push_cur(); > + stack_count++; > set_cur(&typtab[TYP_AGFL], XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > if (iocur_top->data == NULL) { > print_warning("cannot read agfl block for ag %u", agno); > if (stop_on_read_error) > - return 0; > + goto pop_out; > } else { > if (!write_buf(iocur_top)) > - return 0; > + goto pop_out; > } > - pop_cur(); > > /* copy AG free space btrees */ > if (agf) { > @@ -1463,22 +1480,21 @@ scan_ag( > print_progress("Copying free space trees of AG %u", > agno); > if (!copy_free_bno_btree(agno, agf)) > - return 0; > + goto pop_out; > if (!copy_free_cnt_btree(agno, agf)) > - return 0; > + goto pop_out; > } > > /* copy inode btrees and the inodes and their associated metadata */ > if (agi) { > if (!copy_inodes(agno, agi)) > - return 0; > + goto pop_out; > } > - > - pop_cur(); > - pop_cur(); > - pop_cur(); > - > - return 1; > + rval = 1; > +pop_out: > + while (stack_count--) > + pop_cur(); > + return rval; > } > > static int > @@ -1492,6 +1508,7 @@ copy_ino( > xfs_dinode_t *dip; > xfs_dinode_core_t tdic; > int offset; > + int rval = 0; > > if (ino == 0) > return 1; > @@ -1515,7 +1532,8 @@ copy_ino( > if (iocur_top->data == NULL) { > print_warning("cannot read %s inode %lld", > typtab[itype].name, (long long)ino); > - return !stop_on_read_error; > + rval = !stop_on_read_error; > + goto pop_out; > } > off_cur(offset << mp->m_sb.sb_inodelog, mp->m_sb.sb_inodesize); > > @@ -1524,7 +1542,10 @@ copy_ino( > memcpy(&dip->di_core, &tdic, sizeof(xfs_dinode_core_t)); > > cur_ino = ino; > - return process_inode_data(dip, itype); > + rval = process_inode_data(dip, itype); > +pop_out: > + pop_cur(); > + return rval; > } > > > @@ -1553,6 +1574,7 @@ copy_log(void) > set_cur(&typtab[TYP_LOG], XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart), > mp->m_sb.sb_logblocks * blkbb, DB_RING_IGN, NULL); > if (iocur_top->data == NULL) { > + pop_cur(); > print_warning("cannot read log"); > return !stop_on_read_error; > } From owner-xfs@oss.sgi.com Mon Aug 25 19:06:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:06:09 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7Q266B1013859 for ; Mon, 25 Aug 2008 19:06:07 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA13560; Tue, 26 Aug 2008 12:07:27 +1000 Date: Tue, 26 Aug 2008 12:08:27 +1000 To: "Christoph Hellwig" Subject: Re: REVIEW: xfs_repair fixes for bad directories From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080701081306.GA11135@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080701081306.GA11135@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17719 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Tue, 01 Jul 2008 18:13:06 +1000, Christoph Hellwig wrote: > On Tue, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: >> Two issues have been encounted with xfs_repair and badly corrupted >> directories. >> >> 1. A huge size (inode di_size) can cause malloc which will fail. >> Patch dir_size_check.patch checks for a valid directory size >> and if it's bad, junks the directory. The di_size for a dir >> only counts the data blocks being used, not all the other >> associated metadata. This is limited to 32GB by the >> XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this >> must be invalid. > > This one looks good. > >> 2. An update a while ago to xfs_repair attempts to fix invalid >> ".." entries for subdirectories where there is a valid parent >> with the appropriate entry. It was a partial fix that never >> did the full job, especially if the subdirectory was short- >> form or it has already been processed. >> >> Patch fix_dir_rebuild_without_dotdot_entry.patch creates a >> post-processing queue after the main scan to update any >> directories with an invalid ".." entry. > > For this one I'll need to read the surrounding code first to do > a useful review, so it'll take some time. Ping? From owner-xfs@oss.sgi.com Mon Aug 25 19:08:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:08:15 -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 (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 m7Q289YB014363 for ; Mon, 25 Aug 2008 19:08:09 -0700 X-ASG-Debug-ID: 1219716572-545d035d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 39A64FBBE61 for ; Mon, 25 Aug 2008 19:09:32 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id z2jjpBHDieHbqICW for ; Mon, 25 Aug 2008 19:09:32 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAFwAs0h5LD0wiGdsb2JhbACSLAEBAQ8gpC2Baw X-IronPort-AV: E=Sophos;i="4.32,267,1217773800"; d="scan'208";a="180308912" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 11:39:30 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXnzr-0006Fp-T4; Tue, 26 Aug 2008 12:09:27 +1000 Date: Tue, 26 Aug 2008 12:09:27 +1000 From: Dave Chinner To: "Nathaniel W. Turner" Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Subject: Re: XFS_BUF_ORDERED instead of XFS_BUF_ISORDERED? Message-ID: <20080826020927.GV5706@disturbed> Mail-Followup-To: "Nathaniel W. Turner" , xfs@oss.sgi.com References: <48B32E36.7060305@houseofnate.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48B32E36.7060305@houseofnate.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219716573 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0200 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.3729 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17720 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 06:12:06PM -0400, Nathaniel W. Turner wrote: > Hi folks, > > While doing a little light reading, I noticed the following in > fs/xfs/xfs_log.c:1011 (in the 2.6.26.3 Linux kernel tree). Am I missing > something, or should XFS_BUF_ORDERED be replaced with XFS_BUF_ISORDERED > in this check? Yes, it is wrong. Well spotted. I guess this shows that I was right when I complained about needing this untestable barrier handling code in every filesystem.... Patch below. Cheers, Dave. -- Dave Chinner david@fromorbit.com XFS: Fix barrier status change detection The current code in xlog_iodone() uses the wrong macro to check if the barrier has been cleared due to an EOPNOTSUPP error form the lower layer. Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index ccba14e..ff2ac20 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1009,7 +1009,7 @@ xlog_iodone(xfs_buf_t *bp) * layer, it means the underlyin device no longer supports * barrier I/O. Warn loudly and turn off barriers. */ - if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ORDERED(bp)) { + if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ISORDERED(bp)) { l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; xfs_fs_cmn_err(CE_WARN, l->l_mp, "xlog_iodone: Barriers are no longer supported" From owner-xfs@oss.sgi.com Mon Aug 25 19:19:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:19:33 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7Q2JSN1015438 for ; Mon, 25 Aug 2008 19:19:30 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA13883 for ; Tue, 26 Aug 2008 12:20:51 +1000 Date: Tue, 26 Aug 2008 12:21:54 +1000 To: "xfs@oss.sgi.com" Subject: REVIEW: Remove convert_extent function in xfs_repair From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17721 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs It seems convert_extent is not that useful, so remove it and call libxfs_bmbt_disk_get_all() directly and use the xfs_bmbt_irec_t structure directly. --- xfsprogs/repair/dinode.c | 239 +++++++++++++++++++-------------------------- xfsprogs/repair/prefetch.c | 33 +++--- 2 files changed, 122 insertions(+), 150 deletions(-) Index: repair/xfsprogs/repair/dinode.c =================================================================== --- repair.orig/xfsprogs/repair/dinode.c +++ repair/xfsprogs/repair/dinode.c @@ -455,35 +455,6 @@ verify_agbno(xfs_mount_t *mp, return verify_ag_bno(sbp, agno, agbno) == 0; } -void -convert_extent( - xfs_bmbt_rec_32_t *rp, - xfs_dfiloff_t *op, /* starting offset (blockno in file) */ - xfs_dfsbno_t *sp, /* starting block (fs blockno) */ - xfs_dfilblks_t *cp, /* blockcount */ - int *fp) /* extent flag */ -{ - xfs_bmbt_irec_t irec, *s = &irec; - xfs_bmbt_rec_t rpcopy, *p = &rpcopy; - - memcpy(&rpcopy, rp, sizeof(rpcopy)); - /* Just use the extent parsing routine from the kernel */ - libxfs_bmbt_disk_get_all(p, s); - - if (fs_has_extflgbit) { - if (s->br_state == XFS_EXT_UNWRITTEN) { - *fp = 1; - } else { - *fp = 0; - } - } else { - *fp = 0; - } - *op = s->br_startoff; - *sp = s->br_startblock; - *cp = s->br_blockcount; -} - /* * return address of block fblock if it's within the range described * by the extent list. Otherwise, returns a null address. @@ -492,20 +463,18 @@ convert_extent( xfs_dfsbno_t get_bmbt_reclist( xfs_mount_t *mp, - xfs_bmbt_rec_32_t *rp, + xfs_bmbt_rec_t *rp, int numrecs, xfs_dfiloff_t fblock) { int i; - xfs_dfilblks_t cnt; - xfs_dfiloff_t off_bno; - xfs_dfsbno_t start; - int flag; + xfs_bmbt_irec_t irec; for (i = 0; i < numrecs; i++, rp++) { - convert_extent(rp, &off_bno, &start, &cnt, &flag); - if (off_bno >= fblock && off_bno + cnt < fblock) - return(start + fblock - off_bno); + libxfs_bmbt_disk_get_all(rp, &irec); + if (irec.br_startoff >= fblock && + irec.br_startoff + irec.br_blockcount < fblock) + return (irec.br_startblock + fblock - irec.br_startoff); } return(NULLDFSBNO); @@ -515,39 +484,36 @@ get_bmbt_reclist( static int process_rt_rec( xfs_mount_t *mp, - xfs_bmbt_rec_32_t *rp, + xfs_bmbt_irec_t *irec, xfs_ino_t ino, xfs_drfsbno_t *tot, int check_dups) { xfs_dfsbno_t b; xfs_drtbno_t ext; - xfs_dfilblks_t c; /* count */ - xfs_dfsbno_t s; /* start */ - xfs_dfiloff_t o; /* offset */ int state; - int flag; /* extent flag */ int pwe; /* partially-written extent */ - convert_extent(rp, &o, &s, &c, &flag); - /* * check numeric validity of the extent */ - if (s >= mp->m_sb.sb_rblocks) { + if (irec->br_startblock >= mp->m_sb.sb_rblocks) { do_warn(_("inode %llu - bad rt extent start block number " - "%llu, offset %llu\n"), ino, s, o); + "%llu, offset %llu\n"), ino, + irec->br_startblock, irec->br_startoff); return 1; } - if (s + c - 1 >= mp->m_sb.sb_rblocks) { + if (irec->br_startblock + irec->br_blockcount - 1 >= mp->m_sb.sb_rblocks) { do_warn(_("inode %llu - bad rt extent last block number %llu, " - "offset %llu\n"), ino, s + c - 1, o); + "offset %llu\n"), ino, irec->br_startblock + + irec->br_blockcount - 1, irec->br_startoff); return 1; } - if (s + c - 1 < s) { + if (irec->br_startblock + irec->br_blockcount - 1 < irec->br_startblock) { do_warn(_("inode %llu - bad rt extent overflows - start %llu, " - "end %llu, offset %llu\n"), - ino, s, s + c - 1, o); + "end %llu, offset %llu\n"), ino, + irec->br_startblock, irec->br_startblock + + irec->br_blockcount - 1, irec->br_startoff); return 1; } @@ -556,19 +522,22 @@ process_rt_rec( * are multiples of an extent */ if (XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) == 0 && - (s % mp->m_sb.sb_rextsize != 0 || - c % mp->m_sb.sb_rextsize != 0)) { + (irec->br_startblock % mp->m_sb.sb_rextsize != 0 || + irec->br_blockcount % mp->m_sb.sb_rextsize != 0)) { do_warn(_("malformed rt inode extent [%llu %llu] (fs rtext " - "size = %u)\n"), s, c, mp->m_sb.sb_rextsize); + "size = %u)\n"), irec->br_startblock, + irec->br_blockcount, mp->m_sb.sb_rextsize); return 1; } /* * set the appropriate number of extents */ - for (b = s; b < s + c; b += mp->m_sb.sb_rextsize) { + for (b = irec->br_startblock; b < irec->br_startblock + + irec->br_blockcount; b += mp->m_sb.sb_rextsize) { ext = (xfs_drtbno_t) b / mp->m_sb.sb_rextsize; - pwe = XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) && flag && + pwe = XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) && + irec->br_state == XFS_EXT_UNWRITTEN && (b % mp->m_sb.sb_rextsize != 0); if (check_dups == 1) { @@ -576,7 +545,9 @@ process_rt_rec( do_warn(_("data fork in rt ino %llu claims " "dup rt extent, off - %llu, " "start - %llu, count %llu\n"), - ino, o, s, c); + ino, irec->br_startoff, + irec->br_startblock, + irec->br_blockcount); return 1; } continue; @@ -598,8 +569,8 @@ process_rt_rec( case XR_E_INO: case XR_E_INUSE_FS: do_error(_("data fork in rt inode %llu found " - "metadata block %llu in rt bmap\n"), - ino, ext); + "metadata block %llu in rt bmap\n"), + ino, ext); case XR_E_INUSE: if (pwe) @@ -622,7 +593,7 @@ process_rt_rec( /* * bump up the block counter */ - *tot += c; + *tot += irec->br_blockcount; return 0; } @@ -638,7 +609,7 @@ process_rt_rec( int process_bmbt_reclist_int( xfs_mount_t *mp, - xfs_bmbt_rec_32_t *rp, + xfs_bmbt_rec_t *rp, int numrecs, int type, xfs_ino_t ino, @@ -649,18 +620,15 @@ process_bmbt_reclist_int( int check_dups, int whichfork) { - xfs_dfsbno_t b; - xfs_dfilblks_t c; /* count */ + xfs_bmbt_irec_t irec; xfs_dfilblks_t cp = 0; /* prev count */ - xfs_dfsbno_t s; /* start */ xfs_dfsbno_t sp = 0; /* prev start */ - xfs_dfiloff_t o = 0; /* offset */ xfs_dfiloff_t op = 0; /* prev offset */ + xfs_dfsbno_t b; char *ftype; char *forkname; int i; int state; - int flag; /* extent flag */ xfs_dfsbno_t e; xfs_agnumber_t agno; xfs_agblock_t agbno; @@ -678,27 +646,29 @@ process_bmbt_reclist_int( ftype = _("regular"); for (i = 0; i < numrecs; i++, rp++) { - convert_extent(rp, &o, &s, &c, &flag); + libxfs_bmbt_disk_get_all(rp, &irec); if (i == 0) - *last_key = *first_key = o; + *last_key = *first_key = irec.br_startoff; else - *last_key = o; - if (i > 0 && op + cp > o) { + *last_key = irec.br_startoff; + if (i > 0 && op + cp > irec.br_startoff) { do_warn(_("bmap rec out of order, inode %llu entry %d " "[o s c] [%llu %llu %llu], %d [%llu %llu %llu]\n"), - ino, i, o, s, c, i-1, op, sp, cp); + ino, i, irec.br_startoff, irec.br_startblock, + irec.br_blockcount, i - 1, op, sp, cp); goto done; } - op = o; - cp = c; - sp = s; + op = irec.br_startoff; + cp = irec.br_blockcount; + sp = irec.br_startblock; /* * check numeric validity of the extent */ - if (c == 0) { - do_warn(_("zero length extent (off = %llu, " - "fsbno = %llu) in ino %llu\n"), o, s, ino); + if (irec.br_blockcount == 0) { + do_warn(_("zero length extent (off = %llu, fsbno = " + "%llu) in ino %llu\n"), irec.br_startoff, + irec.br_startblock, ino); goto done; } @@ -707,10 +677,10 @@ process_bmbt_reclist_int( * realtime bitmaps don't use AG locks, so returning * immediately is fine for this code path. */ - if (process_rt_rec(mp, rp, ino, tot, check_dups)) + if (process_rt_rec(mp, &irec, ino, tot, check_dups)) return 1; /* - * skip rest of loop processing since that's + * skip rest of loop processing since that'irec.br_startblock * all for regular file forks and attr forks */ continue; @@ -719,44 +689,51 @@ process_bmbt_reclist_int( /* * regular file data fork or attribute fork */ - switch (verify_dfsbno_range(mp, s, c)) { + switch (verify_dfsbno_range(mp, irec.br_startblock, + irec.br_blockcount)) { case XR_DFSBNORANGE_VALID: break; case XR_DFSBNORANGE_BADSTART: do_warn(_("inode %llu - bad extent starting " "block number %llu, offset %llu\n"), - ino, s, o); + ino, irec.br_startblock, + irec.br_startoff); goto done; case XR_DFSBNORANGE_BADEND: do_warn(_("inode %llu - bad extent last block " - "number %llu, offset %llu\n"), - ino, s + c - 1, o); + "number %llu, offset %llu\n"), ino, + irec.br_startblock + irec.br_blockcount + - 1, irec.br_startoff); goto done; case XR_DFSBNORANGE_OVERFLOW: do_warn(_("inode %llu - bad extent overflows - " "start %llu, end %llu, offset %llu\n"), - ino, s, s + c - 1, o); + ino, irec.br_startblock, + irec.br_startblock + irec.br_blockcount + - 1, irec.br_startoff); goto done; } - if (o >= fs_max_file_offset) { + if (irec.br_startoff >= fs_max_file_offset) { do_warn(_("inode %llu - extent offset too large - " "start %llu, count %llu, offset %llu\n"), - ino, s, c, o); + ino, irec.br_startblock, irec.br_blockcount, + irec.br_startoff); goto done; } if (blkmapp && *blkmapp) - blkmap_set_ext(blkmapp, o, s, c); + blkmap_set_ext(blkmapp, irec.br_startoff, + irec.br_startblock, irec.br_blockcount); /* * Profiling shows that the following loop takes the * most time in all of xfs_repair. */ - agno = XFS_FSB_TO_AGNO(mp, s); - agbno = XFS_FSB_TO_AGBNO(mp, s); - e = s + c; + agno = XFS_FSB_TO_AGNO(mp, irec.br_startblock); + agbno = XFS_FSB_TO_AGBNO(mp, irec.br_startblock); + e = irec.br_startblock + irec.br_blockcount; if (agno != locked_agno) { if (locked_agno != -1) pthread_mutex_unlock(&ag_locks[locked_agno]); @@ -771,25 +748,27 @@ process_bmbt_reclist_int( * checking each entry without setting the * block bitmap */ - for (b = s; b < e; b++, agbno++) { + for (b = irec.br_startblock; b < e; b++, agbno++) { if (search_dup_extent(mp, agno, agbno)) { do_warn(_("%s fork in ino %llu claims " "dup extent, off - %llu, " "start - %llu, cnt %llu\n"), - forkname, ino, o, s, c); + forkname, ino, irec.br_startoff, + irec.br_startblock, + irec.br_blockcount); goto done; } } - *tot += c; + *tot += irec.br_blockcount; continue; } - for (b = s; b < e; b++, agbno++) { + for (b = irec.br_startblock; b < e; b++, agbno++) { /* * Process in chunks of 16 (XR_BB_UNIT/XR_BB) * for common XR_E_UNKNOWN to XR_E_INUSE transition */ - if (((agbno & XR_BB_MASK) == 0) && ((s + c - b) >= (XR_BB_UNIT/XR_BB))) { + if (((agbno & XR_BB_MASK) == 0) && ((irec.br_startblock + irec.br_blockcount - b) >= (XR_BB_UNIT/XR_BB))) { if (ba_bmap[agno][agbno>>XR_BB] == XR_E_UNKNOWN_LL) { ba_bmap[agno][agbno>>XR_BB] = XR_E_INUSE_LL; agbno += (XR_BB_UNIT/XR_BB) - 1; @@ -836,7 +815,7 @@ process_bmbt_reclist_int( state, b); } } - *tot += c; + *tot += irec.br_blockcount; } error = 0; done: @@ -862,9 +841,9 @@ process_bmbt_reclist( xfs_dfiloff_t *last_key, int whichfork) { - return(process_bmbt_reclist_int(mp, rp, numrecs, type, ino, tot, - blkmapp, first_key, last_key, 0, - whichfork)); + return(process_bmbt_reclist_int(mp, (xfs_bmbt_rec_t *)rp, numrecs, type, + ino, tot, blkmapp, first_key, last_key, + 0, whichfork)); } /* @@ -884,9 +863,9 @@ scan_bmbt_reclist( xfs_dfiloff_t first_key = 0; xfs_dfiloff_t last_key = 0; - return(process_bmbt_reclist_int(mp, rp, numrecs, type, ino, tot, - NULL, &first_key, &last_key, 1, - whichfork)); + return(process_bmbt_reclist_int(mp, (xfs_bmbt_rec_t *)rp, numrecs, type, + ino, tot, NULL, &first_key, &last_key, + 1, whichfork)); } /* @@ -943,21 +922,18 @@ getfunc_extlist(xfs_mount_t *mp, xfs_dfiloff_t bno, int whichfork) { - xfs_dfiloff_t fbno; - xfs_dfilblks_t bcnt; - xfs_dfsbno_t fsbno; + xfs_bmbt_irec_t irec; xfs_dfsbno_t final_fsbno = NULLDFSBNO; - xfs_bmbt_rec_32_t *rootblock = (xfs_bmbt_rec_32_t *) + xfs_bmbt_rec_t *rootblock = (xfs_bmbt_rec_t *) XFS_DFORK_PTR(dip, whichfork); xfs_extnum_t nextents = XFS_DFORK_NEXTENTS(dip, whichfork); int i; - int flag; for (i = 0; i < nextents; i++) { - convert_extent(rootblock + i, &fbno, &fsbno, &bcnt, &flag); - - if (fbno <= bno && bno < fbno + bcnt) { - final_fsbno = bno - fbno + fsbno; + libxfs_bmbt_disk_get_all(rootblock + i, &irec); + if (irec.br_startoff <= bno && + bno < irec.br_startoff + irec.br_blockcount) { + final_fsbno = bno - irec.br_startoff + irec.br_startblock; break; } } @@ -976,16 +952,14 @@ getfunc_btree(xfs_mount_t *mp, #ifdef DEBUG int prev_level; #endif - int flag; int found; - xfs_bmbt_rec_32_t *rec; + xfs_bmbt_rec_t *rec; + xfs_bmbt_irec_t irec; xfs_bmbt_ptr_t *pp; xfs_bmbt_key_t *key; xfs_bmdr_key_t *rkey; xfs_bmdr_ptr_t *rp; - xfs_dfiloff_t fbno; xfs_dfsbno_t fsbno; - xfs_dfilblks_t bcnt; xfs_buf_t *bp; xfs_dfsbno_t final_fsbno = NULLDFSBNO; xfs_bmbt_block_t *block; @@ -1120,13 +1094,13 @@ getfunc_btree(xfs_mount_t *mp, ino, INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_bmap_dmnr[0]); - rec = (xfs_bmbt_rec_32_t *)XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, - xfs_bmbt, block, 1, mp->m_bmap_dmxr[0]); + rec = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, xfs_bmbt, block, 1, + mp->m_bmap_dmxr[0]); for (i = 0; i < INT_GET(block->bb_numrecs, ARCH_CONVERT); i++) { - convert_extent(rec + i, &fbno, &fsbno, &bcnt, &flag); - - if (fbno <= bno && bno < fbno + bcnt) { - final_fsbno = bno - fbno + fsbno; + libxfs_bmbt_disk_get_all(rec + i, &irec); + if (irec.br_startoff <= bno && + bno < irec.br_startoff + irec.br_blockcount) { + final_fsbno = bno - irec.br_startoff + irec.br_startblock; break; } } @@ -1464,16 +1438,13 @@ process_lclinode( int process_symlink_extlist(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino) { - xfs_dfsbno_t start; /* start */ - xfs_dfilblks_t cnt; /* count */ - xfs_dfiloff_t offset; /* offset */ xfs_dfiloff_t expected_offset; - xfs_bmbt_rec_32_t *rp; + xfs_bmbt_rec_t *rp; + xfs_bmbt_irec_t irec; int numrecs; int i; int max_blocks; int whichfork = XFS_DATA_FORK; - int flag; if (INT_GET(dino->di_core.di_size, ARCH_CONVERT) <= XFS_DFORK_SIZE(dino, mp, whichfork)) { @@ -1496,7 +1467,7 @@ process_symlink_extlist(xfs_mount_t *mp, return(1); } - rp = (xfs_bmbt_rec_32_t *)XFS_DFORK_PTR(dino, whichfork); + rp = (xfs_bmbt_rec_t *)XFS_DFORK_PTR(dino, whichfork); numrecs = XFS_DFORK_NEXTENTS(dino, whichfork); /* @@ -1514,23 +1485,23 @@ process_symlink_extlist(xfs_mount_t *mp, expected_offset = 0; for (i = 0; numrecs > 0; i++, numrecs--) { - convert_extent(rp, &offset, &start, &cnt, &flag); + libxfs_bmbt_disk_get_all(rp, &irec); - if (offset != expected_offset) { + if (irec.br_startoff != expected_offset) { do_warn( _("bad extent #%d offset (%llu) in symlink %llu data fork\n"), - i, offset, lino); + i, irec.br_startoff, lino); return(1); } - if (cnt == 0 || cnt > max_blocks) { + if (irec.br_blockcount == 0 || irec.br_blockcount > max_blocks) { do_warn( _("bad extent #%d count (%llu) in symlink %llu data fork\n"), - i, cnt, lino); + i, irec.br_blockcount, lino); return(1); } - max_blocks -= cnt; - expected_offset += cnt; + max_blocks -= irec.br_blockcount; + expected_offset += irec.br_blockcount; } return(0); Index: repair/xfsprogs/repair/prefetch.c =================================================================== --- repair.orig/xfsprogs/repair/prefetch.c +++ repair/xfsprogs/repair/prefetch.c @@ -152,38 +152,39 @@ pf_read_bmbt_reclist( int numrecs) { int i; - xfs_dfsbno_t s; /* start */ - xfs_dfilblks_t c; /* count */ - xfs_dfiloff_t o; /* offset */ + xfs_bmbt_irec_t irec; xfs_dfilblks_t cp = 0; /* prev count */ xfs_dfiloff_t op = 0; /* prev offset */ - int flag; /* extent flag */ for (i = 0; i < numrecs; i++, rp++) { - convert_extent((xfs_bmbt_rec_32_t*)rp, &o, &s, &c, &flag); + libxfs_bmbt_disk_get_all(rp, &irec); - if (((i > 0) && (op + cp > o)) || (c == 0) || - (o >= fs_max_file_offset)) + if (((i > 0) && (op + cp > irec.br_startoff)) || + (irec.br_blockcount == 0) || + (irec.br_startoff >= fs_max_file_offset)) return 0; - if (!verify_dfsbno(mp, s) || !verify_dfsbno(mp, s + c - 1)) + if (!verify_dfsbno(mp, irec.br_startblock) || !verify_dfsbno(mp, + irec.br_startblock + irec.br_blockcount - 1)) return 0; - if (!args->dirs_only && ((o + c) >= mp->m_dirfreeblk)) + if (!args->dirs_only && ((irec.br_startoff + + irec.br_blockcount) >= mp->m_dirfreeblk)) break; /* only Phase 6 reads the free blocks */ - op = o; - cp = c; + op = irec.br_startoff; + cp = irec.br_blockcount; - while (c) { + while (irec.br_blockcount) { unsigned int len; #ifdef XR_PF_TRACE pftrace("queuing dir extent in AG %d", args->agno); #endif - len = (c > mp->m_dirblkfsbs) ? mp->m_dirblkfsbs : c; - pf_queue_io(args, s, len, B_DIR_META); - c -= len; - s += len; + len = (irec.br_blockcount > mp->m_dirblkfsbs) ? + mp->m_dirblkfsbs : irec.br_blockcount; + pf_queue_io(args, irec.br_startblock, len, B_DIR_META); + irec.br_blockcount -= len; + irec.br_startblock += len; } } return 1; From owner-xfs@oss.sgi.com Mon Aug 25 19:29:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:29:17 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7Q2TBrG016231 for ; Mon, 25 Aug 2008 19:29:12 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA14149; Tue, 26 Aug 2008 12:30:32 +1000 Date: Tue, 26 Aug 2008 12:31:38 +1000 To: "Barry Naujok" , "xfs@oss.sgi.com" Subject: Re: REVIEW: Fix xfs_check SEGV when encountering an unreadable block From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17722 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Ping? On Mon, 30 Jun 2008 11:51:32 +1000, Barry Naujok wrote: > xfs_check (xfs_db "check" command) internally uses a stack for I/Os > it reads/writes. In the check command, there are a few places where > the I/O stack is pushed, a read is issued and the read fails but > does not pop the stack location back. > > In nested uses of this stack, the caller then accesses this un-popped > block which the data pointer is "NULL" causing a SEGV. > > I've checked all calls to push_cur()/set_cur() to make sure all > failures call pop_cur(). > > -- > check.c | 45 +++++++++++++++++++++++---------------------- > 1 file changed, 23 insertions(+), 22 deletions(-) > > --- a/xfsprogs/db/check.c 2008-06-30 11:46:26.000000000 +1000 > +++ b/xfsprogs/db/check.c 2008-06-30 11:44:58.759289182 +1000 > @@ -1991,6 +1991,7 @@ process_block_dir_v2( > "%lld\n", > id->ino); > error++; > + pop_cur(); > return 0; > } > dir_hash_init(); > @@ -2951,6 +2952,7 @@ process_leaf_dir_v1( > "%lld\n", > id->ino); > error++; > + pop_cur(); > return 0; > } > parent = process_leaf_dir_v1_int(dot, dotdot, id); > @@ -3322,6 +3324,7 @@ process_node_dir_v1( > v = verbose || id->ilist; > parent = 0; > dbno = NULLFILEOFF; > + push_cur(); > while ((dbno = blkmap_next_off(blkmap, dbno, &t)) != NULLFILEOFF) { > bno = blkmap_get(blkmap, dbno); > v2 = bno != NULLFSBLOCK && CHECK_BLIST(bno); > @@ -3337,6 +3340,7 @@ process_node_dir_v1( > (__uint32_t)dbno, (xfs_dfsbno_t)bno); > if (bno == NULLFSBLOCK) > continue; > + pop_cur(); > push_cur(); > set_cur(&typtab[TYP_DIR], XFS_FSB_TO_DADDR(mp, bno), blkbb, > DB_RING_IGN, NULL); > @@ -3353,10 +3357,7 @@ process_node_dir_v1( > #else > if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) == > XFS_DIR_NODE_MAGIC) > #endif > - { > - pop_cur(); > continue; > - } > lino = process_leaf_dir_v1_int(dot, dotdot, id); > if (lino) { > if (parent) { > @@ -3368,8 +3369,8 @@ process_node_dir_v1( > } else > parent = lino; > } > - pop_cur(); > } > + pop_cur(); > return parent; > } > > @@ -3411,8 +3412,7 @@ process_quota( > perblock = (uint)(mp->m_sb.sb_blocksize / sizeof(*dqb)); > dqid = 0; > qbno = NULLFILEOFF; > - while ((qbno = blkmap_next_off(blkmap, qbno, &t)) != > - NULLFILEOFF) { > + while ((qbno = blkmap_next_off(blkmap, qbno, &t)) != NULLFILEOFF) { > bno = blkmap_get(blkmap, qbno); > dqid = (xfs_dqid_t)qbno * perblock; > cb = CHECK_BLIST(bno); > @@ -3421,13 +3421,13 @@ process_quota( > set_cur(&typtab[TYP_DQBLK], XFS_FSB_TO_DADDR(mp, bno), blkbb, > DB_RING_IGN, NULL); > if ((dqb = iocur_top->data) == NULL) { > - pop_cur(); > if (scicb) > dbprintf("can't read block %lld for %s quota " > "inode (fsblock %lld)\n", > (xfs_dfiloff_t)qbno, s, > (xfs_dfsbno_t)bno); > error++; > + pop_cur(); > continue; > } > for (i = 0; i < perblock; i++, dqid++, dqb++) { > @@ -3525,12 +3525,12 @@ process_rtbitmap( > set_cur(&typtab[TYP_RTBITMAP], XFS_FSB_TO_DADDR(mp, bno), blkbb, > DB_RING_IGN, NULL); > if ((words = iocur_top->data) == NULL) { > - pop_cur(); > if (!sflag) > dbprintf("can't read block %lld for rtbitmap " > "inode\n", > (xfs_dfiloff_t)bmbno); > error++; > + pop_cur(); > continue; > } > for (bit = 0; > @@ -3578,8 +3578,7 @@ process_rtsummary( > int t; > > sumbno = NULLFILEOFF; > - while ((sumbno = blkmap_next_off(blkmap, sumbno, &t)) != > - NULLFILEOFF) { > + while ((sumbno = blkmap_next_off(blkmap, sumbno, &t)) != NULLFILEOFF) { > bno = blkmap_get(blkmap, sumbno); > if (bno == NULLFSBLOCK) { > if (!sflag) > @@ -3598,6 +3597,7 @@ process_rtsummary( > "inode\n", > (xfs_dfiloff_t)sumbno); > error++; > + pop_cur(); > continue; > } > memcpy((char *)sumfile + sumbno * mp->m_sb.sb_blocksize, bytes, > @@ -3906,16 +3906,15 @@ scan_ag( > agffreeblks = agflongest = 0; > agfbtreeblks = -2; > agicount = agifreecount = 0; > - push_cur(); > + push_cur(); /* 1 pushed */ > set_cur(&typtab[TYP_SB], > XFS_AG_DADDR(mp, agno, XFS_SB_DADDR), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > > if (!iocur_top->data) { > dbprintf("can't read superblock for ag %u\n", agno); > - pop_cur(); > serious_error++; > - return; > + goto pop1_out; > } > > libxfs_xlate_sb(iocur_top->data, sb, 1, XFS_SB_ALL_BITS); > @@ -3945,16 +3944,14 @@ scan_ag( > if (sb->sb_logstart && XFS_FSB_TO_AGNO(mp, sb->sb_logstart) == agno) > set_dbmap(agno, XFS_FSB_TO_AGBNO(mp, sb->sb_logstart), > sb->sb_logblocks, DBM_LOG, agno, XFS_SB_BLOCK(mp)); > - push_cur(); > + push_cur(); /* 2 pushed */ > set_cur(&typtab[TYP_AGF], > XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > if ((agf = iocur_top->data) == NULL) { > dbprintf("can't read agf block for ag %u\n", agno); > - pop_cur(); > - pop_cur(); > serious_error++; > - return; > + goto pop2_out; > } > if (INT_GET(agf->agf_magicnum, ARCH_CONVERT) != XFS_AGF_MAGIC) { > if (!sflag) > @@ -3975,17 +3972,14 @@ scan_ag( > set_dbmap(agno, INT_GET(agf->agf_length, ARCH_CONVERT), > sb->sb_agblocks - INT_GET(agf->agf_length, ARCH_CONVERT), > DBM_MISSING, agno, XFS_SB_BLOCK(mp)); > - push_cur(); > + push_cur(); /* 3 pushed */ > set_cur(&typtab[TYP_AGI], > XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), > XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL); > if ((agi = iocur_top->data) == NULL) { > dbprintf("can't read agi block for ag %u\n", agno); > serious_error++; > - pop_cur(); > - pop_cur(); > - pop_cur(); > - return; > + goto pop3_out; > } > if (INT_GET(agi->agi_magicnum, ARCH_CONVERT) != XFS_AGI_MAGIC) { > if (!sflag) > @@ -4066,8 +4060,11 @@ scan_ag( > error++; > } > } > +pop3_out: > pop_cur(); > +pop2_out: > pop_cur(); > +pop1_out: > pop_cur(); > } > > @@ -4095,6 +4092,7 @@ scan_freelist( > if ((agfl = iocur_top->data) == NULL) { > dbprintf("can't read agfl block for ag %u\n", seqno); > serious_error++; > + pop_cur(); > return; > } > i = INT_GET(agf->agf_flfirst, ARCH_CONVERT); > @@ -4144,6 +4142,7 @@ scan_lbtree( > XFS_FSB_TO_AGNO(mp, root), > XFS_FSB_TO_AGBNO(mp, root)); > error++; > + pop_cur(); > return; > } > (*func)(iocur_top->data, nlevels - 1, type, root, id, totd, toti, nex, > @@ -4169,6 +4168,7 @@ scan_sbtree( > if (!sflag) > dbprintf("can't read btree block %u/%u\n", seqno, root); > error++; > + pop_cur(); > return; > } > (*func)(iocur_top->data, nlevels - 1, agf, root, isroot); > @@ -4484,6 +4484,7 @@ scanfunc_ino( > seqno, > XFS_AGINO_TO_AGBNO(mp, agino)); > error++; > + pop_cur(); > continue; > } > for (j = 0, nfree = 0; j < XFS_INODES_PER_CHUNK; j++) { From owner-xfs@oss.sgi.com Mon Aug 25 19:44:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:44:36 -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 (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 m7Q2iTEf017389 for ; Mon, 25 Aug 2008 19:44:30 -0700 X-ASG-Debug-ID: 1219718751-647b03c60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2A9ECFBC0FE for ; Mon, 25 Aug 2008 19:45:52 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id AgmXbUbepuSc8hEI for ; Mon, 25 Aug 2008 19:45:52 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAAwLs0h5LD0wiGdsb2JhbACSLAEBAQ8gpCWBaw X-IronPort-AV: E=Sophos;i="4.32,267,1217773800"; d="scan'208";a="180334682" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 12:15:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXoZ1-0007wI-NC; Tue, 26 Aug 2008 12:45:47 +1000 Date: Tue, 26 Aug 2008 12:45:47 +1000 From: Dave Chinner To: Christoph Hellwig Cc: 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: <20080826024547.GX5706@disturbed> Mail-Followup-To: Christoph Hellwig , Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Linux Kernel , xfs@oss.sgi.com References: <6278d2220808221412x28f4ac5dl508884c8030b364a@mail.gmail.com> <20080825010213.GO5706@disturbed> <48B21507.9050708@sgi.com> <20080825035542.GR5706@disturbed> <1219647573.20732.28.camel@twins> <20080825215532.GB28188@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080825215532.GB28188@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219718753 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3731 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17723 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 11:55:32PM +0200, Christoph Hellwig wrote: > 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. Agreed. Patch below. Cheers, Dave. -- Dave Chinner david@fromorbit.com 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. Signed-off-by: Dave Chinner --- fs/xfs/xfs_dfrag.c | 9 ++++++++- fs/xfs/xfs_vnodeops.c | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 760f4c5..75b0cd4 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c @@ -149,7 +149,14 @@ xfs_swap_extents( sbp = &sxp->sx_stat; - xfs_lock_two_inodes(ip, tip, lock_flags); + /* + * we have to do two separate lock calls here to keep lockdep + * happy. If we try to get all the locks in one call, lock will + * report false positives when we drop the ILOCK and regain them + * below. + */ + xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); + xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); locked = 1; /* Verify that both files have the same format */ diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index f108102..cb1b5fd 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -1836,6 +1836,12 @@ again: #endif } +/* + * xfs_lock_two_inodes() can only be used to lock one type of lock + * at a time - the iolock or the ilock, but not both at once. If + * we lock both at once, lockdep will report false positives saying + * we have violated locking orders. + */ void xfs_lock_two_inodes( xfs_inode_t *ip0, @@ -1846,7 +1852,11 @@ xfs_lock_two_inodes( int attempts = 0; xfs_log_item_t *lp; +#ifdef DEBUG + if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) + ASSERT((lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) == 0); ASSERT(ip0->i_ino != ip1->i_ino); +#endif if (ip0->i_ino > ip1->i_ino) { temp = ip0; From owner-xfs@oss.sgi.com Mon Aug 25 20:06:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 20:06:52 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7Q36kuF018915 for ; Mon, 25 Aug 2008 20:06:46 -0700 X-ASG-Debug-ID: 1219720087-10af020a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BA0171A4828C for ; Mon, 25 Aug 2008 20:08:08 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id M63KD7tc87jf1t8e for ; Mon, 25 Aug 2008 20:08:08 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACAI8Os0h5LD0wiGdsb2JhbACSLAEBAQ8gpC6Baw X-IronPort-AV: E=Sophos;i="4.32,268,1217773800"; d="scan'208";a="180348679" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Aug 2008 12:38:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KXouV-0008PL-MH; Tue, 26 Aug 2008 13:07:59 +1000 Date: Tue, 26 Aug 2008 13:07:59 +1000 From: Dave Chinner To: Jamie Lokier Cc: Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080826030759.GY5706@disturbed> Mail-Followup-To: Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> <20080825120146.GC20960@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080825120146.GC20960@shareable.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219720089 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.3732 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17724 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 01:01:47PM +0100, Jamie Lokier wrote: > Dave Chinner wrote: > > To keep on top of this, we keep adding new variations and types and > > expect the filesystems to make best use of them (without > > documentation) to optimise for certain situations. Example - the > > new(ish) BIO_META tag that only CFQ understands. I can change the > > way XFS issues bios to use this tag to make CFQ behave the same way > > it used to w.r.t. metadata I/O from XFS, but then the deadline and > > AS will probably regress because they don't understand that tag and > > still need the old optimisations that just got removed. Ditto for > > prioritised bio dispatch - CFQ supports it but none of the others > > do. > > There's nothing wrong with adding BIO_META (for example) and other > hints in _principle_. You should be able to ignore it with no adverse > effects. If its not used by a filesystem (and there's nothing else > competing to use the same disk), I would hope to see the same > performance as other kernels which don't have it. Right, but it's what we need to do to make use of that optimisation that is the problem. For XFS, it needs to replace the current BIO_SYNC hints we use (even for async I/O) to get metadata dispatched quickly. i.e. CFQ looks at the sync flag first then the meta flag. Hence to take advantage of it, we need to remove the BIO_SYNC hints we currently use which will change the behaviour on all other elevators as a side effect. This is the optimisation problem I'm refering to - the BIO_SYNC usage was done years ago to get metadata dispatched quickly because that is what all the elevators did with sync I/O. Now to optimise for CFQ we need to remove that BIO_SYNC optimisation which is still valid for the other elevators.... > If the elevators are being changed in such a way that old filesystem > code which doesn't use new hint bits is running significantly slower, > surely that's blatant elevator regression, and that's where the bugs > should be reported and fixed? Sure, but in reality getting ppl to go through the pain of triage is extremely rare because it only takes 10s to change elevators and make the problem go away... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Aug 25 20:36:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 20:36:27 -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.6 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 m7Q3aOdw025513 for ; Mon, 25 Aug 2008 20:36:24 -0700 X-ASG-Debug-ID: 1219721865-407001c70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.flatline.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 79D13FBC210 for ; Mon, 25 Aug 2008 20:37:46 -0700 (PDT) Received: from mail.flatline.de (flatline.de [80.190.243.144]) by cuda.sgi.com with ESMTP id sPMKqgwSFFtqbqIi for ; Mon, 25 Aug 2008 20:37:46 -0700 (PDT) Received: from shell.priv.flatline.de ([172.16.123.7] helo=slop.flatline.de ident=count) by mail.flatline.de with smtp (Exim 4.69) (envelope-from ) id 1KXpNF-0003Gd-Tf; Tue, 26 Aug 2008 05:37:43 +0200 Received: by slop.flatline.de (sSMTP sendmail emulation); Tue, 26 Aug 2008 05:37:41 +0200 Date: Tue, 26 Aug 2008 05:37:41 +0200 From: Andreas Kotes To: Allan Haywood Cc: David Chinner , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: XFS internal error Subject: Re: XFS internal error Message-ID: <20080826033741.GX21319@slop.flatline.de> References: <20080310122216.GG14256@slop.flatline.de> <20080310223018.GA155407@sgi.com> <20080310225927.GP14256@slop.flatline.de> <20080310234539.GC155407@sgi.com> <20080311134746.GQ14256@slop.flatline.de> <20080312175050.GD14256@slop.flatline.de> <20080313000121.GU155407@sgi.com> <20080313071445.GA30874@slop.flatline.de> <20080313071744.GB30874@slop.flatline.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: flatline.de[80.190.243.144] X-Barracuda-Start-Time: 1219721867 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.3735 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17725 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: count@flatline.de Precedence: bulk X-list: xfs Hello, I think that might have been an issue on our FS as well. No, no resolution, no debugging advice, etc .. We've basically had to ignore it - and it didn't surface a lot more, now you mention it. We are working far less close to 100% than before, though ... *thinking* Andreas * Allan Haywood [20080825 20:58]: > Sorry for top posting on this reply, but I was wondering if there was any resolution to your problem below. We seem to be running into a similar problem. A few hours before the error in this thread occurred the filesystem was filled up to 100%, we had to clean things up to continue running. > > Any additional information would be great. > > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of Andreas Kotes > Sent: Thursday, March 13, 2008 12:18 AM > To: David Chinner > Cc: xfs@oss.sgi.com > Subject: Re: XFS internal error > > * Andreas Kotes [20080313 08:14]: > > * David Chinner [20080313 01:01]: > > > On Wed, Mar 12, 2008 at 06:50:50PM +0100, Andreas Kotes wrote: > > > > * Andreas Kotes [20080311 14:47]: > > > > > I basically build a PXE image which does an xfs_repair -L /dev/sda2 from > > > > > initrd - and the problem persists. Sigh. Exactly no change. > > > > > > Do you do this on every boot? > > > > no, I did this on a6b and a7b so far, where the problems I mentioned > > occur, and only after I saw these in-memory problems. in general, XFS > > proves to be realiable for us. > > > > would you recommend running an xfs_check before running an xfs_repair in > > case of problems? > > oh, btw - running xfs_check doesn't work most of the time, as the log > usually contains entries, and isn't replayed before shutdown .. > > I figure running this on every boot would leave me killing my log all of > the time, if the shutdown didn't leave time to write the changes to > disk? ;) From owner-xfs@oss.sgi.com Mon Aug 25 20:49:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 20:49:33 -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.6 required=5.0 tests=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 m7Q3nHCl026407 for ; Mon, 25 Aug 2008 20:49:18 -0700 X-ASG-Debug-ID: 1219722639-305e035a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bifrost.lang.hm (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4FD20FBC54F for ; Mon, 25 Aug 2008 20:50:39 -0700 (PDT) Received: from bifrost.lang.hm (mail.lang.hm [64.81.33.126]) by cuda.sgi.com with ESMTP id Ay5ohEL8uqxz0v0R for ; Mon, 25 Aug 2008 20:50:39 -0700 (PDT) Received: from asgard.lang.hm (asgard.lang.hm [10.0.0.100]) by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id m7Q3njZF017911; Mon, 25 Aug 2008 20:49:45 -0700 Date: Mon, 25 Aug 2008 20:50:14 -0700 (PDT) From: david@lang.hm X-X-Sender: dlang@asgard.lang.hm To: Dave Chinner cc: Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: <20080826030759.GY5706@disturbed> Message-ID: References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> <20080825120146.GC20960@shareable.org> <20080826030759.GY5706@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: mail.lang.hm[64.81.33.126] X-Barracuda-Start-Time: 1219722640 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=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3735 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name X-Virus-Scanned: ClamAV 0.91.2/8089/Mon Aug 25 17:28:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17726 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@lang.hm Precedence: bulk X-list: xfs On Tue, 26 Aug 2008, Dave Chinner wrote: > > On Mon, Aug 25, 2008 at 01:01:47PM +0100, Jamie Lokier wrote: >> Dave Chinner wrote: >>> To keep on top of this, we keep adding new variations and types and >>> expect the filesystems to make best use of them (without >>> documentation) to optimise for certain situations. Example - the >>> new(ish) BIO_META tag that only CFQ understands. I can change the >>> way XFS issues bios to use this tag to make CFQ behave the same way >>> it used to w.r.t. metadata I/O from XFS, but then the deadline and >>> AS will probably regress because they don't understand that tag and >>> still need the old optimisations that just got removed. Ditto for >>> prioritised bio dispatch - CFQ supports it but none of the others >>> do. >> >> There's nothing wrong with adding BIO_META (for example) and other >> hints in _principle_. You should be able to ignore it with no adverse >> effects. If its not used by a filesystem (and there's nothing else >> competing to use the same disk), I would hope to see the same >> performance as other kernels which don't have it. > > Right, but it's what we need to do to make use of that optimisation > that is the problem. For XFS, it needs to replace the current > BIO_SYNC hints we use (even for async I/O) to get metadata > dispatched quickly. i.e. CFQ looks at the sync flag first then the > meta flag. Hence to take advantage of it, we need to remove the > BIO_SYNC hints we currently use which will change the behaviour on > all other elevators as a side effect. > > This is the optimisation problem I'm refering to - the BIO_SYNC > usage was done years ago to get metadata dispatched quickly because > that is what all the elevators did with sync I/O. Now to optimise > for CFQ we need to remove that BIO_SYNC optimisation which is still > valid for the other elevators.... > >> If the elevators are being changed in such a way that old filesystem >> code which doesn't use new hint bits is running significantly slower, >> surely that's blatant elevator regression, and that's where the bugs >> should be reported and fixed? > > Sure, but in reality getting ppl to go through the pain of triage is > extremely rare because it only takes 10s to change elevators and > make the problem go away... it sounds as if the various flag definitions have been evolving, would it be worthwhile to sep back and try to get the various filesystem folks to brainstorm together on what types of hints they would _like_ to see supported? it sounds like you are using 'sync' for things where you really should be saying 'metadata' (or 'journal contents'), it's happened to work well enough in the past, but it's forcing you to keep tweaking the filesystems. it may be better to try and define things from the filesystem point of view and let the elevators do the tweaking. basicly I'm proposing a complete rethink of the filesyste <-> elevator interface. David Lang From owner-xfs@oss.sgi.com Tue Aug 26 05:52:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 05:52:35 -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.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45, J_CHICKENPOX_46,J_CHICKENPOX_47,J_CHICKENPOX_48,MIME_8BIT_HEADER autolearn=no 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 m7QCq43r004188 for ; Tue, 26 Aug 2008 05:52:04 -0700 X-ASG-Debug-ID: 1219755204-3227001a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wf-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BA244FC0502 for ; Tue, 26 Aug 2008 05:53:24 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by cuda.sgi.com with ESMTP id c7dlrG3DXc9mKQca for ; Tue, 26 Aug 2008 05:53:24 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 26so2090556wfd.32 for ; Tue, 26 Aug 2008 05:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=iXkoZlHaGlGaAAJiTozSh8oFMB9B4KTIt6+bp+SwYoE=; b=R1ViCllGeva3PDlKIeRmCZbFz9spS62gvVD2kb2NZU2kWDoTOaiH7BG8KiDMWKgWj/ Suu+ZO8o5whslndxhlU/3iDx3qvdV7ocQwBV6Y+za6JJttqoPq4mxPIJzcBJVjrCEKMm I6yoDzbRFAHoZCHq1Ueqm/4iaKKa1MrJvUDOk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=wiDNkQez5q5SCrqaxrfsVy74Cb+vk2GT/UpWb1mNitFEtp9XMV0XVVapHmDUTXkSoH HCx4V7b1JTAopCoTLcns1M8XQOXWhMNTWvbBMNIv0Eg+2IUKOxrtb3fzjO+cDxoobPC2 xiyvvnEQ352BD7Q2aCRwpcANEciRjV1JvmsxA= Received: by 10.142.125.4 with SMTP id x4mr1974735wfc.349.1219755203668; Tue, 26 Aug 2008 05:53:23 -0700 (PDT) Received: by 10.142.112.10 with HTTP; Tue, 26 Aug 2008 05:53:23 -0700 (PDT) Message-ID: <50ed5c760808260553i7def5e93qb0bcb4d2206a4a38@mail.gmail.com> Date: Tue, 26 Aug 2008 14:53:23 +0200 From: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" To: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel In-Reply-To: <20080826014133.GS5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Disposition: inline References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> <20080826014133.GS5706@disturbed> X-Barracuda-Connect: wf-out-1314.google.com[209.85.200.168] X-Barracuda-Start-Time: 1219755204 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0860 1.0000 -1.4773 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.48 X-Barracuda-Spam-Status: No, SCORE=-1.48 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.3771 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8090/Tue Aug 26 03:30:04 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m7QCq43r004190 X-archive-position: 17727 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nailman23@gmail.com Precedence: bulk X-list: xfs 2008/8/26 Dave Chinner : > On Mon, Aug 25, 2008 at 01:08:29PM +0200, S³awomir Nowakowski wrote: >> 2008/8/23 Dave Chinner : >> Next we have created some files: >> -one big file called "bigfile" and size of 5109497856 bytes >> -two small text files called: "file1" and "file2" >> >> At this stage it looked as follows: > .... >> Filesystem 1K-blocks Used Available Use% Mounted on >> /dev/sda3 4993984 4989916 4068 100% /mnt/z >> >> Then we have run system with 2.6.25.13 kernel and checked how it looks: > ..... >> Filesystem 1K-blocks Used Available Use% Mounted on >> /dev/sda3 4993984 4993984 0 100% /mnt/z >> >> As it shown in case of 2.6.25.13 kernel system reports no free space, >> but under 2.6.17.13 kernel there is 4068kB of free space. >> >> At this stage when editing file file1 with i.e. mcedit and trying to >> write changes, the system cuts this file to 0 bytes! > > Oh, look, yet another editor that doesn't safely handle ENOSPC and > trashes files when it can't overwrite them. That's not an XFS > problem - I suggest raising a bug against the editor.... > >> >> Is it known issue and/or does solution or workaround exists? >> > >> > $ sudo xfs_io -x -c 'resblks 0' >> > >> > will remove the reservation. This means your filesystem can shutdown >> > or lose data at ENOSPC in certain circumstances.... >> >> A question: does using the command: >> >> $ sudo xfs_io -x -c 'resblks 0' >> >> for 2.6.25.13 kernel gives higher risk of losing data then in case of >> 2.6.17.13 kernel. > > Hard to say. If you don't run to ENOSPC then there is no difference. > If you do run to ENOSPC then I think that there is a slightly higher > risk of tripping problems on 2.6.25.x because of other ENOSPC fixes > that have been included since 2.6.17.13. This really is a safety net > in that it allows the system to continue without problems in > conditions where it would have previously done a bad thing... > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > Dear Dave, Can you please take a look at the following outputs of some commands run under 2.6.17.17 and 2.6.25.13 kernels? Here is a situation on 2.6.17.13 kernel: xfs_io -x -c 'statfs' /mnt/point fd.path = "/mnt/sda" statfs.f_bsize = 4096 statfs.f_blocks = 487416 statfs.f_bavail = 6 statfs.f_files = 160 statfs.f_ffree = 154 geom.bsize = 4096 geom.agcount = 8 geom.agblocks = 61247 geom.datablocks = 489976 geom.rtblocks = 0 geom.rtextents = 0 geom.rtextsize = 1 geom.sunit = 0 geom.swidth = 0 counts.freedata = 6 counts.freertx = 0 counts.freeino = 58 counts.allocino = 64 xfs_io -x -c 'resblks' /mnt/point reserved blocks = 0 available reserved blocks = 0 xfs_info /mnt/point meta-data=/dev/sda4 isize=256 agcount=8, agsize=61247 blks = sectsz=512 attr=0 data = bsize=4096 blocks=489976, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=2560, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 But under 2.6.25.13 kernel the situation looks different: xfs_io -x -c 'statfs' /mnt/point: fd.path = "/mnt/-sda4" statfs.f_bsize = 4096 statfs.f_blocks = 487416 statfs.f_bavail = 30 statfs.f_files = 544 statfs.f_ffree = 538 geom.bsize = 4096 geom.agcount = 8 geom.agblocks = 61247 geom.datablocks = 489976 geom.rtblocks = 0 geom.rtextents = 0 geom.rtextsize = 1 geom.sunit = 0 geom.swidth = 0 counts.freedata = 30 counts.freertx = 0 counts.freeino = 58 counts.allocino = 64 xfs_io -x -c 'resblks' /mnt/point: reserved blocks = 18446744073709551586 available reserved blocks = 18446744073709551586 xfs_info /mnt/point meta-data=/dev/sda4 isize=256 agcount=8, agsize=61247 blks = sectsz=512 attr=0 data = bsize=4096 blocks=489976, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=2560, version=1 = sectsz=512 sunit=0 blks realtime =none extsz=4096 blocks=0, rtextents=0 As you can easy see statfs.f_bavail, statfs.f_files, statfs.f_ffree and counts.freedata values are different. Can you explain why? Also after applying your solution "xfs_io -x -c 'resblks 0' " the command xfs_io -x -c 'resblks' /mnt/point gives output: reserved blocks = 0 available reserved blocks = 18446744073709551586 Is it OK? Another question is if you know some advices for tuning of XFS file systems that will contain maximum 10 files? Thank you very much for your help! I really appreciate it. From owner-xfs@oss.sgi.com Tue Aug 26 12:12:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:12:25 -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 m7QJCLoZ032345 for ; Tue, 26 Aug 2008 12:12:21 -0700 X-ASG-Debug-ID: 1219778025-652c03110000-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 7BB483D1124; Tue, 26 Aug 2008 12:13:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id kDVF1qr7cVRrzKty; Tue, 26 Aug 2008 12:13:45 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY3z6-0001e4-Pz; Tue, 26 Aug 2008 19:13:44 +0000 Date: Tue, 26 Aug 2008 15:13:44 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: Fix xfs_check SEGV when encountering an unreadable block Subject: Re: REVIEW: Fix xfs_check SEGV when encountering an unreadable block Message-ID: <20080826191344.GA30481@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1219778025 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.3796 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: 17729 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 Mon, Jun 30, 2008 at 11:51:32AM +1000, Barry Naujok wrote: > xfs_check (xfs_db "check" command) internally uses a stack for I/Os > it reads/writes. In the check command, there are a few places where > the I/O stack is pushed, a read is issued and the read fails but > does not pop the stack location back. > > In nested uses of this stack, the caller then accesses this un-popped > block which the data pointer is "NULL" causing a SEGV. > > I've checked all calls to push_cur()/set_cur() to make sure all > failures call pop_cur(). Looks good to me. From owner-xfs@oss.sgi.com Tue Aug 26 12:10:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:10:55 -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 (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 m7QJAnYO032074 for ; Tue, 26 Aug 2008 12:10:51 -0700 X-ASG-Debug-ID: 1219777929-2eaf02220000-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 4A1BEFC5301; Tue, 26 Aug 2008 12:12:09 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id LCSTBLTqQFTOMGdC; Tue, 26 Aug 2008 12:12:09 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY3xY-0007Cc-Ix; Tue, 26 Aug 2008 19:12:08 +0000 Date: Tue, 26 Aug 2008 15:12:08 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: xfs_metadump improvements Subject: Re: REVIEW: xfs_metadump improvements Message-ID: <20080826191208.GA2788@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1219777933 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.3797 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: 17728 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 Mon, Jun 30, 2008 at 05:53:53PM +1000, Barry Naujok wrote: > Based on what I found in xfs_check, I fixed up xfs_metadump in the > same way. That's the pop_cur bits and they look sane to me. > > Also, I've increased the default maximum expected extent size for > a directory, as in practice, 400 block extents for directory > structures is not rare. Also looks good, but mixing these two up in the same commit doesn't seem like a good idea. From owner-xfs@oss.sgi.com Tue Aug 26 12:14:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:14:28 -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 (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 m7QJEOU0000663 for ; Tue, 26 Aug 2008 12:14:25 -0700 X-ASG-Debug-ID: 1219778148-2e3d02450000-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 904FEFC5778; Tue, 26 Aug 2008 12:15:48 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 1k25SsIq6hHLjFkt; Tue, 26 Aug 2008 12:15:48 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY415-0005dN-TE; Tue, 26 Aug 2008 19:15:47 +0000 Date: Tue, 26 Aug 2008 15:15:47 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: Remove convert_extent function in xfs_repair Subject: Re: REVIEW: Remove convert_extent function in xfs_repair Message-ID: <20080826191547.GA6638@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1219778148 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.3797 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: 17730 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:21:54PM +1000, Barry Naujok wrote: > It seems convert_extent is not that useful, so remove it and call > libxfs_bmbt_disk_get_all() directly and use the xfs_bmbt_irec_t > structure directly. Yes, the new code is much more readable. The patch looks good to m. From owner-xfs@oss.sgi.com Tue Aug 26 12:30:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:30:51 -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,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7QJUhws006794 for ; Tue, 26 Aug 2008 12:30:44 -0700 X-ASG-Debug-ID: 1219779125-75d600390000-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 1D0711A51B4D; Tue, 26 Aug 2008 12:32:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id du7HizkeHzPHmkdj; Tue, 26 Aug 2008 12:32:05 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY4Gr-0004Yo-LA; Tue, 26 Aug 2008 19:32:05 +0000 Date: Tue, 26 Aug 2008 15:32:05 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: xfs_repair fixes for bad directories Subject: Re: REVIEW: xfs_repair fixes for bad directories Message-ID: <20080826193205.GA31105@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1219779127 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: 17731 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, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: > Two issues have been encounted with xfs_repair and badly corrupted > directories. > > 1. A huge size (inode di_size) can cause malloc which will fail. > Patch dir_size_check.patch checks for a valid directory size > and if it's bad, junks the directory. The di_size for a dir > only counts the data blocks being used, not all the other > associated metadata. This is limited to 32GB by the > XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this > must be invalid. As menioned before this one is trivial nad makes sens. > 2. An update a while ago to xfs_repair attempts to fix invalid > ".." entries for subdirectories where there is a valid parent > with the appropriate entry. It was a partial fix that never > did the full job, especially if the subdirectory was short- > form or it has already been processed. > > Patch fix_dir_rebuild_without_dotdot_entry.patch creates a > post-processing queue after the main scan to update any > directories with an invalid ".." entry. Where is the existing attemp? I can't find code doing anything like that removed in the patch. But the actual patch looks good, while I had this mess with the tons of different boolean flags in repair converting these to a more descriptive bitmask should be a different patch. > Both these patches sit on top of the dinode.patch that has been > posted out for review previously. But you didn't get a review for it, did you? Looked over it briefly and it looks good to m. Again the new code is much much mor readable. From owner-xfs@oss.sgi.com Tue Aug 26 12:33:48 2008 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. From owner-xfs@oss.sgi.com Tue Aug 26 13:12:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 13:12:16 -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 m7QKCBs6011405 for ; Tue, 26 Aug 2008 13:12:11 -0700 X-ASG-Debug-ID: 1219781613-332802400000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail-gx0-f21.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7B86D3D16D6 for ; Tue, 26 Aug 2008 13:13:33 -0700 (PDT) Received: from mail-gx0-f21.google.com (mail-gx0-f21.google.com [209.85.217.21]) by cuda.sgi.com with ESMTP id GHUbP3aDhOAh9SCZ for ; Tue, 26 Aug 2008 13:13:33 -0700 (PDT) Received: by gxk14 with SMTP id 14so3584325gxk.20 for ; Tue, 26 Aug 2008 13:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=c8pdKvhCCFhtcfhJVvYW7TMUFCkUqBjYPvCr1o5In04=; b=CVY50JQzAyrTwIKklhn2Q50PysDzfi9W09VJHDK9+556vUA4wYWpmlse2qm8zC409S MNF0V+fr0RVPPkwFXCL6nKUedz5crwsev6aFui4HAGZICaI601roWcaarovGZjE7ZuYy iqgQCGvFOczrtUgn16zy4vZCoZQD6Tb8myUqY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ENmDxjlLKd9RIxmT1MxU2sTJZvcrKgbPgdDRMoXv3kcu4Yf39gX0svrig4s5mnKlT0 MmPnwrlXEUbvGFGD0Ex+ISrRLt7SykKkvdQ9Vd8p/r+M2ydvD5hqwxmfq4OTQ0GJgObF 54+a5FchSc5zjz/HdA2MO/2lHEi4WSVn2Qu+A= Received: by 10.150.216.3 with SMTP id o3mr9869537ybg.25.1219781613452; Tue, 26 Aug 2008 13:13:33 -0700 (PDT) Received: by 10.65.38.8 with HTTP; Tue, 26 Aug 2008 13:13:33 -0700 (PDT) Message-ID: <6278d2220808261313ve58a692r38c913356ee135e2@mail.gmail.com> Date: Tue, 26 Aug 2008 21:13:33 +0100 From: "Daniel J Blueman" To: "Dave Chinner" 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... Cc: "Christoph Hellwig" , "Peter Zijlstra" , "Lachlan McIlroy" , "Daniel J Blueman" , "Linux Kernel" , xfs@oss.sgi.com In-Reply-To: <20080826024547.GX5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> X-Barracuda-Connect: mail-gx0-f21.google.com[209.85.217.21] X-Barracuda-Start-Time: 1219781614 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3800 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8094/Tue Aug 26 12:45:52 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17733 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: daniel.blueman@gmail.com Precedence: bulk X-list: xfs Hi Dave, On Tue, Aug 26, 2008 at 3:45 AM, Dave Chinner wrote: > On Mon, Aug 25, 2008 at 11:55:32PM +0200, Christoph Hellwig wrote: >> 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. > > Agreed. Patch below. > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > > 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. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_dfrag.c | 9 ++++++++- > fs/xfs/xfs_vnodeops.c | 10 ++++++++++ > 2 files changed, 18 insertions(+), 1 deletions(-) > > diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c > index 760f4c5..75b0cd4 100644 > --- a/fs/xfs/xfs_dfrag.c > +++ b/fs/xfs/xfs_dfrag.c > @@ -149,7 +149,14 @@ xfs_swap_extents( > > sbp = &sxp->sx_stat; > > - xfs_lock_two_inodes(ip, tip, lock_flags); > + /* > + * we have to do two separate lock calls here to keep lockdep > + * happy. If we try to get all the locks in one call, lock will > + * report false positives when we drop the ILOCK and regain them > + * below. > + */ > + xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); > + xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > locked = 1; > > /* Verify that both files have the same format */ > diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c > index f108102..cb1b5fd 100644 > --- a/fs/xfs/xfs_vnodeops.c > +++ b/fs/xfs/xfs_vnodeops.c > @@ -1836,6 +1836,12 @@ again: > #endif > } > > +/* > + * xfs_lock_two_inodes() can only be used to lock one type of lock > + * at a time - the iolock or the ilock, but not both at once. If > + * we lock both at once, lockdep will report false positives saying > + * we have violated locking orders. > + */ > void > xfs_lock_two_inodes( > xfs_inode_t *ip0, > @@ -1846,7 +1852,11 @@ xfs_lock_two_inodes( > int attempts = 0; > xfs_log_item_t *lp; > > +#ifdef DEBUG > + if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) > + ASSERT((lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) == 0); > ASSERT(ip0->i_ino != ip1->i_ino); > +#endif > > if (ip0->i_ino > ip1->i_ino) { > temp = ip0; Good to get your patch and HCH's ack...thanks! I'll pursue testing and touchdown in < 24 hrs. Daniel -- Daniel J Blueman From owner-xfs@oss.sgi.com Tue Aug 26 14:33:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 14:33:25 -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.6 required=5.0 tests=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 m7QLXJEs017739 for ; Tue, 26 Aug 2008 14:33:20 -0700 X-ASG-Debug-ID: 1219786481-737b02110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from py-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4CCEFFC70E6 for ; Tue, 26 Aug 2008 14:34:41 -0700 (PDT) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by cuda.sgi.com with ESMTP id Y28t5aDDcktrNDj0 for ; Tue, 26 Aug 2008 14:34:41 -0700 (PDT) Received: by py-out-1112.google.com with SMTP id f31so1521962pyh.4 for ; Tue, 26 Aug 2008 14:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=tnEPDFlr3ypsefdXRdYUHdUyN9mfXikFl7qS7yCbEvw=; b=n/PcK3dYAjCtL26ZqQI93BDGn0vPMIj9RtocHpBM0eY/IBp6SfqQi9MTvTih6XY1dR XqxsKNgXT/jMefx5QZMnSZGNq7Ixz4wl3QCWYrAdD7AjV2t1yIh+ow4yBNmuOdbBBDaq Cgl2zk6Zs/i+hbQ/IpE7TzmITSDl78UxpBIHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=UamrfNCDxrfFHJCUTcBir5AW+2d9yVVOvsjP5ziI3vTpzL5uF1FCgSmjsvBKAESjEl UqpNoD4p469ENnEgHhmkvm3jR5uRGpkjz0tvsYhz/URj/RSxKf2embLR+LBa0FjgwQG6 PwjGvPHdODRphRXawbBoTt1LTL7Nqb4X6Bitw= Received: by 10.65.137.5 with SMTP id p5mr12418125qbn.50.1219786480888; Tue, 26 Aug 2008 14:34:40 -0700 (PDT) Received: by 10.65.38.8 with HTTP; Tue, 26 Aug 2008 14:34:40 -0700 (PDT) Message-ID: <6278d2220808261434o15dcbbfbge8138098bf453c0b@mail.gmail.com> Date: Tue, 26 Aug 2008 22:34:40 +0100 From: "Daniel J Blueman" To: "Dave Chinner" 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... Cc: "Christoph Hellwig" , "Peter Zijlstra" , "Lachlan McIlroy" , "Linux Kernel" , xfs@oss.sgi.com In-Reply-To: <6278d2220808261313ve58a692r38c913356ee135e2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> <6278d2220808261313ve58a692r38c913356ee135e2@mail.gmail.com> X-Barracuda-Connect: py-out-1112.google.com[64.233.166.177] X-Barracuda-Start-Time: 1219786483 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8094/Tue Aug 26 12:45:52 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17734 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: daniel.blueman@gmail.com Precedence: bulk X-list: xfs On Tue, Aug 26, 2008 at 9:13 PM, Daniel J Blueman wrote: > Hi Dave, > > On Tue, Aug 26, 2008 at 3:45 AM, Dave Chinner wrote: >> On Mon, Aug 25, 2008 at 11:55:32PM +0200, Christoph Hellwig wrote: >>> 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. >> >> Agreed. Patch below. >> >> Cheers, >> >> Dave. >> -- >> Dave Chinner >> david@fromorbit.com >> >> 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. >> >> Signed-off-by: Dave Chinner >> --- >> fs/xfs/xfs_dfrag.c | 9 ++++++++- >> fs/xfs/xfs_vnodeops.c | 10 ++++++++++ >> 2 files changed, 18 insertions(+), 1 deletions(-) >> >> diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c >> index 760f4c5..75b0cd4 100644 >> --- a/fs/xfs/xfs_dfrag.c >> +++ b/fs/xfs/xfs_dfrag.c >> @@ -149,7 +149,14 @@ xfs_swap_extents( >> >> sbp = &sxp->sx_stat; >> >> - xfs_lock_two_inodes(ip, tip, lock_flags); >> + /* >> + * we have to do two separate lock calls here to keep lockdep >> + * happy. If we try to get all the locks in one call, lock will >> + * report false positives when we drop the ILOCK and regain them >> + * below. >> + */ >> + xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); >> + xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); >> locked = 1; >> >> /* Verify that both files have the same format */ >> diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c >> index f108102..cb1b5fd 100644 >> --- a/fs/xfs/xfs_vnodeops.c >> +++ b/fs/xfs/xfs_vnodeops.c >> @@ -1836,6 +1836,12 @@ again: >> #endif >> } >> >> +/* >> + * xfs_lock_two_inodes() can only be used to lock one type of lock >> + * at a time - the iolock or the ilock, but not both at once. If >> + * we lock both at once, lockdep will report false positives saying >> + * we have violated locking orders. >> + */ >> void >> xfs_lock_two_inodes( >> xfs_inode_t *ip0, >> @@ -1846,7 +1852,11 @@ xfs_lock_two_inodes( >> int attempts = 0; >> xfs_log_item_t *lp; >> >> +#ifdef DEBUG >> + if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) >> + ASSERT((lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) == 0); >> ASSERT(ip0->i_ino != ip1->i_ino); >> +#endif >> >> if (ip0->i_ino > ip1->i_ino) { >> temp = ip0; > > Good to get your patch and HCH's ack...thanks! > > I'll pursue testing and touchdown in < 24 hrs. Excellent - confirmed it addresses the lockdep report I was seeing before and doesn't introduce any regressions. Thanks, Daniel -- Daniel J Blueman From owner-xfs@oss.sgi.com Tue Aug 26 17:31:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 17:31:54 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R0VnBa031355 for ; Tue, 26 Aug 2008 17:31:50 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA07933; Wed, 27 Aug 2008 10:33:11 +1000 Date: Wed, 27 Aug 2008 10:33:50 +1000 To: "Christoph Hellwig" Subject: Re: REVIEW: xfs_repair fixes for bad directories From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080826193205.GA31105@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080826193205.GA31105@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8095/Tue Aug 26 14:06:44 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17735 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 27 Aug 2008 05:32:05 +1000, Christoph Hellwig wrote: > On Tue, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: >> Two issues have been encounted with xfs_repair and badly corrupted >> directories. >> >> 1. A huge size (inode di_size) can cause malloc which will fail. >> Patch dir_size_check.patch checks for a valid directory size >> and if it's bad, junks the directory. The di_size for a dir >> only counts the data blocks being used, not all the other >> associated metadata. This is limited to 32GB by the >> XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this >> must be invalid. > > As menioned before this one is trivial nad makes sens. > >> 2. An update a while ago to xfs_repair attempts to fix invalid >> ".." entries for subdirectories where there is a valid parent >> with the appropriate entry. It was a partial fix that never >> did the full job, especially if the subdirectory was short- >> form or it has already been processed. >> >> Patch fix_dir_rebuild_without_dotdot_entry.patch creates a >> post-processing queue after the main scan to update any >> directories with an invalid ".." entry. > > Where is the existing attemp? I can't find code doing anything like > that removed in the patch. But the actual patch looks good, while > I had this mess with the tons of different boolean flags in repair > converting these to a more descriptive bitmask should be a different > patch. > >> Both these patches sit on top of the dinode.patch that has been >> posted out for review previously. > > But you didn't get a review for it, did you? Looked over it briefly > and it looks good to m. Again the new code is much much mor readable. Yeah, Chandan did a good review a while ago and has been checked in now. From owner-xfs@oss.sgi.com Tue Aug 26 17:51:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 17:51:30 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_45,J_CHICKENPOX_46,J_CHICKENPOX_47,J_CHICKENPOX_48, MIME_8BIT_HEADER autolearn=no 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 m7R0pS54000309 for ; Tue, 26 Aug 2008 17:51:28 -0700 X-ASG-Debug-ID: 1219798370-4a6f01310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9AF7AFCA89B for ; Tue, 26 Aug 2008 17:52:50 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Zw5PhHFOf5XcYam7 for ; Tue, 26 Aug 2008 17:52:50 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlYCADhAtEh5LD0wiGdsb2JhbACSLwEBAQ8gpyiBaw X-IronPort-AV: E=Sophos;i="4.32,274,1217773800"; d="scan'208";a="180975677" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 27 Aug 2008 10:22:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KY9H9-0005uN-9V; Wed, 27 Aug 2008 10:52:43 +1000 Date: Wed, 27 Aug 2008 10:52:43 +1000 From: Dave Chinner To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel Message-ID: <20080827005243.GB5706@disturbed> Mail-Followup-To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski , xfs@oss.sgi.com References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> <20080826014133.GS5706@disturbed> <50ed5c760808260553i7def5e93qb0bcb4d2206a4a38@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50ed5c760808260553i7def5e93qb0bcb4d2206a4a38@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219798371 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.3818 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8095/Tue Aug 26 14:06:44 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17736 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Aug 26, 2008 at 02:53:23PM +0200, SÅ‚awomir Nowakowski wrote: > 2008/8/26 Dave Chinner : > run under 2.6.17.17 and 2.6.25.13 kernels? > > Here is a situation on 2.6.17.13 kernel: > > xfs_io -x -c 'statfs' /mnt/point > > fd.path = "/mnt/sda" > statfs.f_bsize = 4096 > statfs.f_blocks = 487416 > statfs.f_bavail = 6 > statfs.f_files = 160 > statfs.f_ffree = 154 > geom.bsize = 4096 > geom.agcount = 8 > geom.agblocks = 61247 > geom.datablocks = 489976 > geom.rtblocks = 0 > geom.rtextents = 0 > geom.rtextsize = 1 > geom.sunit = 0 > geom.swidth = 0 > counts.freedata = 6 > counts.freertx = 0 > counts.freeino = 58 > counts.allocino = 64 The counts.* numbers are the real numbers, not th statfs numbers which are somewhat made up - the inode count for example is influenced by the amount of free space.... > xfs_io -x -c 'resblks' /mnt/point > > reserved blocks = 0 > available reserved blocks = 0 .... > > But under 2.6.25.13 kernel the situation looks different: > > xfs_io -x -c 'statfs' /mnt/point: > > fd.path = "/mnt/-sda4" > statfs.f_bsize = 4096 > statfs.f_blocks = 487416 > statfs.f_bavail = 30 > statfs.f_files = 544 > statfs.f_ffree = 538 More free space, therefore more inodes.... > geom.bsize = 4096 > geom.agcount = 8 > geom.agblocks = 61247 > geom.datablocks = 489976 > geom.rtblocks = 0 > geom.rtextents = 0 > geom.rtextsize = 1 > geom.sunit = 0 > geom.swidth = 0 > counts.freedata = 30 > counts.freertx = 0 > counts.freeino = 58 > counts.allocino = 64 but the counts.* values show that the inode counts are the same. However, the free space is different, partially due to a different set of ENOSPC deadlock fixes that were done that required different calculations of space usage.... > xfs_io -x -c 'resblks' /mnt/point: > > reserved blocks = 18446744073709551586 > available reserved blocks = 18446744073709551586 Well, that is wrong - that's a large negative number. FWIW, I can't reproduce this on a pure 2.6.24 on ia32 or 2.6.27-rc4 kernel on x86_64-UML: # mount /mnt/xfs2 # df -k /mnt/xfs2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/ubd/2 2086912 1176 2085736 1% /mnt/xfs2 # xfs_io -x -c 'resblks 0' /mnt/xfs2 reserved blocks = 0 available reserved blocks = 0 # df -k /mnt/xfs2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/ubd/2 2086912 160 2086752 1% /mnt/xfs2 # xfs_io -f -c 'truncate 2g' -c 'resvsp 0 2086720k' /mnt/xfs2/fred # df -k /mnt/xfs2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/ubd/2 2086912 2086880 32 100% /mnt/xfs2 # xfs_io -x -c statfs /mnt/xfs2 fd.path = "/mnt/xfs2" statfs.f_bsize = 4096 statfs.f_blocks = 521728 statfs.f_bavail = 8 statfs.f_files = 192 statfs.f_ffree = 188 .... counts.freedata = 8 counts.freertx = 0 counts.freeino = 60 counts.allocino = 64 death:/mnt# umount /mnt/xfs2 death:/mnt# mount /mnt/xfs2 # xfs_io -x -c statfs /mnt/xfs2 fd.path = "/mnt/xfs2" statfs.f_bsize = 4096 statfs.f_blocks = 521728 statfs.f_bavail = 0 statfs.f_files = 64 statfs.f_ffree = 60 .... counts.freedata = 0 counts.freertx = 0 counts.freeino = 60 counts.allocino = 64 # df -k /mnt/xfs2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/ubd/2 2086912 2086912 0 100% /mnt/xfs2 # xfs_io -x -c resblks /mnt/xfs2 reserved blocks = 8 available reserved blocks = 8 Can you produce a metadump of the filesystem image that your have produced on 2.6.17 that results in bad behaviour on later kernels so I can see if I can reproduce the same results here? If you've only got a handful of files the image will be small enough to mail to me.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 26 18:18:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 18:19:01 -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 (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 m7R1Ispd002355 for ; Tue, 26 Aug 2008 18:18:54 -0700 X-ASG-Debug-ID: 1219800016-45ed03210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1867FFCAA23 for ; Tue, 26 Aug 2008 18:20:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id PofhK2s2IXKrWP08 for ; Tue, 26 Aug 2008 18:20:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlYCAHRHtEh5LD0wiGdsb2JhbACSLwEBAQ8gpzSBaw X-IronPort-AV: E=Sophos;i="4.32,274,1217773800"; d="scan'208";a="180994068" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 27 Aug 2008 10:50:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KY9hl-0006UZ-Oo; Wed, 27 Aug 2008 11:20:13 +1000 Date: Wed, 27 Aug 2008 11:20:13 +1000 From: Dave Chinner To: david@lang.hm Cc: Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080827012013.GC5706@disturbed> Mail-Followup-To: david@lang.hm, Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> <20080825120146.GC20960@shareable.org> <20080826030759.GY5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219800018 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.3820 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8095/Tue Aug 26 14:06:44 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17737 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Aug 25, 2008 at 08:50:14PM -0700, david@lang.hm wrote: > it sounds as if the various flag definitions have been evolving, would it > be worthwhile to sep back and try to get the various filesystem folks to > brainstorm together on what types of hints they would _like_ to see > supported? Three types: 1. immediate dispatch - merge first with adjacent requests then dispatch 2. delayed dispatch - queue for a short while to allow merging of requests from above 3. bulk data - queue and merge. dispatch is completely controlled by the elevator Basically most metadata and log writes would fall into category 2, which every logbufs/2 log writes or every log force using a category 1 to prevent log I/O from being stalled too long by other I/O. Data writes from the filesystem would appear as category 3 (read and write) and are subject to the specific elevator scheduling. That is, things like the CFQ ionice throttling would work on the bulk data queue, but not the other queues that the filesystem is using for metadata. Tagging the I/O as a sync I/O can still be done, but that only affects category 3 scheduling - category 1 or 2 would do the same thing whether sync or async.... > it sounds like you are using 'sync' for things where you really should be > saying 'metadata' (or 'journal contents'), it's happened to work well > enough in the past, but it's forcing you to keep tweaking the > filesystems. Right, because there was no 'metadata' tagging, and 'sync' happened to do exactly what we needed on all elevators at the time. > it may be better to try and define things from the > filesystem point of view and let the elevators do the tweaking. > > basicly I'm proposing a complete rethink of the filesyste <-> elevator > interface. Yeah, I've been saying that for a while w.r.t. the filesystem/block layer interfaces, esp. now with discard requests, data integrity, device alignment information, barriers, etc being exposed by the layers below the filesystem, but with no interface for filesystems to be able to access that information... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Aug 26 19:46:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 19:46:20 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R2kGYl007671 for ; Tue, 26 Aug 2008 19:46:17 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA10413; Wed, 27 Aug 2008 12:47:37 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 25ECF58C52A8; Wed, 27 Aug 2008 12:47:37 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 983809 - Un-popped buffers for failed reads in xfs_db can SEGV Message-Id: <20080827024737.25ECF58C52A8@chook.melbourne.sgi.com> Date: Wed, 27 Aug 2008 12:47:37 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17738 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Make sure to pop buffers for a failed read in xfs_check and xfs_metadump (both in xfs_db) Date: Wed Aug 27 12:46:20 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: hch@infradead.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31976a xfsprogs/db/check.c - 1.36 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/db/check.c.diff?r1=text&tr1=1.36&r2=text&tr2=1.35&f=h xfsprogs/db/metadump.c - 1.4 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/db/metadump.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.3&f=h - Pop buffers for failed reads From owner-xfs@oss.sgi.com Tue Aug 26 20:00:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 20:00:01 -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=-0.7 required=5.0 tests=AWL,BAYES_00,MISSING_HEADERS autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R2xvc7008591 for ; Tue, 26 Aug 2008 19:59:59 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA10652; Wed, 27 Aug 2008 13:01:18 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 42B8F58C52A8; Wed, 27 Aug 2008 13:01:18 +1000 (EST) Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 986140 - Increase xfs_metadump's max valid ext size for dirs Message-Id: <20080827030118.42B8F58C52A8@chook.melbourne.sgi.com> Date: Wed, 27 Aug 2008 13:01:18 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17739 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Increase default "valid" maximum extent size for xfs_metadump when copying directory contents to 1000 blocks per extent (from 20). Date: Wed Aug 27 13:00:05 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: hch@infradead.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31977a xfsprogs/db/metadump.c - 1.5 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/db/metadump.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.4&f=h - Increase default max extent size to 1000 blocks From owner-xfs@oss.sgi.com Tue Aug 26 20:09:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 20:09:10 -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.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R397VP009311 for ; Tue, 26 Aug 2008 20:09:08 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA10737; Wed, 27 Aug 2008 13:10:29 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 4CA4758C52A8; Wed, 27 Aug 2008 13:10:29 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 984775 - mkfs.xfs destroys file even with "-N" flag Message-Id: <20080827031029.4CA4758C52A8@chook.melbourne.sgi.com> Date: Wed, 27 Aug 2008 13:10:29 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17740 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Don't destroy file with "-N -d file" options. Date: Wed Aug 27 13:09:26 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: Michal Marek The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31978a xfsprogs/mkfs/xfs_mkfs.c - 1.92 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c.diff?r1=text&tr1=1.92&r2=text&tr2=1.91&f=h - Don't destroy file with -N -d file options From owner-xfs@oss.sgi.com Tue Aug 26 21:03:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 21:03:46 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R43PR6016912 for ; Tue, 26 Aug 2008 21:03:26 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA11707; Wed, 27 Aug 2008 14:04:46 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 0762258C52A8; Wed, 27 Aug 2008 14:04:45 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 986141 - xfs_repair - remove convert_extents function Message-Id: <20080827040446.0762258C52A8@chook.melbourne.sgi.com> Date: Wed, 27 Aug 2008 14:04:45 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17741 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Call libxfs_bmbt_disk_get_all directly instead of using a wrapper function Date: Wed Aug 27 14:03:52 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: hch@infradead.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31982a xfsprogs/repair/dinode.c - 1.31 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/dinode.c.diff?r1=text&tr1=1.31&r2=text&tr2=1.30&f=h xfsprogs/repair/prefetch.c - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/prefetch.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h - Call libxfs_bmbt_disk_get_all directly instead of using a wrapper function From owner-xfs@oss.sgi.com Tue Aug 26 21:18:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 21:18:47 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R4Icoe017954 for ; Tue, 26 Aug 2008 21:18:38 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA12004; Wed, 27 Aug 2008 14:19:59 +1000 Date: Wed, 27 Aug 2008 14:21:34 +1000 To: "Christoph Hellwig" Subject: Re: REVIEW: xfs_repair fixes for bad directories From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080826193205.GA31105@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080826193205.GA31105@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17742 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 27 Aug 2008 05:32:05 +1000, Christoph Hellwig wrote: > On Tue, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: > >> 2. An update a while ago to xfs_repair attempts to fix invalid >> ".." entries for subdirectories where there is a valid parent >> with the appropriate entry. It was a partial fix that never >> did the full job, especially if the subdirectory was short- >> form or it has already been processed. >> >> Patch fix_dir_rebuild_without_dotdot_entry.patch creates a >> post-processing queue after the main scan to update any >> directories with an invalid ".." entry. > > Where is the existing attemp? I can't find code doing anything like > that removed in the patch. But the actual patch looks good, while > I had this mess with the tons of different boolean flags in repair > converting these to a more descriptive bitmask should be a different > patch. A while ago, when we found some directories couldn't be deleted as their "." and ".." entries were in different blocks, code was added to detect this and fix it up, including restoring ".." entries that were missing in phase 6: } else if (parent == ip->i_ino) { add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); + } else if (parent == NULLFSINO) { + /* ".." was missing, but this entry refers to it, + so, set it as the parent and mark for rebuild */ + do_warn(_("entry \"%s\" in dir ino %llu doesn't have a" + " .. entry, will set it in ino %llu.\n"), + fname, ip->i_ino, inum); + set_inode_parent(irec, ino_offset, ip->i_ino); + add_inode_reached(irec, ino_offset); + add_inode_ref(current_irec, current_ino_offset); } else { junkit = 1; do_warn( It didn't quite work in the end depending on the order of inode scanning! So, this patch added that post-processing queue to make sure it always works. From owner-xfs@oss.sgi.com Tue Aug 26 22:56:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 22:56:45 -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=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7R5ueWY022276 for ; Tue, 26 Aug 2008 22:56:41 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA13756; Wed, 27 Aug 2008 15:58:01 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16380) id 1ECB158C52A8; Wed, 27 Aug 2008 15:58:01 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 986143 - Fix barrier status change detection. Message-Id: <20080827055801.1ECB158C52A8@chook.melbourne.sgi.com> Date: Wed, 27 Aug 2008 15:58:01 +1000 (EST) From: pleckie@sgi.com (Peter Leckie) X-Virus-Scanned: ClamAV 0.91.2/8096/Tue Aug 26 17:21:28 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17743 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pleckie@sgi.com Precedence: bulk X-list: xfs Fix barrier status change detection. The current code in xlog_iodone() uses the wrong macro to check if the barrier has been cleared due to an EOPNOTSUPP error form the lower layer. Signed-off-by: Dave Chinner Signed-off-by: Nathaniel W. Turner Date: Wed Aug 27 15:56:11 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/pleckie/2.6.x-xfs Inspected by: pleckie,david@fromorbit.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31984a fs/xfs/xfs_log.c - 1.367 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.367&r2=text&tr2=1.366&f=h - Fix barrier status change detection. From owner-xfs@oss.sgi.com Wed Aug 27 06:48:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 06:48:55 -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.6 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 m7RDmP9E005734 for ; Wed, 27 Aug 2008 06:48:25 -0700 X-ASG-Debug-ID: 1219844988-1c3700480000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 699C43D7929 for ; Wed, 27 Aug 2008 06:49:48 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id Q5zNf204a2FsWP3r for ; Wed, 27 Aug 2008 06:49:48 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDnl5f006568; Wed, 27 Aug 2008 09:49:47 -0400 Received: from pobox.devel.redhat.com (pobox.devel.redhat.com [10.11.255.8]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7RDnkdl004201; Wed, 27 Aug 2008 09:49:46 -0400 Received: from warthog.cambridge.redhat.com (IDENT:U2FsdGVkX1/UNUYvUTsbxZ27RJo7smo3/FijHhN1aBU@xen4-1.farm.hsv.redhat.com [10.15.4.90]) by pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id m7RDnj7P021649; Wed, 27 Aug 2008 09:49:46 -0400 Received: from [127.0.0.1] (helo=warthog.procyon.org.uk) by warthog.cambridge.redhat.com with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KYLP6-0005R9-TF; Wed, 27 Aug 2008 14:49:44 +0100 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells X-ASG-Orig-Subj: [PATCH 47/59] CRED: Wrap task credential accesses in the XFS filesystem Subject: [PATCH 47/59] CRED: Wrap task credential accesses in the XFS filesystem To: linux-kernel@vger.kernel.org Cc: linux-security-module@vger.kernel.org, David Howells , Serge Hallyn , xfs@oss.sgi.com Date: Wed, 27 Aug 2008 14:49:44 +0100 Message-ID: <20080827134944.19980.51300.stgit@warthog.procyon.org.uk> In-Reply-To: <20080827134541.19980.61042.stgit@warthog.procyon.org.uk> References: <20080827134541.19980.61042.stgit@warthog.procyon.org.uk> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1219844989 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/8098/Wed Aug 27 03:36:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17744 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dhowells@redhat.com Precedence: bulk X-list: xfs Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells Reviewed-by: James Morris Acked-by: Serge Hallyn Cc: xfs@oss.sgi.com --- fs/xfs/linux-2.6/xfs_cred.h | 2 +- fs/xfs/xfs_acl.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_cred.h b/fs/xfs/linux-2.6/xfs_cred.h index 652721c..293043a 100644 --- a/fs/xfs/linux-2.6/xfs_cred.h +++ b/fs/xfs/linux-2.6/xfs_cred.h @@ -24,7 +24,7 @@ * Credentials */ typedef struct cred { - /* EMPTY */ + /* EMPTY */ } cred_t; extern struct cred *sys_cred; diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index b2f639a..91d6933 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -366,7 +366,7 @@ xfs_acl_allow_set( return ENOTDIR; if (vp->i_sb->s_flags & MS_RDONLY) return EROFS; - if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER)) + if (XFS_I(vp)->i_d.di_uid != current_fsuid() && !capable(CAP_FOWNER)) return EPERM; return 0; } @@ -413,13 +413,13 @@ xfs_acl_access( switch (fap->acl_entry[i].ae_tag) { case ACL_USER_OBJ: seen_userobj = 1; - if (fuid != current->fsuid) + if (fuid != current_fsuid()) continue; matched.ae_tag = ACL_USER_OBJ; matched.ae_perm = allows; break; case ACL_USER: - if (fap->acl_entry[i].ae_id != current->fsuid) + if (fap->acl_entry[i].ae_id != current_fsuid()) continue; matched.ae_tag = ACL_USER; matched.ae_perm = allows; From owner-xfs@oss.sgi.com Wed Aug 27 11:07:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 11:08:01 -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=-1.7 required=5.0 tests=BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_33,J_CHICKENPOX_45,J_CHICKENPOX_46,J_CHICKENPOX_47, J_CHICKENPOX_48,MIME_8BIT_HEADER autolearn=no 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 m7RI7w9q027824 for ; Wed, 27 Aug 2008 11:07:58 -0700 X-ASG-Debug-ID: 1219860560-7f1a023b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wx-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6DDD43DBF8B for ; Wed, 27 Aug 2008 11:09:20 -0700 (PDT) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by cuda.sgi.com with ESMTP id CWIynhYDsEppNrbg for ; Wed, 27 Aug 2008 11:09:20 -0700 (PDT) Received: by wx-out-0506.google.com with SMTP id h30so1052757wxd.32 for ; Wed, 27 Aug 2008 11:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=+TGYVYUoRlFpxB/EV4iXBwOiyk6FYIhe4BxJBDbDMyI=; b=cU3JPJAEtzIWg3FUqr3Rpl3zknjlgexk/HazjpGSEkM5KF7I3d/xlP4Fb0NySb82ZD lxQA7tbmS7lnJ30oXDkJhlLrELM7tdxNFTCWdEhoFXMYKQ9/0GfDiEoIbb1CT4StIdop 0LJXAFHrnMQes5ICrdd9msgtbGUuo05kA2C44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=yCyxUCECszQK3hU54ncfDV1d7+qHwQwicJ/YFkchE18M06I22hHlR17thJ9Y4PZgzr uxt51DMV9NPub1/t678XiNJ1Ayx2sWsl5r43sT9++rQ5UeEO+sfvScbxvfZmg2VPN9R+ aabhMpaoHyRew+owe+Kqhq9QE4ufz+U7WnXfQ= Received: by 10.142.52.9 with SMTP id z9mr102876wfz.30.1219860558755; Wed, 27 Aug 2008 11:09:18 -0700 (PDT) Received: by 10.142.112.10 with HTTP; Wed, 27 Aug 2008 11:09:18 -0700 (PDT) Message-ID: <50ed5c760808271109u4dee0311ha7cf2c1e7cae31dd@mail.gmail.com> Date: Wed, 27 Aug 2008 20:09:18 +0200 From: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" To: "=?ISO-8859-2?Q?S=B3awomir_Nowakowski?=" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel In-Reply-To: <20080827005243.GB5706@disturbed> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_35313_16004752.1219860558769" References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> <20080826014133.GS5706@disturbed> <50ed5c760808260553i7def5e93qb0bcb4d2206a4a38@mail.gmail.com> <20080827005243.GB5706@disturbed> X-Barracuda-Connect: wx-out-0506.google.com[66.249.82.225] X-Barracuda-Start-Time: 1219860561 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0201 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.3885 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8099/Wed Aug 27 06:14:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17745 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nailman23@gmail.com Precedence: bulk X-list: xfs ------=_Part_35313_16004752.1219860558769 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: base64 Content-Disposition: inline RGVhciBEYXZlLAoKV2UgcmVhbGx5IGFwcmVjaWF0ZSB5b3VyIGhlbHAuLgoK SW4gdGhlIHJlYWx0aW9uIHRvIHByZXZpb3VzIGNvcnJlc3BvbmRhdGlvbnMg YWJvdXQgZGlmZmVyZW5jZXMgYmV0d2VlbgppbXBsZW1lbnRhdGlvbiBvZiBr ZXJuZWxzIDIuNi4xNy4xMyBhbmQgMi42LjI1LjEzIHdlJ2QgbGlrZSB0byBh c2sKc29tZSBxdWVzdGlvbnMuCgpXZSB3YXMgYmFzZWQgb24gZ2l0IHJlcG9z aXRvcnk6CgpnaXQ6Ly9naXQua2VybmVsLm9yZwoKV2UgaGF2ZSByZXZlcnRl ZCBzb21lIGNoYW5nZXMgZm9yIFhGUyBpbiAyLjYuMjUuMTMga2VybmVsLiBX ZSBoYXZlCnVzZWRmIDMgY29tbWl0czoKCi0gOTRFMUU5OUYxMS4uLiAoU0dJ LVBWOiA5NjQ0NjgpCi0gNEJFNTM2REVCRS4uLiAoU0dJLVBWOiA5NTU2NzQp Ci0gNENBNDg4RUI0Li4uICAoU0dJLVBWOiA5NzExODYpCgpXaXRoIHRoZXNl IGNoYW5nZXMgd2UgaGF2ZSBjcmVhdGVkIHBhdGNoIGZvciAyLjYuMjUuMTMg a2VybmVsLiBUaGlzCnBhdGNoIHNob3VsZCBlbGltaW5hdGUgYWRkaXRpb25h bCByZXNlcnZhdGlvbiBvZiBkaXNrIHNwYWNlIGluIFhGUwpmaWxlIHN5c3Rl bS4gT3VyIGludGVudGlvbiB3YXMgdG8gZ2V0IHNpbWlsYXJpdHkgc3BhY2Ug b2YgZGlzayBiZXR3ZWVuCjIuNi4xNy4xMyBhbmQgMi42LjI1LjEzIGtlcm5l bHMuCgpEb2VzIHBhdGNoIHRoYXQgaXMgYXR0YWNoZWQgdG8gdGhpcyBtYWls IGRvIGV2ZXJ5dGhpbmcgcHJvcGVybHk/IElzIGl0CjEwMCUgY29tcGF0aWJl IHdpdGggWEZTIEFQST8KCklmIHlvdSB3bmF0IGFueXRoaW5nIG1vcmUgZnJv bSB1cyBqdXRzIGFzay4gV1FlIGRlbGl2ZXIgaXQuCgpUaGFuayB5b3UgdmV5 IG11Y2ggZm9yIHlvdXIgYXR0aXR1ZGUuCgpSb2xhbmQKCjIwMDgvOC8yNywg RGF2ZSBDaGlubmVyIDxkYXZpZEBmcm9tb3JiaXQuY29tPjoKPiBPbiBUdWUs IEF1ZyAyNiwgMjAwOCBhdCAwMjo1MzoyM1BNICswMjAwLCBTs2F3b21pciBO b3dha293c2tpIHdyb3RlOgo+ID4gMjAwOC84LzI2IERhdmUgQ2hpbm5lciA8 ZGF2aWRAZnJvbW9yYml0LmNvbT46Cj4gPiBydW4gdW5kZXIgMi42LjE3LjE3 IGFuZCAyLjYuMjUuMTMga2VybmVscz8KPiA+Cj4gPiBIZXJlIGlzIGEgc2l0 dWF0aW9uIG9uIDIuNi4xNy4xMyBrZXJuZWw6Cj4gPgo+ID4geGZzX2lvIC14 IC1jICdzdGF0ZnMnIC9tbnQvcG9pbnQKPiA+Cj4gPiBmZC5wYXRoID0gIi9t bnQvc2RhIgo+ID4gc3RhdGZzLmZfYnNpemUgPSA0MDk2Cj4gPiBzdGF0ZnMu Zl9ibG9ja3MgPSA0ODc0MTYKPiA+IHN0YXRmcy5mX2JhdmFpbCA9IDYKPiA+ IHN0YXRmcy5mX2ZpbGVzID0gMTYwCj4gPiBzdGF0ZnMuZl9mZnJlZSA9IDE1 NAo+ID4gZ2VvbS5ic2l6ZSA9IDQwOTYKPiA+IGdlb20uYWdjb3VudCA9IDgK PiA+IGdlb20uYWdibG9ja3MgPSA2MTI0Nwo+ID4gZ2VvbS5kYXRhYmxvY2tz ID0gNDg5OTc2Cj4gPiBnZW9tLnJ0YmxvY2tzID0gMAo+ID4gZ2VvbS5ydGV4 dGVudHMgPSAwCj4gPiBnZW9tLnJ0ZXh0c2l6ZSA9IDEKPiA+IGdlb20uc3Vu aXQgPSAwCj4gPiBnZW9tLnN3aWR0aCA9IDAKPiA+IGNvdW50cy5mcmVlZGF0 YSA9IDYKPiA+IGNvdW50cy5mcmVlcnR4ID0gMAo+ID4gY291bnRzLmZyZWVp bm8gPSA1OAo+ID4gY291bnRzLmFsbG9jaW5vID0gNjQKPgo+IFRoZSBjb3Vu dHMuKiBudW1iZXJzIGFyZSB0aGUgcmVhbCBudW1iZXJzLCBub3QgdGggc3Rh dGZzIG51bWJlcnMKPiB3aGljaCBhcmUgc29tZXdoYXQgbWFkZSB1cCAtIHRo ZSBpbm9kZSBjb3VudCBmb3IgZXhhbXBsZSBpcwo+IGluZmx1ZW5jZWQgYnkg dGhlIGFtb3VudCBvZiBmcmVlIHNwYWNlLi4uLgo+Cj4gPiB4ZnNfaW8gLXgg LWMgJ3Jlc2Jsa3MnIC9tbnQvcG9pbnQKPiA+Cj4gPiByZXNlcnZlZCBibG9j a3MgPSAwCj4gPiBhdmFpbGFibGUgcmVzZXJ2ZWQgYmxvY2tzID0gMAo+IC4u Li4KPgo+ID4KPiA+IEJ1dCB1bmRlciAyLjYuMjUuMTMga2VybmVsIHRoZSBz aXR1YXRpb24gbG9va3MgZGlmZmVyZW50Ogo+ID4KPiA+IHhmc19pbyAteCAt YyAnc3RhdGZzJyAvbW50L3BvaW50Ogo+ID4KPiA+IGZkLnBhdGggPSAiL21u dC8tc2RhNCIKPiA+IHN0YXRmcy5mX2JzaXplID0gNDA5Ngo+ID4gc3RhdGZz LmZfYmxvY2tzID0gNDg3NDE2Cj4gPiBzdGF0ZnMuZl9iYXZhaWwgPSAzMAo+ ID4gc3RhdGZzLmZfZmlsZXMgPSA1NDQKPiA+IHN0YXRmcy5mX2ZmcmVlID0g NTM4Cj4KPiBNb3JlIGZyZWUgc3BhY2UsIHRoZXJlZm9yZSBtb3JlIGlub2Rl cy4uLi4KPgo+ID4gZ2VvbS5ic2l6ZSA9IDQwOTYKPiA+IGdlb20uYWdjb3Vu dCA9IDgKPiA+IGdlb20uYWdibG9ja3MgPSA2MTI0Nwo+ID4gZ2VvbS5kYXRh YmxvY2tzID0gNDg5OTc2Cj4gPiBnZW9tLnJ0YmxvY2tzID0gMAo+ID4gZ2Vv bS5ydGV4dGVudHMgPSAwCj4gPiBnZW9tLnJ0ZXh0c2l6ZSA9IDEKPiA+IGdl b20uc3VuaXQgPSAwCj4gPiBnZW9tLnN3aWR0aCA9IDAKPiA+IGNvdW50cy5m cmVlZGF0YSA9IDMwCj4gPiBjb3VudHMuZnJlZXJ0eCA9IDAKPiA+IGNvdW50 cy5mcmVlaW5vID0gNTgKPiA+IGNvdW50cy5hbGxvY2lubyA9IDY0Cj4KPiBi dXQgdGhlIGNvdW50cy4qIHZhbHVlcyBzaG93IHRoYXQgdGhlIGlub2RlIGNv dW50cyBhcmUgdGhlIHNhbWUuCj4gSG93ZXZlciwgdGhlIGZyZWUgc3BhY2Ug aXMgZGlmZmVyZW50LCBwYXJ0aWFsbHkgZHVlIHRvIGEgZGlmZmVyZW50Cj4g c2V0IG9mIEVOT1NQQyBkZWFkbG9jayBmaXhlcyB0aGF0IHdlcmUgZG9uZSB0 aGF0IHJlcXVpcmVkIGRpZmZlcmVudAo+IGNhbGN1bGF0aW9ucyBvZiBzcGFj ZSB1c2FnZS4uLi4KPgo+ID4geGZzX2lvIC14IC1jICdyZXNibGtzJyAvbW50 L3BvaW50Ogo+ID4KPiA+IHJlc2VydmVkIGJsb2NrcyA9IDE4NDQ2NzQ0MDcz NzA5NTUxNTg2Cj4gPiBhdmFpbGFibGUgcmVzZXJ2ZWQgYmxvY2tzID0gMTg0 NDY3NDQwNzM3MDk1NTE1ODYKPgo+IFdlbGwsIHRoYXQgaXMgd3JvbmcgLSB0 aGF0J3MgYSBsYXJnZSBuZWdhdGl2ZSBudW1iZXIuCj4KPiBGV0lXLCBJIGNh bid0IHJlcHJvZHVjZSB0aGlzIG9uIGEgcHVyZSAyLjYuMjQgb24gaWEzMiBv ciAyLjYuMjctcmM0IGtlcm5lbAo+IG9uIHg4Nl82NC1VTUw6Cj4KPiAjIG1v dW50IC9tbnQveGZzMgo+ICMgZGYgLWsgL21udC94ZnMyCj4gRmlsZXN5c3Rl bSAgICAgICAgICAgMUstYmxvY2tzICAgICAgVXNlZCBBdmFpbGFibGUgVXNl JSBNb3VudGVkIG9uCj4gL2Rldi91YmQvMiAgICAgICAgICAgICAyMDg2OTEy ICAgICAgMTE3NiAgIDIwODU3MzYgICAxJSAvbW50L3hmczIKPiAjIHhmc19p byAteCAtYyAncmVzYmxrcyAwJyAvbW50L3hmczIKPiByZXNlcnZlZCBibG9j a3MgPSAwCj4gYXZhaWxhYmxlIHJlc2VydmVkIGJsb2NrcyA9IDAKPiAjIGRm IC1rIC9tbnQveGZzMgo+IEZpbGVzeXN0ZW0gICAgICAgICAgIDFLLWJsb2Nr cyAgICAgIFVzZWQgQXZhaWxhYmxlIFVzZSUgTW91bnRlZCBvbgo+IC9kZXYv dWJkLzIgICAgICAgICAgICAgMjA4NjkxMiAgICAgICAxNjAgICAyMDg2NzUy ICAgMSUgL21udC94ZnMyCj4gIyB4ZnNfaW8gLWYgLWMgJ3RydW5jYXRlIDJn JyAtYyAncmVzdnNwIDAgMjA4NjcyMGsnIC9tbnQveGZzMi9mcmVkCj4gIyBk ZiAtayAvbW50L3hmczIKPiBGaWxlc3lzdGVtICAgICAgICAgICAxSy1ibG9j a3MgICAgICBVc2VkIEF2YWlsYWJsZSBVc2UlIE1vdW50ZWQgb24KPiAvZGV2 L3ViZC8yICAgICAgICAgICAgIDIwODY5MTIgICAyMDg2ODgwICAgICAgICAz MiAxMDAlIC9tbnQveGZzMgo+ICMgeGZzX2lvIC14IC1jIHN0YXRmcyAvbW50 L3hmczIKPiBmZC5wYXRoID0gIi9tbnQveGZzMiIKPiBzdGF0ZnMuZl9ic2l6 ZSA9IDQwOTYKPiBzdGF0ZnMuZl9ibG9ja3MgPSA1MjE3MjgKPiBzdGF0ZnMu Zl9iYXZhaWwgPSA4Cj4gc3RhdGZzLmZfZmlsZXMgPSAxOTIKPiBzdGF0ZnMu Zl9mZnJlZSA9IDE4OAo+IC4uLi4KPiBjb3VudHMuZnJlZWRhdGEgPSA4Cj4g Y291bnRzLmZyZWVydHggPSAwCj4gY291bnRzLmZyZWVpbm8gPSA2MAo+IGNv dW50cy5hbGxvY2lubyA9IDY0Cj4gZGVhdGg6L21udCMgdW1vdW50IC9tbnQv eGZzMgo+IGRlYXRoOi9tbnQjIG1vdW50IC9tbnQveGZzMgo+ICMgeGZzX2lv IC14IC1jIHN0YXRmcyAvbW50L3hmczIKPiBmZC5wYXRoID0gIi9tbnQveGZz MiIKPiBzdGF0ZnMuZl9ic2l6ZSA9IDQwOTYKPiBzdGF0ZnMuZl9ibG9ja3Mg PSA1MjE3MjgKPiBzdGF0ZnMuZl9iYXZhaWwgPSAwCj4gc3RhdGZzLmZfZmls ZXMgPSA2NAo+IHN0YXRmcy5mX2ZmcmVlID0gNjAKPiAuLi4uCj4gY291bnRz LmZyZWVkYXRhID0gMAo+IGNvdW50cy5mcmVlcnR4ID0gMAo+IGNvdW50cy5m cmVlaW5vID0gNjAKPiBjb3VudHMuYWxsb2Npbm8gPSA2NAo+ICMgZGYgLWsg L21udC94ZnMyCj4gRmlsZXN5c3RlbSAgICAgICAgICAgMUstYmxvY2tzICAg ICAgVXNlZCBBdmFpbGFibGUgVXNlJSBNb3VudGVkIG9uCj4gL2Rldi91YmQv MiAgICAgICAgICAgICAyMDg2OTEyICAgMjA4NjkxMiAgICAgICAgIDAgMTAw JSAvbW50L3hmczIKPiAjIHhmc19pbyAteCAtYyByZXNibGtzIC9tbnQveGZz Mgo+IHJlc2VydmVkIGJsb2NrcyA9IDgKPiBhdmFpbGFibGUgcmVzZXJ2ZWQg YmxvY2tzID0gOAo+Cj4gQ2FuIHlvdSBwcm9kdWNlIGEgbWV0YWR1bXAgb2Yg dGhlIGZpbGVzeXN0ZW0gaW1hZ2UgdGhhdCB5b3VyIGhhdmUgcHJvZHVjZWQK PiBvbiAyLjYuMTcgdGhhdCByZXN1bHRzIGluIGJhZCBiZWhhdmlvdXIgb24g bGF0ZXIga2VybmVscyBzbyBJIGNhbiBzZWUgaWYKPiBJIGNhbiByZXByb2R1 Y2UgdGhlIHNhbWUgcmVzdWx0cyBoZXJlPyBJZiB5b3UndmUgb25seSBnb3Qg YSBoYW5kZnVsIG9mIGZpbGVzCj4gdGhlIGltYWdlIHdpbGwgYmUgc21hbGwg ZW5vdWdoIHRvIG1haWwgdG8gbWUuLi4uCj4KPiBDaGVlcnMsCj4KPiBEYXZl Lgo+IC0tCj4gRGF2ZSBDaGlubmVyCj4gZGF2aWRAZnJvbW9yYml0LmNvbQo+ Cg== ------=_Part_35313_16004752.1219860558769 Content-Type: text/plain; name=d10.diff.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fke9diii Content-Disposition: attachment; filename=d10.diff.txt ZGlmZiAtck51cCB4ZnMvbGludXgtMi42L3hmc19zdXBlci5jIHhmcy9saW51 eC0yLjYveGZzX3N1cGVyLmMKLS0tIHhmcy9saW51eC0yLjYveGZzX3N1cGVy LmMJMjAwOC0wOC0yNSAxNDoyNToxMS4wMDAwMDAwMDAgKzAyMDAKKysrIHhm cy9saW51eC0yLjYveGZzX3N1cGVyLmMJMjAwOC0wOC0yNyAxMTo1NTozMy4w MDAwMDAwMDAgKzAyMDAKQEAgLTYxLDYgKzYxLDkgQEAKICNpbmNsdWRlIDxs aW51eC9rdGhyZWFkLmg+CiAjaW5jbHVkZSA8bGludXgvZnJlZXplci5oPgog CisKKyNkZWZpbmUgTk9fMjYxOF9YRlMKKwogc3RhdGljIHN0cnVjdCBxdW90 YWN0bF9vcHMgeGZzX3F1b3RhY3RsX29wZXJhdGlvbnM7CiBzdGF0aWMgc3Ry dWN0IHN1cGVyX29wZXJhdGlvbnMgeGZzX3N1cGVyX29wZXJhdGlvbnM7CiBz dGF0aWMga21lbV96b25lX3QgKnhmc192bm9kZV96b25lOwpAQCAtMTE4Nyw4 ICsxMTkwLDEzIEBAIHhmc19mc19zdGF0ZnMoCiAJc3RhdHAtPmZfYnNpemUg PSBzYnAtPnNiX2Jsb2Nrc2l6ZTsKIAlsc2l6ZSA9IHNicC0+c2JfbG9nc3Rh cnQgPyBzYnAtPnNiX2xvZ2Jsb2NrcyA6IDA7CiAJc3RhdHAtPmZfYmxvY2tz ID0gc2JwLT5zYl9kYmxvY2tzIC0gbHNpemU7CisjaWZuZGVmIE5PXzI2MThf WEZTCiAJc3RhdHAtPmZfYmZyZWUgPSBzdGF0cC0+Zl9iYXZhaWwgPQogCQkJ CXNicC0+c2JfZmRibG9ja3MgLSBYRlNfQUxMT0NfU0VUX0FTSURFKG1wKTsK KyNlbHNlCisJc3RhdHAtPmZfYmZyZWUgPSBzdGF0cC0+Zl9iYXZhaWwgPSBz YnAtPnNiX2ZkYmxvY2tzOworI2VuZGlmCisKIAlmYWtlaW5vcyA9IHN0YXRw LT5mX2JmcmVlIDw8IHNicC0+c2JfaW5vcGJsb2c7CiAjaWYgWEZTX0JJR19J TlVNUwogCWZha2Vpbm9zICs9IG1wLT5tX2lub2FkZDsKZGlmZiAtck51cCB4 ZnMveGZzX2Zzb3BzLmMgeGZzL3hmc19mc29wcy5jCi0tLSB4ZnMveGZzX2Zz b3BzLmMJMjAwOC0wOC0yNSAxNDoyNToxMy4wMDAwMDAwMDAgKzAyMDAKKysr IHhmcy94ZnNfZnNvcHMuYwkyMDA4LTA4LTI3IDExOjU2OjMwLjAwMDAwMDAw MCArMDIwMApAQCAtNDYsNiArNDYsOCBAQAogI2luY2x1ZGUgInhmc19ydy5o IgogI2luY2x1ZGUgInhmc19maWxlc3RyZWFtLmgiCiAKKyNkZWZpbmUgTk9f MjYxOF9YRlMKKwogLyoKICAqIEZpbGUgc3lzdGVtIG9wZXJhdGlvbnMKICAq LwpAQCAtNDY0LDcgKzQ2NiwxMSBAQCB4ZnNfZnNfY291bnRzKAogewogCXhm c19pY3NiX3N5bmNfY291bnRlcnNfZmxhZ3MobXAsIFhGU19JQ1NCX0xBWllf Q09VTlQpOwogCXNwaW5fbG9jaygmbXAtPm1fc2JfbG9jayk7CisjaWZkZWYg Tk9fMjYxOF9YRlMKKwljbnQtPmZyZWVkYXRhID0gbXAtPm1fc2Iuc2JfZmRi bG9ja3M7CisjZWxzZQogCWNudC0+ZnJlZWRhdGEgPSBtcC0+bV9zYi5zYl9m ZGJsb2NrcyAtIFhGU19BTExPQ19TRVRfQVNJREUobXApOworI2VuZGlmCQog CWNudC0+ZnJlZXJ0eCA9IG1wLT5tX3NiLnNiX2ZyZXh0ZW50czsKIAljbnQt PmZyZWVpbm8gPSBtcC0+bV9zYi5zYl9pZnJlZTsKIAljbnQtPmFsbG9jaW5v ID0gbXAtPm1fc2Iuc2JfaWNvdW50OwpAQCAtNTM5LDI0ICs1NDUsNDIgQEAg cmV0cnk6CiAJCX0KIAkJbXAtPm1fcmVzYmxrcyA9IHJlcXVlc3Q7CiAJfSBl bHNlIHsKKyNpZm5kZWYgTk9fMjYxOF9YRlMKIAkJX19pbnQ2NF90CWZyZWU7 CiAKIAkJZnJlZSA9ICBtcC0+bV9zYi5zYl9mZGJsb2NrcyAtIFhGU19BTExP Q19TRVRfQVNJREUobXApOwogCQlpZiAoIWZyZWUpCiAJCQlnb3RvIG91dDsg LyogRU5PU1BDIGFuZCBmZGJsa3NfZGVsdGEgPSAwICovCi0KKwkJCQorI2Vu ZGlmCiAJCWRlbHRhID0gcmVxdWVzdCAtIG1wLT5tX3Jlc2Jsa3M7CisKKyNp Zm5kZWYgTk9fMjYxOF9YRlMKIAkJbGNvdW50ZXIgPSBmcmVlIC0gZGVsdGE7 CisjZWxzZQorCQlsY291bnRlciA9IG1wLT5tX3NiLnNiX2ZkYmxvY2tzIC0g ZGVsdGE7CisjZW5kaWYKIAkJaWYgKGxjb3VudGVyIDwgMCkgewogCQkJLyog V2UgY2FuJ3Qgc2F0aXNmeSB0aGUgcmVxdWVzdCwganVzdCBnZXQgd2hhdCB3 ZSBjYW4gKi8KKyNpZm5kZWYgTk9fMjYxOF9YRlMKIAkJCW1wLT5tX3Jlc2Js a3MgKz0gZnJlZTsKIAkJCW1wLT5tX3Jlc2Jsa3NfYXZhaWwgKz0gZnJlZTsK IAkJCWZkYmxrc19kZWx0YSA9IC1mcmVlOwogCQkJbXAtPm1fc2Iuc2JfZmRi bG9ja3MgPSBYRlNfQUxMT0NfU0VUX0FTSURFKG1wKTsKKyNlbHNlCisJCQlt cC0+bV9yZXNibGtzICs9IG1wLT5tX3NiLnNiX2ZkYmxvY2tzOworCQkJbXAt Pm1fcmVzYmxrc19hdmFpbCArPSBtcC0+bV9zYi5zYl9mZGJsb2NrczsKKwkJ CWZkYmxrc19kZWx0YSA9IC1tcC0+bV9zYi5zYl9mZGJsb2NrczsKKwkJCW1w LT5tX3NiLnNiX2ZkYmxvY2tzID0gMDsKKyNlbmRpZgogCQl9IGVsc2Ugewog CQkJZmRibGtzX2RlbHRhID0gLWRlbHRhOworI2lmbmRlZiBOT18yNjE4X1hG UwogCQkJbXAtPm1fc2Iuc2JfZmRibG9ja3MgPQogCQkJCWxjb3VudGVyICsg WEZTX0FMTE9DX1NFVF9BU0lERShtcCk7CisjZWxzZQorCQkJbXAtPm1fc2Iu c2JfZmRibG9ja3MgPSBsY291bnRlcjsKKyNlbmRpZgogCQkJbXAtPm1fcmVz YmxrcyA9IHJlcXVlc3Q7CiAJCQltcC0+bV9yZXNibGtzX2F2YWlsICs9IGRl bHRhOwogCQl9CmRpZmYgLXJOdXAgeGZzL3hmc19tb3VudC5jIHhmcy94ZnNf bW91bnQuYwotLS0geGZzL3hmc19tb3VudC5jCTIwMDgtMDgtMjUgMTQ6MjU6 MTQuMDAwMDAwMDAwICswMjAwCisrKyB4ZnMveGZzX21vdW50LmMJMjAwOC0w OC0yNyAxNDo0MjowMi4wMDAwMDAwMDAgKzAyMDAKQEAgLTQ0LDYgKzQ0LDkg QEAKICNpbmNsdWRlICJ4ZnNfcXVvdGEuaCIKICNpbmNsdWRlICJ4ZnNfZnNv cHMuaCIKIAorCisjZGVmaW5lIE5PXzI2MThfWEZTCisKIFNUQVRJQyB2b2lk CXhmc19tb3VudF9sb2dfc2IoeGZzX21vdW50X3QgKiwgX19pbnQ2NF90KTsK IFNUQVRJQyBpbnQJeGZzX3V1aWRfbW91bnQoeGZzX21vdW50X3QgKik7CiBT VEFUSUMgdm9pZAl4ZnNfdXVpZF91bm1vdW50KHhmc19tb3VudF90ICptcCk7 CkBAIC0xNTI1LDYgKzE1MjgsMTEgQEAgeGZzX21vZF9zYih4ZnNfdHJhbnNf dCAqdHAsIF9faW50NjRfdCBmaQogICoKICAqIFRoZSBtX3NiX2xvY2sgbXVz dCBiZSBoZWxkIHdoZW4gdGhpcyByb3V0aW5lIGlzIGNhbGxlZC4KICAqLwor IAorI2lmZGVmIE5PXzI2MThfWEZTCQorICAgICNkZWZpbmUgU0VUX0FTSURF X0JMT0NLUyA4CisjZW5kaWYgCisgCiBpbnQKIHhmc19tb2RfaW5jb3JlX3Ni X3VubG9ja2VkKAogCXhmc19tb3VudF90CSptcCwKQEAgLTE1NjIsOCArMTU3 MCwxMiBAQCB4ZnNfbW9kX2luY29yZV9zYl91bmxvY2tlZCgKIAkJbXAtPm1f c2Iuc2JfaWZyZWUgPSBsY291bnRlcjsKIAkJcmV0dXJuIDA7CiAJY2FzZSBY RlNfU0JTX0ZEQkxPQ0tTOgorI2lmbmRlZiBOT18yNjE4X1hGUwkKIAkJbGNv dW50ZXIgPSAobG9uZyBsb25nKQogCQkJbXAtPm1fc2Iuc2JfZmRibG9ja3Mg LSBYRlNfQUxMT0NfU0VUX0FTSURFKG1wKTsKKyNlbHNlCisJCWxjb3VudGVy ID0gKGxvbmcgbG9uZyltcC0+bV9zYi5zYl9mZGJsb2NrcyAtIFNFVF9BU0lE RV9CTE9DS1M7CisjZW5kaWYKIAkJcmVzX3VzZWQgPSAobG9uZyBsb25nKSht cC0+bV9yZXNibGtzIC0gbXAtPm1fcmVzYmxrc19hdmFpbCk7CiAKIAkJaWYg KGRlbHRhID4gMCkgewkJLyogUHV0dGluZyBibG9ja3MgYmFjayAqLwpAQCAt MTU5Niw4ICsxNjA4LDExIEBAIHhmc19tb2RfaW5jb3JlX3NiX3VubG9ja2Vk KAogCQkJCX0KIAkJCX0KIAkJfQotCisjaWZuZGVmIE5PXzI2MThfWEZTCQog CQltcC0+bV9zYi5zYl9mZGJsb2NrcyA9IGxjb3VudGVyICsgWEZTX0FMTE9D X1NFVF9BU0lERShtcCk7CisjZWxzZQorCQltcC0+bV9zYi5zYl9mZGJsb2Nr cyA9IGxjb3VudGVyICsgU0VUX0FTSURFX0JMT0NLUzsgICAgCisjZW5kaWYJ CQogCQlyZXR1cm4gMDsKIAljYXNlIFhGU19TQlNfRlJFWFRFTlRTOgogCQls Y291bnRlciA9IChsb25nIGxvbmcpbXAtPm1fc2Iuc2JfZnJleHRlbnRzOwpA QCAtMjMyMSw4ICsyMzM2LDE0IEBAIHhmc19pY3NiX3N5bmNfY291bnRlcnMo CiAgKi8KIAogI2RlZmluZSBYRlNfSUNTQl9JTk9fQ05UUl9SRUVOQUJMRQko dWludDY0X3QpNjQKKworI2lmbmRlZiBOT18yNjE4X1hGUwogI2RlZmluZSBY RlNfSUNTQl9GREJMS19DTlRSX1JFRU5BQkxFKG1wKSBcCiAJCSh1aW50NjRf dCkoNTEyICsgWEZTX0FMTE9DX1NFVF9BU0lERShtcCkpCisjZWxzZQorI2Rl ZmluZSBYRlNfSUNTQl9GREJMS19DTlRSX1JFRU5BQkxFICAgNTEyCisjZW5k aWYKKwkJCiBTVEFUSUMgdm9pZAogeGZzX2ljc2JfYmFsYW5jZV9jb3VudGVy KAogCXhmc19tb3VudF90CSptcCwKQEAgLTIzNTcsNyArMjM3OCwxMSBAQCB4 ZnNfaWNzYl9iYWxhbmNlX2NvdW50ZXIoCiAJY2FzZSBYRlNfU0JTX0ZEQkxP Q0tTOgogCQljb3VudCA9IG1wLT5tX3NiLnNiX2ZkYmxvY2tzOwogCQlyZXNp ZCA9IGRvX2Rpdihjb3VudCwgd2VpZ2h0KTsKKyNpZm5kZWYgTk9fMjYxOF9Y RlMKIAkJaWYgKGNvdW50IDwgbWF4KG1pbiwgWEZTX0lDU0JfRkRCTEtfQ05U Ul9SRUVOQUJMRShtcCkpKQorI2Vsc2UKKwkJaWYgKGNvdW50IDwgbWF4KG1p biwgWEZTX0lDU0JfRkRCTEtfQ05UUl9SRUVOQUJMRSkpCisjZW5kaWYJCQog CQkJZ290byBvdXQ7CiAJCWJyZWFrOwogCWRlZmF1bHQ6CkBAIC0yNDE4LDEy ICsyNDQzLDE5IEBAIGFnYWluOgogCiAJY2FzZSBYRlNfU0JTX0ZEQkxPQ0tT OgogCQlCVUdfT04oKG1wLT5tX3Jlc2Jsa3MgLSBtcC0+bV9yZXNibGtzX2F2 YWlsKSAhPSAwKTsKLQorI2lmbmRlZiBOT18yNjE4X1hGUwogCQlsY291bnRl ciA9IGljc2JwLT5pY3NiX2ZkYmxvY2tzIC0gWEZTX0FMTE9DX1NFVF9BU0lE RShtcCk7CisjZWxzZQorICAgICAgICAgICAgICAgIGxjb3VudGVyID0gaWNz YnAtPmljc2JfZmRibG9ja3M7CisjZW5kaWYJCQogCQlsY291bnRlciArPSBk ZWx0YTsKIAkJaWYgKHVubGlrZWx5KGxjb3VudGVyIDwgMCkpCiAJCQlnb3Rv IGJhbGFuY2VfY291bnRlcjsKKyNpZm5kZWYgTk9fMjYxOF9YRlMKIAkJaWNz YnAtPmljc2JfZmRibG9ja3MgPSBsY291bnRlciArIFhGU19BTExPQ19TRVRf QVNJREUobXApOworI2Vsc2UJCQorCQlpY3NicC0+aWNzYl9mZGJsb2NrcyA9 IGxjb3VudGVyOworI2VuZGlmCiAJCWJyZWFrOwogCWRlZmF1bHQ6CiAJCUJV RygpOwo= ------=_Part_35313_16004752.1219860558769-- From owner-xfs@oss.sgi.com Wed Aug 27 14:53:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 14:53:49 -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.6 required=5.0 tests=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 m7RLrgWN017331 for ; Wed, 27 Aug 2008 14:53:44 -0700 X-ASG-Debug-ID: 1219874104-5a32018e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bifrost.lang.hm (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1E0A1FD01A3 for ; Wed, 27 Aug 2008 14:55:04 -0700 (PDT) Received: from bifrost.lang.hm (mail.lang.hm [64.81.33.126]) by cuda.sgi.com with ESMTP id ph1qSRnEJGoPzOjf for ; Wed, 27 Aug 2008 14:55:04 -0700 (PDT) Received: from asgard.lang.hm (asgard.lang.hm [10.0.0.100]) by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id m7RLs0Vw012801; Wed, 27 Aug 2008 14:54:01 -0700 Date: Wed, 27 Aug 2008 14:54:28 -0700 (PDT) From: david@lang.hm X-X-Sender: dlang@asgard.lang.hm To: Dave Chinner cc: Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) In-Reply-To: <20080827012013.GC5706@disturbed> Message-ID: References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> <20080825120146.GC20960@shareable.org> <20080826030759.GY5706@disturbed> <20080827012013.GC5706@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: mail.lang.hm[64.81.33.126] X-Barracuda-Start-Time: 1219874106 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=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name X-Virus-Scanned: ClamAV 0.91.2/8100/Wed Aug 27 10:58:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17746 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@lang.hm Precedence: bulk X-list: xfs On Wed, 27 Aug 2008, Dave Chinner wrote: > On Mon, Aug 25, 2008 at 08:50:14PM -0700, david@lang.hm wrote: >> it sounds as if the various flag definitions have been evolving, would it >> be worthwhile to sep back and try to get the various filesystem folks to >> brainstorm together on what types of hints they would _like_ to see >> supported? > > Three types: > > 1. immediate dispatch - merge first with adjacent requests > then dispatch > 2. delayed dispatch - queue for a short while to allow > merging of requests from above > 3. bulk data - queue and merge. dispatch is completely > controlled by the elevator does this list change if you consider the fact that there may be a raid array or some more complex structure for the block device instead of a simple single disk partition? since I am suggesting re-thinking the filesystem <-> elevator interface, is there anything you need to have the elevator tell the filesystem? (I'm thinking that this may be the path for the filesystem to learn things about the block device that's under it, is it a raid array, a solid-state drive, etc) David Lang > Basically most metadata and log writes would fall into category 2, > which every logbufs/2 log writes or every log force using a category > 1 to prevent log I/O from being stalled too long by other I/O. > > Data writes from the filesystem would appear as category 3 (read and write) > and are subject to the specific elevator scheduling. That is, things > like the CFQ ionice throttling would work on the bulk data queue, > but not the other queues that the filesystem is using for metadata. > > Tagging the I/O as a sync I/O can still be done, but that only > affects category 3 scheduling - category 1 or 2 would do the same > thing whether sync or async.... > >> it sounds like you are using 'sync' for things where you really should be >> saying 'metadata' (or 'journal contents'), it's happened to work well >> enough in the past, but it's forcing you to keep tweaking the >> filesystems. > > Right, because there was no 'metadata' tagging, and 'sync' happened > to do exactly what we needed on all elevators at the time. > >> it may be better to try and define things from the >> filesystem point of view and let the elevators do the tweaking. >> >> basicly I'm proposing a complete rethink of the filesyste <-> elevator >> interface. > > Yeah, I've been saying that for a while w.r.t. the filesystem/block > layer interfaces, esp. now with discard requests, data integrity, > device alignment information, barriers, etc being exposed by the > layers below the filesystem, but with no interface for filesystems > to be able to access that information... > > Cheers, > > Dave. > From owner-xfs@oss.sgi.com Wed Aug 27 17:18:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 17:18:50 -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,MIME_8BIT_HEADER autolearn=no 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 m7S0IlFi030182 for ; Wed, 27 Aug 2008 17:18:48 -0700 X-ASG-Debug-ID: 1219882810-4e4f02860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 856DDFD1021 for ; Wed, 27 Aug 2008 17:20:10 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id qEwHBiyCHw0DwnpZ for ; Wed, 27 Aug 2008 17:20:10 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AikEAOWKtUh5LD0wamdsb2JhbACSPRICHqcUgWg X-IronPort-AV: E=Sophos;i="4.32,283,1217773800"; d="scan'208";a="181803257" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 28 Aug 2008 09:50:08 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KYVF8-0007Fo-4v; Thu, 28 Aug 2008 10:20:06 +1000 Date: Thu, 28 Aug 2008 10:20:05 +1000 From: Dave Chinner To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS issue under 2.6.25.13 kernel Subject: Re: XFS issue under 2.6.25.13 kernel Message-ID: <20080828002005.GA30189@disturbed> Mail-Followup-To: =?utf-8?B?U8WCYXdvbWly?= Nowakowski , xfs@oss.sgi.com References: <50ed5c760808220303p37e03e8dge5b868a572374e0b@mail.gmail.com> <20080823010524.GM5706@disturbed> <50ed5c760808250408o44aeaf07me262eab8da8340ba@mail.gmail.com> <20080826014133.GS5706@disturbed> <50ed5c760808260553i7def5e93qb0bcb4d2206a4a38@mail.gmail.com> <20080827005243.GB5706@disturbed> <50ed5c760808271109u4dee0311ha7cf2c1e7cae31dd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <50ed5c760808271109u4dee0311ha7cf2c1e7cae31dd@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219882811 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0139 1.0000 -1.9302 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.93 X-Barracuda-Spam-Status: No, SCORE=-1.93 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.3910 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8102/Wed Aug 27 16:30:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17747 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 27, 2008 at 08:09:18PM +0200, SÅ‚awomir Nowakowski wrote: > Dear Dave, > > We really apreciate your help.. > > In the realtion to previous correspondations about differences between > implementation of kernels 2.6.17.13 and 2.6.25.13 we'd like to ask > some questions. > > We was based on git repository: > > git://git.kernel.org > > We have reverted some changes for XFS in 2.6.25.13 kernel. We have > usedf 3 commits: > > - 94E1E99F11... (SGI-PV: 964468) > - 4BE536DEBE... (SGI-PV: 955674) > - 4CA488EB4... (SGI-PV: 971186) > > With these changes we have created patch for 2.6.25.13 kernel. This > patch should eliminate additional reservation of disk space in XFS > file system. Our intention was to get similarity space of disk between > 2.6.17.13 and 2.6.25.13 kernels. After removing the reservation with xfs_io (the big difference), I don't see why you need to hack the kernel as well. Have you got such little margin in your filesystem provisioning that you can't spare 4 blocks per AG? > Does patch that is attached to this mail do everything properly? Don't know. You've taken away a bunch of reserved blocks other code relies on existing for correct operation at ENOSPC. Given that you are doing this because you are running so close to ENOSPC there's a good chance that you've broken something. I don't have the time (or the desire) to analyse the impact of the changes being made, but I bet that the XFSQA tests that exercise behaviour at ENOSPC will start to deadlock again... > Is it > 100% compatibe with XFS API? You've changed statfs. You'll have to make sure it reports the correct thing in all cases (there's an XFSQA test for this). Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 27 18:07:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 18:07:45 -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 (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 m7S17cI6032160 for ; Wed, 27 Aug 2008 18:07:38 -0700 X-ASG-Debug-ID: 1219885741-60eb018b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5D08BFD1146 for ; Wed, 27 Aug 2008 18:09:01 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id dzK3JDNuxfTWPA2D for ; Wed, 27 Aug 2008 18:09:01 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AikEAHCVtUh5LD0wamdsb2JhbACSPRICHqcIgWg X-IronPort-AV: E=Sophos;i="4.32,283,1217773800"; d="scan'208";a="181836058" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 28 Aug 2008 10:38:59 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KYW0O-0008Lj-O8; Thu, 28 Aug 2008 11:08:56 +1000 Date: Thu, 28 Aug 2008 11:08:56 +1000 From: Dave Chinner To: david@lang.hm Cc: Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Subject: Re: XFS vs Elevators (was Re: [PATCH RFC] nilfs2: continuous snapshotting file system) Message-ID: <20080828010856.GB30189@disturbed> Mail-Followup-To: david@lang.hm, Jamie Lokier , Nick Piggin , gus3 , Szabolcs Szakacsits , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080821051508.GB5706@disturbed> <200808211933.34565.nickpiggin@yahoo.com.au> <20080821170854.GJ5706@disturbed> <200808221229.11069.nickpiggin@yahoo.com.au> <20080825015922.GP5706@disturbed> <20080825120146.GC20960@shareable.org> <20080826030759.GY5706@disturbed> <20080827012013.GC5706@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219885742 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.3914 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8102/Wed Aug 27 16:30:33 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17748 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Aug 27, 2008 at 02:54:28PM -0700, david@lang.hm wrote: > On Wed, 27 Aug 2008, Dave Chinner wrote: > >> On Mon, Aug 25, 2008 at 08:50:14PM -0700, david@lang.hm wrote: >>> it sounds as if the various flag definitions have been evolving, would it >>> be worthwhile to sep back and try to get the various filesystem folks to >>> brainstorm together on what types of hints they would _like_ to see >>> supported? >> >> Three types: >> >> 1. immediate dispatch - merge first with adjacent requests >> then dispatch >> 2. delayed dispatch - queue for a short while to allow >> merging of requests from above >> 3. bulk data - queue and merge. dispatch is completely >> controlled by the elevator > > does this list change if you consider the fact that there may be a raid > array or some more complex structure for the block device instead of a > simple single disk partition? No. The whole point of immediate dispatch is that those I/Os are extremely latency sensitive (i.e. whole fs can stall waiting or them), so it doesn't matter what the end target is. The faster the storage subsystem, the more important it is to dispatch those I/Os immediately to keep the pipes filled... > since I am suggesting re-thinking the filesystem <-> elevator interface, > is there anything you need to have the elevator tell the filesystem? (I'm > thinking that this may be the path for the filesystem to learn things > about the block device that's under it, is it a raid array, a solid-state > drive, etc) Not so much the elevator, but the block layer in general. That is: - capability reporting - barriers and type - discard support - integrity support - maximum number of I/Os that can be in flight before congestion occurs - geometry of the underlying storage - independent domains within the device (e.g. boundaries of linear concatentations) - stripe unit/width per domain - optimal I/O size per domain - latency characteristics per domain - notifiers to indicate change of status due to device hotplug back up to the filesystem - barrier status change - geometry changes due to on-line volume modification (e.g. raid5/6 rebuild after adding a new disk, added another disk to a linear concat, etc) I'm sure there's more, but that's the list quickly off the top of my head. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Aug 27 20:20:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 27 Aug 2008 20:20:39 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7S3KZYk011507 for ; Wed, 27 Aug 2008 20:20:36 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA09847; Thu, 28 Aug 2008 13:21:56 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 70DFB58C52A9; Thu, 28 Aug 2008 13:21:56 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 907752 - Update QA 096 for ASCII CI mkfs output Message-Id: <20080828032156.70DFB58C52A9@chook.melbourne.sgi.com> Date: Thu, 28 Aug 2008 13:21:56 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8103/Wed Aug 27 17:41:49 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17749 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Update QA 096 for ASCII CI mkfs output Date: Thu Aug 28 13:21:09 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: hch@infradead.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31997a xfstests/096 - 1.14 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/096.diff?r1=text&tr1=1.14&r2=text&tr2=1.13&f=h - Execute bits changed from xxx to --- Update for ASCII CI mkfs output From owner-xfs@oss.sgi.com Thu Aug 28 00:22:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 00:22:31 -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=3.5 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_101,J_CHICKENPOX_25,J_CHICKENPOX_31,J_CHICKENPOX_33,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7S7MSaC031942 for ; Thu, 28 Aug 2008 00:22:28 -0700 X-ASG-Debug-ID: 1219908230-18e6019a0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from po-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C01531B43FA1 for ; Thu, 28 Aug 2008 00:23:50 -0700 (PDT) Received: from po-out-1718.google.com (po-out-1718.google.com [72.14.252.155]) by cuda.sgi.com with ESMTP id HnGhTQ5BxpUHqhm1 for ; Thu, 28 Aug 2008 00:23:50 -0700 (PDT) Received: by po-out-1718.google.com with SMTP id b23so441771poe.2 for ; Thu, 28 Aug 2008 00:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:mime-version:content-type; bh=JroRgVhDlaJPd7cm1K/30D+LvJBG9TQnY0bGoUeHh1k=; b=Y+BxjuLWq+DXvj4o7/nqRhJ03me9f4Yt8my7LUljiPFjppsPKuF9yVwAdTHOgKduVC LV01UHy97w2EEhVRxSfq8kGFUYV7Xdh/idSFI4WoIxEJEK4GXerA1vZjOTegjeVlycdu X/LPkw793M2Zw5kTe9MSCeE9pdp1lIfvrnSE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:mime-version:content-type; b=EtxjbreSjQx5IhB2Ay/cU4Aw+Lse/pcn6L+xmSOTEYlj88JrDvWbNOKv28elhhCWtb MnfsBoBwmN8XIouHMAlFwZc0czTfJcHLAkygKOfH2jxSz0J35YviVZl7ybJk5SCIhbZu bSRG+4XhCtGipTAAvsg3wF+WHDgLhbZUV1ICY= Received: by 10.141.197.8 with SMTP id z8mr537419rvp.157.1219908191279; Thu, 28 Aug 2008 00:23:11 -0700 (PDT) Received: by 10.141.67.6 with HTTP; Thu, 28 Aug 2008 00:23:11 -0700 (PDT) Message-ID: <9af422e10808280023v147f2f93j6cc9c87bb94c0fb6@mail.gmail.com> Date: Thu, 28 Aug 2008 09:23:11 +0200 From: "agnes isaac" Reply-To: agnes_isaac1m@yahoo.com To: agnesisac2@gmail.com X-ASG-Orig-Subj: Hello Subject: Hello MIME-Version: 1.0 X-Barracuda-Connect: po-out-1718.google.com[72.14.252.155] X-Barracuda-Start-Time: 1219908231 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5016 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3939 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/8104/Wed Aug 27 19:11:35 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 831 X-archive-position: 17750 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: agnesisac2@gmail.com Precedence: bulk X-list: xfs *Hello!!!, I saw your contact, and i was deeply moved.I think that you are a very interesting person.So I decided to use the chance to get to know you.i dont think that the age appearance is so important. The most important is what is inside you and how do you feel about the life. I know this life from many sides and I am rather mature already to know how to make a man happy.I think we should use every chance to find our happiness. and I am contacting you for obvious reason which you will understand.i am sending this mail just to know if this email address is OK,reply me with my email address ( agnes_isaac1m@yahoo.com )so that i will send my photo and more details to you,and i have a very importantthing to tell you, i still hope for your reply, have a pleasant day, Agnes Isaac,* [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Aug 28 16:14:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 16:14:59 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7SNEuUl029195 for ; Thu, 28 Aug 2008 16:14:57 -0700 X-ASG-Debug-ID: 1219965378-0fcb02b80000-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 B72F01A67CBB for ; Thu, 28 Aug 2008 16:16:19 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ALh0gLaGRn3dZn2q for ; Thu, 28 Aug 2008 16:16:19 -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 m7SNGKIF019786 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 29 Aug 2008 01:16:20 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7SNGKGS019784 for xfs@oss.sgi.com; Fri, 29 Aug 2008 01:16:20 +0200 Date: Fri, 29 Aug 2008 01:16:20 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] tiny nametest.c warning fixes Subject: Re: [PATCH] tiny nametest.c warning fixes Message-ID: <20080828231620.GA19757@lst.de> References: <20080809195908.GA9005@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080809195908.GA9005@lst.de> 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: 1219965380 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.4001 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8112/Thu Aug 28 14:27:00 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17751 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 ping? On Sat, Aug 09, 2008 at 09:59:08PM +0200, Christoph Hellwig wrote: > Include ctype.h for toupper/tolower and remove an unused variable. > > > Signed-off-by: Christoph Hellwig > > --- xfstests/src/nametest.c 24 Jun 2008 16:29:51 -0000 1.8 > +++ xfstests/src/nametest.c 9 Aug 2008 19:55:37 -0000 > @@ -16,6 +16,7 @@ > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > > +#include > #include "global.h" > > /* > @@ -308,7 +309,6 @@ main(int argc, char *argv[]) > char *get_name(struct info *ip) > { > static char path[PATH_MAX]; > - int i; > char *p; > > if (!mixcase) ---end quoted text--- From owner-xfs@oss.sgi.com Thu Aug 28 16:17:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 16:17:16 -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 m7SNHCaa029678 for ; Thu, 28 Aug 2008 16:17:12 -0700 X-ASG-Debug-ID: 1219965516-4d2101770000-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 631F71206750 for ; Thu, 28 Aug 2008 16:18:36 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Wws0LElGyx6gZmxK for ; Thu, 28 Aug 2008 16:18:36 -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 m7SNIaIF019869 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 29 Aug 2008 01:18:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7SNIac3019867 for xfs@oss.sgi.com; Fri, 29 Aug 2008 01:18:36 +0200 Date: Fri, 29 Aug 2008 01:18:36 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/4] fix the noquota mount option Subject: Re: [PATCH 3/4] fix the noquota mount option Message-ID: <20080828231836.GC19757@lst.de> References: <20080525190750.GC13372@lst.de> <20080723080514.GB3417@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723080514.GB3417@lst.de> 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: 1219965517 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.4002 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8112/Thu Aug 28 14:27:00 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17753 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 ping^2? On Wed, Jul 23, 2008 at 10:05:14AM +0200, Christoph Hellwig wrote: > ping? > > On Sun, May 25, 2008 at 09:07:50PM +0200, Christoph Hellwig wrote: > > Noquota should clear all mount options, and not just user and group > > quota. Probably doesn't matter very much in real life. > > > > > > Signed-off-by: Christoph Hellwig > > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:57:33.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:58:52.000000000 +0200 > > @@ -337,6 +337,7 @@ xfs_parseargs( > > } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > > mp->m_qflags &= ~(XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > > XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | > > XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD); > > } else if (!strcmp(this_char, MNTOPT_QUOTA) || > > !strcmp(this_char, MNTOPT_UQUOTA) || > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Thu Aug 28 16:16:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 16:16:20 -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.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54, J_CHICKENPOX_75 autolearn=no 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 m7SNGHhg029405 for ; Thu, 28 Aug 2008 16:16:17 -0700 X-ASG-Debug-ID: 1219965455-0da601550000-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 48DBC3E2A5A for ; Thu, 28 Aug 2008 16:17:35 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 8KZZsJD744piE0qN for ; Thu, 28 Aug 2008 16:17:35 -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 m7SNHZIF019843 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 29 Aug 2008 01:17:35 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7SNHZX3019841 for xfs@oss.sgi.com; Fri, 29 Aug 2008 01:17:35 +0200 Date: Fri, 29 Aug 2008 01:17:35 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] kill struct xfs_mount_args Subject: Re: [PATCH 2/4] kill struct xfs_mount_args Message-ID: <20080828231735.GB19757@lst.de> References: <20080525190741.GB13372@lst.de> <20080723080505.GA3417@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723080505.GA3417@lst.de> 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: 1219965458 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.4003 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8112/Thu Aug 28 14:27:00 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17752 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 ping^2? On Wed, Jul 23, 2008 at 10:05:05AM +0200, Christoph Hellwig wrote: > ping? > > On Sun, May 25, 2008 at 09:07:41PM +0200, Christoph Hellwig wrote: > > No need to parse the mount option into a structure before applying it > > to struct xfs_mount. > > > > The content of xfs_start_flags gets merged into xfs_parseargs. Calls > > inbetween don't care and can use mount members instead of the args > > struct. > > > > This patch uncovered that the mount option for shared filesystems wasn't > > ever exposed on Linux. The code to handle it is #if 0'ed in this patch > > pending a decision on this feature. I'll send a writeup about it to > > the list soon. > > > > > > Signed-off-by: Christoph Hellwig > > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 16:23:57.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:57:16.000000000 +0200 > > @@ -18,7 +18,6 @@ > > #include "xfs.h" > > #include "xfs_bit.h" > > #include "xfs_log.h" > > -#include "xfs_clnt.h" > > #include "xfs_inum.h" > > #include "xfs_trans.h" > > #include "xfs_sb.h" > > @@ -74,32 +73,6 @@ static kmem_zone_t *xfs_vnode_zone; > > static kmem_zone_t *xfs_ioend_zone; > > mempool_t *xfs_ioend_pool; > > > > -STATIC struct xfs_mount_args * > > -xfs_args_allocate( > > - struct super_block *sb, > > - int silent) > > -{ > > - struct xfs_mount_args *args; > > - > > - args = kzalloc(sizeof(struct xfs_mount_args), GFP_KERNEL); > > - if (!args) > > - return NULL; > > - > > - args->logbufs = args->logbufsize = -1; > > - strncpy(args->fsname, sb->s_id, MAXNAMELEN); > > - > > - /* Copy the already-parsed mount(2) flags we're interested in */ > > - if (sb->s_flags & MS_DIRSYNC) > > - args->flags |= XFSMNT_DIRSYNC; > > - if (sb->s_flags & MS_SYNCHRONOUS) > > - args->flags |= XFSMNT_WSYNC; > > - if (silent) > > - args->flags |= XFSMNT_QUIET; > > - args->flags |= XFSMNT_32BITINODES; > > - > > - return args; > > -} > > - > > #define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ > > #define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ > > #define MNTOPT_LOGDEV "logdev" /* log device */ > > @@ -171,26 +144,54 @@ suffix_strtoul(char *s, char **endp, uns > > return simple_strtoul((const char *)s, endp, base) << shift_left_factor; > > } > > > > +/* > > + * This function fills in xfs_mount_t fields based on mount args. > > + * Note: the superblock has _not_ yet been read in. > > + * > > + * Note that this function leaks the various device name allocations on > > + * failure. The caller takes care of them. > > + */ > > STATIC int > > xfs_parseargs( > > struct xfs_mount *mp, > > char *options, > > - struct xfs_mount_args *args, > > - int update) > > + char **mtpt) > > { > > + struct super_block *sb = mp->m_super; > > char *this_char, *value, *eov; > > - int dsunit, dswidth, vol_dsunit, vol_dswidth; > > - int iosize; > > + int dsunit = 0; > > + int dswidth = 0; > > + int iosize = 0; > > int dmapi_implies_ikeep = 1; > > + uchar_t iosizelog = 0; > > > > - args->flags |= XFSMNT_BARRIER; > > - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; > > + /* > > + * Copy binary VFS mount flags we are interested in. > > + */ > > + if (sb->s_flags & MS_RDONLY) > > + mp->m_flags |= XFS_MOUNT_RDONLY; > > + if (sb->s_flags & MS_DIRSYNC) > > + mp->m_flags |= XFS_MOUNT_DIRSYNC; > > + if (sb->s_flags & MS_SYNCHRONOUS) > > + mp->m_flags |= XFS_MOUNT_WSYNC; > > + > > + /* > > + * Set some default flags that could be cleared by the mount option > > + * parsing. > > + */ > > + mp->m_flags |= XFS_MOUNT_BARRIER; > > + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > > + mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > > + > > + /* > > + * These can be overridden by the mount option parsing. > > + */ > > + mp->m_logbufs = -1; > > + mp->m_logbsize = -1; > > > > if (!options) > > goto done; > > > > - iosize = dsunit = dswidth = vol_dsunit = vol_dswidth = 0; > > - > > while ((this_char = strsep(&options, ",")) != NULL) { > > if (!*this_char) > > continue; > > @@ -204,7 +205,7 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - args->logbufs = simple_strtoul(value, &eov, 10); > > + mp->m_logbufs = simple_strtoul(value, &eov, 10); > > } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -212,7 +213,7 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - args->logbufsize = suffix_strtoul(value, &eov, 10); > > + mp->m_logbsize = suffix_strtoul(value, &eov, 10); > > } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -220,7 +221,9 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - strncpy(args->logname, value, MAXNAMELEN); > > + mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > > + if (!mp->m_logname) > > + return ENOMEM; > > } else if (!strcmp(this_char, MNTOPT_MTPT)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -228,7 +231,9 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - strncpy(args->mtpt, value, MAXNAMELEN); > > + *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > > + if (!*mtpt) > > + return ENOMEM; > > } else if (!strcmp(this_char, MNTOPT_RTDEV)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -236,7 +241,9 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - strncpy(args->rtname, value, MAXNAMELEN); > > + mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > > + if (!mp->m_rtname) > > + return ENOMEM; > > } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -245,8 +252,7 @@ xfs_parseargs( > > return EINVAL; > > } > > iosize = simple_strtoul(value, &eov, 10); > > - args->flags |= XFSMNT_IOSIZE; > > - args->iosizelog = (uint8_t) iosize; > > + iosizelog = (uint8_t) iosize; > > } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -255,8 +261,7 @@ xfs_parseargs( > > return EINVAL; > > } > > iosize = suffix_strtoul(value, &eov, 10); > > - args->flags |= XFSMNT_IOSIZE; > > - args->iosizelog = ffs(iosize) - 1; > > + iosizelog = ffs(iosize) - 1; > > } else if (!strcmp(this_char, MNTOPT_GRPID) || > > !strcmp(this_char, MNTOPT_BSDGROUPS)) { > > mp->m_flags |= XFS_MOUNT_GRPID; > > @@ -264,23 +269,25 @@ xfs_parseargs( > > !strcmp(this_char, MNTOPT_SYSVGROUPS)) { > > mp->m_flags &= ~XFS_MOUNT_GRPID; > > } else if (!strcmp(this_char, MNTOPT_WSYNC)) { > > - args->flags |= XFSMNT_WSYNC; > > + mp->m_flags |= XFS_MOUNT_WSYNC; > > } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { > > - args->flags |= XFSMNT_OSYNCISOSYNC; > > + mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; > > } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { > > - args->flags |= XFSMNT_NORECOVERY; > > + mp->m_flags |= XFS_MOUNT_NORECOVERY; > > } else if (!strcmp(this_char, MNTOPT_INO64)) { > > - args->flags |= XFSMNT_INO64; > > -#if !XFS_BIG_INUMS > > +#if XFS_BIG_INUMS > > + mp->m_flags |= XFS_MOUNT_INO64; > > + mp->m_inoadd = XFS_INO64_OFFSET; > > +#else > > cmn_err(CE_WARN, > > "XFS: %s option not allowed on this system", > > this_char); > > return EINVAL; > > #endif > > } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { > > - args->flags |= XFSMNT_NOALIGN; > > + mp->m_flags |= XFS_MOUNT_NOALIGN; > > } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { > > - args->flags |= XFSMNT_SWALLOC; > > + mp->m_flags |= XFS_MOUNT_SWALLOC; > > } else if (!strcmp(this_char, MNTOPT_SUNIT)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > > @@ -298,7 +305,7 @@ xfs_parseargs( > > } > > dswidth = simple_strtoul(value, &eov, 10); > > } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { > > - args->flags &= ~XFSMNT_32BITINODES; > > + mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; > > #if !XFS_BIG_INUMS > > cmn_err(CE_WARN, > > "XFS: %s option not allowed on this system", > > @@ -306,56 +313,60 @@ xfs_parseargs( > > return EINVAL; > > #endif > > } else if (!strcmp(this_char, MNTOPT_NOUUID)) { > > - args->flags |= XFSMNT_NOUUID; > > + mp->m_flags |= XFS_MOUNT_NOUUID; > > } else if (!strcmp(this_char, MNTOPT_BARRIER)) { > > - args->flags |= XFSMNT_BARRIER; > > + mp->m_flags |= XFS_MOUNT_BARRIER; > > } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { > > - args->flags &= ~XFSMNT_BARRIER; > > + mp->m_flags &= ~XFS_MOUNT_BARRIER; > > } else if (!strcmp(this_char, MNTOPT_IKEEP)) { > > - args->flags |= XFSMNT_IKEEP; > > + mp->m_flags |= XFS_MOUNT_IKEEP; > > } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { > > dmapi_implies_ikeep = 0; > > - args->flags &= ~XFSMNT_IKEEP; > > + mp->m_flags &= ~XFS_MOUNT_IKEEP; > > } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { > > - args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE; > > + mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; > > } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { > > - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; > > + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > > } else if (!strcmp(this_char, MNTOPT_ATTR2)) { > > - args->flags |= XFSMNT_ATTR2; > > + mp->m_flags |= XFS_MOUNT_ATTR2; > > } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { > > - args->flags &= ~XFSMNT_ATTR2; > > - args->flags |= XFSMNT_NOATTR2; > > + mp->m_flags &= ~XFS_MOUNT_ATTR2; > > + mp->m_flags |= XFS_MOUNT_NOATTR2; > > } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { > > - args->flags2 |= XFSMNT2_FILESTREAMS; > > + mp->m_flags |= XFS_MOUNT_FILESTREAMS; > > } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > > - args->flags &= ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); > > - args->flags &= ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); > > + mp->m_qflags &= ~(XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > > + XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD); > > } else if (!strcmp(this_char, MNTOPT_QUOTA) || > > !strcmp(this_char, MNTOPT_UQUOTA) || > > !strcmp(this_char, MNTOPT_USRQUOTA)) { > > - args->flags |= XFSMNT_UQUOTA | XFSMNT_UQUOTAENF; > > + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > > + XFS_UQUOTA_ENFD); > > } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || > > !strcmp(this_char, MNTOPT_UQUOTANOENF)) { > > - args->flags |= XFSMNT_UQUOTA; > > - args->flags &= ~XFSMNT_UQUOTAENF; > > + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); > > + mp->m_qflags &= ~XFS_UQUOTA_ENFD; > > } else if (!strcmp(this_char, MNTOPT_PQUOTA) || > > !strcmp(this_char, MNTOPT_PRJQUOTA)) { > > - args->flags |= XFSMNT_PQUOTA | XFSMNT_PQUOTAENF; > > + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | > > + XFS_OQUOTA_ENFD); > > } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { > > - args->flags |= XFSMNT_PQUOTA; > > - args->flags &= ~XFSMNT_PQUOTAENF; > > + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); > > + mp->m_qflags &= ~XFS_OQUOTA_ENFD; > > } else if (!strcmp(this_char, MNTOPT_GQUOTA) || > > !strcmp(this_char, MNTOPT_GRPQUOTA)) { > > - args->flags |= XFSMNT_GQUOTA | XFSMNT_GQUOTAENF; > > + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > > + XFS_OQUOTA_ENFD); > > } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { > > - args->flags |= XFSMNT_GQUOTA; > > - args->flags &= ~XFSMNT_GQUOTAENF; > > + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); > > + mp->m_qflags &= ~XFS_OQUOTA_ENFD; > > } else if (!strcmp(this_char, MNTOPT_DMAPI)) { > > - args->flags |= XFSMNT_DMAPI; > > + mp->m_flags |= XFS_MOUNT_DMAPI; > > } else if (!strcmp(this_char, MNTOPT_XDSM)) { > > - args->flags |= XFSMNT_DMAPI; > > + mp->m_flags |= XFS_MOUNT_DMAPI; > > } else if (!strcmp(this_char, MNTOPT_DMI)) { > > - args->flags |= XFSMNT_DMAPI; > > + mp->m_flags |= XFS_MOUNT_DMAPI; > > } else if (!strcmp(this_char, "ihashsize")) { > > cmn_err(CE_WARN, > > "XFS: ihashsize no longer used, option is deprecated."); > > @@ -373,27 +384,29 @@ xfs_parseargs( > > } > > } > > > > - if (args->flags & XFSMNT_NORECOVERY) { > > - if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) { > > - cmn_err(CE_WARN, > > - "XFS: no-recovery mounts must be read-only."); > > - return EINVAL; > > - } > > + /* > > + * no recovery flag requires a read-only mount > > + */ > > + if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && > > + !(mp->m_flags & XFS_MOUNT_RDONLY)) { > > + cmn_err(CE_WARN, "XFS: no-recovery mounts must be read-only."); > > + return EINVAL; > > } > > > > - if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) { > > + if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) { > > cmn_err(CE_WARN, > > "XFS: sunit and swidth options incompatible with the noalign option"); > > return EINVAL; > > } > > > > - if ((args->flags & XFSMNT_GQUOTA) && (args->flags & XFSMNT_PQUOTA)) { > > + if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && > > + (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { > > cmn_err(CE_WARN, > > "XFS: cannot mount with both project and group quota"); > > return EINVAL; > > } > > > > - if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') { > > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && !mtpt) { > > printk("XFS: %s option needs the mount point option as well\n", > > MNTOPT_DMAPI); > > return EINVAL; > > @@ -421,27 +434,66 @@ xfs_parseargs( > > * Note that if "ikeep" or "noikeep" mount options are > > * supplied, then they are honored. > > */ > > - if ((args->flags & XFSMNT_DMAPI) && dmapi_implies_ikeep) > > - args->flags |= XFSMNT_IKEEP; > > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && dmapi_implies_ikeep) > > + mp->m_flags |= XFS_MOUNT_IKEEP; > > > > - if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { > > +done: > > + if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) { > > + /* > > + * At this point the superblock has not been read > > + * in, therefore we do not know the block size. > > + * Before the mount call ends we will convert > > + * these to FSBs. > > + */ > > if (dsunit) { > > - args->sunit = dsunit; > > - args->flags |= XFSMNT_RETERR; > > - } else { > > - args->sunit = vol_dsunit; > > + mp->m_dalign = dsunit; > > + mp->m_flags |= XFS_MOUNT_RETERR; > > } > > - dswidth ? (args->swidth = dswidth) : > > - (args->swidth = vol_dswidth); > > - } else { > > - args->sunit = args->swidth = 0; > > + > > + if (dswidth) > > + mp->m_swidth = dswidth; > > + } > > + > > + if (mp->m_logbufs != -1 && > > + mp->m_logbufs != 0 && > > + (mp->m_logbufs < XLOG_MIN_ICLOGS || > > + mp->m_logbufs > XLOG_MAX_ICLOGS)) { > > + cmn_err(CE_WARN, > > + "XFS: invalid logbufs value: %d [not %d-%d]", > > + mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); > > + return XFS_ERROR(EINVAL); > > + } > > + if (mp->m_logbsize != -1 && > > + mp->m_logbsize != 0 && > > + (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || > > + mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || > > + !is_power_of_2(mp->m_logbsize))) { > > + cmn_err(CE_WARN, > > + "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", > > + mp->m_logbsize); > > + return XFS_ERROR(EINVAL); > > + } > > + > > + mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); > > + if (!mp->m_fsname) > > + return ENOMEM; > > + mp->m_fsname_len = strlen(mp->m_fsname) + 1; > > + > > + if (iosizelog) { > > + if (iosizelog > XFS_MAX_IO_LOG || > > + iosizelog < XFS_MIN_IO_LOG) { > > + cmn_err(CE_WARN, > > + "XFS: invalid log iosize: %d [not %d-%d]", > > + iosizelog, XFS_MIN_IO_LOG, > > + XFS_MAX_IO_LOG); > > + return XFS_ERROR(EINVAL); > > + } > > + > > + mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; > > + mp->m_readio_log = iosizelog; > > + mp->m_writeio_log = iosizelog; > > } > > > > -done: > > - if (args->flags & XFSMNT_32BITINODES) > > - mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > > - if (args->flags2) > > - args->flags |= XFSMNT_FLAGS2; > > return 0; > > } > > > > @@ -693,8 +745,7 @@ xfs_close_devices( > > */ > > STATIC int > > xfs_open_devices( > > - struct xfs_mount *mp, > > - struct xfs_mount_args *args) > > + struct xfs_mount *mp) > > { > > struct block_device *ddev = mp->m_super->s_bdev; > > struct block_device *logdev = NULL, *rtdev = NULL; > > @@ -703,14 +754,14 @@ xfs_open_devices( > > /* > > * Open real time and log devices - order is important. > > */ > > - if (args->logname[0]) { > > - error = xfs_blkdev_get(mp, args->logname, &logdev); > > + if (mp->m_logname) { > > + error = xfs_blkdev_get(mp, mp->m_logname, &logdev); > > if (error) > > goto out; > > } > > > > - if (args->rtname[0]) { > > - error = xfs_blkdev_get(mp, args->rtname, &rtdev); > > + if (mp->m_rtname) { > > + error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); > > if (error) > > goto out_close_logdev; > > > > @@ -1411,175 +1462,28 @@ xfs_fs_setxquota( > > > > /* > > * This function fills in xfs_mount_t fields based on mount args. > > - * Note: the superblock has _not_ yet been read in. > > - */ > > -STATIC int > > -xfs_start_flags( > > - struct xfs_mount_args *ap, > > - struct xfs_mount *mp) > > -{ > > - int error; > > - > > - /* Values are in BBs */ > > - if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { > > - /* > > - * At this point the superblock has not been read > > - * in, therefore we do not know the block size. > > - * Before the mount call ends we will convert > > - * these to FSBs. > > - */ > > - mp->m_dalign = ap->sunit; > > - mp->m_swidth = ap->swidth; > > - } > > - > > - if (ap->logbufs != -1 && > > - ap->logbufs != 0 && > > - (ap->logbufs < XLOG_MIN_ICLOGS || > > - ap->logbufs > XLOG_MAX_ICLOGS)) { > > - cmn_err(CE_WARN, > > - "XFS: invalid logbufs value: %d [not %d-%d]", > > - ap->logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); > > - return XFS_ERROR(EINVAL); > > - } > > - mp->m_logbufs = ap->logbufs; > > - if (ap->logbufsize != -1 && > > - ap->logbufsize != 0 && > > - (ap->logbufsize < XLOG_MIN_RECORD_BSIZE || > > - ap->logbufsize > XLOG_MAX_RECORD_BSIZE || > > - !is_power_of_2(ap->logbufsize))) { > > - cmn_err(CE_WARN, > > - "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", > > - ap->logbufsize); > > - return XFS_ERROR(EINVAL); > > - } > > - > > - error = ENOMEM; > > - > > - mp->m_logbsize = ap->logbufsize; > > - mp->m_fsname_len = strlen(ap->fsname) + 1; > > - > > - mp->m_fsname = kstrdup(ap->fsname, GFP_KERNEL); > > - if (!mp->m_fsname) > > - goto out; > > - > > - if (ap->rtname[0]) { > > - mp->m_rtname = kstrdup(ap->rtname, GFP_KERNEL); > > - if (!mp->m_rtname) > > - goto out_free_fsname; > > - > > - } > > - > > - if (ap->logname[0]) { > > - mp->m_logname = kstrdup(ap->logname, GFP_KERNEL); > > - if (!mp->m_logname) > > - goto out_free_rtname; > > - } > > - > > - if (ap->flags & XFSMNT_WSYNC) > > - mp->m_flags |= XFS_MOUNT_WSYNC; > > -#if XFS_BIG_INUMS > > - if (ap->flags & XFSMNT_INO64) { > > - mp->m_flags |= XFS_MOUNT_INO64; > > - mp->m_inoadd = XFS_INO64_OFFSET; > > - } > > -#endif > > - if (ap->flags & XFSMNT_RETERR) > > - mp->m_flags |= XFS_MOUNT_RETERR; > > - if (ap->flags & XFSMNT_NOALIGN) > > - mp->m_flags |= XFS_MOUNT_NOALIGN; > > - if (ap->flags & XFSMNT_SWALLOC) > > - mp->m_flags |= XFS_MOUNT_SWALLOC; > > - if (ap->flags & XFSMNT_OSYNCISOSYNC) > > - mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; > > - if (ap->flags & XFSMNT_32BITINODES) > > - mp->m_flags |= XFS_MOUNT_32BITINODES; > > - > > - if (ap->flags & XFSMNT_IOSIZE) { > > - if (ap->iosizelog > XFS_MAX_IO_LOG || > > - ap->iosizelog < XFS_MIN_IO_LOG) { > > - cmn_err(CE_WARN, > > - "XFS: invalid log iosize: %d [not %d-%d]", > > - ap->iosizelog, XFS_MIN_IO_LOG, > > - XFS_MAX_IO_LOG); > > - return XFS_ERROR(EINVAL); > > - } > > - > > - mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; > > - mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; > > - } > > - > > - if (ap->flags & XFSMNT_IKEEP) > > - mp->m_flags |= XFS_MOUNT_IKEEP; > > - if (ap->flags & XFSMNT_DIRSYNC) > > - mp->m_flags |= XFS_MOUNT_DIRSYNC; > > - if (ap->flags & XFSMNT_ATTR2) > > - mp->m_flags |= XFS_MOUNT_ATTR2; > > - if (ap->flags & XFSMNT_NOATTR2) > > - mp->m_flags |= XFS_MOUNT_NOATTR2; > > - > > - if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) > > - mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > > - > > - /* > > - * no recovery flag requires a read-only mount > > - */ > > - if (ap->flags & XFSMNT_NORECOVERY) { > > - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { > > - cmn_err(CE_WARN, > > - "XFS: tried to mount a FS read-write without recovery!"); > > - return XFS_ERROR(EINVAL); > > - } > > - mp->m_flags |= XFS_MOUNT_NORECOVERY; > > - } > > - > > - if (ap->flags & XFSMNT_NOUUID) > > - mp->m_flags |= XFS_MOUNT_NOUUID; > > - if (ap->flags & XFSMNT_BARRIER) > > - mp->m_flags |= XFS_MOUNT_BARRIER; > > - else > > - mp->m_flags &= ~XFS_MOUNT_BARRIER; > > - > > - if (ap->flags2 & XFSMNT2_FILESTREAMS) > > - mp->m_flags |= XFS_MOUNT_FILESTREAMS; > > - > > - if (ap->flags & XFSMNT_DMAPI) > > - mp->m_flags |= XFS_MOUNT_DMAPI; > > - return 0; > > - > > - > > - out_free_rtname: > > - kfree(mp->m_rtname); > > - out_free_fsname: > > - kfree(mp->m_fsname); > > - out: > > - return error; > > -} > > - > > -/* > > - * This function fills in xfs_mount_t fields based on mount args. > > * Note: the superblock _has_ now been read in. > > */ > > STATIC int > > xfs_finish_flags( > > - struct xfs_mount_args *ap, > > struct xfs_mount *mp) > > { > > int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); > > > > /* Fail a mount where the logbuf is smaller then the log stripe */ > > if (xfs_sb_version_haslogv2(&mp->m_sb)) { > > - if ((ap->logbufsize <= 0) && > > - (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { > > + if (mp->m_logbsize <= 0 && > > + mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { > > mp->m_logbsize = mp->m_sb.sb_logsunit; > > - } else if (ap->logbufsize > 0 && > > - ap->logbufsize < mp->m_sb.sb_logsunit) { > > + } else if (mp->m_logbsize > 0 && > > + mp->m_logbsize < mp->m_sb.sb_logsunit) { > > cmn_err(CE_WARN, > > "XFS: logbuf size must be greater than or equal to log stripe size"); > > return XFS_ERROR(EINVAL); > > } > > } else { > > /* Fail a mount if the logbuf is larger than 32K */ > > - if (ap->logbufsize > XLOG_BIG_RECORD_BSIZE) { > > + if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { > > cmn_err(CE_WARN, > > "XFS: logbuf size for version 1 logs must be 16K or 32K"); > > return XFS_ERROR(EINVAL); > > @@ -1591,7 +1495,7 @@ xfs_finish_flags( > > * told by noattr2 to turn it off > > */ > > if (xfs_sb_version_hasattr2(&mp->m_sb) && > > - !(ap->flags & XFSMNT_NOATTR2)) > > + !(mp->m_flags & XFS_MOUNT_NOATTR2)) > > mp->m_flags |= XFS_MOUNT_ATTR2; > > > > /* > > @@ -1603,6 +1507,7 @@ xfs_finish_flags( > > return XFS_ERROR(EROFS); > > } > > > > +#if 0 /* shared mounts were never supported on Linux */ > > /* > > * check for shared mount. > > */ > > @@ -1625,25 +1530,11 @@ xfs_finish_flags( > > /* > > * Shared XFS V0 can't deal with DMI. Return EINVAL. > > */ > > - if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI)) > > + if (mp->m_sb.sb_shared_vn == 0 && > > + (mp->m_flags & XFS_MOUNT_DMAPI)) > > return XFS_ERROR(EINVAL); > > } > > - > > - if (ap->flags & XFSMNT_UQUOTA) { > > - mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); > > - if (ap->flags & XFSMNT_UQUOTAENF) > > - mp->m_qflags |= XFS_UQUOTA_ENFD; > > - } > > - > > - if (ap->flags & XFSMNT_GQUOTA) { > > - mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); > > - if (ap->flags & XFSMNT_GQUOTAENF) > > - mp->m_qflags |= XFS_OQUOTA_ENFD; > > - } else if (ap->flags & XFSMNT_PQUOTA) { > > - mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); > > - if (ap->flags & XFSMNT_PQUOTAENF) > > - mp->m_qflags |= XFS_OQUOTA_ENFD; > > - } > > +#endif > > > > return 0; > > } > > @@ -1656,16 +1547,12 @@ xfs_fs_fill_super( > > { > > struct inode *root; > > struct xfs_mount *mp = NULL; > > - struct xfs_mount_args *args; > > int flags = 0, error = ENOMEM; > > - > > - args = xfs_args_allocate(sb, silent); > > - if (!args) > > - return -ENOMEM; > > + char *mtpt = NULL; > > > > mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); > > if (!mp) > > - goto out_free_args; > > + goto out; > > > > spin_lock_init(&mp->m_sb_lock); > > mutex_init(&mp->m_ilock); > > @@ -1678,12 +1565,9 @@ xfs_fs_fill_super( > > mp->m_super = sb; > > sb->s_fs_info = mp; > > > > - if (sb->s_flags & MS_RDONLY) > > - mp->m_flags |= XFS_MOUNT_RDONLY; > > - > > - error = xfs_parseargs(mp, (char *)data, args, 0); > > + error = xfs_parseargs(mp, (char *)data, &mtpt); > > if (error) > > - goto out_free_mp; > > + goto out_free_fsname; > > > > sb_min_blocksize(sb, BBSIZE); > > sb->s_xattr = xfs_xattr_handlers; > > @@ -1691,33 +1575,28 @@ xfs_fs_fill_super( > > sb->s_qcop = &xfs_quotactl_operations; > > sb->s_op = &xfs_super_operations; > > > > - error = xfs_dmops_get(mp, args); > > + error = xfs_dmops_get(mp); > > if (error) > > - goto out_free_mp; > > - error = xfs_qmops_get(mp, args); > > + goto out_free_fsname; > > + error = xfs_qmops_get(mp); > > if (error) > > goto out_put_dmops; > > > > - if (args->flags & XFSMNT_QUIET) > > + if (silent) > > flags |= XFS_MFSI_QUIET; > > > > - error = xfs_open_devices(mp, args); > > + error = xfs_open_devices(mp); > > if (error) > > goto out_put_qmops; > > > > if (xfs_icsb_init_counters(mp)) > > mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; > > > > - /* > > - * Setup flags based on mount(2) options and then the superblock > > - */ > > - error = xfs_start_flags(args, mp); > > - if (error) > > - goto out_free_fsname; > > error = xfs_readsb(mp, flags); > > if (error) > > - goto out_free_fsname; > > - error = xfs_finish_flags(args, mp); > > + goto out_destroy_counters; > > + > > + error = xfs_finish_flags(mp); > > if (error) > > goto out_free_sb; > > > > @@ -1736,7 +1615,7 @@ xfs_fs_fill_super( > > if (error) > > goto out_filestream_unmount; > > > > - XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname); > > + XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, mtpt, mp->m_fsname); > > > > sb->s_dirt = 1; > > sb->s_magic = XFS_SB_MAGIC; > > @@ -1769,27 +1648,27 @@ xfs_fs_fill_super( > > goto fail_vnrele; > > } > > > > - xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); > > + kfree(mtpt); > > > > - kfree(args); > > + xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); > > return 0; > > > > out_filestream_unmount: > > xfs_filestream_unmount(mp); > > out_free_sb: > > xfs_freesb(mp); > > - out_free_fsname: > > - xfs_free_fsname(mp); > > + out_destroy_counters: > > xfs_icsb_destroy_counters(mp); > > xfs_close_devices(mp); > > out_put_qmops: > > xfs_qmops_put(mp); > > out_put_dmops: > > xfs_dmops_put(mp); > > - out_free_mp: > > + out_free_fsname: > > + xfs_free_fsname(mp); > > + kfree(mtpt); > > kfree(mp); > > - out_free_args: > > - kfree(args); > > + out: > > return -error; > > > > fail_vnrele: > > Index: linux-2.6-xfs/fs/xfs/xfs_clnt.h > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_clnt.h 2008-05-25 16:23:44.000000000 +0200 > > +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 > > @@ -1,105 +0,0 @@ > > -/* > > - * Copyright (c) 2000-2005 Silicon Graphics, Inc. > > - * All Rights Reserved. > > - * > > - * This program is free software; you can redistribute it and/or > > - * modify it under the terms of the GNU General Public License as > > - * published by the Free Software Foundation. > > - * > > - * This program is distributed in the hope that it would be useful, > > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > - * GNU General Public License for more details. > > - * > > - * You should have received a copy of the GNU General Public License > > - * along with this program; if not, write the Free Software Foundation, > > - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > - */ > > -#ifndef __XFS_CLNT_H__ > > -#define __XFS_CLNT_H__ > > - > > -/* > > - * XFS arguments structure, constructed from the arguments we > > - * are passed via the mount system call. > > - * > > - * NOTE: The mount system call is handled differently between > > - * Linux and IRIX. In IRIX we worked work with a binary data > > - * structure coming in across the syscall interface from user > > - * space (the mount userspace knows about each filesystem type > > - * and the set of valid options for it, and converts the users > > - * argument string into a binary structure _before_ making the > > - * system call), and the ABI issues that this implies. > > - * > > - * In Linux, we are passed a comma separated set of options; > > - * ie. a NULL terminated string of characters. Userspace mount > > - * code does not have any knowledge of mount options expected by > > - * each filesystem type and so each filesystem parses its mount > > - * options in kernel space. > > - * > > - * For the Linux port, we kept this structure pretty much intact > > - * and use it internally (because the existing code groks it). > > - */ > > -struct xfs_mount_args { > > - int flags; /* flags -> see XFSMNT_... macros below */ > > - int flags2; /* flags -> see XFSMNT2_... macros below */ > > - int logbufs; /* Number of log buffers, -1 to default */ > > - int logbufsize; /* Size of log buffers, -1 to default */ > > - char fsname[MAXNAMELEN+1]; /* data device name */ > > - char rtname[MAXNAMELEN+1]; /* realtime device filename */ > > - char logname[MAXNAMELEN+1]; /* journal device filename */ > > - char mtpt[MAXNAMELEN+1]; /* filesystem mount point */ > > - int sunit; /* stripe unit (BBs) */ > > - int swidth; /* stripe width (BBs), multiple of sunit */ > > - uchar_t iosizelog; /* log2 of the preferred I/O size */ > > - int ihashsize; /* inode hash table size (buckets) */ > > -}; > > - > > -/* > > - * XFS mount option flags -- args->flags1 > > - */ > > -#define XFSMNT_ATTR2 0x00000001 /* allow ATTR2 EA format */ > > -#define XFSMNT_WSYNC 0x00000002 /* safe mode nfs mount > > - * compatible */ > > -#define XFSMNT_INO64 0x00000004 /* move inode numbers up > > - * past 2^32 */ > > -#define XFSMNT_UQUOTA 0x00000008 /* user quota accounting */ > > -#define XFSMNT_PQUOTA 0x00000010 /* IRIX prj quota accounting */ > > -#define XFSMNT_UQUOTAENF 0x00000020 /* user quota limit > > - * enforcement */ > > -#define XFSMNT_PQUOTAENF 0x00000040 /* IRIX project quota limit > > - * enforcement */ > > -#define XFSMNT_QUIET 0x00000080 /* don't report mount errors */ > > -#define XFSMNT_NOALIGN 0x00000200 /* don't allocate at > > - * stripe boundaries*/ > > -#define XFSMNT_RETERR 0x00000400 /* return error to user */ > > -#define XFSMNT_NORECOVERY 0x00000800 /* no recovery, implies > > - * read-only mount */ > > -#define XFSMNT_SHARED 0x00001000 /* shared XFS mount */ > > -#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */ > > -#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */ > > - /* (osyncisdsync is default) */ > > -#define XFSMNT_NOATTR2 0x00008000 /* turn off ATTR2 EA format */ > > -#define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32 > > - * bits of address space */ > > -#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */ > > -#define XFSMNT_GQUOTAENF 0x00800000 /* group quota limit > > - * enforcement */ > > -#define XFSMNT_NOUUID 0x01000000 /* Ignore fs uuid */ > > -#define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */ > > -#define XFSMNT_BARRIER 0x04000000 /* use write barriers */ > > -#define XFSMNT_IKEEP 0x08000000 /* inode cluster delete */ > > -#define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width > > - * allocation */ > > -#define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename > > - * symlink,mkdir,rmdir,mknod */ > > -#define XFSMNT_FLAGS2 0x80000000 /* more flags set in flags2 */ > > - > > -/* > > - * XFS mount option flags -- args->flags2 > > - */ > > -#define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred > > - * I/O size in stat(2) */ > > -#define XFSMNT2_FILESTREAMS 0x00000002 /* enable the filestreams > > - * allocator */ > > - > > -#endif /* __XFS_CLNT_H__ */ > > Index: linux-2.6-xfs/fs/xfs/xfs_dmops.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_dmops.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_dmops.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -25,7 +25,6 @@ > > #include "xfs_inum.h" > > #include "xfs_ag.h" > > #include "xfs_mount.h" > > -#include "xfs_clnt.h" > > > > > > static struct xfs_dmops xfs_dmcore_stub = { > > @@ -38,9 +37,9 @@ static struct xfs_dmops xfs_dmcore_stub > > }; > > > > int > > -xfs_dmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) > > +xfs_dmops_get(struct xfs_mount *mp) > > { > > - if (args->flags & XFSMNT_DMAPI) { > > + if (mp->m_flags & XFS_MOUNT_DMAPI) { > > struct xfs_dmops *ops; > > > > ops = symbol_get(xfs_dmcore_xfs); > > Index: linux-2.6-xfs/fs/xfs/xfs_mount.h > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-05-25 16:23:58.000000000 +0200 > > @@ -540,9 +540,9 @@ extern void xfs_sb_from_disk(struct xfs_ > > extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); > > extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); > > > > -extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); > > +extern int xfs_dmops_get(struct xfs_mount *); > > extern void xfs_dmops_put(struct xfs_mount *); > > -extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); > > +extern int xfs_qmops_get(struct xfs_mount *); > > extern void xfs_qmops_put(struct xfs_mount *); > > > > extern struct xfs_dmops xfs_dmcore_xfs; > > Index: linux-2.6-xfs/fs/xfs/xfs_qmops.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_qmops.c 2008-05-25 16:23:45.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_qmops.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -28,7 +28,6 @@ > > #include "xfs_mount.h" > > #include "xfs_quota.h" > > #include "xfs_error.h" > > -#include "xfs_clnt.h" > > > > > > STATIC struct xfs_dquot * > > @@ -131,9 +130,11 @@ static struct xfs_qmops xfs_qmcore_stub > > }; > > > > int > > -xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) > > +xfs_qmops_get(struct xfs_mount *mp) > > { > > - if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) { > > + if (mp->m_qflags & (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) { > > struct xfs_qmops *ops; > > > > ops = symbol_get(xfs_qmcore_xfs); > > Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -49,7 +49,6 @@ > > #include "xfs_extfree_item.h" > > #include "xfs_acl.h" > > #include "xfs_attr.h" > > -#include "xfs_clnt.h" > > #include "xfs_mru_cache.h" > > #include "xfs_filestream.h" > > #include "xfs_fsops.h" > > Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -21,7 +21,6 @@ > > #include "xfs_bit.h" > > #include "xfs_log.h" > > #include "xfs_inum.h" > > -#include "xfs_clnt.h" > > #include "xfs_trans.h" > > #include "xfs_sb.h" > > #include "xfs_ag.h" > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -22,7 +22,6 @@ > > #include "xfs_log.h" > > #include "xfs_imap.h" > > #include "xfs_inum.h" > > -#include "xfs_clnt.h" > > #include "xfs_trans.h" > > #include "xfs_sb.h" > > #include "xfs_ag.h" > > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -20,7 +20,6 @@ > > #include "xfs_bit.h" > > #include "xfs_log.h" > > #include "xfs_inum.h" > > -#include "xfs_clnt.h" > > #include "xfs_trans.h" > > #include "xfs_sb.h" > > #include "xfs_ag.h" > > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_bhv.c 2008-05-25 16:23:44.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c 2008-05-25 16:23:58.000000000 +0200 > > @@ -20,7 +20,6 @@ > > #include "xfs_bit.h" > > #include "xfs_log.h" > > #include "xfs_inum.h" > > -#include "xfs_clnt.h" > > #include "xfs_trans.h" > > #include "xfs_sb.h" > > #include "xfs_ag.h" > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Thu Aug 28 16:17:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 16:17:44 -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 (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 m7SNHeZ2029915 for ; Thu, 28 Aug 2008 16:17:40 -0700 X-ASG-Debug-ID: 1219965543-0e1d01360000-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 BA2843E2A78 for ; Thu, 28 Aug 2008 16:19:03 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id F37eqxMfF5eDa4OJ for ; Thu, 28 Aug 2008 16:19:03 -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 m7SNJ4IF019892 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 29 Aug 2008 01:19:04 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7SNJ4BD019890 for xfs@oss.sgi.com; Fri, 29 Aug 2008 01:19:04 +0200 Date: Fri, 29 Aug 2008 01:19:04 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] fix biosize option Subject: Re: [PATCH 4/4] fix biosize option Message-ID: <20080828231904.GD19757@lst.de> References: <20080525190754.GD13372@lst.de> <20080723080520.GC3417@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723080520.GC3417@lst.de> 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: 1219965544 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.4003 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8112/Thu Aug 28 14:27:00 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17754 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 ping^2? On Wed, Jul 23, 2008 at 10:05:20AM +0200, Christoph Hellwig wrote: > ping? > > On Sun, May 25, 2008 at 09:07:54PM +0200, Christoph Hellwig wrote: > > iosizelog shouldn't be the same as iosize but the logarithm of it. Then > > again the current biosize option doesn't make much sense to me as it > > doesn't set the preferred I/O size as mentioned in the comment next to > > it but rather the allocation size and thus is identical to the allocsize > > option (except for the missing logarithm). It's also not documented in > > Documentation/filesystems/xfs.txt or the mount manpage. > > > > > > Signed-off-by: Christoph Hellwig > > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:59:04.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:59:38.000000000 +0200 > > @@ -252,7 +252,7 @@ xfs_parseargs( > > return EINVAL; > > } > > iosize = simple_strtoul(value, &eov, 10); > > - iosizelog = (uint8_t) iosize; > > + iosizelog = ffs(iosize) - 1; > > } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { > > if (!value || !*value) { > > cmn_err(CE_WARN, > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Thu Aug 28 18:19:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 18:19:18 -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=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7T1JCXW010789 for ; Thu, 28 Aug 2008 18:19:13 -0700 Received: from [134.14.55.216] (wererabbit.melbourne.sgi.com [134.14.55.216]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA03657; Fri, 29 Aug 2008 11:20:27 +1000 Message-ID: <48B74EDB.7060407@sgi.com> Date: Fri, 29 Aug 2008 11:20:27 +1000 From: Peter Leckie User-Agent: Thunderbird 1.5.0.10 (X11/20070305) MIME-Version: 1.0 To: David Chinner CC: Christoph Hellwig , Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [2.6.27-rc4] XFS i_lock vs i_iolock... 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> <20080826193508.GA17542@infradead.org> In-Reply-To: <20080826193508.GA17542@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/8113/Thu Aug 28 16:49:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17755 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pleckie@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Looks good. We probably don't need the #ifdef DEBUG as ASSERT is > debug-only anyway. Hey Dave did you want to update the patch? From owner-xfs@oss.sgi.com Thu Aug 28 18:35:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 18:36:01 -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 (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 m7T1Zw2C012481 for ; Thu, 28 Aug 2008 18:35:58 -0700 X-ASG-Debug-ID: 1219973841-440203000000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 75A15FDFADB for ; Thu, 28 Aug 2008 18:37:21 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Rn6HtkoXaPcNfjeA for ; Thu, 28 Aug 2008 18:37:21 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvcDAPjttkh5LD0wiGdsb2JhbACSQAEBAQ8gp2yBag X-IronPort-AV: E=Sophos;i="4.32,289,1217773800"; d="scan'208";a="182686424" Received: from ppp121-44-61-48.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.61.48]) by ipmail01.adl6.internode.on.net with ESMTP; 29 Aug 2008 11:07:09 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KYsvE-0007Ur-E8; Fri, 29 Aug 2008 11:37:08 +1000 Date: Fri, 29 Aug 2008 11:37:08 +1000 From: Dave Chinner To: Peter Leckie Cc: Christoph Hellwig , Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Christoph Hellwig , 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: <20080829013708.GD6016@disturbed> Mail-Followup-To: Peter Leckie , Christoph Hellwig , Peter Zijlstra , Lachlan McIlroy , Daniel J Blueman , Christoph Hellwig , xfs@oss.sgi.com 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> <20080826193508.GA17542@infradead.org> <48B74EDB.7060407@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48B74EDB.7060407@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1219973842 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: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.4012 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/8113/Thu Aug 28 16:49:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17756 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Aug 29, 2008 at 11:20:27AM +1000, Peter Leckie wrote: > Christoph Hellwig wrote: >> Looks good. We probably don't need the #ifdef DEBUG as ASSERT is >> debug-only anyway. > Hey Dave did you want to update the patch? Below. -- Dave Chinner david@fromorbit.com 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. Signed-off-by: Dave Chinner --- fs/xfs/xfs_dfrag.c | 9 ++++++++- fs/xfs/xfs_vnodeops.c | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 760f4c5..75b0cd4 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c @@ -149,7 +149,14 @@ xfs_swap_extents( sbp = &sxp->sx_stat; - xfs_lock_two_inodes(ip, tip, lock_flags); + /* + * we have to do two separate lock calls here to keep lockdep + * happy. If we try to get all the locks in one call, lock will + * report false positives when we drop the ILOCK and regain them + * below. + */ + xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); + xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); locked = 1; /* Verify that both files have the same format */ diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 883b8b1..ac2e4e9 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -1836,6 +1836,12 @@ again: #endif } +/* + * xfs_lock_two_inodes() can only be used to lock one type of lock + * at a time - the iolock or the ilock, but not both at once. If + * we lock both at once, lockdep will report false positives saying + * we have violated locking orders. + */ void xfs_lock_two_inodes( xfs_inode_t *ip0, @@ -1846,6 +1852,8 @@ xfs_lock_two_inodes( int attempts = 0; xfs_log_item_t *lp; + if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) + ASSERT((lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) == 0); ASSERT(ip0->i_ino != ip1->i_ino); if (ip0->i_ino > ip1->i_ino) { From owner-xfs@oss.sgi.com Thu Aug 28 18:59:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 18:59:41 -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=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7T1xaxS014632 for ; Thu, 28 Aug 2008 18:59:38 -0700 Received: from chapter11.melbourne.sgi.com (chapter11.melbourne.sgi.com [134.14.54.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA04446; Fri, 29 Aug 2008 12:00:59 +1000 Received: by chapter11.melbourne.sgi.com (Postfix, from userid 16380) id 16E3F3D642A7; Fri, 29 Aug 2008 12:00:59 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 986238 - Prevent lockdep false positives when locking two inodes. Message-Id: <20080829020059.16E3F3D642A7@chapter11.melbourne.sgi.com> Date: Fri, 29 Aug 2008 12:00:59 +1000 (EST) From: pleckie@sgi.com (Peter Leckie) X-Virus-Scanned: ClamAV 0.91.2/8113/Thu Aug 28 16:49:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17757 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pleckie@sgi.com Precedence: bulk X-list: 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. Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Date: Fri Aug 29 11:53:42 AEST 2008 Workarea: chapter11.melbourne.sgi.com:/scratch/pleckie/2.6.x-xfs Inspected by: pleckie,david@fromorbit.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31999a fs/xfs/xfs_vnodeops.c - 1.773 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.773&r2=text&tr2=1.772&f=h - Prevent lockdep false positives when locking two inodes. fs/xfs/xfs_dfrag.c - 1.72 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.72&r2=text&tr2=1.71&f=h - Prevent lockdep false positives when locking two inodes. From owner-xfs@oss.sgi.com Thu Aug 28 23:17:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 23:17:54 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7T6HNF7007730 for ; Thu, 28 Aug 2008 23:17:24 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA08803; Fri, 29 Aug 2008 16:18:45 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id D036358C52AB; Fri, 29 Aug 2008 16:18:44 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 981498 - Cleanup more dir v1 macros and stuff Message-Id: <20080829061844.D036358C52AB@chook.melbourne.sgi.com> Date: Fri, 29 Aug 2008 16:18:44 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17758 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Remove final remnants of dirv1 macros and related stuff Date: Fri Aug 29 16:17:50 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/2.6.x-xfs Inspected by: hch@infraread.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:32002a fs/xfs/xfsidbg.c - 1.363 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.363&r2=text&tr2=1.362&f=h - Remove final remnants of dirv1 macros and related stuff fs/xfs/xfs_da_btree.h - 1.71 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_da_btree.h.diff?r1=text&tr1=1.71&r2=text&tr2=1.70&f=h - Remove final remnants of dirv1 macros and related stuff fs/xfs/xfs_mount.h - 1.275 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.275&r2=text&tr2=1.274&f=h - Remove final remnants of dirv1 macros and related stuff From owner-xfs@oss.sgi.com Thu Aug 28 23:57:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 28 Aug 2008 23:57:21 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7T6vFk0011216 for ; Thu, 28 Aug 2008 23:57:16 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA09658 for ; Fri, 29 Aug 2008 16:58:39 +1000 Date: Fri, 29 Aug 2008 17:00:56 +1000 To: "xfs@oss.sgi.com" Subject: [REVIEW #2] Update kernel code to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17759 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Mostly header changes associated with #ifdef __KERNEL__ stuff. Some function prototypes had to be reordered to separate shared and kernel only functions. One thing I don't have clear confirmation on yet is this change: static inline int xfs_lowbit32(__uint32_t v) { - unsigned long t = v; - return (v) ? find_first_bit(&t, 32) : -1; + return ffs(v) - 1; } --- fs/xfs/xfs_ag.h | 2 fs/xfs/xfs_alloc.c | 2 fs/xfs/xfs_alloc.h | 4 + fs/xfs/xfs_arch.h | 39 +++++++--- fs/xfs/xfs_bit.h | 3 fs/xfs/xfs_bmap.h | 35 +++++---- fs/xfs/xfs_bmap_btree.h | 3 fs/xfs/xfs_btree.h | 4 - fs/xfs/xfs_da_btree.h | 4 - fs/xfs/xfs_ialloc.h | 3 fs/xfs/xfs_imap.h | 2 fs/xfs/xfs_inode.h | 178 ++++++++++++++++++++++++------------------------ fs/xfs/xfs_inode_item.h | 5 - fs/xfs/xfs_mount.h | 9 +- fs/xfs/xfs_trans.h | 5 - 15 files changed, 161 insertions(+), 137 deletions(-) Index: 2.6.x-xfs/fs/xfs/xfs_ag.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_ag.h +++ 2.6.x-xfs/fs/xfs/xfs_ag.h @@ -196,11 +196,13 @@ typedef struct xfs_perag spinlock_t pagb_lock; /* lock for pagb_list */ #endif xfs_perag_busy_t *pagb_list; /* unstable blocks */ +#ifdef __KERNEL__ atomic_t pagf_fstrms; /* # of filestreams active in this AG */ int pag_ici_init; /* incore inode cache initialised */ rwlock_t pag_ici_lock; /* incore inode lock */ struct radix_tree_root pag_ici_root; /* incore inode cache root */ +#endif } xfs_perag_t; #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) Index: 2.6.x-xfs/fs/xfs/xfs_alloc.c =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_alloc.c +++ 2.6.x-xfs/fs/xfs/xfs_alloc.c @@ -2185,6 +2185,7 @@ xfs_alloc_read_agf( be32_to_cpu(agf->agf_magicnum) == XFS_AGF_MAGIC && XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) && be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) && + be32_to_cpu(agf->agf_btreeblks) <= be32_to_cpu(agf->agf_length) && be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp); @@ -2213,6 +2214,7 @@ xfs_alloc_read_agf( #ifdef DEBUG else if (!XFS_FORCED_SHUTDOWN(mp)) { ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks)); + ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks)); ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount)); ASSERT(pag->pagf_longest == be32_to_cpu(agf->agf_longest)); ASSERT(pag->pagf_levels[XFS_BTNUM_BNOi] == Index: 2.6.x-xfs/fs/xfs/xfs_alloc.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_alloc.h +++ 2.6.x-xfs/fs/xfs/xfs_alloc.h @@ -121,6 +121,8 @@ extern ktrace_t *xfs_alloc_trace_buf; #define XFS_ALLOC_KTRACE_BUSYSEARCH 6 #endif +#endif /* __KERNEL__ */ + /* * Compute and fill in value of m_ag_maxlevels. */ @@ -196,6 +198,8 @@ xfs_free_extent( xfs_fsblock_t bno, /* starting block number of extent */ xfs_extlen_t len); /* length of extent */ +#ifdef __KERNEL__ + void xfs_alloc_mark_busy(xfs_trans_t *tp, xfs_agnumber_t agno, Index: 2.6.x-xfs/fs/xfs/xfs_arch.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_arch.h +++ 2.6.x-xfs/fs/xfs/xfs_arch.h @@ -41,21 +41,36 @@ #endif #ifdef XFS_NATIVE_HOST -#define cpu_to_be16(val) ((__be16)(val)) -#define cpu_to_be32(val) ((__be32)(val)) -#define cpu_to_be64(val) ((__be64)(val)) -#define be16_to_cpu(val) ((__uint16_t)(val)) -#define be32_to_cpu(val) ((__uint32_t)(val)) -#define be64_to_cpu(val) ((__uint64_t)(val)) +#define cpu_to_be16(val) ((__force __be16)(__u16)(val)) +#define cpu_to_be32(val) ((__force __be32)(__u32)(val)) +#define cpu_to_be64(val) ((__force __be64)(__u64)(val)) +#define be16_to_cpu(val) ((__force __u16)(__be16)(val)) +#define be32_to_cpu(val) ((__force __u32)(__be32)(val)) +#define be64_to_cpu(val) ((__force __u64)(__be64)(val)) #else -#define cpu_to_be16(val) (__swab16((__uint16_t)(val))) -#define cpu_to_be32(val) (__swab32((__uint32_t)(val))) -#define cpu_to_be64(val) (__swab64((__uint64_t)(val))) -#define be16_to_cpu(val) (__swab16((__be16)(val))) -#define be32_to_cpu(val) (__swab32((__be32)(val))) -#define be64_to_cpu(val) (__swab64((__be64)(val))) +#define cpu_to_be16(val) ((__force __be16)__swab16((__u16)(val))) +#define cpu_to_be32(val) ((__force __be32)__swab32((__u32)(val))) +#define cpu_to_be64(val) ((__force __be64)__swab64((__u64)(val))) +#define be16_to_cpu(val) (__swab16((__force __u16)(__be16)(val))) +#define be32_to_cpu(val) (__swab32((__force __u32)(__be32)(val))) +#define be64_to_cpu(val) (__swab64((__force __u64)(__be64)(val))) #endif +static inline void be16_add_cpu(__be16 *a, __s16 b) +{ + *a = cpu_to_be16(be16_to_cpu(*a) + b); +} + +static inline void be32_add_cpu(__be32 *a, __s32 b) +{ + *a = cpu_to_be32(be32_to_cpu(*a) + b); +} + +static inline void be64_add_cpu(__be64 *a, __s64 b) +{ + *a = cpu_to_be64(be64_to_cpu(*a) + b); +} + #endif /* __KERNEL__ */ /* do we need conversion? */ Index: 2.6.x-xfs/fs/xfs/xfs_bit.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bit.h +++ 2.6.x-xfs/fs/xfs/xfs_bit.h @@ -61,8 +61,7 @@ static inline int xfs_highbit64(__uint64 /* Get low bit set out of 32-bit argument, -1 if none set */ static inline int xfs_lowbit32(__uint32_t v) { - unsigned long t = v; - return (v) ? find_first_bit(&t, 32) : -1; + return ffs(v) - 1; } /* Get low bit set out of 64-bit argument, -1 if none set */ Index: 2.6.x-xfs/fs/xfs/xfs_bmap.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bmap.h +++ 2.6.x-xfs/fs/xfs/xfs_bmap.h @@ -137,9 +137,7 @@ typedef struct xfs_bmalloca { char conv; /* overwriting unwritten extents */ } xfs_bmalloca_t; -#ifdef __KERNEL__ - -#if defined(XFS_BMAP_TRACE) +#if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) /* * Trace operations for bmap extent tracing */ @@ -163,9 +161,12 @@ xfs_bmap_trace_exlist( int whichfork); /* data or attr fork */ #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ xfs_bmap_trace_exlist(__func__,ip,c,w) -#else + +#else /* __KERNEL__ && XFS_BMAP_TRACE */ + #define XFS_BMAP_TRACE_EXLIST(ip,c,w) -#endif + +#endif /* __KERNEL__ && XFS_BMAP_TRACE */ /* * Convert inode from non-attributed to attributed. @@ -205,6 +206,7 @@ xfs_bmap_compute_maxlevels( struct xfs_mount *mp, /* file system mount structure */ int whichfork); /* data or attr fork */ +#ifdef __KERNEL__ /* * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi * caller. Frees all the extents that need freeing, which must be done @@ -218,6 +220,7 @@ xfs_bmap_finish( struct xfs_trans **tp, /* transaction pointer addr */ xfs_bmap_free_t *flist, /* i/o: list extents to free */ int *committed); /* xact committed or not */ +#endif /* * Returns the file-relative block number of the first unused block in the file. @@ -344,6 +347,18 @@ xfs_bunmapi( int *done); /* set if not done yet */ /* + * Check an extent list, which has just been read, for + * any bit in the extent flag field. + */ +int +xfs_check_nostate_extents( + struct xfs_ifork *ifp, + xfs_extnum_t idx, + xfs_extnum_t num); + +#ifdef __KERNEL__ + +/* * Fcntl interface to xfs_bmapi. */ int /* error code */ @@ -375,16 +390,6 @@ xfs_bmap_count_blocks( int *count); /* - * Check an extent list, which has just been read, for - * any bit in the extent flag field. - */ -int -xfs_check_nostate_extents( - struct xfs_ifork *ifp, - xfs_extnum_t idx, - xfs_extnum_t num); - -/* * Search the extent records for the entry containing block bno. * If bno lies in a hole, point to the next entry. If bno lies * past eof, *eofp will be set, and *prevp will contain the last Index: 2.6.x-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bmap_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_bmap_btree.h @@ -250,6 +250,8 @@ typedef struct xfs_btree_lblock xfs_bmbt extern ktrace_t *xfs_bmbt_trace_buf; #endif +#endif /* __KERNEL__ */ + /* * Prototypes for xfs_bmap.c to call. */ @@ -300,6 +302,5 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_bl extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); -#endif /* __KERNEL__ */ #endif /* __XFS_BMAP_BTREE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_btree.h @@ -186,8 +186,6 @@ typedef struct xfs_btree_cur #define XFS_BUF_TO_SBLOCK(bp) ((xfs_btree_sblock_t *)XFS_BUF_PTR(bp)) -#ifdef __KERNEL__ - #ifdef DEBUG /* * Debug routine: check that block header is ok. @@ -436,8 +434,6 @@ xfs_btree_setbuf( int lev, /* level in btree */ struct xfs_buf *bp); /* new buffer to set */ -#endif /* __KERNEL__ */ - /* * Min and max functions for extlen, agblock, fileoff, and filblks types. Index: 2.6.x-xfs/fs/xfs/xfs_da_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_da_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_da_btree.h @@ -206,9 +206,8 @@ struct xfs_nameops { }; -#ifdef __KERNEL__ /*======================================================================== - * Function prototypes for the kernel. + * Function prototypes. *========================================================================*/ /* @@ -269,6 +268,5 @@ xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *da extern struct kmem_zone *xfs_da_state_zone; extern struct kmem_zone *xfs_dabuf_zone; -#endif /* __KERNEL__ */ #endif /* __XFS_DA_BTREE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_ialloc.h +++ 2.6.x-xfs/fs/xfs/xfs_ialloc.h @@ -56,7 +56,6 @@ static inline int xfs_ialloc_find_free(x } -#ifdef __KERNEL__ /* * Allocate an inode on disk. * Mode is used to tell whether the new inode will need space, and whether @@ -154,6 +153,4 @@ xfs_ialloc_pagi_init( struct xfs_trans *tp, /* transaction pointer */ xfs_agnumber_t agno); /* allocation group number */ -#endif /* __KERNEL__ */ - #endif /* __XFS_IALLOC_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_imap.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_imap.h +++ 2.6.x-xfs/fs/xfs/xfs_imap.h @@ -30,11 +30,9 @@ typedef struct xfs_imap { ushort im_boffset; /* inode offset in block in bytes */ } xfs_imap_t; -#ifdef __KERNEL__ struct xfs_mount; struct xfs_trans; int xfs_imap(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_imap_t *, uint); -#endif #endif /* __XFS_IMAP_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h +++ 2.6.x-xfs/fs/xfs/xfs_inode.h @@ -103,34 +103,6 @@ typedef struct xfs_ifork { #define XFS_IMAP_LOOKUP 0x1 #define XFS_IMAP_BULKSTAT 0x2 -#ifdef __KERNEL__ -struct bhv_desc; -struct cred; -struct ktrace; -struct xfs_buf; -struct xfs_bmap_free; -struct xfs_bmbt_irec; -struct xfs_bmbt_block; -struct xfs_inode; -struct xfs_inode_log_item; -struct xfs_mount; -struct xfs_trans; -struct xfs_dquot; - -#if defined(XFS_ILOCK_TRACE) -#define XFS_ILOCK_KTRACE_SIZE 32 -extern ktrace_t *xfs_ilock_trace_buf; -extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); -#else -#define xfs_ilock_trace(i,n,f,ra) -#endif - -typedef struct dm_attrs_s { - __uint32_t da_dmevmask; /* DMIG event mask */ - __uint16_t da_dmstate; /* DMIG state info */ - __uint16_t da_pad; /* DMIG extra padding */ -} dm_attrs_t; - /* * This is the xfs in-core inode structure. * Most of the on-disk inode is embedded in the i_d field. @@ -191,6 +163,34 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; +#ifdef __KERNEL__ +struct bhv_desc; +struct cred; +struct ktrace; +struct xfs_buf; +struct xfs_bmap_free; +struct xfs_bmbt_irec; +struct xfs_bmbt_block; +struct xfs_inode; +struct xfs_inode_log_item; +struct xfs_mount; +struct xfs_trans; +struct xfs_dquot; + +#if defined(XFS_ILOCK_TRACE) +#define XFS_ILOCK_KTRACE_SIZE 32 +extern ktrace_t *xfs_ilock_trace_buf; +extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); +#else +#define xfs_ilock_trace(i,n,f,ra) +#endif + +typedef struct dm_attrs_s { + __uint32_t da_dmevmask; /* DMIG event mask */ + __uint16_t da_dmstate; /* DMIG state info */ + __uint16_t da_pad; /* DMIG extra padding */ +} dm_attrs_t; + typedef struct { struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ @@ -327,6 +327,27 @@ xfs_iflags_test_and_clear(xfs_inode_t *i spin_unlock(&ip->i_flags_lock); return ret; } + +/* + * Manage the i_flush queue embedded in the inode. This completion + * queue synchronizes processes attempting to flush the in-core + * inode back to disk. + */ +static inline void xfs_iflock(xfs_inode_t *ip) +{ + wait_for_completion(&ip->i_flush); +} + +static inline int xfs_iflock_nowait(xfs_inode_t *ip) +{ + return try_wait_for_completion(&ip->i_flush); +} + +static inline void xfs_ifunlock(xfs_inode_t *ip) +{ + complete(&ip->i_flush); +} + #endif /* __KERNEL__ */ @@ -487,51 +508,24 @@ void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); int xfs_finish_reclaim_all(struct xfs_mount *, int); +#endif /* __KERNEL__ */ + /* * xfs_inode.c prototypes. */ int xfs_itobp(struct xfs_mount *, struct xfs_trans *, - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, - xfs_daddr_t, uint, uint); -int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, - xfs_inode_t **, xfs_daddr_t, uint); -int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); -int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, - xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, - int, struct xfs_buf **, boolean_t *, xfs_inode_t **); + struct xfs_inode *, struct xfs_dinode **, + struct xfs_buf **, xfs_daddr_t, uint, uint); +int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, int); void xfs_dinode_from_disk(struct xfs_icdinode *, struct xfs_dinode_core *); void xfs_dinode_to_disk(struct xfs_dinode_core *, struct xfs_icdinode *); -uint xfs_ip2xflags(struct xfs_inode *); -uint xfs_dic2xflags(struct xfs_dinode *); -int xfs_ifree(struct xfs_trans *, xfs_inode_t *, - struct xfs_bmap_free *); -int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); -int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, - xfs_fsize_t, int, int); -int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); - -struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); -void xfs_idestroy_fork(xfs_inode_t *, int); -void xfs_idestroy(xfs_inode_t *); -void xfs_idata_realloc(xfs_inode_t *, int, int); -void xfs_iextract(xfs_inode_t *); -void xfs_iext_realloc(xfs_inode_t *, int, int); -void xfs_iroot_realloc(xfs_inode_t *, int, int); -void xfs_ipin(xfs_inode_t *); -void xfs_iunpin(xfs_inode_t *); -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); -int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); -void xfs_ichgtime(xfs_inode_t *, int); -xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); -void xfs_lock_inodes(xfs_inode_t **, int, uint); -void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); - -void xfs_synchronize_atime(xfs_inode_t *); -void xfs_mark_inode_dirty_sync(xfs_inode_t *); +void xfs_idestroy_fork(struct xfs_inode *, int); +void xfs_idata_realloc(struct xfs_inode *, int, int); +void xfs_iroot_realloc(struct xfs_inode *, int, int); +int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, @@ -559,6 +553,38 @@ void xfs_iext_irec_compact_pages(xfs_if void xfs_iext_irec_compact_full(xfs_ifork_t *); void xfs_iext_irec_update_extoffs(xfs_ifork_t *, int, int); +#ifdef __KERNEL__ + +int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, + xfs_inode_t **, xfs_daddr_t, uint); +int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, + xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, + int, struct xfs_buf **, boolean_t *, xfs_inode_t **); + +uint xfs_ip2xflags(struct xfs_inode *); +uint xfs_dic2xflags(struct xfs_dinode *); +int xfs_ifree(struct xfs_trans *, xfs_inode_t *, + struct xfs_bmap_free *); +int xfs_itruncate_start(xfs_inode_t *, uint, xfs_fsize_t); +int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, + xfs_fsize_t, int, int); +int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); + +void xfs_idestroy(xfs_inode_t *); +void xfs_iextract(xfs_inode_t *); +void xfs_iext_realloc(xfs_inode_t *, int, int); +void xfs_ipin(xfs_inode_t *); +void xfs_iunpin(xfs_inode_t *); +int xfs_iflush(xfs_inode_t *, uint); +void xfs_iflush_all(struct xfs_mount *); +void xfs_ichgtime(xfs_inode_t *, int); +xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); +void xfs_lock_inodes(xfs_inode_t **, int, uint); +void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); + +void xfs_synchronize_atime(xfs_inode_t *); +void xfs_mark_inode_dirty_sync(xfs_inode_t *); + #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) #ifdef DEBUG @@ -567,6 +593,8 @@ void xfs_isize_check(struct xfs_mount * #define xfs_isize_check(mp, ip, isize) #endif /* DEBUG */ +#endif /* __KERNEL__ */ + #if defined(DEBUG) void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *); #else @@ -577,26 +605,4 @@ extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; -/* - * Manage the i_flush queue embedded in the inode. This completion - * queue synchronizes processes attempting to flush the in-core - * inode back to disk. - */ -static inline void xfs_iflock(xfs_inode_t *ip) -{ - wait_for_completion(&ip->i_flush); -} - -static inline int xfs_iflock_nowait(xfs_inode_t *ip) -{ - return try_wait_for_completion(&ip->i_flush); -} - -static inline void xfs_ifunlock(xfs_inode_t *ip) -{ - complete(&ip->i_flush); -} - -#endif /* __KERNEL__ */ - #endif /* __XFS_INODE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h +++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h @@ -168,6 +168,8 @@ static inline int xfs_ilog_fext(int w) return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); } +#ifdef __KERNEL__ + static inline int xfs_inode_clean(xfs_inode_t *ip) { return (!ip->i_itemp || @@ -175,9 +177,6 @@ static inline int xfs_inode_clean(xfs_in !ip->i_update_core; } - -#ifdef __KERNEL__ - extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); extern void xfs_inode_item_destroy(struct xfs_inode *); extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *); Index: 2.6.x-xfs/fs/xfs/xfs_mount.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_mount.h +++ 2.6.x-xfs/fs/xfs/xfs_mount.h @@ -508,7 +508,6 @@ typedef struct xfs_mod_sb { #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) -extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern int xfs_log_sbcount(xfs_mount_t *, uint); extern int xfs_mountfs(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); @@ -527,9 +526,6 @@ extern void xfs_freesb(xfs_mount_t *); extern int xfs_fs_writable(xfs_mount_t *); extern int xfs_syncsub(xfs_mount_t *, int, int *); extern int xfs_sync_inodes(xfs_mount_t *, int, int *); -extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); -extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); -extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); @@ -541,4 +537,9 @@ extern struct xfs_dmops xfs_dmcore_xfs; #endif /* __KERNEL__ */ +extern void xfs_mod_sb(struct xfs_trans *, __int64_t); +extern xfs_agnumber_t xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t); +extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); +extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); + #endif /* __XFS_MOUNT_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_trans.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_trans.h +++ 2.6.x-xfs/fs/xfs/xfs_trans.h @@ -928,7 +928,6 @@ typedef struct xfs_trans { /* * XFS transaction mechanism exported interfaces. */ -void xfs_trans_init(struct xfs_mount *); xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *xfs_trans_dup(xfs_trans_t *); @@ -975,7 +974,6 @@ int _xfs_trans_commit(xfs_trans_t *, int *); #define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL) void xfs_trans_cancel(xfs_trans_t *, int); -int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); int xfs_trans_ail_init(struct xfs_mount *); void xfs_trans_ail_destroy(struct xfs_mount *); void xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t); @@ -990,4 +988,7 @@ extern kmem_zone_t *xfs_trans_zone; #endif /* __KERNEL__ */ +void xfs_trans_init(struct xfs_mount *); +int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); + #endif /* __XFS_TRANS_H__ */ From owner-xfs@oss.sgi.com Fri Aug 29 00:55:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 29 Aug 2008 00:55:52 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7T7tkS1022999 for ; Fri, 29 Aug 2008 00:55:49 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA10767 for ; Fri, 29 Aug 2008 17:57:11 +1000 Date: Fri, 29 Aug 2008 17:59:43 +1000 To: "xfs@oss.sgi.com" Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17760 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok wrote: > Mostly header changes associated with #ifdef __KERNEL__ stuff. > > Some function prototypes had to be reordered to separate > shared and kernel only functions. fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing declaration), here's a better version: Index: 2.6.x-xfs/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h +++ 2.6.x-xfs/fs/xfs/xfs_inode.h @@ -131,6 +131,8 @@ typedef struct dm_attrs_s { __uint16_t da_pad; /* DMIG extra padding */ } dm_attrs_t; +#endif /* __KERNEL__ */ + /* * This is the xfs in-core inode structure. * Most of the on-disk inode is embedded in the i_d field. @@ -191,6 +193,8 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; +#ifdef __KERNEL__ + typedef struct { struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ @@ -490,19 +494,12 @@ int xfs_finish_reclaim_all(struct xfs_m /* * xfs_inode.c prototypes. */ -int xfs_itobp(struct xfs_mount *, struct xfs_trans *, - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, - xfs_daddr_t, uint, uint); int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t, uint); int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, int, struct xfs_buf **, boolean_t *, xfs_inode_t **); -void xfs_dinode_from_disk(struct xfs_icdinode *, - struct xfs_dinode_core *); -void xfs_dinode_to_disk(struct xfs_dinode_core *, - struct xfs_icdinode *); uint xfs_ip2xflags(struct xfs_inode *); uint xfs_dic2xflags(struct xfs_dinode *); @@ -514,15 +511,11 @@ int xfs_itruncate_finish(struct xfs_tra int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); -void xfs_idestroy_fork(xfs_inode_t *, int); void xfs_idestroy(xfs_inode_t *); -void xfs_idata_realloc(xfs_inode_t *, int, int); void xfs_iextract(xfs_inode_t *); void xfs_iext_realloc(xfs_inode_t *, int, int); -void xfs_iroot_realloc(xfs_inode_t *, int, int); void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); @@ -532,6 +525,19 @@ void xfs_lock_two_inodes(xfs_inode_t *, void xfs_synchronize_atime(xfs_inode_t *); void xfs_mark_inode_dirty_sync(xfs_inode_t *); +#endif /* __KERNEL__ */ + +int xfs_itobp(struct xfs_mount *, struct xfs_trans *, + xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, + xfs_daddr_t, uint, uint); +void xfs_dinode_from_disk(struct xfs_icdinode *, + struct xfs_dinode_core *); +void xfs_dinode_to_disk(struct xfs_dinode_core *, + struct xfs_icdinode *); +void xfs_idestroy_fork(xfs_inode_t *, int); +void xfs_idata_realloc(xfs_inode_t *, int, int); +void xfs_iroot_realloc(xfs_inode_t *, int, int); +int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, @@ -577,6 +583,8 @@ extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; +#ifdef __KERNEL__ + /* * Manage the i_flush queue embedded in the inode. This completion * queue synchronizes processes attempting to flush the in-core From owner-xfs@oss.sgi.com Fri Aug 29 02:36:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 29 Aug 2008 02:36:31 -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,RDNS_NONE, STOX_REPLY_TYPE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7T9aP3a030612 for ; Fri, 29 Aug 2008 02:36:25 -0700 X-ASG-Debug-ID: 1220002667-0a6f034c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D3AA01BC82ED for ; Fri, 29 Aug 2008 02:37:48 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id 9MEj773BQYPiRoDo for ; Fri, 29 Aug 2008 02:37:48 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.195]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9awVV024192; Fri, 29 Aug 2008 18:36:58 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7T9awS26730; Fri, 29 Aug 2008 18:36:58 +0900 (JST) Received: from kuichi.jp.nec.com (kuichi.jp.nec.com [10.26.220.17]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9avjf006237; Fri, 29 Aug 2008 18:36:57 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Fri, 29 Aug 2008 18:36:56 +0900 Message-ID: <4DF7C90FADA442868BA3D4C269F96DBF@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "Andrew Morton" Cc: , , , , , "Christoph Hellwig" , , , References: <20080818212819t-sato@mail.jp.nec.com> <20080821125841.a04a706f.akpm@linux-foundation.org> In-Reply-To: <20080821125841.a04a706f.akpm@linux-foundation.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature Date: Fri, 29 Aug 2008 18:36:56 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1220002669 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT, STOX_REPLY_TYPE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.4043 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 STOX_REPLY_TYPE STOX_REPLY_TYPE 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17761 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, Andrew Morton wrote: >> --- linux-2.6.27-rc2.org/include/linux/fs.h 2008-08-06 13:49:54.000000000 +0900 >> +++ linux-2.6.27-rc2-freeze/include/linux/fs.h 2008-08-07 08:59:54.000000000 +0900 >> @@ -226,6 +226,8 @@ extern int dir_notify_enable; >> #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ >> #define FIBMAP _IO(0x00,1) /* bmap access */ >> #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ >> +#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ >> +#define FITHAW _IOWR('X', 120, int) /* Thaw */ > >FIFREEZE is 119, but a few lines above we have > >#define BLKDISCARD _IO(0x12,119) > >Should we be using 120 and 121 here? As Andreas said, we need to use 'X' to keep compatibility with XFS's freeze ioctl. > >> #define FS_IOC_GETFLAGS _IOR('f', 1, long) >> #define FS_IOC_SETFLAGS _IOW('f', 2, long) >> @@ -574,6 +576,10 @@ struct block_device { >> * care to not mess up bd_private for that case. >> */ >> unsigned long bd_private; >> + /* The counter of freeze processes */ >> + int bd_freeze_count; >> + /* Semaphore for freeze */ >> + struct semaphore bd_freeze_sem; > >"freeze" is not an adequate description of what this protects. I think >it's only the modification and testing of bd_freeze_count, isn't it? > >If so, all this could be done more neatly by removing the lock, >switching to atomic_t and using our (rich) atomic_t operations. > >otoh, perhaps it protects more than this, in which case the lock >can/should be switched to a `struct mutex'? bd_freeze_sem protects the following two sequences. 1. freeze_bdev() - Test of bd_freeze_count - Increment of bd_freeze_count - s_op->write_super_lockfs - Set unfreeze timer 2. thaw_bdev() - Test of bd_freeze_count - Decrement of bd_freeze_count - s_op->unlockfs - Unset unfreeze timer Because the journal sync in ext3's write_super_lockfs might need a long time, we should use the mutex (not atomic_t). If bd_freeze_sem protects only the modification and testing of bd_freeze_count, freeze_bdev() and thaw_bdev() will run simultaneously and unexpected problem will occur. (For example, after we run the freeze ioctl with timeout period, the filesystem is frozen, but the unfreeze timer isn't set.) Cheers, Takashi From owner-xfs@oss.sgi.com Fri Aug 29 02:36:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 29 Aug 2008 02:36:40 -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,STOX_REPLY_TYPE 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 m7T9aOD2030608 for ; Fri, 29 Aug 2008 02:36:25 -0700 X-ASG-Debug-ID: 1220002666-704500700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7359F125784D for ; Fri, 29 Aug 2008 02:37:46 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id sAkXDTiJBXuejXa4 for ; Fri, 29 Aug 2008 02:37:46 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.192]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9bU8W024661; Fri, 29 Aug 2008 18:37:30 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7T9bUR05165; Fri, 29 Aug 2008 18:37:30 +0900 (JST) Received: from saigo.jp.nec.com (saigo.jp.nec.com [10.26.220.6]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9bSwP006572; Fri, 29 Aug 2008 18:37:28 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Fri, 29 Aug 2008 18:37:28 +0900 Message-ID: <328724AE665B49F8A8B60D92187C4BBF@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "Christoph Hellwig" Cc: "Andrew Morton" , , , , , , "Christoph Hellwig" , , , References: <20080818212819t-sato@mail.jp.nec.com> <20080822181458.GA15469@infradead.org> In-Reply-To: <20080822181458.GA15469@infradead.org> X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature Date: Fri, 29 Aug 2008 18:37:28 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1220002669 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: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT, STOX_REPLY_TYPE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.4044 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 STOX_REPLY_TYPE STOX_REPLY_TYPE 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17762 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, Christoph Hellwig wrote: >On Mon, Aug 18, 2008 at 09:28:19PM +0900, Takashi Sato wrote: >> + down(&bdev->bd_freeze_sem); >> + bdev->bd_freeze_count++; >> + if (bdev->bd_freeze_count > 1) { >> + sb = get_super(bdev); >> + drop_super(sb); >> + up(&bdev->bd_freeze_sem); >> + return sb; >> + } >> + >> down(&bdev->bd_mount_sem); > >Now you have a reference counter of freezes which actually is pretty >sensible, but also needs some documentation. What I don't understand >here at all is why you do the get_super/drop_super in the already frozen >case. Even if the filesystem has already been frozen, the superblock should be returned. Because a caller should recognize the success of freeze_bdev() and call thaw_bdev() to decrease the reference count. But I will remove drop_super() as it should be called in thaw_bdev(). > >Now that the freeze_count has replaced one of the uses of bd_mount_sem >you should also replace the other use in the unmount path by simply >checking for the freez_count and abort if it's set. To do so you'll >need to hold the bd_mount_sem over the whole unmount operation to >prevent new frezes from coming in. In the original implementation, unmount is protected by s_umount(semaphore), not bd_mount_sem. So, unmount task waits for unfreeze. I think this original behavior shouldn't be changed, so the existing s_umount lock is better. > >As others noted it should be a mutex and not a semaphore. As you said, we should use the mutex. I will replace it. > >> /* >> + * ioctl_freeze - Freeze the filesystem. >> + * >> + * @filp: target file >> + * >> + * Call freeze_bdev() to freeze the filesystem. >> + */ >> +static int ioctl_freeze(struct file *filp) > >This is not quite kerneldcoc format, which would ne a /** as commnt >start. But I don't think the comment is actually needed, it's a pretty >obvious file scope function. (Same commnt also applies to ioctl_thaw) I will remove these comments. > >> + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; >> + >> + if (!capable(CAP_SYS_ADMIN)) >> + return -EPERM; >> + >> + /* If filesystem doesn't support freeze feature, return. */ >> + if (sb->s_op->write_super_lockfs == NULL) >> + return -EOPNOTSUPP; >> + >> + /* If a regular file or a directory isn't specified, return. */ >> + if (sb->s_bdev == NULL) >> + return -EINVAL; > >I don't understand this commnt. What you are checking is that the >filesystem has a non-NULL s_bdev, which implies a not blockdevice-backed >filesystem. I will fix the comment as : " If a blockdevice-backed filesystem isn't specified, return." Cheers, Takashi From owner-xfs@oss.sgi.com Fri Aug 29 02:38:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 29 Aug 2008 02:38:23 -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,J_CHICKENPOX_24, J_CHICKENPOX_53,STOX_REPLY_TYPE autolearn=no 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 m7T9cJ5T031224 for ; Fri, 29 Aug 2008 02:38:19 -0700 X-ASG-Debug-ID: 1220002781-6c3c012a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8727412578BB for ; Fri, 29 Aug 2008 02:39:41 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id M0CJmUV28XwrverJ for ; Fri, 29 Aug 2008 02:39:41 -0700 (PDT) Received: from mailgate4.nec.co.jp ([10.7.69.184]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9d55k020490; Fri, 29 Aug 2008 18:39:05 +0900 (JST) Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m7T9d5W22185; Fri, 29 Aug 2008 18:39:05 +0900 (JST) Received: from togyo.jp.nec.com (togyo.jp.nec.com [10.26.220.4]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7T9d48J000923; Fri, 29 Aug 2008 18:39:04 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Fri, 29 Aug 2008 18:39:03 +0900 Message-ID: <6C2C1EFE3E5B416DB1676983F121993B@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "Andrew Morton" , "Oleg Nesterov" Cc: , , , , , "Christoph Hellwig" , , , , "Oleg Nesterov" References: <20080818212856t-sato@mail.jp.nec.com> <20080821132006.9949101c.akpm@linux-foundation.org> In-Reply-To: <20080821132006.9949101c.akpm@linux-foundation.org> X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Date: Fri, 29 Aug 2008 18:39:03 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1220002783 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=STOX_REPLY_TYPE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.4044 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 STOX_REPLY_TYPE STOX_REPLY_TYPE X-Virus-Scanned: ClamAV 0.91.2/8115/Thu Aug 28 18:49:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17763 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, Andrew and Oleg. Andrew Morton wrote: >On Mon, 18 Aug 2008 21:28:56 +0900 >Takashi Sato wrote: > >> The timeout feature is added to freeze ioctl. And new ioctl >> to reset the timeout period is added. >> o Freeze the filesystem >> int ioctl(int fd, int FIFREEZE, long *timeout_sec) >> fd: The file descriptor of the mountpoint >> FIFREEZE: request code for the freeze >> timeout_sec: the timeout period in seconds >> If it's 0 or 1, the timeout isn't set. >> This special case of "1" is implemented to keep >> the compatibility with XFS applications. >> Return value: 0 if the operation succeeds. Otherwise, -1 >> >> o Reset the timeout period >> int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) >> fd:file descriptor of mountpoint >> FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period >> timeout_sec: new timeout period in seconds >> Return value: 0 if the operation succeeds. Otherwise, -1 >> Error number: If the filesystem has already been unfrozen, >> errno is set to EINVAL. > >I don't think the changelogs actually explained why this feature is >being added? I will fix the changelogs as following. ----------------------------------------------------------- The timeout feature is added to "freeze ioctl" to solve a deadlock when the freezer accesses a frozen filesystem. And new ioctl to reset the timeout period is added to extend the timeout period. For example, the freezer resets the timeout period to 10 seconds every 5 seconds. In this approach, even if the freezer causes a deadlock by accessing the frozen filesystem, it will be solved by the timeout in 10 seconds and the freezer will be able to recognize that at the next reset of timeout period. ----------------------------------------------------------- > >Which userspace tools are expected to send these ioctls? Something in >util-linux? dm-utils? Are patches to those packages planned? I think the management software for the storage device will use these ioctls to take a consistent backup. >> >> ... >> >> /* >> + * ioctl_freeze_reset_timeout - Reset timeout for freeze. >> + * >> + * @filp: target file >> + * @argp: timeout value(sec) >> + * >> + * Reset timeout for freeze. >> + */ >> +static int >> +ioctl_freeze_reset_timeout(struct file *filp, int __user *argp) >> +{ >> + int timeout_sec; >> + unsigned int timeout_msec; >> + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; >> + struct block_device *bdev = sb->s_bdev; >> + int error; >> + >> + if (!capable(CAP_SYS_ADMIN)) >> + return -EPERM; >> + >> + /* If a regular file or a directory isn't specified, return EINVAL. */ >> + if (bdev == NULL) >> + return -EINVAL; >> + >> + /* arg(sec) to tick value */ >> + error = get_user(timeout_sec, argp); >> + if (error) >> + return error; >> + >> + if (timeout_sec <= 0 || timeout_sec > UINT_MAX/1000) >> + return -EINVAL; >> + >> + timeout_msec = timeout_sec * 1000; >> + >> + down(&bdev->bd_freeze_sem); >> + if (!bdev->bd_freeze_count) { >> + up(&bdev->bd_freeze_sem); >> + return -EINVAL; >> + } >> + /* setup unfreeze timer */ >> + add_freeze_timeout(bdev, timeout_msec); >> + up(&bdev->bd_freeze_sem); >> + >> + return 0; >> +} > >This duplicates quite a bit of code from ioctl_freeze(). Can this be >cleaned up? I will clean it up. >> +/* >> * When you add any new common ioctls to the switches above and below >> * please update compat_sys_ioctl() too. >> * >> @@ -235,13 +302,17 @@ int do_vfs_ioctl(struct file *filp, unsi >> break; >> >> case FIFREEZE: >> - error = ioctl_freeze(filp); >> + error = ioctl_freeze(filp, argp); >> break; >> >> case FITHAW: >> error = ioctl_thaw(filp); >> break; >> >> + case FIFREEZE_RESET_TIMEOUT: >> + error = ioctl_freeze_reset_timeout(filp, argp); >> + break; >> + >> default: >> if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) >> error = file_ioctl(filp, cmd, arg); >> >> ... >> >> EXPORT_SYMBOL_GPL(kern_mount_data); >> + >> +/* >> + * freeze_timeout - Thaw the filesystem. >> + * >> + * @work: work queue (delayed_work.work) >> + * >> + * Called by the delayed work when elapsing the timeout period. >> + * Thaw the filesystem. >> + */ >> +void freeze_timeout(struct work_struct *work) >> +{ >> + struct block_device *bd = container_of(work, >> + struct block_device, bd_freeze_timeout.work); >> + struct super_block *sb = get_super(bd); >> + >> + thaw_bdev(bd, sb); >> + >> + if (sb) >> + drop_super(sb); >> +} >> +EXPORT_SYMBOL_GPL(freeze_timeout); > >I can't see why this was exported. It isn't needed, I will delete it. >> +/* >> + * add_freeze_timeout - Add timeout for freeze. >> + * >> + * @bdev: block device struct >> + * @timeout_msec: timeout period >> + * >> + * Add the delayed work for freeze timeout to the delayed work queue. >> + */ >> +void add_freeze_timeout(struct block_device *bdev, unsigned int timeout_msec) >> +{ >> + s64 timeout_jiffies = msecs_to_jiffies(timeout_msec); >> + >> + /* Set delayed work queue */ >> + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); >> + schedule_delayed_work(&bdev->bd_freeze_timeout, timeout_jiffies); >> +} > >I don't particularly like the names of these new global symbols. The >kernel already has a "freezer" thing, part of power-management. >Introducing another one is a bit confusing. > >otoh, freezer seems to have consistently used "freezer", so the 'r' >arguable saves us. > >Still, I'd have thought that "fsfreeze" would have been a clearer, more >specific identifier for the whole project. I will rename the names of these global symbols. For example, "add_fsfreeze_timeout"... >> +/* >> + * del_freeze_timeout - Delete timeout for freeze. >> + * >> + * @bdev: block device struct >> + * >> + * Delete the delayed work for freeze timeout from the delayed work queue. >> + */ >> +void del_freeze_timeout(struct block_device *bdev) >> +{ >> + /* >> + * It's possible that the delayed work task (freeze_timeout()) calls >> + * del_freeze_timeout(). If the delayed work task calls >> + * cancel_delayed_work_sync((), the deadlock will occur. >> + * So we need this check (delayed_work_pending()). >> + */ >> + if (delayed_work_pending(&bdev->bd_freeze_timeout)) >> + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); >> +} > >So if the calling task is keventd via run_workqueue() then >delayed_work_pending() should return false due to run_workqueue() >ordering, so we avoid the deadlock. > >Seems a bit racy if some other process starts the delayed-work while >this function is running but I guess the new semaphore prevents that. > >Perhaps cancel_delayed_work_sync() shouldn't hang up if called from the >work handler? I think so. In my current implementation, the delayed work task calls thaw_bdev() to unfreeze a filesystem and it calls del_freeze_timeout(). So, the deadlock occurs. But I've found that the delayed work task doesn't need to call del_freeze_timeout() because it is removed from the delayed work queue automatically after the work finishes. So I will fix thaw_bdev() so that it doesn't call del_freeze_timeout() only when it's called by the delayed work task. And I will delete delayed_work_pending() in del_freeze_timeout(). Cheers, Takashi From owner-xfs@oss.sgi.com Fri Aug 29 11:09:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 29 Aug 2008 11:10:02 -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 (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 m7TI9uqA001238 for ; Fri, 29 Aug 2008 11:09:59 -0700 X-ASG-Debug-ID: 1220033480-1f2103a60000-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 62EC3FE257C; Fri, 29 Aug 2008 11:11:20 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id hjwBMcGDTTOi2FTS; Fri, 29 Aug 2008 11:11:20 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KZ8RM-0006Ah-EY; Fri, 29 Aug 2008 18:11:20 +0000 Date: Fri, 29 Aug 2008 14:11:20 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Message-ID: <20080829181120.GA9455@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1220033481 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.4078 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8118/Fri Aug 29 10:54:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17764 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 Fri, Aug 29, 2008 at 05:59:43PM +1000, Barry Naujok wrote: > On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok wrote: > >> Mostly header changes associated with #ifdef __KERNEL__ stuff. >> >> Some function prototypes had to be reordered to separate >> shared and kernel only functions. > > fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing > declaration), here's a better version: I still don't like it very much :) What about just moving the xfs_ictimestamp and xfs_icdinode defintions next to the ifork so that we can save one ifdef __KERNEL__? Also might be worth to move the xfs_iflock & co inlines before the end of that __KERNEL__ block to save another ifdef. > > Index: 2.6.x-xfs/fs/xfs/xfs_inode.h > =================================================================== > --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h > +++ 2.6.x-xfs/fs/xfs/xfs_inode.h > @@ -131,6 +131,8 @@ typedef struct dm_attrs_s { > __uint16_t da_pad; /* DMIG extra padding */ > } dm_attrs_t; > > +#endif /* __KERNEL__ */ > + > /* > * This is the xfs in-core inode structure. > * Most of the on-disk inode is embedded in the i_d field. > @@ -191,6 +193,8 @@ typedef struct xfs_icdinode { > __uint32_t di_gen; /* generation number */ > } xfs_icdinode_t; > > +#ifdef __KERNEL__ > + > typedef struct { > struct xfs_inode *ip_mnext; /* next inode in mount list */ > struct xfs_inode *ip_mprev; /* ptr to prev inode */ > @@ -490,19 +494,12 @@ int xfs_finish_reclaim_all(struct xfs_m > /* > * xfs_inode.c prototypes. > */ > -int xfs_itobp(struct xfs_mount *, struct xfs_trans *, > - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, > - xfs_daddr_t, uint, uint); > int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, > xfs_inode_t **, xfs_daddr_t, uint); > int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); > int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, > xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, > int, struct xfs_buf **, boolean_t *, xfs_inode_t **); > -void xfs_dinode_from_disk(struct xfs_icdinode *, > - struct xfs_dinode_core *); > -void xfs_dinode_to_disk(struct xfs_dinode_core *, > - struct xfs_icdinode *); > > uint xfs_ip2xflags(struct xfs_inode *); > uint xfs_dic2xflags(struct xfs_dinode *); > @@ -514,15 +511,11 @@ int xfs_itruncate_finish(struct xfs_tra > int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); > > struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); > -void xfs_idestroy_fork(xfs_inode_t *, int); > void xfs_idestroy(xfs_inode_t *); > -void xfs_idata_realloc(xfs_inode_t *, int, int); > void xfs_iextract(xfs_inode_t *); > void xfs_iext_realloc(xfs_inode_t *, int, int); > -void xfs_iroot_realloc(xfs_inode_t *, int, int); > void xfs_ipin(xfs_inode_t *); > void xfs_iunpin(xfs_inode_t *); > -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); > int xfs_iflush(xfs_inode_t *, uint); > void xfs_iflush_all(struct xfs_mount *); > void xfs_ichgtime(xfs_inode_t *, int); > @@ -532,6 +525,19 @@ void xfs_lock_two_inodes(xfs_inode_t *, > > void xfs_synchronize_atime(xfs_inode_t *); > void xfs_mark_inode_dirty_sync(xfs_inode_t *); > +#endif /* __KERNEL__ */ > + > +int xfs_itobp(struct xfs_mount *, struct xfs_trans *, > + xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, > + xfs_daddr_t, uint, uint); > +void xfs_dinode_from_disk(struct xfs_icdinode *, > + struct xfs_dinode_core *); > +void xfs_dinode_to_disk(struct xfs_dinode_core *, > + struct xfs_icdinode *); > +void xfs_idestroy_fork(xfs_inode_t *, int); > +void xfs_idata_realloc(xfs_inode_t *, int, int); > +void xfs_iroot_realloc(xfs_inode_t *, int, int); > +int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); > > xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); > void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, > @@ -577,6 +583,8 @@ extern struct kmem_zone *xfs_ifork_zone; > extern struct kmem_zone *xfs_inode_zone; > extern struct kmem_zone *xfs_ili_zone; > > +#ifdef __KERNEL__ > + > /* > * Manage the i_flush queue embedded in the inode. This completion > * queue synchronizes processes attempting to flush the in-core > > ---end quoted text--- From owner-xfs@oss.sgi.com Sun Aug 31 10:09:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 10:09:34 -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.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7VH9VbF028713 for ; Sun, 31 Aug 2008 10:09:32 -0700 X-ASG-Debug-ID: 1220202655-727201720000-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 C5D1E1223B25 for ; Sun, 31 Aug 2008 10:10:55 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id TQSSp4P0lUhA70cv for ; Sun, 31 Aug 2008 10:10:55 -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 m7VHAuIF023401 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 31 Aug 2008 19:10:56 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7VHAuYO023399; Sun, 31 Aug 2008 19:10:56 +0200 Date: Sun, 31 Aug 2008 19:10:56 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com, linux-kernel@vger.kernel.org X-ASG-Orig-Subj: XFS status update for August 2008 Subject: XFS status update for August 2008 Message-ID: <20080831171056.GA23373@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 1220202656 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.4263 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17765 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 With the 2.6.27-rc5 release the 2.6.27 cycle is nearing it's end. The major XFS feature in 2.6.27-rc5 is support for case-insensitive file names. At this point it is still limited to 7bit ASCII file names, with updates for utf8 file names expected to follow later. In addition to that 2.6.27-rc5 fixes a long-standing problem with non-EABI arm compiler which pack some XFS data structures wrongly. Besides this 2.6.27-rc5 also contains various cleanups, most notably the removal of the last bhv_vnode_t instances, and most uses of semaphores. As usual the diffstat for XFS from 2.6.26 to 2.6.26-rc5 is negative: 100 files changed, 3819 insertions(+), 4409 deletions(-) On the user space front a new minor xfsprogs version is about to be released containing various fixes including the user space part of arm packing fix. Work in progress on the XFS mailing list are a large patch set to unify the alloc, inobt and bmap btree implementation into a single that supports arbitrarily pluggable key and record formats. These btree changes are the first major preparation for adding CRC checks to all metadata structures in XFS, and an even larger patch set to unify the XFS and Linux inode structures, and perform all inode write back from the btree uses instead of an inode cache in XFS. From owner-xfs@oss.sgi.com Sun Aug 31 15:22:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 15:23:02 -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=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_25,J_CHICKENPOX_26,J_CHICKENPOX_43,J_CHICKENPOX_52, J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7VMMvXJ023347 for ; Sun, 31 Aug 2008 15:22:58 -0700 X-ASG-Debug-ID: 1220221460-515b02060000-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 D56281BCA608 for ; Sun, 31 Aug 2008 15:24:20 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id EP52ddsbX0KVguNj for ; Sun, 31 Aug 2008 15:24:20 -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 m7VMOKIF002426 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 1 Sep 2008 00:24:20 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m7VMOKbY002424 for xfs@oss.sgi.com; Mon, 1 Sep 2008 00:24:20 +0200 Date: Mon, 1 Sep 2008 00:24:20 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [RFC] btree test harness Subject: Re: [RFC] btree test harness Message-ID: <20080831222420.GA2301@lst.de> References: <20080813223022.GA15025@lst.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <20080813223022.GA15025@lst.de> 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: 1220221461 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.4285 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17766 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 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline New version below. Now we use an ioctl to driver the tests for a given maximum of levels. There's a small program for xfstests that calls it. No real testcases yet because the setup is still a little weird: mkfs.xfs -f \ -b size=512 \ -d agcount=1 \ -l logdev=/dev/hdb,size=65000b,lazy-count=1 \ /dev/hdd mount -t xfs -o logdev=/dev/hdb /dev/hdd /mnt/ ./src/btree-test /mnt 0 Next step would be to find the largest span of free blocks using real allocator functions, which should make this a lot safer, and might also get rid of the requirement of an external log. --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xfs-btree-test-harness Index: linux-2.6-xfs/fs/xfs/xfs_btree_test.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_test.c 2008-08-31 19:18:01.000000000 -0300 @@ -0,0 +1,1283 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_types.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_btree_trace.h" +#include "xfs_ialloc.h" +#include "xfs_alloc.h" +#include "xfs_error.h" +#include "xfs_trans_space.h" +#include "xfs_rw.h" + +/* + * Btree test harness. + * + * The idea is we implement a btree not that we can freely excercise + * without the rest of the filesystem involed. It basically mirrors + * the alloc by block number btree, just with a separate root block + * and dummy agf, and a "special" allocator. The allocator here + * just takes over the whole allocation group from a start offset + * and uses a simple bitmap - that way we can stree the btree without + * having to call into the XFS allocator (and this another btree). + * This is of course very dangerous on a real live filesystem, but + * this code shouldn't be used on those anyway. + * + * Initially this is based on the alloc btree code because it is + * the simplest. Ideally this also needs to be expanded to handle + * inode rooted btrees and all the other features of the btrees + * (e.g. longest extent tracking). + * + * The test harness itself is at the bottom of the file. It + * gets invoked in a debug build on XFS initialisation, and + * when it is complete it is never referenced again. + * + * Test harness + * + * The following tests are necessary: + * + * - split test + * - merge test + * - sparse tree test + * - depth test + * + * Ideally the tests should grow and shrink the tree, thereby + * exercising root splitting and merging. + * + * what we need: + * + * - a fake struct xfs_mount + * - a fake struct xfs_trans + * - a fake agf + * - a fake agf struct xfs_buf + * - special cursor init + */ + +/* We need to start a little after 0 to avoid hardcoded assumptions */ +#define XFS_TBT_FIRST_FREE_BLOCK 8 + + +static unsigned long *xfs_tbt_allocmap; +static size_t xfs_tbt_allomap_size; + +STATIC int +xfs_tbt_init_freelist( + struct xfs_mount *mp, + xfs_agnumber_t agno) +{ + struct xfs_buf *agbp; + struct xfs_agf *agf; + int error; + __uint32_t freeblks, startblk; + int i; + + error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); + if (error || agbp == NULL) { + cmn_err(CE_WARN, "xfs_alloc_read_agf failed (%d).\n", error); + return error ? error : ENOMEM; + } + + /* + * See what the largest free space is and used for us. + * + * XXX(hch): this assumes it's clustered at the end.. + */ + agf = XFS_BUF_TO_AGF(agbp); + freeblks = be32_to_cpu(agf->agf_longest); + startblk = be32_to_cpu(agf->agf_length) - freeblks; + xfs_buf_relse(agbp); + + cmn_err(CE_NOTE, "%s: using %d blocks, starting at %d\n", + __func__, freeblks, startblk); + + /* just us a simple bitmap array indexed by blockno */ + xfs_tbt_allomap_size = freeblks / NBBY; + xfs_tbt_allocmap = kmalloc(xfs_tbt_allomap_size, GFP_KERNEL); + if (!xfs_tbt_allocmap) { + cmn_err(CE_WARN, "xfs_tbt_init_freelist: ENOMEM"); + return ENOMEM; + } + + memset(xfs_tbt_allocmap, 0xff, xfs_tbt_allomap_size); /* all free */ + for (i = 0; i < startblk; i++) + clear_bit(i, xfs_tbt_allocmap); /* except for used blocks */ + + return 0; +} + +STATIC void +xfs_tbt_destroy_freelist( + struct xfs_mount *mp) +{ + kfree(xfs_tbt_allocmap); +} + +STATIC int +xfs_tbt_alloc( + xfs_agblock_t *bnop) +{ + xfs_agblock_t bno; + int val; + + bno = find_first_bit(xfs_tbt_allocmap, + xfs_tbt_allomap_size/sizeof(long)); + if (bno >= xfs_tbt_allomap_size/sizeof(long)) { + cmn_err(CE_WARN, "%s: ran out of space\n", __func__); + return ENOSPC; + } + + val = test_and_clear_bit(bno, xfs_tbt_allocmap); + + ASSERT(val); + ASSERT(find_first_bit(xfs_tbt_allocmap, + xfs_tbt_allomap_size/sizeof(long)) > bno); + ASSERT(bno != NULLAGBLOCK); + + *bnop = bno; + return 0; +} + +STATIC int +xfs_tbt_free( + xfs_agblock_t bno) +{ + int val; + + ASSERT(bno <= xfs_tbt_allomap_size); + + val = test_and_set_bit(bno, xfs_tbt_allocmap); + ASSERT(val == 0); + + return 0; +} + +STATIC int +xfs_tbt_alloc_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *start, + union xfs_btree_ptr *new, + int length, + int *stat) +{ + xfs_agblock_t bno; + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + error = xfs_tbt_alloc(&bno); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + new->s = cpu_to_be32(bno); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +} + +STATIC int +xfs_tbt_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + xfs_tbt_free(XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp))); + return 0; +} + +STATIC struct xfs_btree_cur * +xfs_tbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_btree_cur *new; + + new = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + new->bc_mp = cur->bc_mp; + new->bc_tp = cur->bc_tp; + new->bc_nlevels = cur->bc_nlevels; + new->bc_btnum = XFS_BTNUM_BNO; + new->bc_blocklog = cur->bc_mp->m_sb.sb_blocklog; + + new->bc_ops = cur->bc_ops; + + new->bc_private.a.agbp = cur->bc_private.a.agbp; + new->bc_private.a.agno = cur->bc_private.a.agno; + + return new; +} + +STATIC void +xfs_tbt_set_root( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int inc) +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + int btnum = cur->bc_btnum; + + ASSERT(ptr->s != 0); + + agf->agf_roots[btnum] = ptr->s; + be32_add_cpu(&agf->agf_levels[btnum], inc); + cur->bc_mp->m_perag[seqno].pagf_levels[btnum] += inc; +} + +STATIC int +xfs_tbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mnr[level != 0]; +} + +STATIC int +xfs_tbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mxr[level != 0]; +} + +STATIC void +xfs_tbt_init_key_from_rec( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->alloc.ar_startblock = rec->alloc.ar_startblock; + key->alloc.ar_blockcount = rec->alloc.ar_blockcount; +} + +STATIC void +xfs_tbt_init_rec_from_key( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + rec->alloc.ar_startblock = key->alloc.ar_startblock; + rec->alloc.ar_blockcount = key->alloc.ar_blockcount; +} + +STATIC void +xfs_tbt_init_rec_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + rec->alloc.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); + rec->alloc.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); +} + +STATIC void +xfs_tbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); + ASSERT(agf->agf_roots[cur->bc_btnum] != 0); + + ptr->s = agf->agf_roots[cur->bc_btnum]; +} + +STATIC __int64_t +xfs_tbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; + xfs_alloc_key_t *kp = &key->alloc; + + return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; +} + +STATIC int +xfs_tbt_kill_root( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int level, + union xfs_btree_ptr *newroot) +{ + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, killroot); + + /* + * Update the root pointer, decreasing the level by 1 and then + * free the old root. + */ + xfs_tbt_set_root(cur, newroot, -1); + error = xfs_tbt_free_block(cur, bp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + XFS_BTREE_STATS_INC(cur, free); + + xfs_btree_setbuf(cur, level, NULL); + cur->bc_nlevels--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + +#ifdef DEBUG +STATIC int +xfs_tbt_keys_inorder( + struct xfs_btree_cur *cur, + union xfs_btree_key *k1, + union xfs_btree_key *k2) +{ + return be32_to_cpu(k1->alloc.ar_startblock) < + be32_to_cpu(k2->alloc.ar_startblock); +} + +STATIC int +xfs_tbt_recs_inorder( + struct xfs_btree_cur *cur, + union xfs_btree_rec *r1, + union xfs_btree_rec *r2) +{ + return be32_to_cpu(r1->alloc.ar_startblock) + + be32_to_cpu(r1->alloc.ar_blockcount) <= + be32_to_cpu(r2->alloc.ar_startblock); +} +#endif /* DEBUG */ + +#ifdef XFS_BTREE_TRACE +ktrace_t *xfs_tbt_trace_buf; + +STATIC void +xfs_tbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + /* do nothing for now */ +} + +STATIC void +xfs_tbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.a.ar_startblock; + *l1 = cur->bc_rec.a.ar_blockcount; +} + +STATIC void +xfs_tbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->alloc.ar_startblock); + *l1 = be32_to_cpu(key->alloc.ar_blockcount); +} + +STATIC void +xfs_tbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->alloc.ar_startblock); + *l1 = be32_to_cpu(rec->alloc.ar_blockcount); + *l2 = 0; +} +#endif /* XFS_BTREE_TRACE */ + +static const struct xfs_btree_ops xfs_tbt_ops = { + .rec_len = sizeof(xfs_alloc_rec_t), + .key_len = sizeof(xfs_alloc_key_t), + + .dup_cursor = xfs_tbt_dup_cursor, + .set_root = xfs_tbt_set_root, + .kill_root = xfs_tbt_kill_root, + .alloc_block = xfs_tbt_alloc_block, + .free_block = xfs_tbt_free_block, + .get_minrecs = xfs_tbt_get_minrecs, + .get_maxrecs = xfs_tbt_get_maxrecs, + .init_key_from_rec = xfs_tbt_init_key_from_rec, + .init_rec_from_key = xfs_tbt_init_rec_from_key, + .init_rec_from_cur = xfs_tbt_init_rec_from_cur, + .init_ptr_from_cur = xfs_tbt_init_ptr_from_cur, + .key_diff = xfs_tbt_key_diff, + +#ifdef DEBUG + .keys_inorder = xfs_tbt_keys_inorder, + .recs_inorder = xfs_tbt_recs_inorder, +#endif + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_tbt_trace_enter, + .trace_cursor = xfs_tbt_trace_cursor, + .trace_key = xfs_tbt_trace_key, + .trace_record = xfs_tbt_trace_record, +#endif +}; + +/* + * Allocate a new allocation btree cursor. + */ +STATIC struct xfs_btree_cur * +xfs_tbt_init_cursor( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + struct xfs_btree_cur *cur; + struct xfs_trans *tp; + int error; + uint resblks; + + resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; + tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE); + tp->t_flags |= XFS_TRANS_RESERVE; + error = xfs_trans_reserve(tp, resblks, + XFS_WRITE_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, + XFS_WRITE_LOG_COUNT); + if (error) { + xfs_trans_cancel(tp, 0); + return NULL; + } + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_mp = mp; + cur->bc_tp = tp; + cur->bc_nlevels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]); + cur->bc_btnum = XFS_BTNUM_BNO; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_tbt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} + +/* + * Lookup the record equal to [bno, len] in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_tbt_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + +/* + * Update the record referred to by cur to the value given + * by [bno, len]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_tbt_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len) /* length of extent */ +{ + union xfs_btree_rec rec; + + rec.alloc.ar_startblock = cpu_to_be32(bno); + rec.alloc.ar_blockcount = cpu_to_be32(len); + return xfs_btree_update(cur, &rec); +} + +/* + * Get the data from the pointed-to record. + */ +STATIC int /* error */ +xfs_tbt_get_rec( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t *bno, /* output: starting block of extent */ + xfs_extlen_t *len, /* output: length of extent */ + int *stat) /* output: success/failure */ +{ + union xfs_btree_rec *rec; + int error; + + error = xfs_btree_get_rec(cur, &rec, stat); + if (!error && *stat == 1) { + *bno = be32_to_cpu(rec->alloc.ar_startblock); + *len = be32_to_cpu(rec->alloc.ar_blockcount); + } + return error; +} + +STATIC int +xfs_tbt_destroy_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_trans *tp = cur->bc_tp; + + xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); + return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); +} + +/* + * Build a full tree of the required depth of single block extents + * separated by a single block. We want discrete reecords to be + * built here. + * + * XXX: we probably want to create larger holes as well to be able + * to do more coverage on left and right merging and splitting. + * However, that is really a function of the specific implementation, + * not the core btree code which + */ +STATIC int +xfs_tbt_build_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels) +{ + struct xfs_btree_cur *cur; + int i; + xfs_agblock_t offset = XFS_TBT_FIRST_FREE_BLOCK; + xfs_extlen_t len = 1; + struct xfs_agf *agf; + int error = 0, error2; + + agf = XFS_BUF_TO_AGF(agbp); + while (be32_to_cpu(agf->agf_levels[0]) < levels) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + + i = 0; + /* Check the extent does not exist */ + error = xfs_tbt_lookup_eq(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + + /* Insert the extent */ + cur->bc_rec.a.ar_startblock = offset; + cur->bc_rec.a.ar_blockcount = len; + i = 0; + error = xfs_btree_insert(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: insert failed at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* keep a count of records in the tree */ + be32_add_cpu(&agf->agf_spare0, 1); + + /* move on to new extent */ + offset += 2; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + /* record largest offset added */ + agf->agf_spare1 = cpu_to_be32(offset); + return error; +} + +STATIC int +xfs_tbt_empty_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels) +{ + int error = 0, error2; + int i; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + + agf = XFS_BUF_TO_AGF(agbp); + while (be32_to_cpu(agf->agf_spare0) > 0) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + i = 0; + + /* find the extent that spans this offset/len */ + error = xfs_tbt_lookup_ge(cur, XFS_TBT_FIRST_FREE_BLOCK, 1, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, XFS_TBT_FIRST_FREE_BLOCK, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "%s error at offset %u (%d)", + __func__, "xfs_btree_delete", + XFS_TBT_FIRST_FREE_BLOCK, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add_cpu(&agf->agf_spare0, -1); +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +/* + * Take a tree and punch alternate blocks out of it until it + * reaches the required depth. The will split records apart. + * + * Hacked out of xfs_tbt_fixup_trees() + */ +STATIC int +xfs_tbt_punch_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels, + int dir) +{ + int error = 0, error2; + int i; + xfs_agblock_t fbno; + xfs_agblock_t nfbno1; + xfs_agblock_t nfbno2; + xfs_extlen_t flen = 0; + xfs_extlen_t nflen1 = 0; + xfs_extlen_t nflen2 = 0; + xfs_agblock_t offset; + xfs_extlen_t len; + xfs_agblock_t delta; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + + agf = XFS_BUF_TO_AGF(agbp); + + switch (dir) { + default: + case 0: /* r to l */ + offset = XFS_TBT_FIRST_FREE_BLOCK + 1; + len = 1; + delta = 2; + break; + case 1: /* l to r */ + offset = be32_to_cpu(agf->agf_spare1) - 3; // why?? + len = 1; + delta = -2; + break; + case 2: /* middle to r/l */ + /* XXX: not implemented yet */ + return 0; + break; + } + + while (be32_to_cpu(agf->agf_levels[0]) < levels) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + + i = 0; + /* find the extent that spans this offset/len */ + error = xfs_tbt_lookup_le(cur, offset, 1, &i); + if (error) { + cmn_err(CE_ALERT, "%s: lookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &fbno, &flen, &i); + if (error) { + cmn_err(CE_ALERT, "%s: get_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1 && fbno <= offset && flen >= len); + + if (fbno == offset && flen == len) + /* just delete the record under the cursor */ + nfbno1 = nfbno2 = NULLAGBLOCK; + else if (fbno == offset) { + /* punching out left edge */ + nfbno1 = fbno + len; + nflen1 = flen - len; + nfbno2 = NULLAGBLOCK; + } else if (fbno + flen == offset + len) { + /* punching out right edge */ + nfbno1 = fbno; + nflen1 = flen - len; + nfbno2 = NULLAGBLOCK; + } else { + /* punching out left and right edge */ + nfbno1 = fbno; + nflen1 = offset - fbno; + nfbno2 = offset + len; + nflen2 = (fbno + flen) - nfbno2; + } + + if (nfbno1 == NULLAGBLOCK) { + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "%s error at offset %u (%d)", + __func__, "xfs_btree_delete", + offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add_cpu(&agf->agf_spare0, -1); + } else { + /* + * Update the by-block entry to start later|be shorter. + */ + error = xfs_tbt_update(cur, nfbno1, nflen1); + if (error) { + cmn_err(CE_ALERT, "%s: " + "xfs_btree_update error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + } + if (nfbno2 != NULLAGBLOCK) { + /* + * Need to add the second entry. Confirm it does not + * exist first + */ + error = xfs_tbt_lookup_eq(cur, nfbno2, nflen2, &i); + if (error) { + cmn_err(CE_ALERT, "%s: " + "lookup equal error at nfbno2 %u (%d)", + __func__, nfbno2, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + error = xfs_btree_insert(cur, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: insert error at nfbno2 %u (%d)", + __func__, nfbno2, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* keep a count of records in the tree */ + be32_add_cpu(&agf->agf_spare0, 1); + } + + /* move on to new extent */ + offset += delta; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +/* + * Take a sparse tree and fill the holes in it until there are + * no holes left. This requires finding the hole and it's adjacent + * extent(s) and updating extents in place and deleting old + * overlapping extents. + * + * XXX: only handles single extent holes in the tree + */ +STATIC int +xfs_tbt_fill_sparse_tree( + struct xfs_mount *mp, + xfs_agnumber_t agno, + struct xfs_buf *agbp, + int levels, + int dir) +{ + int error = 0, error2; + int i; + xfs_agblock_t lbno; + xfs_agblock_t rbno; + xfs_extlen_t llen = 0; + xfs_extlen_t rlen = 0; + xfs_agblock_t offset; + xfs_extlen_t len; + struct xfs_btree_cur *cur; + struct xfs_agf *agf; + int delta; + + agf = XFS_BUF_TO_AGF(agbp); + + switch (dir) { + default: + case 0: /* r to l */ + offset = XFS_TBT_FIRST_FREE_BLOCK + 1; + len = 1; + delta = 2; + break; + case 1: /* l to r */ + offset = be32_to_cpu(agf->agf_spare1) - 3; // why?? + len = 1; + delta = -2; + break; + case 2: /* middle to r/l */ + /* XXX: not implemented yet */ + return 0; + break; + } + + while (be32_to_cpu(agf->agf_spare0) > 1) { + cur = xfs_tbt_init_cursor(mp, agno, agbp); + if (!cur) + return ENOMEM; + + /* are we in a hole? (should be) */ + error = xfs_tbt_lookup_eq(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: eqlookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 0); + + /* find left neighbour */ + error = xfs_tbt_lookup_le(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: lelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &lbno, &llen, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: leget_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* find right neighbour */ + error = xfs_tbt_lookup_ge(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: gelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* get the range of the extent */ + error = xfs_tbt_get_rec(cur, &rbno, &rlen, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: geget_rec error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + error = EIO; + if (lbno + llen != offset) { + cmn_err(CE_ALERT, + "%s: left record not correct at %u (%u,%u)", + __func__, offset, lbno, llen); + goto out_error; + } else if (offset + len != rbno) { + cmn_err(CE_ALERT, + "%s: right record not correct at %u (%u,%u)", + __func__, offset, rbno, rlen); + goto out_error; + } + + /* + * fill hole: update one record, delete the other. + * The cursor currently points at the right record, + * so delete it and update the left record. Technically + * this is correct as the index of the left record does + * not change - only it's length + */ + llen = llen + len + rlen; + error = xfs_btree_delete(cur, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: xfs_btree_delete error at offset %u (%d)", + __func__, rbno, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + be32_add_cpu(&agf->agf_spare0, -1); + + /* find left neighbour (again) */ + error = xfs_tbt_lookup_le(cur, offset, len, &i); + if (error) { + cmn_err(CE_ALERT, + "%s: lelookup error at offset %u (%d)", + __func__, offset, error); + goto out_error; + } + XFS_WANT_CORRUPTED_RETURN(i == 1); + + /* Update the left entry */ + error = xfs_tbt_update(cur, lbno, llen); + if (error) { + cmn_err(CE_ALERT, + "%s: xfs_btree_update error at offset %u (%d)", + __func__, lbno, error); + goto out_error; + } + + /* move on to new extent */ + offset += delta; + +out_error: + error2 = xfs_tbt_destroy_cursor(cur); + if (error2) { + cmn_err(CE_ALERT, + "%s: failed to commit transaction (%d)", + __func__, error); + if (!error) + error = error2; + } + + if (error) + return error; + } + + return error; +} + +STATIC int +xfs_tbt_init_ag( + struct xfs_mount *mp, + xfs_agnumber_t agno, + xfs_agblock_t *agbnop) +{ + xfs_extlen_t agsize = mp->m_sb.sb_agblocks; + struct xfs_buf *bp; + struct xfs_btree_block *block; + struct xfs_alloc_rec *arec; + xfs_agblock_t agbno; + xfs_agblock_t rbno; + int error; + struct xfs_agf *agf; + + /* Allocate a btree root block */ + error = xfs_tbt_alloc(&rbno); + if (error) { + printk("xfs_tbt_alloc failed\n"); + return error; + } + + bp = xfs_buf_get(mp->m_ddev_targp, + XFS_AGB_TO_DADDR(mp, agno, rbno), + BTOBB(mp->m_sb.sb_blocksize), 0); + + block = XFS_BUF_TO_BLOCK(bp); + memset(block, 0, mp->m_sb.sb_blocksize); + block->bb_magic = cpu_to_be32(XFS_ABTB_MAGIC); + block->bb_level = 0; + block->bb_numrecs = cpu_to_be16(1); + block->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); + block->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); + + arec = XFS_BTREE_REC_ADDR(xfs_alloc, block, 1); + arec->ar_startblock = cpu_to_be32(2); /* don't start at the beginning */ + arec->ar_blockcount = cpu_to_be32(mp->m_sb.sb_agblocks - + be32_to_cpu(arec->ar_startblock)); + + error = xfs_bwrite(mp, bp); + if (error) + return error; + + /* + * AG freelist header block + */ + error = xfs_tbt_alloc(&agbno); + if (error) { + printk("xfs_tbt_alloc failed\n"); + return error; + } + + bp = xfs_buf_get(mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, agbno), + XFS_FSS_TO_BB(mp, 1), 0); + + agf = XFS_BUF_TO_AGF(bp); + memset(agf, 0, mp->m_sb.sb_sectsize); + agf->agf_magicnum = cpu_to_be32(XFS_AGF_MAGIC); + agf->agf_versionnum = cpu_to_be32(XFS_AGF_VERSION); + agf->agf_seqno = cpu_to_be32(agno); + agf->agf_length = cpu_to_be32(agsize); + agf->agf_roots[XFS_BTNUM_BNOi] = cpu_to_be32(rbno); // + agf->agf_roots[XFS_BTNUM_CNTi] = cpu_to_be32(rbno); // + agf->agf_levels[XFS_BTNUM_BNOi] = cpu_to_be32(1); + agf->agf_levels[XFS_BTNUM_CNTi] = cpu_to_be32(1); + agf->agf_flfirst = 0; + agf->agf_fllast = cpu_to_be32(XFS_AGFL_SIZE(mp) - 1); + agf->agf_flcount = 0; + /* don't start at the beginning */ + agf->agf_freeblks = cpu_to_be32(agsize - 2); + agf->agf_longest = cpu_to_be32(agsize - 2); + + error = xfs_bwrite(mp, bp); + if (error) + return error; + + *agbnop = agbno; + return 0; +} + +STATIC int +xfs_tbt_read_agf( + struct xfs_mount *mp, + struct xfs_trans *tp, + xfs_agnumber_t agno, + xfs_agblock_t agbno, + struct xfs_buf **bpp) +{ + int error; + + ASSERT(agno != NULLAGNUMBER); + error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, + XFS_AG_DADDR(mp, agno, agbno), + XFS_FSS_TO_BB(mp, 1), 0, bpp); + if (error) + return error; + + ASSERT(*bpp); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + return 0; +} + +int +xfs_tbt_test_one( + struct xfs_mount *mp, + xfs_agnumber_t agno, + int levels) +{ + struct xfs_buf *agbp = NULL; + int error; + xfs_agblock_t agbno; + + if (levels > XFS_AG_MAXLEVELS(mp)) { + cmn_err(CE_WARN, "filesystem only supports %d btree levels\n", + XFS_AG_MAXLEVELS(mp)); + return -EINVAL; + } + + cmn_err(CE_NOTE, "xfs_tbt_test_all: Testing %d levels", levels); + + error = xfs_tbt_init_freelist(mp, agno); + if (error) { + cmn_err(CE_WARN, "xfs_tbt_init_freelist failed (%d).\n", error); + goto out; + } + + error = xfs_tbt_init_ag(mp, agno, &agbno); + if (error) { + cmn_err(CE_WARN, "xfs_tbt_init_ag failed (%d).\n", error); + goto out_free_freelist; + } + + error = xfs_tbt_read_agf(mp, NULL, agno, agbno, &agbp); + if (error || agbp == NULL) { + cmn_err(CE_WARN, "xfs_alloc_read_agf failed (%d).\n", error); + goto out_free_ag; + } + + + error = xfs_tbt_build_sparse_tree(mp, agno, agbp, levels); + if (error) + goto out_free_ag; + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 0 /* left to right */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 0 /* l to r */); + if (error) + goto out_free_ag; + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 1 /* r to l */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 1 /* r to l */); + if (error) + goto out_free_ag; +#ifdef notyet + error = xfs_tbt_fill_sparse_tree(mp, agno, agbp, levels, + 2 /* middle to r/l */); + if (error) + goto out_free_ag; + error = xfs_tbt_punch_sparse_tree(mp, agno, agbp, levels, + 2 /* middle to r/l */); + if (error) + goto out_free_ag; +#endif + + error = xfs_tbt_empty_sparse_tree(mp, agno, agbp, levels); + if (error) + goto out_free_ag; + + cmn_err(CE_NOTE, "xfs_tbt_test_all: Tested %d levels OK", levels); + + out_free_ag: + xfs_buf_relse(agbp); + out_free_freelist: + xfs_tbt_destroy_freelist(mp); + out: + if (error) { + cmn_err(CE_WARN, + "xfs_tbt_test_all: fail with error %d\n", error); + return error; + } + cmn_err(CE_NOTE, "xfs_tbt_test_all: passed successfully\n"); + return 0; +} + +int +xfs_ioc_test_btree( + struct xfs_mount *mp, + void __user *argp) +{ + struct xfs_ioc_test_btree tb; + + if (copy_from_user(&tb, argp, sizeof(tb))) + return -EFAULT; + if (tb.flags != 0) + return -EINVAL; + return xfs_tbt_test_one(mp, tb.agno, tb.levels); +} Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-08-30 18:28:46.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-08-30 18:29:03.000000000 -0300 @@ -84,6 +84,8 @@ xfs-y += xfs_alloc.o \ xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ xfs_dir2_trace.o +xfs-$(CONFIG_XFS_DEBUG) += xfs_btree_test.o + # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ kmem.o \ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-31 19:17:54.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-08-31 19:18:01.000000000 -0300 @@ -1578,7 +1578,13 @@ xfs_ioctl( error = xfs_errortag_clearall(mp, 1); return -error; +#ifdef DEBUG + case XFS_IOC_TEST_BTREE: + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + return xfs_ioc_test_btree(mp, (void __user *)arg); +#endif default: return -ENOTTY; } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.h 2008-08-31 19:17:54.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.h 2008-08-31 19:18:01.000000000 -0300 @@ -74,4 +74,6 @@ extern int xfs_dev_is_read_only(struct x extern int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t); +extern int xfs_ioc_test_btree(struct xfs_mount *, void __user *); + #endif /* __XFS_LRW_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_fs.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_fs.h 2008-08-31 19:17:54.000000000 -0300 +++ linux-2.6-xfs/fs/xfs/xfs_fs.h 2008-08-31 19:18:01.000000000 -0300 @@ -421,6 +421,15 @@ typedef struct xfs_handle { #define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ /* + * Arguments for the btree test suite (debug builds only). + */ +struct xfs_ioc_test_btree { + __u32 agno; + __u32 levels; + __u32 flags; +}; + +/* * ioctl commands that are used by Linux filesystems */ #define XFS_IOC_GETXFLAGS FS_IOC_GETFLAGS @@ -485,6 +494,7 @@ typedef struct xfs_handle { #define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom) #define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) /* XFS_IOC_GETFSUUID ---------- deprecated 140 */ +#define XFS_IOC_TEST_BTREE _IOW ('X', 126, struct xfs_ioc_test_btree) #ifndef HAVE_BBMACROS --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=fsqa-add-btree-testharness Index: xfstests/src/Makefile =================================================================== --- xfstests.orig/src/Makefile 2008-08-31 19:09:03.000000000 -0300 +++ xfstests/src/Makefile 2008-08-31 19:15:00.000000000 -0300 @@ -15,7 +15,7 @@ TARGETS = dirstress fill fill2 getpagesi LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize \ preallo_rw_pattern_reader preallo_rw_pattern_writer ftrunc trunc \ fs_perms testx looptest locktest unwritten_mmap \ - bulkstat_unlink_test bulkstat_unlink_test_modified + bulkstat_unlink_test bulkstat_unlink_test_modified btree-test IRIX_TARGETS = open_unlink Index: xfstests/src/btree-test.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xfstests/src/btree-test.c 2008-08-31 19:15:14.000000000 -0300 @@ -0,0 +1,48 @@ + +#include +#include +#include +#include +#include +#include + +/* + * Until headers are ready. + */ +#ifndef XFS_IOC_TEST_BTREE +struct xfs_ioc_test_btree { + __u32 agno; + __u32 levels; + __u32 flags; +}; +#define XFS_IOC_TEST_BTREE _IOW ('X', 126, struct xfs_ioc_test_btree) +#endif /* XFS_IOC_TEST_BTREE */ + +int main(int argc, char **argv) +{ + struct xfs_ioc_test_btree tb; + int fd; + + if (argc != 4) { + fprintf(stderr, "usage: %s path agno levels\n", argv[0]); + return 1; + } + + fd = open(argv[1], O_RDONLY); + if (fd < 0) { + fprintf(stderr, "can't open %s\n", argv[1]); + return 1; + } + + tb.agno = atoi(argv[2]); + tb.levels = atoi(argv[3]); + tb.flags = 0; + + if (ioctl(fd, XFS_IOC_TEST_BTREE, &tb)) { + fprintf(stderr, "btree test failed: %s\n", + strerror(errno)); + return 1; + } + + return 0; +} --EeQfGwPcQSOJBaQU-- From owner-xfs@oss.sgi.com Sun Aug 31 18:53:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 18:54:13 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m811raHo009314 for ; Sun, 31 Aug 2008 18:53:37 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA06666; Mon, 1 Sep 2008 11:54:58 +1000 Date: Mon, 01 Sep 2008 11:56:03 +1000 To: "Christoph Hellwig" Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080829181120.GA9455@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080829181120.GA9455@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17767 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Sat, 30 Aug 2008 04:11:20 +1000, Christoph Hellwig wrote: > On Fri, Aug 29, 2008 at 05:59:43PM +1000, Barry Naujok wrote: >> On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok >> wrote: >> >>> Mostly header changes associated with #ifdef __KERNEL__ stuff. >>> >>> Some function prototypes had to be reordered to separate >>> shared and kernel only functions. >> >> fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing >> declaration), here's a better version: > > I still don't like it very much :) What about just moving the > xfs_ictimestamp and xfs_icdinode defintions next to the ifork > so that we can save one ifdef __KERNEL__? Also might be worth > to move the xfs_iflock & co inlines before the end of that __KERNEL__ > block to save another ifdef. Ok, this now only has one blob of #ifdef __KERNEL__ in it now: Index: 2.6.x-xfs/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h +++ 2.6.x-xfs/fs/xfs/xfs_inode.h @@ -84,54 +84,6 @@ typedef struct xfs_ifork { } xfs_ifork_t; /* - * Flags for xfs_ichgtime(). - */ -#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ -#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ - -/* - * Per-fork incore inode flags. - */ -#define XFS_IFINLINE 0x01 /* Inline data is read in */ -#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */ -#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */ -#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */ - -/* - * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate(). - */ -#define XFS_IMAP_LOOKUP 0x1 -#define XFS_IMAP_BULKSTAT 0x2 - -#ifdef __KERNEL__ -struct bhv_desc; -struct cred; -struct ktrace; -struct xfs_buf; -struct xfs_bmap_free; -struct xfs_bmbt_irec; -struct xfs_bmbt_block; -struct xfs_inode; -struct xfs_inode_log_item; -struct xfs_mount; -struct xfs_trans; -struct xfs_dquot; - -#if defined(XFS_ILOCK_TRACE) -#define XFS_ILOCK_KTRACE_SIZE 32 -extern ktrace_t *xfs_ilock_trace_buf; -extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); -#else -#define xfs_ilock_trace(i,n,f,ra) -#endif - -typedef struct dm_attrs_s { - __uint32_t da_dmevmask; /* DMIG event mask */ - __uint16_t da_dmstate; /* DMIG state info */ - __uint16_t da_pad; /* DMIG extra padding */ -} dm_attrs_t; - -/* * This is the xfs in-core inode structure. * Most of the on-disk inode is embedded in the i_d field. * @@ -191,6 +143,97 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; +/* + * Flags for xfs_ichgtime(). + */ +#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ +#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ + +/* + * Per-fork incore inode flags. + */ +#define XFS_IFINLINE 0x01 /* Inline data is read in */ +#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */ +#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */ +#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */ + +/* + * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate(). + */ +#define XFS_IMAP_LOOKUP 0x1 +#define XFS_IMAP_BULKSTAT 0x2 + +/* + * Fork handling. + */ + +#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) +#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) + +#define XFS_IFORK_PTR(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + &(ip)->i_df : \ + (ip)->i_afp) +#define XFS_IFORK_DSIZE(ip) \ + (XFS_IFORK_Q(ip) ? \ + XFS_IFORK_BOFF(ip) : \ + XFS_LITINO((ip)->i_mount)) +#define XFS_IFORK_ASIZE(ip) \ + (XFS_IFORK_Q(ip) ? \ + XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ + 0) +#define XFS_IFORK_SIZE(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + XFS_IFORK_DSIZE(ip) : \ + XFS_IFORK_ASIZE(ip)) +#define XFS_IFORK_FORMAT(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + (ip)->i_d.di_format : \ + (ip)->i_d.di_aformat) +#define XFS_IFORK_FMT_SET(ip,w,n) \ + ((w) == XFS_DATA_FORK ? \ + ((ip)->i_d.di_format = (n)) : \ + ((ip)->i_d.di_aformat = (n))) +#define XFS_IFORK_NEXTENTS(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + (ip)->i_d.di_nextents : \ + (ip)->i_d.di_anextents) +#define XFS_IFORK_NEXT_SET(ip,w,n) \ + ((w) == XFS_DATA_FORK ? \ + ((ip)->i_d.di_nextents = (n)) : \ + ((ip)->i_d.di_anextents = (n))) + + + +#ifdef __KERNEL__ + +struct bhv_desc; +struct cred; +struct ktrace; +struct xfs_buf; +struct xfs_bmap_free; +struct xfs_bmbt_irec; +struct xfs_bmbt_block; +struct xfs_inode; +struct xfs_inode_log_item; +struct xfs_mount; +struct xfs_trans; +struct xfs_dquot; + +#if defined(XFS_ILOCK_TRACE) +#define XFS_ILOCK_KTRACE_SIZE 32 +extern ktrace_t *xfs_ilock_trace_buf; +extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); +#else +#define xfs_ilock_trace(i,n,f,ra) +#endif + +typedef struct dm_attrs_s { + __uint32_t da_dmevmask; /* DMIG event mask */ + __uint16_t da_dmstate; /* DMIG state info */ + __uint16_t da_pad; /* DMIG extra padding */ +} dm_attrs_t; + typedef struct { struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ @@ -327,50 +370,26 @@ xfs_iflags_test_and_clear(xfs_inode_t *i spin_unlock(&ip->i_flags_lock); return ret; } -#endif /* __KERNEL__ */ - /* - * Fork handling. + * Manage the i_flush queue embedded in the inode. This completion + * queue synchronizes processes attempting to flush the in-core + * inode back to disk. */ +static inline void xfs_iflock(xfs_inode_t *ip) +{ + wait_for_completion(&ip->i_flush); +} -#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) -#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) - -#define XFS_IFORK_PTR(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - &(ip)->i_df : \ - (ip)->i_afp) -#define XFS_IFORK_DSIZE(ip) \ - (XFS_IFORK_Q(ip) ? \ - XFS_IFORK_BOFF(ip) : \ - XFS_LITINO((ip)->i_mount)) -#define XFS_IFORK_ASIZE(ip) \ - (XFS_IFORK_Q(ip) ? \ - XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ - 0) -#define XFS_IFORK_SIZE(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - XFS_IFORK_DSIZE(ip) : \ - XFS_IFORK_ASIZE(ip)) -#define XFS_IFORK_FORMAT(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - (ip)->i_d.di_format : \ - (ip)->i_d.di_aformat) -#define XFS_IFORK_FMT_SET(ip,w,n) \ - ((w) == XFS_DATA_FORK ? \ - ((ip)->i_d.di_format = (n)) : \ - ((ip)->i_d.di_aformat = (n))) -#define XFS_IFORK_NEXTENTS(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - (ip)->i_d.di_nextents : \ - (ip)->i_d.di_anextents) -#define XFS_IFORK_NEXT_SET(ip,w,n) \ - ((w) == XFS_DATA_FORK ? \ - ((ip)->i_d.di_nextents = (n)) : \ - ((ip)->i_d.di_anextents = (n))) +static inline int xfs_iflock_nowait(xfs_inode_t *ip) +{ + return try_wait_for_completion(&ip->i_flush); +} -#ifdef __KERNEL__ +static inline void xfs_ifunlock(xfs_inode_t *ip) +{ + complete(&ip->i_flush); +} /* * In-core inode flags. @@ -490,19 +509,12 @@ int xfs_finish_reclaim_all(struct xfs_m /* * xfs_inode.c prototypes. */ -int xfs_itobp(struct xfs_mount *, struct xfs_trans *, - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, - xfs_daddr_t, uint, uint); int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t, uint); int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, int, struct xfs_buf **, boolean_t *, xfs_inode_t **); -void xfs_dinode_from_disk(struct xfs_icdinode *, - struct xfs_dinode_core *); -void xfs_dinode_to_disk(struct xfs_dinode_core *, - struct xfs_icdinode *); uint xfs_ip2xflags(struct xfs_inode *); uint xfs_dic2xflags(struct xfs_dinode *); @@ -514,15 +526,11 @@ int xfs_itruncate_finish(struct xfs_tra int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); -void xfs_idestroy_fork(xfs_inode_t *, int); void xfs_idestroy(xfs_inode_t *); -void xfs_idata_realloc(xfs_inode_t *, int, int); void xfs_iextract(xfs_inode_t *); void xfs_iext_realloc(xfs_inode_t *, int, int); -void xfs_iroot_realloc(xfs_inode_t *, int, int); void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); @@ -533,6 +541,20 @@ void xfs_lock_two_inodes(xfs_inode_t *, void xfs_synchronize_atime(xfs_inode_t *); void xfs_mark_inode_dirty_sync(xfs_inode_t *); +#endif /* __KERNEL__ */ + +int xfs_itobp(struct xfs_mount *, struct xfs_trans *, + xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, + xfs_daddr_t, uint, uint); +void xfs_dinode_from_disk(struct xfs_icdinode *, + struct xfs_dinode_core *); +void xfs_dinode_to_disk(struct xfs_dinode_core *, + struct xfs_icdinode *); +void xfs_idestroy_fork(xfs_inode_t *, int); +void xfs_idata_realloc(xfs_inode_t *, int, int); +void xfs_iroot_realloc(xfs_inode_t *, int, int); +int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); + xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, xfs_bmbt_irec_t *); @@ -577,26 +599,4 @@ extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; -/* - * Manage the i_flush queue embedded in the inode. This completion - * queue synchronizes processes attempting to flush the in-core - * inode back to disk. - */ -static inline void xfs_iflock(xfs_inode_t *ip) -{ - wait_for_completion(&ip->i_flush); -} - -static inline int xfs_iflock_nowait(xfs_inode_t *ip) -{ - return try_wait_for_completion(&ip->i_flush); -} - -static inline void xfs_ifunlock(xfs_inode_t *ip) -{ - complete(&ip->i_flush); -} - -#endif /* __KERNEL__ */ - #endif /* __XFS_INODE_H__ */ From owner-xfs@oss.sgi.com Sun Aug 31 18:58:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 18:58:29 -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,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m811wQ5r009916 for ; Sun, 31 Aug 2008 18:58:27 -0700 X-ASG-Debug-ID: 1220234391-42c400d60000-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 D44B91BCAA98; Sun, 31 Aug 2008 18:59:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id Ypob34Y6wIjsdn8p; Sun, 31 Aug 2008 18:59:51 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KZyhr-0004Na-0E; Mon, 01 Sep 2008 01:59:51 +0000 Date: Sun, 31 Aug 2008 21:59:50 -0400 From: Christoph Hellwig To: Barry Naujok Cc: Christoph Hellwig , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Message-ID: <20080901015950.GA16825@infradead.org> References: <20080829181120.GA9455@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1220234391 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.4299 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17768 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 Mon, Sep 01, 2008 at 11:56:03AM +1000, Barry Naujok wrote: > On Sat, 30 Aug 2008 04:11:20 +1000, Christoph Hellwig > wrote: > >> On Fri, Aug 29, 2008 at 05:59:43PM +1000, Barry Naujok wrote: >>> On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok >>> wrote: >>> >>>> Mostly header changes associated with #ifdef __KERNEL__ stuff. >>>> >>>> Some function prototypes had to be reordered to separate >>>> shared and kernel only functions. >>> >>> fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing >>> declaration), here's a better version: >> >> I still don't like it very much :) What about just moving the >> xfs_ictimestamp and xfs_icdinode defintions next to the ifork >> so that we can save one ifdef __KERNEL__? Also might be worth >> to move the xfs_iflock & co inlines before the end of that __KERNEL__ >> block to save another ifdef. > > Ok, this now only has one blob of #ifdef __KERNEL__ in it now: Looks good. From owner-xfs@oss.sgi.com Sun Aug 31 19:04:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 19:04:28 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m8124NkL010560 for ; Sun, 31 Aug 2008 19:04:24 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA06909; Mon, 1 Sep 2008 12:05:47 +1000 To: "Christoph Hellwig" Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080829181120.GA9455@infradead.org> <20080901015950.GA16825@infradead.org> Content-Transfer-Encoding: 7bit Date: Mon, 01 Sep 2008 12:06:54 +1000 Message-ID: In-Reply-To: <20080901015950.GA16825@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17769 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Mon, 01 Sep 2008 11:59:50 +1000, Christoph Hellwig wrote: > On Mon, Sep 01, 2008 at 11:56:03AM +1000, Barry Naujok wrote: >> On Sat, 30 Aug 2008 04:11:20 +1000, Christoph Hellwig >> >> wrote: >> >>> On Fri, Aug 29, 2008 at 05:59:43PM +1000, Barry Naujok wrote: >>>> On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok >>>> wrote: >>>> >>>>> Mostly header changes associated with #ifdef __KERNEL__ stuff. >>>>> >>>>> Some function prototypes had to be reordered to separate >>>>> shared and kernel only functions. >>>> >>>> fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing >>>> declaration), here's a better version: >>> >>> I still don't like it very much :) What about just moving the >>> xfs_ictimestamp and xfs_icdinode defintions next to the ifork >>> so that we can save one ifdef __KERNEL__? Also might be worth >>> to move the xfs_iflock & co inlines before the end of that __KERNEL__ >>> block to save another ifdef. >> >> Ok, this now only has one blob of #ifdef __KERNEL__ in it now: > > Looks good. > What about the rest ;) From owner-xfs@oss.sgi.com Sun Aug 31 19:07:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 19:07:05 -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 m81272d4010971 for ; Sun, 31 Aug 2008 19:07:02 -0700 X-ASG-Debug-ID: 1220234907-5ea401200000-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 F1C693F1F11; Sun, 31 Aug 2008 19:08:27 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id eGLMdCIvpi038urU; Sun, 31 Aug 2008 19:08:27 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KZyqB-00058s-3c; Mon, 01 Sep 2008 02:08:27 +0000 Date: Sun, 31 Aug 2008 22:08:27 -0400 From: Christoph Hellwig To: Barry Naujok Cc: Christoph Hellwig , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Message-ID: <20080901020826.GA31724@infradead.org> References: <20080829181120.GA9455@infradead.org> <20080901015950.GA16825@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1220234907 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.4299 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17770 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 Mon, Sep 01, 2008 at 12:06:54PM +1000, Barry Naujok wrote: >> Looks good. >> > > What about the rest ;) Same comments apply - looks good except that in a few places less ifdef blocks would be nice. But we can do thes later if this helps you. From owner-xfs@oss.sgi.com Sun Aug 31 19:08:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 19:08:20 -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.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33, J_CHICKENPOX_83 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m8128IgA011352 for ; Sun, 31 Aug 2008 19:08:18 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA07075; Mon, 1 Sep 2008 12:09:41 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 4A4CB58C52AB; Mon, 1 Sep 2008 12:09:41 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 967805 - xfsprogs.pot file is not built if src file deleted and po/Makefile not updated Message-Id: <20080901020941.4A4CB58C52AB@chook.melbourne.sgi.com> Date: Mon, 1 Sep 2008 12:09:41 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17771 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Point out the actual source file missing when generateing pkg.pot file rather than obscure error message Date: Mon Sep 1 12:08:00 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: tes, nscott@aconex.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:32010a xfsprogs/include/buildrules - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/include/buildrules.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - Point out the actual source file missage when generating pkg.pot file rather than obscure error message From owner-xfs@oss.sgi.com Sun Aug 31 21:52:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 21:52:42 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m814qBPH026267 for ; Sun, 31 Aug 2008 21:52:17 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA09700; Mon, 1 Sep 2008 14:53:33 +1000 Date: Mon, 01 Sep 2008 14:55:24 +1000 To: "Christoph Hellwig" Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080829181120.GA9455@infradead.org> <20080901015950.GA16825@infradead.org> <20080901020826.GA31724@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080901020826.GA31724@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17772 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Mon, 01 Sep 2008 12:08:27 +1000, Christoph Hellwig wrote: > On Mon, Sep 01, 2008 at 12:06:54PM +1000, Barry Naujok wrote: >>> Looks good. >>> >> >> What about the rest ;) > > Same comments apply - looks good except that in a few places less > ifdef blocks would be nice. But we can do thes later if this helps you. Ok, updates based on that principle. Changes since first patch: xfs_ag.h - moved pagb_list to before the #ifdef __KERNEL__ xfs_alloc.h - moved xfs_alloc_xxx_busy to the first (and now only) #ifdef __KERNEL__ block xfs_bmap.h - moved xfs_bmap_finish to the start of the __KERNEL__ block. xfs_inode.h - had to use struct xfs_inode instead of xfs_inode_t for shared function prototypes (and unified kernel only code into one block). xfs_inode_item.h - move xfs_ilog_xxx functions before __KERNEL__ block. xfs_mount.h - clarified #ifndef __KERNEL__/#else at start. xfs_trans.h - unified kernel structures, constants, flags and function prototypes into one section. --- fs/xfs/xfs_ag.h | 5 fs/xfs/xfs_alloc.c | 2 fs/xfs/xfs_alloc.h | 27 +--- fs/xfs/xfs_arch.h | 39 ++++- fs/xfs/xfs_bit.h | 3 fs/xfs/xfs_bmap.h | 61 ++++----- fs/xfs/xfs_bmap_btree.h | 3 fs/xfs/xfs_btree.h | 4 fs/xfs/xfs_da_btree.h | 4 fs/xfs/xfs_ialloc.h | 3 fs/xfs/xfs_imap.h | 2 fs/xfs/xfs_inode.h | 244 ++++++++++++++++++------------------ fs/xfs/xfs_inode_item.h | 41 ++---- fs/xfs/xfs_mount.h | 17 +- fs/xfs/xfs_trans.h | 317 +++++++++++++++++++++++------------------------- 15 files changed, 386 insertions(+), 386 deletions(-) Index: 2.6.x-xfs/fs/xfs/xfs_ag.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_ag.h +++ 2.6.x-xfs/fs/xfs/xfs_ag.h @@ -192,15 +192,16 @@ typedef struct xfs_perag xfs_agino_t pagi_freecount; /* number of free inodes */ xfs_agino_t pagi_count; /* number of allocated inodes */ int pagb_count; /* pagb slots in use */ + xfs_perag_busy_t *pagb_list; /* unstable blocks */ #ifdef __KERNEL__ spinlock_t pagb_lock; /* lock for pagb_list */ -#endif - xfs_perag_busy_t *pagb_list; /* unstable blocks */ + atomic_t pagf_fstrms; /* # of filestreams active in this AG */ int pag_ici_init; /* incore inode cache initialised */ rwlock_t pag_ici_lock; /* incore inode lock */ struct radix_tree_root pag_ici_root; /* incore inode cache root */ +#endif } xfs_perag_t; #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) Index: 2.6.x-xfs/fs/xfs/xfs_alloc.c =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_alloc.c +++ 2.6.x-xfs/fs/xfs/xfs_alloc.c @@ -2185,6 +2185,7 @@ xfs_alloc_read_agf( be32_to_cpu(agf->agf_magicnum) == XFS_AGF_MAGIC && XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) && be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) && + be32_to_cpu(agf->agf_btreeblks) <= be32_to_cpu(agf->agf_length) && be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp); @@ -2213,6 +2214,7 @@ xfs_alloc_read_agf( #ifdef DEBUG else if (!XFS_FORCED_SHUTDOWN(mp)) { ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks)); + ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks)); ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount)); ASSERT(pag->pagf_longest == be32_to_cpu(agf->agf_longest)); ASSERT(pag->pagf_levels[XFS_BTNUM_BNOi] == Index: 2.6.x-xfs/fs/xfs/xfs_alloc.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_alloc.h +++ 2.6.x-xfs/fs/xfs/xfs_alloc.h @@ -121,6 +121,19 @@ extern ktrace_t *xfs_alloc_trace_buf; #define XFS_ALLOC_KTRACE_BUSYSEARCH 6 #endif +void +xfs_alloc_mark_busy(xfs_trans_t *tp, + xfs_agnumber_t agno, + xfs_agblock_t bno, + xfs_extlen_t len); + +void +xfs_alloc_clear_busy(xfs_trans_t *tp, + xfs_agnumber_t ag, + int idx); + +#endif /* __KERNEL__ */ + /* * Compute and fill in value of m_ag_maxlevels. */ @@ -196,18 +209,4 @@ xfs_free_extent( xfs_fsblock_t bno, /* starting block number of extent */ xfs_extlen_t len); /* length of extent */ -void -xfs_alloc_mark_busy(xfs_trans_t *tp, - xfs_agnumber_t agno, - xfs_agblock_t bno, - xfs_extlen_t len); - -void -xfs_alloc_clear_busy(xfs_trans_t *tp, - xfs_agnumber_t ag, - int idx); - - -#endif /* __KERNEL__ */ - #endif /* __XFS_ALLOC_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_arch.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_arch.h +++ 2.6.x-xfs/fs/xfs/xfs_arch.h @@ -41,21 +41,36 @@ #endif #ifdef XFS_NATIVE_HOST -#define cpu_to_be16(val) ((__be16)(val)) -#define cpu_to_be32(val) ((__be32)(val)) -#define cpu_to_be64(val) ((__be64)(val)) -#define be16_to_cpu(val) ((__uint16_t)(val)) -#define be32_to_cpu(val) ((__uint32_t)(val)) -#define be64_to_cpu(val) ((__uint64_t)(val)) +#define cpu_to_be16(val) ((__force __be16)(__u16)(val)) +#define cpu_to_be32(val) ((__force __be32)(__u32)(val)) +#define cpu_to_be64(val) ((__force __be64)(__u64)(val)) +#define be16_to_cpu(val) ((__force __u16)(__be16)(val)) +#define be32_to_cpu(val) ((__force __u32)(__be32)(val)) +#define be64_to_cpu(val) ((__force __u64)(__be64)(val)) #else -#define cpu_to_be16(val) (__swab16((__uint16_t)(val))) -#define cpu_to_be32(val) (__swab32((__uint32_t)(val))) -#define cpu_to_be64(val) (__swab64((__uint64_t)(val))) -#define be16_to_cpu(val) (__swab16((__be16)(val))) -#define be32_to_cpu(val) (__swab32((__be32)(val))) -#define be64_to_cpu(val) (__swab64((__be64)(val))) +#define cpu_to_be16(val) ((__force __be16)__swab16((__u16)(val))) +#define cpu_to_be32(val) ((__force __be32)__swab32((__u32)(val))) +#define cpu_to_be64(val) ((__force __be64)__swab64((__u64)(val))) +#define be16_to_cpu(val) (__swab16((__force __u16)(__be16)(val))) +#define be32_to_cpu(val) (__swab32((__force __u32)(__be32)(val))) +#define be64_to_cpu(val) (__swab64((__force __u64)(__be64)(val))) #endif +static inline void be16_add_cpu(__be16 *a, __s16 b) +{ + *a = cpu_to_be16(be16_to_cpu(*a) + b); +} + +static inline void be32_add_cpu(__be32 *a, __s32 b) +{ + *a = cpu_to_be32(be32_to_cpu(*a) + b); +} + +static inline void be64_add_cpu(__be64 *a, __s64 b) +{ + *a = cpu_to_be64(be64_to_cpu(*a) + b); +} + #endif /* __KERNEL__ */ /* do we need conversion? */ Index: 2.6.x-xfs/fs/xfs/xfs_bit.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bit.h +++ 2.6.x-xfs/fs/xfs/xfs_bit.h @@ -61,8 +61,7 @@ static inline int xfs_highbit64(__uint64 /* Get low bit set out of 32-bit argument, -1 if none set */ static inline int xfs_lowbit32(__uint32_t v) { - unsigned long t = v; - return (v) ? find_first_bit(&t, 32) : -1; + return ffs(v) - 1; } /* Get low bit set out of 64-bit argument, -1 if none set */ Index: 2.6.x-xfs/fs/xfs/xfs_bmap.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bmap.h +++ 2.6.x-xfs/fs/xfs/xfs_bmap.h @@ -137,9 +137,7 @@ typedef struct xfs_bmalloca { char conv; /* overwriting unwritten extents */ } xfs_bmalloca_t; -#ifdef __KERNEL__ - -#if defined(XFS_BMAP_TRACE) +#if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) /* * Trace operations for bmap extent tracing */ @@ -163,9 +161,12 @@ xfs_bmap_trace_exlist( int whichfork); /* data or attr fork */ #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ xfs_bmap_trace_exlist(__func__,ip,c,w) -#else + +#else /* __KERNEL__ && XFS_BMAP_TRACE */ + #define XFS_BMAP_TRACE_EXLIST(ip,c,w) -#endif + +#endif /* __KERNEL__ && XFS_BMAP_TRACE */ /* * Convert inode from non-attributed to attributed. @@ -206,20 +207,6 @@ xfs_bmap_compute_maxlevels( int whichfork); /* data or attr fork */ /* - * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi - * caller. Frees all the extents that need freeing, which must be done - * last due to locking considerations. - * - * Return 1 if the given transaction was committed and a new one allocated, - * and 0 otherwise. - */ -int /* error */ -xfs_bmap_finish( - struct xfs_trans **tp, /* transaction pointer addr */ - xfs_bmap_free_t *flist, /* i/o: list extents to free */ - int *committed); /* xact committed or not */ - -/* * Returns the file-relative block number of the first unused block in the file. * This is the lowest-address hole if the file has holes, else the first block * past the end of file. @@ -344,6 +331,32 @@ xfs_bunmapi( int *done); /* set if not done yet */ /* + * Check an extent list, which has just been read, for + * any bit in the extent flag field. + */ +int +xfs_check_nostate_extents( + struct xfs_ifork *ifp, + xfs_extnum_t idx, + xfs_extnum_t num); + +#ifdef __KERNEL__ + +/* + * Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi + * caller. Frees all the extents that need freeing, which must be done + * last due to locking considerations. + * + * Return 1 if the given transaction was committed and a new one allocated, + * and 0 otherwise. + */ +int /* error */ +xfs_bmap_finish( + struct xfs_trans **tp, /* transaction pointer addr */ + xfs_bmap_free_t *flist, /* i/o: list extents to free */ + int *committed); /* xact committed or not */ + +/* * Fcntl interface to xfs_bmapi. */ int /* error code */ @@ -375,16 +388,6 @@ xfs_bmap_count_blocks( int *count); /* - * Check an extent list, which has just been read, for - * any bit in the extent flag field. - */ -int -xfs_check_nostate_extents( - struct xfs_ifork *ifp, - xfs_extnum_t idx, - xfs_extnum_t num); - -/* * Search the extent records for the entry containing block bno. * If bno lies in a hole, point to the next entry. If bno lies * past eof, *eofp will be set, and *prevp will contain the last Index: 2.6.x-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_bmap_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_bmap_btree.h @@ -250,6 +250,8 @@ typedef struct xfs_btree_lblock xfs_bmbt extern ktrace_t *xfs_bmbt_trace_buf; #endif +#endif /* __KERNEL__ */ + /* * Prototypes for xfs_bmap.c to call. */ @@ -300,6 +302,5 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_bl extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); -#endif /* __KERNEL__ */ #endif /* __XFS_BMAP_BTREE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_btree.h @@ -186,8 +186,6 @@ typedef struct xfs_btree_cur #define XFS_BUF_TO_SBLOCK(bp) ((xfs_btree_sblock_t *)XFS_BUF_PTR(bp)) -#ifdef __KERNEL__ - #ifdef DEBUG /* * Debug routine: check that block header is ok. @@ -436,8 +434,6 @@ xfs_btree_setbuf( int lev, /* level in btree */ struct xfs_buf *bp); /* new buffer to set */ -#endif /* __KERNEL__ */ - /* * Min and max functions for extlen, agblock, fileoff, and filblks types. Index: 2.6.x-xfs/fs/xfs/xfs_da_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_da_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_da_btree.h @@ -206,9 +206,8 @@ struct xfs_nameops { }; -#ifdef __KERNEL__ /*======================================================================== - * Function prototypes for the kernel. + * Function prototypes. *========================================================================*/ /* @@ -269,6 +268,5 @@ xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *da extern struct kmem_zone *xfs_da_state_zone; extern struct kmem_zone *xfs_dabuf_zone; -#endif /* __KERNEL__ */ #endif /* __XFS_DA_BTREE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_ialloc.h +++ 2.6.x-xfs/fs/xfs/xfs_ialloc.h @@ -56,7 +56,6 @@ static inline int xfs_ialloc_find_free(x } -#ifdef __KERNEL__ /* * Allocate an inode on disk. * Mode is used to tell whether the new inode will need space, and whether @@ -154,6 +153,4 @@ xfs_ialloc_pagi_init( struct xfs_trans *tp, /* transaction pointer */ xfs_agnumber_t agno); /* allocation group number */ -#endif /* __KERNEL__ */ - #endif /* __XFS_IALLOC_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_imap.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_imap.h +++ 2.6.x-xfs/fs/xfs/xfs_imap.h @@ -30,11 +30,9 @@ typedef struct xfs_imap { ushort im_boffset; /* inode offset in block in bytes */ } xfs_imap_t; -#ifdef __KERNEL__ struct xfs_mount; struct xfs_trans; int xfs_imap(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_imap_t *, uint); -#endif #endif /* __XFS_IMAP_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h +++ 2.6.x-xfs/fs/xfs/xfs_inode.h @@ -20,7 +20,7 @@ struct xfs_dinode; struct xfs_dinode_core; - +struct xfs_inode; /* * Fork identifiers. @@ -84,54 +84,6 @@ typedef struct xfs_ifork { } xfs_ifork_t; /* - * Flags for xfs_ichgtime(). - */ -#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ -#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ - -/* - * Per-fork incore inode flags. - */ -#define XFS_IFINLINE 0x01 /* Inline data is read in */ -#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */ -#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */ -#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */ - -/* - * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate(). - */ -#define XFS_IMAP_LOOKUP 0x1 -#define XFS_IMAP_BULKSTAT 0x2 - -#ifdef __KERNEL__ -struct bhv_desc; -struct cred; -struct ktrace; -struct xfs_buf; -struct xfs_bmap_free; -struct xfs_bmbt_irec; -struct xfs_bmbt_block; -struct xfs_inode; -struct xfs_inode_log_item; -struct xfs_mount; -struct xfs_trans; -struct xfs_dquot; - -#if defined(XFS_ILOCK_TRACE) -#define XFS_ILOCK_KTRACE_SIZE 32 -extern ktrace_t *xfs_ilock_trace_buf; -extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); -#else -#define xfs_ilock_trace(i,n,f,ra) -#endif - -typedef struct dm_attrs_s { - __uint32_t da_dmevmask; /* DMIG event mask */ - __uint16_t da_dmstate; /* DMIG state info */ - __uint16_t da_pad; /* DMIG extra padding */ -} dm_attrs_t; - -/* * This is the xfs in-core inode structure. * Most of the on-disk inode is embedded in the i_d field. * @@ -191,6 +143,96 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; +/* + * Flags for xfs_ichgtime(). + */ +#define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ +#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ + +/* + * Per-fork incore inode flags. + */ +#define XFS_IFINLINE 0x01 /* Inline data is read in */ +#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */ +#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */ +#define XFS_IFEXTIREC 0x08 /* Indirection array of extent blocks */ + +/* + * Flags for xfs_itobp(), xfs_imap() and xfs_dilocate(). + */ +#define XFS_IMAP_LOOKUP 0x1 +#define XFS_IMAP_BULKSTAT 0x2 + +/* + * Fork handling. + */ + +#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) +#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) + +#define XFS_IFORK_PTR(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + &(ip)->i_df : \ + (ip)->i_afp) +#define XFS_IFORK_DSIZE(ip) \ + (XFS_IFORK_Q(ip) ? \ + XFS_IFORK_BOFF(ip) : \ + XFS_LITINO((ip)->i_mount)) +#define XFS_IFORK_ASIZE(ip) \ + (XFS_IFORK_Q(ip) ? \ + XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ + 0) +#define XFS_IFORK_SIZE(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + XFS_IFORK_DSIZE(ip) : \ + XFS_IFORK_ASIZE(ip)) +#define XFS_IFORK_FORMAT(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + (ip)->i_d.di_format : \ + (ip)->i_d.di_aformat) +#define XFS_IFORK_FMT_SET(ip,w,n) \ + ((w) == XFS_DATA_FORK ? \ + ((ip)->i_d.di_format = (n)) : \ + ((ip)->i_d.di_aformat = (n))) +#define XFS_IFORK_NEXTENTS(ip,w) \ + ((w) == XFS_DATA_FORK ? \ + (ip)->i_d.di_nextents : \ + (ip)->i_d.di_anextents) +#define XFS_IFORK_NEXT_SET(ip,w,n) \ + ((w) == XFS_DATA_FORK ? \ + ((ip)->i_d.di_nextents = (n)) : \ + ((ip)->i_d.di_anextents = (n))) + + + +#ifdef __KERNEL__ + +struct bhv_desc; +struct cred; +struct ktrace; +struct xfs_buf; +struct xfs_bmap_free; +struct xfs_bmbt_irec; +struct xfs_bmbt_block; +struct xfs_inode_log_item; +struct xfs_mount; +struct xfs_trans; +struct xfs_dquot; + +#if defined(XFS_ILOCK_TRACE) +#define XFS_ILOCK_KTRACE_SIZE 32 +extern ktrace_t *xfs_ilock_trace_buf; +extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); +#else +#define xfs_ilock_trace(i,n,f,ra) +#endif + +typedef struct dm_attrs_s { + __uint32_t da_dmevmask; /* DMIG event mask */ + __uint16_t da_dmstate; /* DMIG state info */ + __uint16_t da_pad; /* DMIG extra padding */ +} dm_attrs_t; + typedef struct { struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ @@ -327,50 +369,26 @@ xfs_iflags_test_and_clear(xfs_inode_t *i spin_unlock(&ip->i_flags_lock); return ret; } -#endif /* __KERNEL__ */ - /* - * Fork handling. + * Manage the i_flush queue embedded in the inode. This completion + * queue synchronizes processes attempting to flush the in-core + * inode back to disk. */ +static inline void xfs_iflock(xfs_inode_t *ip) +{ + wait_for_completion(&ip->i_flush); +} -#define XFS_IFORK_Q(ip) ((ip)->i_d.di_forkoff != 0) -#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) - -#define XFS_IFORK_PTR(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - &(ip)->i_df : \ - (ip)->i_afp) -#define XFS_IFORK_DSIZE(ip) \ - (XFS_IFORK_Q(ip) ? \ - XFS_IFORK_BOFF(ip) : \ - XFS_LITINO((ip)->i_mount)) -#define XFS_IFORK_ASIZE(ip) \ - (XFS_IFORK_Q(ip) ? \ - XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : \ - 0) -#define XFS_IFORK_SIZE(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - XFS_IFORK_DSIZE(ip) : \ - XFS_IFORK_ASIZE(ip)) -#define XFS_IFORK_FORMAT(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - (ip)->i_d.di_format : \ - (ip)->i_d.di_aformat) -#define XFS_IFORK_FMT_SET(ip,w,n) \ - ((w) == XFS_DATA_FORK ? \ - ((ip)->i_d.di_format = (n)) : \ - ((ip)->i_d.di_aformat = (n))) -#define XFS_IFORK_NEXTENTS(ip,w) \ - ((w) == XFS_DATA_FORK ? \ - (ip)->i_d.di_nextents : \ - (ip)->i_d.di_anextents) -#define XFS_IFORK_NEXT_SET(ip,w,n) \ - ((w) == XFS_DATA_FORK ? \ - ((ip)->i_d.di_nextents = (n)) : \ - ((ip)->i_d.di_anextents = (n))) +static inline int xfs_iflock_nowait(xfs_inode_t *ip) +{ + return try_wait_for_completion(&ip->i_flush); +} -#ifdef __KERNEL__ +static inline void xfs_ifunlock(xfs_inode_t *ip) +{ + complete(&ip->i_flush); +} /* * In-core inode flags. @@ -490,19 +508,12 @@ int xfs_finish_reclaim_all(struct xfs_m /* * xfs_inode.c prototypes. */ -int xfs_itobp(struct xfs_mount *, struct xfs_trans *, - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, - xfs_daddr_t, uint, uint); int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t, uint); int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t, int, struct xfs_buf **, boolean_t *, xfs_inode_t **); -void xfs_dinode_from_disk(struct xfs_icdinode *, - struct xfs_dinode_core *); -void xfs_dinode_to_disk(struct xfs_dinode_core *, - struct xfs_icdinode *); uint xfs_ip2xflags(struct xfs_inode *); uint xfs_dic2xflags(struct xfs_dinode *); @@ -514,15 +525,11 @@ int xfs_itruncate_finish(struct xfs_tra int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t); -void xfs_idestroy_fork(xfs_inode_t *, int); void xfs_idestroy(xfs_inode_t *); -void xfs_idata_realloc(xfs_inode_t *, int, int); void xfs_iextract(xfs_inode_t *); void xfs_iext_realloc(xfs_inode_t *, int, int); -void xfs_iroot_realloc(xfs_inode_t *, int, int); void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); @@ -533,6 +540,20 @@ void xfs_lock_two_inodes(xfs_inode_t *, void xfs_synchronize_atime(xfs_inode_t *); void xfs_mark_inode_dirty_sync(xfs_inode_t *); +#endif /* __KERNEL__ */ + +int xfs_itobp(struct xfs_mount *, struct xfs_trans *, + struct xfs_inode *, struct xfs_dinode **, + struct xfs_buf **, xfs_daddr_t, uint, uint); +void xfs_dinode_from_disk(struct xfs_icdinode *, + struct xfs_dinode_core *); +void xfs_dinode_to_disk(struct xfs_dinode_core *, + struct xfs_icdinode *); +void xfs_idestroy_fork(struct xfs_inode *, int); +void xfs_idata_realloc(struct xfs_inode *, int, int); +void xfs_iroot_realloc(struct xfs_inode *, int, int); +int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); + xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, xfs_bmbt_irec_t *); @@ -562,7 +583,8 @@ void xfs_iext_irec_update_extoffs(xfs_i #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) #ifdef DEBUG -void xfs_isize_check(struct xfs_mount *, xfs_inode_t *, xfs_fsize_t); +void xfs_isize_check(struct xfs_mount *, struct xfs_inode *, + xfs_fsize_t); #else /* DEBUG */ #define xfs_isize_check(mp, ip, isize) #endif /* DEBUG */ @@ -577,26 +599,4 @@ extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; -/* - * Manage the i_flush queue embedded in the inode. This completion - * queue synchronizes processes attempting to flush the in-core - * inode back to disk. - */ -static inline void xfs_iflock(xfs_inode_t *ip) -{ - wait_for_completion(&ip->i_flush); -} - -static inline int xfs_iflock_nowait(xfs_inode_t *ip) -{ - return try_wait_for_completion(&ip->i_flush); -} - -static inline void xfs_ifunlock(xfs_inode_t *ip) -{ - complete(&ip->i_flush); -} - -#endif /* __KERNEL__ */ - #endif /* __XFS_INODE_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h +++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h @@ -112,6 +112,24 @@ typedef struct xfs_inode_log_format_64 { #define XFS_ILI_IOLOCKED_ANY (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED) +#define XFS_ILOG_FBROOT(w) xfs_ilog_fbroot(w) +static inline int xfs_ilog_fbroot(int w) +{ + return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT); +} + +#define XFS_ILOG_FEXT(w) xfs_ilog_fext(w) +static inline int xfs_ilog_fext(int w) +{ + return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); +} + +#define XFS_ILOG_FDATA(w) xfs_ilog_fdata(w) +static inline int xfs_ilog_fdata(int w) +{ + return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA); +} + #ifdef __KERNEL__ struct xfs_buf; @@ -148,26 +166,6 @@ typedef struct xfs_inode_log_item { } xfs_inode_log_item_t; -#define XFS_ILOG_FDATA(w) xfs_ilog_fdata(w) -static inline int xfs_ilog_fdata(int w) -{ - return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA); -} - -#endif /* __KERNEL__ */ - -#define XFS_ILOG_FBROOT(w) xfs_ilog_fbroot(w) -static inline int xfs_ilog_fbroot(int w) -{ - return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT); -} - -#define XFS_ILOG_FEXT(w) xfs_ilog_fext(w) -static inline int xfs_ilog_fext(int w) -{ - return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); -} - static inline int xfs_inode_clean(xfs_inode_t *ip) { return (!ip->i_itemp || @@ -175,9 +173,6 @@ static inline int xfs_inode_clean(xfs_in !ip->i_update_core; } - -#ifdef __KERNEL__ - extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); extern void xfs_inode_item_destroy(struct xfs_inode *); extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *); Index: 2.6.x-xfs/fs/xfs/xfs_mount.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_mount.h +++ 2.6.x-xfs/fs/xfs/xfs_mount.h @@ -44,14 +44,14 @@ typedef struct xfs_trans_reservations { } xfs_trans_reservations_t; #ifndef __KERNEL__ -/* - * Moved here from xfs_ag.h to avoid reordering header files - */ + #define XFS_DADDR_TO_AGNO(mp,d) \ ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) #define XFS_DADDR_TO_AGBNO(mp,d) \ ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) -#else + +#else /* __KERNEL__ */ + struct cred; struct log; struct xfs_mount_args; @@ -508,7 +508,6 @@ typedef struct xfs_mod_sb { #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) -extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern int xfs_log_sbcount(xfs_mount_t *, uint); extern int xfs_mountfs(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); @@ -527,9 +526,6 @@ extern void xfs_freesb(xfs_mount_t *); extern int xfs_fs_writable(xfs_mount_t *); extern int xfs_syncsub(xfs_mount_t *, int, int *); extern int xfs_sync_inodes(xfs_mount_t *, int, int *); -extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); -extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); -extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); @@ -541,4 +537,9 @@ extern struct xfs_dmops xfs_dmcore_xfs; #endif /* __KERNEL__ */ +extern void xfs_mod_sb(struct xfs_trans *, __int64_t); +extern xfs_agnumber_t xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t); +extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); +extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); + #endif /* __XFS_MOUNT_H__ */ Index: 2.6.x-xfs/fs/xfs/xfs_trans.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_trans.h +++ 2.6.x-xfs/fs/xfs/xfs_trans.h @@ -18,6 +18,8 @@ #ifndef __XFS_TRANS_H__ #define __XFS_TRANS_H__ +struct xfs_log_item; + /* * This is the structure written in the log at the head of * every transaction. It identifies the type and id of the @@ -98,76 +100,6 @@ typedef struct xfs_trans_header { #define XFS_TRANS_TYPE_MAX 41 /* new transaction types need to be reflected in xfs_logprint(8) */ - -#ifdef __KERNEL__ -struct xfs_buf; -struct xfs_buftarg; -struct xfs_efd_log_item; -struct xfs_efi_log_item; -struct xfs_inode; -struct xfs_item_ops; -struct xfs_log_iovec; -struct xfs_log_item; -struct xfs_log_item_desc; -struct xfs_mount; -struct xfs_trans; -struct xfs_dquot_acct; - -typedef struct xfs_log_item { - struct list_head li_ail; /* AIL pointers */ - xfs_lsn_t li_lsn; /* last on-disk lsn */ - struct xfs_log_item_desc *li_desc; /* ptr to current desc*/ - struct xfs_mount *li_mountp; /* ptr to fs mount */ - uint li_type; /* item type */ - uint li_flags; /* misc flags */ - struct xfs_log_item *li_bio_list; /* buffer item list */ - void (*li_cb)(struct xfs_buf *, - struct xfs_log_item *); - /* buffer item iodone */ - /* callback func */ - struct xfs_item_ops *li_ops; /* function list */ -} xfs_log_item_t; - -#define XFS_LI_IN_AIL 0x1 -#define XFS_LI_ABORTED 0x2 - -typedef struct xfs_item_ops { - uint (*iop_size)(xfs_log_item_t *); - void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); - void (*iop_pin)(xfs_log_item_t *); - void (*iop_unpin)(xfs_log_item_t *, int); - void (*iop_unpin_remove)(xfs_log_item_t *, struct xfs_trans *); - uint (*iop_trylock)(xfs_log_item_t *); - void (*iop_unlock)(xfs_log_item_t *); - xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); - void (*iop_push)(xfs_log_item_t *); - void (*iop_pushbuf)(xfs_log_item_t *); - void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); -} xfs_item_ops_t; - -#define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) -#define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) -#define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip) -#define IOP_UNPIN(ip, flags) (*(ip)->li_ops->iop_unpin)(ip, flags) -#define IOP_UNPIN_REMOVE(ip,tp) (*(ip)->li_ops->iop_unpin_remove)(ip, tp) -#define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip) -#define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip) -#define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn) -#define IOP_PUSH(ip) (*(ip)->li_ops->iop_push)(ip) -#define IOP_PUSHBUF(ip) (*(ip)->li_ops->iop_pushbuf)(ip) -#define IOP_COMMITTING(ip, lsn) (*(ip)->li_ops->iop_committing)(ip, lsn) - -/* - * Return values for the IOP_TRYLOCK() routines. - */ -#define XFS_ITEM_SUCCESS 0 -#define XFS_ITEM_PINNED 1 -#define XFS_ITEM_LOCKED 2 -#define XFS_ITEM_FLUSHING 3 -#define XFS_ITEM_PUSHBUF 4 - -#endif /* __KERNEL__ */ - /* * This structure is used to track log items associated with * a transaction. It points to the log item and keeps some @@ -176,7 +108,7 @@ typedef struct xfs_item_ops { * once we get to commit processing (see xfs_trans_commit()). */ typedef struct xfs_log_item_desc { - xfs_log_item_t *lid_item; + struct xfs_log_item *lid_item; ushort lid_size; unsigned char lid_flags; unsigned char lid_index; @@ -276,94 +208,6 @@ xfs_lic_desc_to_chunk(xfs_log_item_desc_ (xfs_caddr_t)(((xfs_log_item_chunk_t*)0)->lic_descs)); } -#ifdef __KERNEL__ -/* - * This structure is used to maintain a list of block ranges that have been - * freed in the transaction. The ranges are listed in the perag[] busy list - * between when they're freed and the transaction is committed to disk. - */ - -typedef struct xfs_log_busy_slot { - xfs_agnumber_t lbc_ag; - ushort lbc_idx; /* index in perag.busy[] */ -} xfs_log_busy_slot_t; - -#define XFS_LBC_NUM_SLOTS 31 -typedef struct xfs_log_busy_chunk { - struct xfs_log_busy_chunk *lbc_next; - uint lbc_free; /* free slots bitmask */ - ushort lbc_unused; /* first unused */ - xfs_log_busy_slot_t lbc_busy[XFS_LBC_NUM_SLOTS]; -} xfs_log_busy_chunk_t; - -#define XFS_LBC_MAX_SLOT (XFS_LBC_NUM_SLOTS - 1) -#define XFS_LBC_FREEMASK ((1U << XFS_LBC_NUM_SLOTS) - 1) - -#define XFS_LBC_INIT(cp) ((cp)->lbc_free = XFS_LBC_FREEMASK) -#define XFS_LBC_CLAIM(cp, slot) ((cp)->lbc_free &= ~(1 << (slot))) -#define XFS_LBC_SLOT(cp, slot) (&((cp)->lbc_busy[(slot)])) -#define XFS_LBC_VACANCY(cp) (((cp)->lbc_free) & XFS_LBC_FREEMASK) -#define XFS_LBC_ISFREE(cp, slot) ((cp)->lbc_free & (1 << (slot))) - -/* - * This is the type of function which can be given to xfs_trans_callback() - * to be called upon the transaction's commit to disk. - */ -typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *); - -/* - * This is the structure maintained for every active transaction. - */ -typedef struct xfs_trans { - unsigned int t_magic; /* magic number */ - xfs_log_callback_t t_logcb; /* log callback struct */ - unsigned int t_type; /* transaction type */ - unsigned int t_log_res; /* amt of log space resvd */ - unsigned int t_log_count; /* count for perm log res */ - unsigned int t_blk_res; /* # of blocks resvd */ - unsigned int t_blk_res_used; /* # of resvd blocks used */ - unsigned int t_rtx_res; /* # of rt extents resvd */ - unsigned int t_rtx_res_used; /* # of resvd rt extents used */ - xfs_log_ticket_t t_ticket; /* log mgr ticket */ - xfs_lsn_t t_lsn; /* log seq num of start of - * transaction. */ - xfs_lsn_t t_commit_lsn; /* log seq num of end of - * transaction. */ - struct xfs_mount *t_mountp; /* ptr to fs mount struct */ - struct xfs_dquot_acct *t_dqinfo; /* acctg info for dquots */ - xfs_trans_callback_t t_callback; /* transaction callback */ - void *t_callarg; /* callback arg */ - unsigned int t_flags; /* misc flags */ - int64_t t_icount_delta; /* superblock icount change */ - int64_t t_ifree_delta; /* superblock ifree change */ - int64_t t_fdblocks_delta; /* superblock fdblocks chg */ - int64_t t_res_fdblocks_delta; /* on-disk only chg */ - int64_t t_frextents_delta;/* superblock freextents chg*/ - int64_t t_res_frextents_delta; /* on-disk only chg */ -#ifdef DEBUG - int64_t t_ag_freeblks_delta; /* debugging counter */ - int64_t t_ag_flist_delta; /* debugging counter */ - int64_t t_ag_btree_delta; /* debugging counter */ -#endif - int64_t t_dblocks_delta;/* superblock dblocks change */ - int64_t t_agcount_delta;/* superblock agcount change */ - int64_t t_imaxpct_delta;/* superblock imaxpct change */ - int64_t t_rextsize_delta;/* superblock rextsize chg */ - int64_t t_rbmblocks_delta;/* superblock rbmblocks chg */ - int64_t t_rblocks_delta;/* superblock rblocks change */ - int64_t t_rextents_delta;/* superblocks rextents chg */ - int64_t t_rextslog_delta;/* superblocks rextslog chg */ - unsigned int t_items_free; /* log item descs free */ - xfs_log_item_chunk_t t_items; /* first log item desc chunk */ - xfs_trans_header_t t_header; /* header for in-log trans */ - unsigned int t_busy_free; /* busy descs free */ - xfs_log_busy_chunk_t t_busy; /* busy/async free blocks */ - unsigned long t_pflags; /* saved process flags state */ -} xfs_trans_t; - -#endif /* __KERNEL__ */ - - #define XFS_TRANS_MAGIC 0x5452414E /* 'TRAN' */ /* * Values for t_flags. @@ -906,6 +750,156 @@ typedef struct xfs_trans { #define XFS_DQUOT_REF 1 #ifdef __KERNEL__ + +struct xfs_buf; +struct xfs_buftarg; +struct xfs_efd_log_item; +struct xfs_efi_log_item; +struct xfs_inode; +struct xfs_item_ops; +struct xfs_log_iovec; +struct xfs_log_item_desc; +struct xfs_mount; +struct xfs_trans; +struct xfs_dquot_acct; + +typedef struct xfs_log_item { + struct list_head li_ail; /* AIL pointers */ + xfs_lsn_t li_lsn; /* last on-disk lsn */ + struct xfs_log_item_desc *li_desc; /* ptr to current desc*/ + struct xfs_mount *li_mountp; /* ptr to fs mount */ + uint li_type; /* item type */ + uint li_flags; /* misc flags */ + struct xfs_log_item *li_bio_list; /* buffer item list */ + void (*li_cb)(struct xfs_buf *, + struct xfs_log_item *); + /* buffer item iodone */ + /* callback func */ + struct xfs_item_ops *li_ops; /* function list */ +} xfs_log_item_t; + +#define XFS_LI_IN_AIL 0x1 +#define XFS_LI_ABORTED 0x2 + +typedef struct xfs_item_ops { + uint (*iop_size)(xfs_log_item_t *); + void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); + void (*iop_pin)(xfs_log_item_t *); + void (*iop_unpin)(xfs_log_item_t *, int); + void (*iop_unpin_remove)(xfs_log_item_t *, struct xfs_trans *); + uint (*iop_trylock)(xfs_log_item_t *); + void (*iop_unlock)(xfs_log_item_t *); + xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); + void (*iop_push)(xfs_log_item_t *); + void (*iop_pushbuf)(xfs_log_item_t *); + void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); +} xfs_item_ops_t; + +#define IOP_SIZE(ip) (*(ip)->li_ops->iop_size)(ip) +#define IOP_FORMAT(ip,vp) (*(ip)->li_ops->iop_format)(ip, vp) +#define IOP_PIN(ip) (*(ip)->li_ops->iop_pin)(ip) +#define IOP_UNPIN(ip, flags) (*(ip)->li_ops->iop_unpin)(ip, flags) +#define IOP_UNPIN_REMOVE(ip,tp) (*(ip)->li_ops->iop_unpin_remove)(ip, tp) +#define IOP_TRYLOCK(ip) (*(ip)->li_ops->iop_trylock)(ip) +#define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip) +#define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn) +#define IOP_PUSH(ip) (*(ip)->li_ops->iop_push)(ip) +#define IOP_PUSHBUF(ip) (*(ip)->li_ops->iop_pushbuf)(ip) +#define IOP_COMMITTING(ip, lsn) (*(ip)->li_ops->iop_committing)(ip, lsn) + +/* + * Return values for the IOP_TRYLOCK() routines. + */ +#define XFS_ITEM_SUCCESS 0 +#define XFS_ITEM_PINNED 1 +#define XFS_ITEM_LOCKED 2 +#define XFS_ITEM_FLUSHING 3 +#define XFS_ITEM_PUSHBUF 4 + +/* + * This structure is used to maintain a list of block ranges that have been + * freed in the transaction. The ranges are listed in the perag[] busy list + * between when they're freed and the transaction is committed to disk. + */ + +typedef struct xfs_log_busy_slot { + xfs_agnumber_t lbc_ag; + ushort lbc_idx; /* index in perag.busy[] */ +} xfs_log_busy_slot_t; + +#define XFS_LBC_NUM_SLOTS 31 +typedef struct xfs_log_busy_chunk { + struct xfs_log_busy_chunk *lbc_next; + uint lbc_free; /* free slots bitmask */ + ushort lbc_unused; /* first unused */ + xfs_log_busy_slot_t lbc_busy[XFS_LBC_NUM_SLOTS]; +} xfs_log_busy_chunk_t; + +#define XFS_LBC_MAX_SLOT (XFS_LBC_NUM_SLOTS - 1) +#define XFS_LBC_FREEMASK ((1U << XFS_LBC_NUM_SLOTS) - 1) + +#define XFS_LBC_INIT(cp) ((cp)->lbc_free = XFS_LBC_FREEMASK) +#define XFS_LBC_CLAIM(cp, slot) ((cp)->lbc_free &= ~(1 << (slot))) +#define XFS_LBC_SLOT(cp, slot) (&((cp)->lbc_busy[(slot)])) +#define XFS_LBC_VACANCY(cp) (((cp)->lbc_free) & XFS_LBC_FREEMASK) +#define XFS_LBC_ISFREE(cp, slot) ((cp)->lbc_free & (1 << (slot))) + +/* + * This is the type of function which can be given to xfs_trans_callback() + * to be called upon the transaction's commit to disk. + */ +typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *); + +/* + * This is the structure maintained for every active transaction. + */ +typedef struct xfs_trans { + unsigned int t_magic; /* magic number */ + xfs_log_callback_t t_logcb; /* log callback struct */ + unsigned int t_type; /* transaction type */ + unsigned int t_log_res; /* amt of log space resvd */ + unsigned int t_log_count; /* count for perm log res */ + unsigned int t_blk_res; /* # of blocks resvd */ + unsigned int t_blk_res_used; /* # of resvd blocks used */ + unsigned int t_rtx_res; /* # of rt extents resvd */ + unsigned int t_rtx_res_used; /* # of resvd rt extents used */ + xfs_log_ticket_t t_ticket; /* log mgr ticket */ + xfs_lsn_t t_lsn; /* log seq num of start of + * transaction. */ + xfs_lsn_t t_commit_lsn; /* log seq num of end of + * transaction. */ + struct xfs_mount *t_mountp; /* ptr to fs mount struct */ + struct xfs_dquot_acct *t_dqinfo; /* acctg info for dquots */ + xfs_trans_callback_t t_callback; /* transaction callback */ + void *t_callarg; /* callback arg */ + unsigned int t_flags; /* misc flags */ + int64_t t_icount_delta; /* superblock icount change */ + int64_t t_ifree_delta; /* superblock ifree change */ + int64_t t_fdblocks_delta; /* superblock fdblocks chg */ + int64_t t_res_fdblocks_delta; /* on-disk only chg */ + int64_t t_frextents_delta;/* superblock freextents chg*/ + int64_t t_res_frextents_delta; /* on-disk only chg */ +#ifdef DEBUG + int64_t t_ag_freeblks_delta; /* debugging counter */ + int64_t t_ag_flist_delta; /* debugging counter */ + int64_t t_ag_btree_delta; /* debugging counter */ +#endif + int64_t t_dblocks_delta;/* superblock dblocks change */ + int64_t t_agcount_delta;/* superblock agcount change */ + int64_t t_imaxpct_delta;/* superblock imaxpct change */ + int64_t t_rextsize_delta;/* superblock rextsize chg */ + int64_t t_rbmblocks_delta;/* superblock rbmblocks chg */ + int64_t t_rblocks_delta;/* superblock rblocks change */ + int64_t t_rextents_delta;/* superblocks rextents chg */ + int64_t t_rextslog_delta;/* superblocks rextslog chg */ + unsigned int t_items_free; /* log item descs free */ + xfs_log_item_chunk_t t_items; /* first log item desc chunk */ + xfs_trans_header_t t_header; /* header for in-log trans */ + unsigned int t_busy_free; /* busy descs free */ + xfs_log_busy_chunk_t t_busy; /* busy/async free blocks */ + unsigned long t_pflags; /* saved process flags state */ +} xfs_trans_t; + /* * XFS transaction mechanism exported interfaces that are * actually macros. @@ -928,7 +922,6 @@ typedef struct xfs_trans { /* * XFS transaction mechanism exported interfaces. */ -void xfs_trans_init(struct xfs_mount *); xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint); xfs_trans_t *xfs_trans_dup(xfs_trans_t *); @@ -975,7 +968,6 @@ int _xfs_trans_commit(xfs_trans_t *, int *); #define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL) void xfs_trans_cancel(xfs_trans_t *, int); -int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); int xfs_trans_ail_init(struct xfs_mount *); void xfs_trans_ail_destroy(struct xfs_mount *); void xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t); @@ -990,4 +982,7 @@ extern kmem_zone_t *xfs_trans_zone; #endif /* __KERNEL__ */ +void xfs_trans_init(struct xfs_mount *); +int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); + #endif /* __XFS_TRANS_H__ */ From owner-xfs@oss.sgi.com Sun Aug 31 22:00:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 22:00:21 -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 (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 m814xxbU026918 for ; Sun, 31 Aug 2008 22:00:04 -0700 X-ASG-Debug-ID: 1220245245-2d0603730000-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 29BDB73C169; Sun, 31 Aug 2008 22:00:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 5wXGCgauBtEaksrf; Sun, 31 Aug 2008 22:00:45 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1Ka1Wv-0000kS-BV; Mon, 01 Sep 2008 05:00:45 +0000 Date: Mon, 1 Sep 2008 01:00:45 -0400 From: Christoph Hellwig To: Barry Naujok Cc: Christoph Hellwig , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs) Message-ID: <20080901050045.GA1396@infradead.org> References: <20080829181120.GA9455@infradead.org> <20080901015950.GA16825@infradead.org> <20080901020826.GA31724@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1220245282 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.4310 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8122/Sat Aug 30 18:04:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17773 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 > --- 2.6.x-xfs.orig/fs/xfs/xfs_ag.h > +++ 2.6.x-xfs/fs/xfs/xfs_ag.h > @@ -192,15 +192,16 @@ typedef struct xfs_perag > xfs_agino_t pagi_freecount; /* number of free inodes */ > xfs_agino_t pagi_count; /* number of allocated inodes */ > int pagb_count; /* pagb slots in use */ > + xfs_perag_busy_t *pagb_list; /* unstable blocks */ > #ifdef __KERNEL__ > spinlock_t pagb_lock; /* lock for pagb_list */ > -#endif > - xfs_perag_busy_t *pagb_list; /* unstable blocks */ > + Inside structures we should be more careful about reordering, but this one looks fine becaus pagb_list and pagb_lock should be in the same cache line either way. The rest looks good, too. From owner-xfs@oss.sgi.com Sun Aug 31 23:39:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 31 Aug 2008 23:39:30 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m816dOjS001086 for ; Sun, 31 Aug 2008 23:39:25 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA11499; Mon, 1 Sep 2008 16:40:47 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 415A958C52AB; Mon, 1 Sep 2008 16:40:47 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 907752 - Fix nametest.c warnings Message-Id: <20080901064047.415A958C52AB@chook.melbourne.sgi.com> Date: Mon, 1 Sep 2008 16:40:47 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/8123/Sun Aug 31 22:59:00 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17774 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Date: Mon Sep 1 16:40:09 AEST 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:32013a xfstests/src/nametest.c - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/src/nametest.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h - Fix nametest.c build warnings