From owner-xfs@oss.sgi.com Wed Aug 1 03:03:14 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 03:03:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,LONGWORDS autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l71A39bm006777 for ; Wed, 1 Aug 2007 03:03:13 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id UAA27292; Wed, 1 Aug 2007 20:03:02 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l71A31eW44275992; Wed, 1 Aug 2007 20:03:02 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l71A2w1t41635989; Wed, 1 Aug 2007 20:02:58 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 1 Aug 2007 20:02:58 +1000 From: David Chinner To: "William J. Earl" Cc: David Chinner , xfs-oss , Michael Nishimoto , markgw@sgi.com Subject: Re: RFC: log record CRC validation Message-ID: <20070801100258.GV31489@sgi.com> References: <20070725092445.GT12413810@sgi.com> <46A7226D.8080906@sgi.com> <46A8DF7E.4090006@agami.com> <20070726233129.GM12413810@sgi.com> <46AAA340.60208@agami.com> <20070731053048.GP31489@sgi.com> <46AFE2CB.6080102@agami.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46AFE2CB.6080102@agami.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12423 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Jul 31, 2007 at 06:32:59PM -0700, William J. Earl wrote: > David Chinner wrote: > >IMO, continuing down this same "the block device is perfect" path is > >a "head in the sand" approach. By ignoring the fact that errors can > >and do occur, we're screwing ourselves when something does actually > >go wrong because we haven't put in place the mechanisms to detect > >errors because we've assumed they will never happen. > > > >We've spent 15 years so far trying to work out what has gone wrong > >in XFS by adding more and more reactive debug into the code without > >an eye to a robust solution. We add a chunk of code here to detect > >that problem, a chunk of code there to detect this problem, and so > >on. It's just not good enough anymore. > > > >Like good security, filesystem integrity is not provided by a single > >mechanism. "Defense in depth" is what we are aiming to provide here > >and to do that you have to assume that errors can propagate through > >every interface into the filesystem. > > > > > > > I understand your argument, but why not simply strengthen the > block layer, even you do it with an optional XFS-based checksum scheme > on all blocks? You could probably do this using dm-crypt and an integrity hash. Unfortunately, I don't trust dm-crypt as far as I can throw it because we've been severely bitten by bugs in dm-crypt. Specifically the bug that existed from 2.6.14 through to 2.6.19 where it reported success to readahead bios that had been cancelled due to block device congestion and hence returning uninitialised bios as "complete" and error free. This resulted in XFS shutdowns because the only code in the entire of Linux that triggered this problem was the XFS btree readahead. Every time this occurred the finger was pointed at XFS because it detected the corruption and we had *zero* information telling us what the problem might have been. A btree block CRC failure would have *immediately* told us the block layer had returned us bad data. This is where I come back to defense in depth. Block device level integrity checking is not sufficient as bugs in this layer still need to be caught by the filesystem. I stand by this even if I implemented the block layer code myself - I don't write perfect code and nobody else does, either. Hence we *must* assume that the layer that returned the block is imperfect even if we wrote it.... > That way, you would not wind up detecting metadata > corruption and silently ignoring file data corruption Data integrity has different selection criteria compared to ensuring structural integrity of the filesystem. That is, different users have different requirements for data integrity and performance. e.g. bit errors in video and audio data don't matter but performance does, yet we still need to protect the filesystem metadata against the same bit errors. Hence, IMO, we really do need to treat them seperately to retain flexibility in the filesystem for different applications. I would prefer to aim for per-inode selection of data CRCs and allow inheritance of the attribute through the directory heirachy. That way the behaviour is user selectable for the subset of the files that the system owner cares about enough to protect. If you want to protect the entire filesystem, set the flag on the root directory at mkfs time.... > For example, > suppose you stole one block in N (where you might choose N according to > the RAID data stripe size, when running over MD), and used it as a > checksum block (storing (N-1)*K subblock checksums)? This in effect > would require either RAID full-stripe read-modify-write or at least an > extra block read-modify-write for a real block write, but it would give > you complete metadata and data integrity checking. This could be an > XFS feature or a new MD feature ("checksum" layer). dm-crypt. But, see above. > This would clearly be somewhat expensive for random writes, > much like RAID 6, and also expensive for random reads, unless the N were > equal to the RAID block size, but, as with the NetApp and Tandem > software checksums, it would assure that a high level of data integrity. Good integrity, but random writes is one of XFS's weaknesses and this would just make it worse. Netapp leverages both WAFL's linearisation of random writes and specialised hardware (NVRAM) to avoid this performance proble altogether but we can't. It's a showstopper, IMO. No matter which way I look at it, block layer integrity checking provides insufficient correctness guarantees while neutralising XFS's strengths and magnifying it's weaknesses. To me it just doesn't make sense for XFS to go down this path when there are other options that don't have these drawbacks. Basically, it makes much more sense to me to break the problem down into it's component pieces and provide protection for each of those pieces one at a time without introducing new issues. This way we don't compromise the strengths of XFS or reduce the flexibility of the filesystem in any way whilst providing better protection against errors that cause corruption. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 1 04:17:24 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 04:17:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.suse.de (mx1.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l71BHLbm016715 for ; Wed, 1 Aug 2007 04:17:24 -0700 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 6BD8D12533; Wed, 1 Aug 2007 13:17:23 +0200 (CEST) To: David Chinner Cc: Michael Nishimoto , markgw@sgi.com, xfs-dev , xfs-oss Subject: Re: RFC: log record CRC validation References: <20070725092445.GT12413810@sgi.com> <46A7226D.8080906@sgi.com> <46A8DF7E.4090006@agami.com> <20070726233129.GM12413810@sgi.com> <46A94963.7000103@agami.com> <20070727065930.GT12413810@sgi.com> <46AFD88E.9070403@agami.com> <20070801022418.GR31489@sgi.com> From: Andi Kleen Date: 01 Aug 2007 14:11:58 +0200 In-Reply-To: <20070801022418.GR31489@sgi.com> Message-ID: Lines: 17 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12424 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andi@firstfloor.org Precedence: bulk X-list: xfs David Chinner writes: > I haven't looked at great depth into other structures in terms of > implementation details. I know that if we use a 16 bit CRC on > directories we can get away without a on-disk format change as the > xfs_da_blkinfo structure has 16 bits of padding. However, given that > directory block size can reach 64k, a CRC16 check is really only > capable of single bit error detection. Hence I think we really need > CRC32 here which means an on-disk format change. When the directory format is changed it would be nice to also support DT_* types at the same time. They can speed up some operations nicely because file system walkers can avoid a stat() (and seek to the inode) just to find out if a name is a directory or not. Right now there is no space for this unfortunately. -Andi From owner-xfs@oss.sgi.com Wed Aug 1 05:17:25 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 05:17:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l71CHLbm024611 for ; Wed, 1 Aug 2007 05:17:23 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id WAA00550; Wed, 1 Aug 2007 22:17:18 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l71CHGeW44879811; Wed, 1 Aug 2007 22:17:17 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l71CHDon44939707; Wed, 1 Aug 2007 22:17:13 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 1 Aug 2007 22:17:13 +1000 From: David Chinner To: Mario Becroft Cc: linux-xfs@oss.sgi.com Subject: Re: Proper method of snapshotting XFS with external log using LVM2 Message-ID: <20070801121713.GY31489@sgi.com> References: <1185737538.12064.44.camel@server.ak.quickcircuit.co.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1185737538.12064.44.camel@server.ak.quickcircuit.co.nz> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12425 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jul 30, 2007 at 07:32:18AM +1200, Mario Becroft wrote: > I am using XFS and LVM2 under Linux. My XFS filesystems have an external > log. > > What is the correct method of creating an LVM2 snapshot of volumes > containing an XFS filesystem with external log? Not sure. I've never tried it. > Do I need to snapshot the main filesystem volume and the log volume? Yes. > Should I be using xfs_freeze to ensure that the filesystem is not > modified between when I create the filesystem snapshot and the log > snapshot? Yes. > Or is there a special procedure for atomically creating both snapshots? > > Or should I not be using an external log? If not, won't this decrease > performance? If it doesn't work, then don't use an external log and yes, it will decrease performance. > In the past I have successfully used xfs_freeze and created separate > snapshots of the filesystem and log volumes. However, I am not sure > whether this is the recommended approach. As long as both snapshots were taken with the one xfs_freeze command, then it shouldbe ok. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 1 05:23:31 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 05:23:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from isp.becroft.co.nz (isp.becroft.co.nz [202.89.33.33]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l71CNTbm028796 for ; Wed, 1 Aug 2007 05:23:30 -0700 Received: from server.ak.quickcircuit.co.nz (gateway.quickcircuit.co.nz [210.55.214.217]) by isp.becroft.co.nz (8.12.11.20060308/8.12.9) with ESMTP id l71CNTG7016188; Thu, 2 Aug 2007 00:23:29 +1200 Subject: Re: Proper method of snapshotting XFS with external log using LVM2 From: Mario Becroft To: David Chinner Cc: linux-xfs@oss.sgi.com In-Reply-To: <20070801121713.GY31489@sgi.com> References: <1185737538.12064.44.camel@server.ak.quickcircuit.co.nz> <20070801121713.GY31489@sgi.com> Content-Type: text/plain Organization: QuickCircuit Ltd. Date: Thu, 02 Aug 2007 00:23:29 +1200 Message-Id: <1185971009.13401.146.camel@server.ak.quickcircuit.co.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on isp.becroft.co.nz X-Virus-Status: Clean X-archive-position: 12426 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mb@gem.win.co.nz Precedence: bulk X-list: xfs Hi David, Thanks very much for your clear explanation of how to snapshot XFS filesystems with external log. It is good to know that I am doing it right. I found that in the latest Linux kernel version 2.6.22.1, you cannot use the method I have been using, and which you confirmed is ok. The problem is that if you xfs_freeze the filesystem, then the LVM snapshot command hangs forever. (Back in kernel version 2.6.16 this did not happen.) I guess the snapshot command is also attempting to freeze the filesystem, or something, which doesn't work when it is already frozen. I suppose how to fix this is a question for the linux-lvm mailing list. Thanks again for your detailed answer. -- Mario Becroft From owner-xfs@oss.sgi.com Wed Aug 1 05:55:56 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 05:56:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l71Ctpbm018177 for ; Wed, 1 Aug 2007 05:55:55 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l71CtsA5027305 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 1 Aug 2007 14:55:54 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l71CtsaQ027303; Wed, 1 Aug 2007 14:55:54 +0200 Date: Wed, 1 Aug 2007 14:55:54 +0200 From: Christoph Hellwig To: David Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH] stop using uio in the readlink code Message-ID: <20070801125554.GA27199@lst.de> References: <20070729211354.GB12824@lst.de> <20070801054142.GT31489@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070801054142.GT31489@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12427 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, Aug 01, 2007 at 03:41:42PM +1000, David Chinner wrote: > Do we really need to copy this code? I guess it doesn't really > matter that much but it would be nice not to have to copy an > exported vfs function just because we don't have a dentry... I was wondering whether to send a patch to fix and export the VFS function afterwards, but I really don't want a an xfs patch like this to have a VFS change depency to start with. Especially as I want to change the name of the helper in namei.c aswell - the vfs_ prefix is completely wrong. From owner-xfs@oss.sgi.com Wed Aug 1 07:09:59 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 07:10:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l71E9qbm000998 for ; Wed, 1 Aug 2007 07:09:57 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id AAA04568; Thu, 2 Aug 2007 00:09:48 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l71E9keW45088064; Thu, 2 Aug 2007 00:09:47 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l71E9ij445007528; Thu, 2 Aug 2007 00:09:44 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 2 Aug 2007 00:09:44 +1000 From: David Chinner To: Mario Becroft Cc: David Chinner , linux-xfs@oss.sgi.com Subject: Re: Proper method of snapshotting XFS with external log using LVM2 Message-ID: <20070801140944.GA31489@sgi.com> References: <1185737538.12064.44.camel@server.ak.quickcircuit.co.nz> <20070801121713.GY31489@sgi.com> <1185971009.13401.146.camel@server.ak.quickcircuit.co.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1185971009.13401.146.camel@server.ak.quickcircuit.co.nz> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12428 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Aug 02, 2007 at 12:23:29AM +1200, Mario Becroft wrote: > Hi David, > > Thanks very much for your clear explanation of how to snapshot XFS > filesystems with external log. It is good to know that I am doing it > right. > > I found that in the latest Linux kernel version 2.6.22.1, you cannot use > the method I have been using, and which you confirmed is ok. The problem > is that if you xfs_freeze the filesystem, then the LVM snapshot command > hangs forever. Ah, yes, I wondered if that still happened. The dm snapshot code is a little naive - it just assumes that it is the only thing that can freeze a device. > (Back in kernel version 2.6.16 this did not happen.) I > guess the snapshot command is also attempting to freeze the filesystem, > or something, which doesn't work when it is already frozen. It hangs on a lock that is held across the xfs_freeze -f ; xfs_freeze -u sequence. > I suppose > how to fix this is a question for the linux-lvm mailing list. IIRC from the last time this came, they'll tell you not to use xfs_freeze. As it is, the freeze_bdev() interface that both xfs_freeze and dm-snapshot use is a complete pile of crud that we need to fix. One of these days I'll get some time to fix it.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 1 08:02:56 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 08:02:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from isp.becroft.co.nz (isp.becroft.co.nz [202.89.33.33]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l71F2sbm006128 for ; Wed, 1 Aug 2007 08:02:56 -0700 Received: from server.ak.quickcircuit.co.nz (gateway.quickcircuit.co.nz [210.55.214.217]) by isp.becroft.co.nz (8.12.11.20060308/8.12.9) with ESMTP id l71F2sSp020306; Thu, 2 Aug 2007 03:02:54 +1200 Subject: Re: Proper method of snapshotting XFS with external log using LVM2 From: Mario Becroft To: David Chinner Cc: linux-xfs@oss.sgi.com, linux-lvm@redhat.com In-Reply-To: <20070801140944.GA31489@sgi.com> References: <1185737538.12064.44.camel@server.ak.quickcircuit.co.nz> <20070801121713.GY31489@sgi.com> <1185971009.13401.146.camel@server.ak.quickcircuit.co.nz> <20070801140944.GA31489@sgi.com> Content-Type: text/plain Organization: QuickCircuit Ltd. Date: Thu, 02 Aug 2007 03:02:54 +1200 Message-Id: <1185980574.2694.35.camel@server.ak.quickcircuit.co.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on isp.becroft.co.nz X-Virus-Status: Clean X-archive-position: 12429 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mb@gem.win.co.nz Precedence: bulk X-list: xfs On Thu, 2007-08-02 at 00:09 +1000, David Chinner wrote: > [lvm snapshot] hangs on a lock that is held across the xfs_freeze -f ; > xfs_freeze -u sequence. Right. > > I suppose > > how to fix this is a question for the linux-lvm mailing list. > > IIRC from the last time this came, they'll tell you not to use > xfs_freeze. Well, two problems with that: 1. There is no way to atomically create snapshots of two different volumes (the main filesystem and the log) without using xfs_freeze. 2. I tried without xfs_freeze anyway just to see what would happen, and actually in kernel 2.6.22.1 if you simply create a snapshot of the main filesystem volume and destroy it several times in a row (not even touching the log volume yet) lvcreate hangs. So it sounds like there is a fundamental problem with the approach, plus a bug somewhere... I will copy this to linux-lvm. For the benefit of those reading on linux-lvm, the issue is that I am trying to snapshot an XFS filesystem with an external log. To do this it is necessary to snapshot two volumes--the main filesystem volume and the log volume--while the filesystem is frozen. It is not sufficient to freeze the filesystem separately for each snapshot creation since its state might change between the two snapshots. The correct approach is to use xfs_freeze to freeze the filesystem, then create both snapshots, then unfreeze it. This used to work 100% reliably with kernel 2.6.16, device-mapper 1.02.03 and LVM2 2.02.02. With device-mapper 1.02.21 and LVM2 2.02.27, lvcreate hangs while creating a snapshot of a filesystem that has been frozen with xfs_freeze. Furthermore, when using kernel 2.6.22.1 (and latest device-mapper and LVM2), even if I do not use xfs_freeze, lvcreate hangs about 10% of the time when creating a snapshot. Once in the hung state (whether because xfs_freeze was used or because of the random hang) it seems impossible to get it unstuck without rebooting the system. I guess this is not an XFS-specific problem--it would happen with any filesystem employing a separate log volume. I am happy to test any patches that might address this issue... or maybe even hack one up myself if someone gives me some pointers, but I guess someone who knows something about LVM should really do it. -- Mario Becroft From owner-xfs@oss.sgi.com Wed Aug 1 21:59:25 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 01 Aug 2007 21:59:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_40 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l724xKbm022989 for ; Wed, 1 Aug 2007 21:59: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 OAA28659; Thu, 2 Aug 2007 14:59:19 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 52D2858F4B6B; Thu, 2 Aug 2007 14:59:19 +1000 (EST) To: xfs@oss.sgi.com Cc: sgi.bugs.xfs@engr.sgi.com Subject: TAKE 968166 - XFSQA 122: TOT XFS type checking fails Message-Id: <20070802045919.52D2858F4B6B@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 14:59:19 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12430 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 Fix up QA for xfsprogs 2.9.x Date: Thu Aug 2 14:57:53 AEST 2007 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/repair Inspected by: mohamedb@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29298a xfstests/030.out.linux - 1.4 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/030.out.linux.diff?r1=text&tr1=1.4&r2=text&tr2=1.3&f=h - Golden output is slightly wrong for xfs_repair 2.9.2+ xfstests/122 - 1.5 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/122.diff?r1=text&tr1=1.5&r2=text&tr2=1.4&f=h - Update test for xfs_metablock_t structure From owner-xfs@oss.sgi.com Thu Aug 2 00:13:29 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:13:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727DPbm003782 for ; Thu, 2 Aug 2007 00:13: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 RAA02238; Thu, 2 Aug 2007 17:13:23 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id ACB8A58F4B6D; Thu, 2 Aug 2007 17:13:23 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968554 - Filestreams fixes for 2.6.23 Message-Id: <20070802071323.ACB8A58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:13:23 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12431 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Set filestreams object timeout to something sane. Date: Thu Aug 2 17:12:33 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29303a fs/xfs/linux-2.6/xfs_globals.c - 1.71 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_globals.c.diff?r1=text&tr1=1.71&r2=text&tr2=1.70&f=h - Set the filestreams default timeout to 30s. From owner-xfs@oss.sgi.com Thu Aug 2 00:25:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:25:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727PFbm012238 for ; Thu, 2 Aug 2007 00:25: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 RAA02769; Thu, 2 Aug 2007 17:25:15 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 9F08058F4B6D; Thu, 2 Aug 2007 17:25:15 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE PARTIAL 968554 - Filestreams fixes for 2.6.23 Message-Id: <20070802072515.9F08058F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:25:15 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12432 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On-demand reaping of the MRU cache Instead of running the mru cache reaper all the time based on a timeout, we should only run it when the cache has active objects. This allows CPUs to sleep when there is no activity rather than be woken repeatedly just to check if there is anything to do. Date: Thu Aug 2 17:24:38 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: donaldd The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29305a fs/xfs/xfs_mru_cache.h - 1.2 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mru_cache.h.diff?r1=text&tr1=1.2&r2=text&tr2=1.1&f=h - Change the reaper to start when the first object is stored in the cache and stop when the last object is reaped. fs/xfs/xfs_mru_cache.c - 1.2 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mru_cache.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.1&f=h - Change the reaper to start when the first object is stored in the cache and stop when the last object is reaped. fs/xfs/xfs_filestream.c - 1.2 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_filestream.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.1&f=h - No longer need to tell the MRU cache to restart the reaper when we flush the cache. From owner-xfs@oss.sgi.com Thu Aug 2 00:29:15 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:29:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727TCbm014035 for ; Thu, 2 Aug 2007 00:29: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 RAA02911; Thu, 2 Aug 2007 17:29:12 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 8B3D058F4B6D; Thu, 2 Aug 2007 17:29:12 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 968554 - Filestreams fixes for 2.6.23 Message-Id: <20070802072912.8B3D058F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:29:12 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12433 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Export the filestreams trace buffer for modularised debugging setups Signed-Off-By: Christoph Hellwig Date: Thu Aug 2 17:28:29 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29306a fs/xfs/linux-2.6/xfs_ksyms.c - 1.60 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.60&r2=text&tr2=1.59&f=h - Export the filestreams trace buffer. From owner-xfs@oss.sgi.com Thu Aug 2 00:40:21 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:40:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727eIbm018527 for ; Thu, 2 Aug 2007 00:40: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 RAA03285; Thu, 2 Aug 2007 17:40:18 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 9CF4458F4B6D; Thu, 2 Aug 2007 17:40:18 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968555 - sparse fixes for 2.6.23 Message-Id: <20070802074018.9CF4458F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:40:18 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12434 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Fix sparse NULL vs 0 warnings Sparse now warns about comparing pointers to 0, so change all instance where that happens to NULL instead. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 17:39:43 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29308a fs/xfs/xfs_log.c - 1.333 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.333&r2=text&tr2=1.332&f=h - Fix sparse NULL vs 0 warnings fs/xfs/xfs_log_recover.c - 1.320 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.320&r2=text&tr2=1.319&f=h - Fix sparse NULL vs 0 warnings From owner-xfs@oss.sgi.com Thu Aug 2 00:46:37 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:46:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727kVbm021238 for ; Thu, 2 Aug 2007 00:46: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 RAA03557; Thu, 2 Aug 2007 17:46:26 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id F0D0458F4B6D; Thu, 2 Aug 2007 17:46:25 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968555 - sparse fixes for 2.6.23 Message-Id: <20070802074625.F0D0458F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:46:25 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12435 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Fix sparse warning in kmem_shake_allow We can't return a masked result of a __bitwise type. Compare it to 0 first to keep the behaviour without the warning. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 17:45:47 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29309a fs/xfs/linux-2.6/kmem.h - 1.43 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/kmem.h.diff?r1=text&tr1=1.43&r2=text&tr2=1.42&f=h - Sparse warns if we return a masked result of a __bitwise type. From owner-xfs@oss.sgi.com Thu Aug 2 00:53:27 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:53:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727rObm024225 for ; Thu, 2 Aug 2007 00:53: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 RAA03698; Thu, 2 Aug 2007 17:53:24 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 9F3AF58F4B6D; Thu, 2 Aug 2007 17:53:24 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968555 - sparse fixes for 2.6.23 Message-Id: <20070802075324.9F3AF58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:53:24 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12436 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix ASSERT and ASSERT_ALWAYS - remove the != 0 inside the unlikely in ASSERT_ALWAYS because sparse now complains about comparisons between pointers and 0 - add a standalone ASSERT implementation because defining it to ASSERT_ALWAYS means the string is expanded before the token passing stringification. This way we get the actual content of the assertation in the assfail message and don't overflow sparse's stringification buffer leading to sparse error messages. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 17:52:47 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29310a fs/xfs/support/debug.h - 1.18 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/support/debug.h.diff?r1=text&tr1=1.18&r2=text&tr2=1.17&f=h - Clean up sparse warnings fo ASSERT_ALWAYS and make ASSERT always stringify the failure correctly. From owner-xfs@oss.sgi.com Thu Aug 2 00:58:41 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 00:58:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l727wabm026258 for ; Thu, 2 Aug 2007 00:58:39 -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 RAA03883; Thu, 2 Aug 2007 17:58:35 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id C646258F4B6D; Thu, 2 Aug 2007 17:58:35 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 968555 - sparse fixes for 2.6.23 Message-Id: <20070802075835.C646258F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 17:58:35 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12437 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix sparse shadowed variable warnings - in xfs_probe_cluster rename the inner len to pg_len. There's no harm here because the outer len isn't used after the inner len comes into existance but it keeps the code clean. - in xfs_da_do_buf remove the inner i because they don't overlap and they are both the same type. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 17:58:04 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29311a fs/xfs/xfs_da_btree.c - 1.175 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_da_btree.c.diff?r1=text&tr1=1.175&r2=text&tr2=1.174&f=h - Fix shadowed var in xfs_da_do_buf. fs/xfs/linux-2.6/xfs_aops.c - 1.147 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_aops.c.diff?r1=text&tr1=1.147&r2=text&tr2=1.146&f=h - Fix shadowed var in xfs_probe_cluster. From owner-xfs@oss.sgi.com Thu Aug 2 03:55:49 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 03:55:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Atkbm020226 for ; Thu, 2 Aug 2007 03:55: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 UAA08071; Thu, 2 Aug 2007 20:55:43 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 0AFC658F4B6D; Thu, 2 Aug 2007 20:55:42 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - fix constness warning in dmapi Message-Id: <20070802105543.0AFC658F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 20:55:42 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12438 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix constness warning in dmapi File operations are const now so make sure the dmapi code propagates this properly. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 20:54:51 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29313a fs/xfs/dmapi/xfs_dm_fsops.c - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm_fsops.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h - make file operations const. Modid: linux-melb:dmapi:29313b fs/dmapi/dmapi_kern.h - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/fs/dmapi/dmapi_kern.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - make file operations const. From owner-xfs@oss.sgi.com Thu Aug 2 03:59:01 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 03:59:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Awwbm021634 for ; Thu, 2 Aug 2007 03:59:00 -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 UAA08146; Thu, 2 Aug 2007 20:58:58 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id C6AC858F4B6D; Thu, 2 Aug 2007 20:58:58 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - fix dmapi warning in 32bit builds Message-Id: <20070802105858.C6AC858F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 20:58:58 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12439 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix dmapi warning in 32bit builds dm_size_t is 64bit even in 32bit builds so we need to use max_t when when comparing to PAGE_CACHE_SIZE. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 20:58:31 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29314a fs/xfs/dmapi/xfs_dm.c - 1.40 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.40&r2=text&tr2=1.39&f=h - fix 32bit build warning in xfs_dm_probe_hole. From owner-xfs@oss.sgi.com Thu Aug 2 04:01:35 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:01:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72B1Sbm022898 for ; Thu, 2 Aug 2007 04:01: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 VAA08398; Thu, 2 Aug 2007 21:01:27 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id A1C2058F4B6D; Thu, 2 Aug 2007 21:01:27 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - fix format string warnings in xfsidbg Message-Id: <20070802110127.A1C2058F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:01:27 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12440 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix format string warnings in xfsidbg Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:01:03 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29315a fs/xfs/xfsidbg.c - 1.317 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.317&r2=text&tr2=1.316&f=h - fix format string warnings. From owner-xfs@oss.sgi.com Thu Aug 2 04:04:26 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:04:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72B4Lbm024274 for ; Thu, 2 Aug 2007 04:04: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 VAA08480; Thu, 2 Aug 2007 21:04:21 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 3AE9458F4B6D; Thu, 2 Aug 2007 21:04:21 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - fix sparse endianess warnings in xfsidbg Message-Id: <20070802110421.3AE9458F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:04:21 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12441 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix sparse endianess warnings in xfsidbg xfsidbg was missed in a a few of the previous endianess conversions, and this patch brings it up to the proper state. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:04:00 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29316a fs/xfs/xfsidbg.c - 1.318 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.318&r2=text&tr2=1.317&f=h - fix sparse endianess warnings. From owner-xfs@oss.sgi.com Thu Aug 2 04:07:44 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:07:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72B7ebm025787 for ; Thu, 2 Aug 2007 04:07: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 VAA08573; Thu, 2 Aug 2007 21:07:40 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 53C2A58F4B6D; Thu, 2 Aug 2007 21:07:40 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - remove confusing INT_ comments in xfs_bmap_btree.c Message-Id: <20070802110740.53C2A58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:07:40 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12442 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs remove confusing INT_ comments in xfs_bmap_btree.c Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:07:17 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29317a fs/xfs/xfs_bmap_btree.c - 1.162 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.c.diff?r1=text&tr1=1.162&r2=text&tr2=1.161&f=h - Cleanup unneeded comments. From owner-xfs@oss.sgi.com Thu Aug 2 04:14:13 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:14:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72BE9bm028028 for ; Thu, 2 Aug 2007 04:14: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 VAA08715; Thu, 2 Aug 2007 21:14:09 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 027AC58F4B6D; Thu, 2 Aug 2007 21:14:08 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - split ondisk vs incore versions of xfs_bmbt_rec_t Message-Id: <20070802111409.027AC58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:14:08 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12443 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs split ondisk vs incore versions of xfs_bmbt_rec_t currently xfs_bmbt_rec_t is used both for ondisk extents as well as host-endian ones. This patch adds a new xfs_bmbt_rec_host_t for the native endian ones and cleans up the fallout. There have been various endianess issues in the tracing / debug printf code that are fixed by this patch. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:13:30 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29318a fs/xfs/xfsidbg.c - 1.319 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.319&r2=text&tr2=1.318&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_bmap_btree.h - 1.77 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.h.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_bmap_btree.c - 1.163 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.c.diff?r1=text&tr1=1.163&r2=text&tr2=1.162&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_inode.c - 1.468 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.468&r2=text&tr2=1.467&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_inode.h - 1.223 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.223&r2=text&tr2=1.222&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_bmap.h - 1.100 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.h.diff?r1=text&tr1=1.100&r2=text&tr2=1.99&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/xfs_bmap.c - 1.374 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.374&r2=text&tr2=1.373&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t fs/xfs/quota/xfs_qm.c - 1.51 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.51&r2=text&tr2=1.50&f=h - split ondisk vs incore versions of xfs_bmbt_rec_t From owner-xfs@oss.sgi.com Thu Aug 2 04:25:00 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:25:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72BOsbm003236 for ; Thu, 2 Aug 2007 04:24: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 VAA09019; Thu, 2 Aug 2007 21:24:53 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 44B6C58F4B6D; Thu, 2 Aug 2007 21:24:53 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - cleanup definitions of BMBT_*BITLEN macros Message-Id: <20070802112453.44B6C58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:24:53 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12444 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs cleanup definitions of BMBT_*BITLEN macros The BMBT_*BITLEN are currently defined in a complicated way depending on XFS_NATIVE_HOST. But if all the macros are expanded they (obviously) expand to the same value for both cases. This patch defines the macros in the most simple way and updates the comment describing them to remove outdated bits. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:24:18 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29320a fs/xfs/xfs_bmap_btree.h - 1.78 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.h.diff?r1=text&tr1=1.78&r2=text&tr2=1.77&f=h - Remove the dependency of the BMBT_*BITLEN macros on XFS_NATIVE_HOST From owner-xfs@oss.sgi.com Thu Aug 2 04:28:04 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:28:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72BS1bm004543 for ; Thu, 2 Aug 2007 04:28:02 -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 VAA09075; Thu, 2 Aug 2007 21:28:00 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 0B9C858F4B6D; Thu, 2 Aug 2007 21:27:59 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - endianess annotations for xfs_bmbt_rec_t Message-Id: <20070802112800.0B9C858F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:27:59 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12445 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs endianess annotations for xfs_bmbt_rec_t Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:27:34 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29321a fs/xfs/xfs_bmap_btree.h - 1.79 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.h.diff?r1=text&tr1=1.79&r2=text&tr2=1.78&f=h - Add endian annotations for xfs_bmbt_rec_t operations. fs/xfs/xfs_bmap_btree.c - 1.165 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.c.diff?r1=text&tr1=1.165&r2=text&tr2=1.164&f=h - Add endian annotations for xfs_bmbt_rec_t operations. fs/xfs/xfs_inode.c - 1.469 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.469&r2=text&tr2=1.468&f=h - Add endian annotations for xfs_bmbt_rec_t operations. fs/xfs/xfs_bmap.c - 1.375 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.375&r2=text&tr2=1.374&f=h - Add endian annotations for xfs_bmbt_rec_t operations. From owner-xfs@oss.sgi.com Thu Aug 2 04:31:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:31:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72BV6bm005809 for ; Thu, 2 Aug 2007 04:31: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 VAA08913; Thu, 2 Aug 2007 21:18:51 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 9603458F4B6D; Thu, 2 Aug 2007 21:18:51 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - clean up xfs_bmbt_set_all/xfs_bmbt_disk_set_all Message-Id: <20070802111851.9603458F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:18:51 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12446 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs clean up xfs_bmbt_set_all/xfs_bmbt_disk_set_all xfs_bmbt_set_all/xfs_bmbt_disk_set_all are identical to xfs_bmbt_set_allf/xfs_bmbt_disk_set_allf except that the former take a xfs_bmbt_irec_t and the latter take the individual extent fields as scalar values. This patch reimplements xfs_bmbt_set_all/xfs_bmbt_disk_set_all as trivial wrappers around xfs_bmbt_set_allf/xfs_bmbt_disk_set_allf and cleans up the variable naming in xfs_bmbt_set_allf/xfs_bmbt_disk_set_allf to have some meaning instead of one char variable names. Signed-off-by: Christoph Hellwig Date: Thu Aug 2 21:18:19 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29319a fs/xfs/xfs_bmap_btree.c - 1.164 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap_btree.c.diff?r1=text&tr1=1.164&r2=text&tr2=1.163&f=h - Reimplement xfs_bmbt_set_all/xfs_bmbt_disk_set_all as trivial wrappers around xfs_bmbt_set_allf/xfs_bmbt_disk_set_allf and clean up variable naming. From owner-xfs@oss.sgi.com Thu Aug 2 04:35:33 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:35:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72BZUbm007486 for ; Thu, 2 Aug 2007 04:35: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 VAA09466; Thu, 2 Aug 2007 21:35:30 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 65FD458F4B6D; Thu, 2 Aug 2007 21:35:30 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - Remove m_nreadaheads Message-Id: <20070802113530.65FD458F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:35:30 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12447 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Remove m_nreadaheads m_nreadaheads in the mount struct is never used; remove it and the various macros assigned to it. Also remove a couple other unused macros in the same areas. Removes one user of xfs_physmem. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:35:08 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29322a fs/xfs/xfsidbg.c - 1.320 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.320&r2=text&tr2=1.319&f=h - remove unused m_nreadaheads and associated macros. fs/xfs/xfs_rw.h - 1.83 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rw.h.diff?r1=text&tr1=1.83&r2=text&tr2=1.82&f=h - remove unused m_nreadaheads and associated macros. fs/xfs/xfs_mount.h - 1.238 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.238&r2=text&tr2=1.237&f=h - remove unused m_nreadaheads and associated macros. fs/xfs/xfs_mount.c - 1.399 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.399&r2=text&tr2=1.398&f=h - remove unused m_nreadaheads and associated macros. fs/xfs/linux-2.6/xfs_lrw.h - 1.56 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_lrw.h.diff?r1=text&tr1=1.56&r2=text&tr2=1.55&f=h - remove unused m_nreadaheads and associated macros. fs/xfs/linux-2.4/xfs_lrw.h - 1.50 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.4/xfs_lrw.h.diff?r1=text&tr1=1.50&r2=text&tr2=1.49&f=h - remove unused m_nreadaheads and associated macros. From owner-xfs@oss.sgi.com Thu Aug 2 04:39:05 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:39:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Bd1bm008854 for ; Thu, 2 Aug 2007 04:39:02 -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 VAA09527; Thu, 2 Aug 2007 21:38:58 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id DC9AC58F4B6D; Thu, 2 Aug 2007 21:38:57 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - choose single default logbuf count & size Message-Id: <20070802113857.DC9AC58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:38:57 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12448 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs choose single default logbuf count & size Remove sizing of logbuf size & count based on physical memory; this was never a very good gauge as it's looking at global memory, but deciding on sizing per-filesystem; no account is made of the total number of filesystems, for example. For now just take the largest "default" case, as was set for machines with >400MB - 8 x 32k buffers. This can always be tuned higher or lower with mount options if necessary. Removes one more user of xfs_physmem. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:38:35 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29323a fs/xfs/xfs_log.c - 1.334 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.334&r2=text&tr2=1.333&f=h - Don't size logbuf size and count based on physical memory. fs/xfs/xfs_log_priv.h - 1.118 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_priv.h.diff?r1=text&tr1=1.118&r2=text&tr2=1.117&f=h - Don't size logbuf size and count based on physical memory. From owner-xfs@oss.sgi.com Thu Aug 2 04:42:45 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:42:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Bggbm010240 for ; Thu, 2 Aug 2007 04:42: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 VAA09620; Thu, 2 Aug 2007 21:42:42 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 5FBCF58F4B6D; Thu, 2 Aug 2007 21:42:42 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - Pick a single default inode cluster size. Message-Id: <20070802114242.5FBCF58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:42:42 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12449 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Pick a single default inode cluster size. Remove scaling of inode "clusters" based on machine memory; small cluster cut-point was an unrealistic 32MB and was probably never tested. Removes another user of xfs_physmem. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:42:18 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29324a fs/xfs/xfs_ialloc.h - 1.48 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ialloc.h.diff?r1=text&tr1=1.48&r2=text&tr2=1.47&f=h - Don't scale inode cluster size based on physical memory. fs/xfs/xfs_mount.c - 1.400 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.400&r2=text&tr2=1.399&f=h - Don't scale inode cluster size based on physical memory. From owner-xfs@oss.sgi.com Thu Aug 2 04:46:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:46:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Bk8bm011474 for ; Thu, 2 Aug 2007 04:46:11 -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 VAA09850; Thu, 2 Aug 2007 21:46:08 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 8BA0B58F4B6D; Thu, 2 Aug 2007 21:46:08 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - Remove xfs_physmem Message-Id: <20070802114608.8BA0B58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:46:08 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12450 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Remove xfs_physmem Now that nobody's using it, remove xfs_physmem & friends. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:45:47 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29325a fs/xfs/linux-2.6/xfs_globals.h - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_globals.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - remove unused xfs_physmem & friends. fs/xfs/linux-2.6/xfs_globals.c - 1.72 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_globals.c.diff?r1=text&tr1=1.72&r2=text&tr2=1.71&f=h - remove unused xfs_physmem & friends. fs/xfs/linux-2.6/xfs_super.c - 1.384 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.384&r2=text&tr2=1.383&f=h - remove unused xfs_physmem & friends. fs/xfs/linux-2.4/xfs_globals.h - 1.24 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.4/xfs_globals.h.diff?r1=text&tr1=1.24&r2=text&tr2=1.23&f=h - remove unused xfs_physmem & friends. fs/xfs/linux-2.4/xfs_globals.c - 1.78 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.4/xfs_globals.c.diff?r1=text&tr1=1.78&r2=text&tr2=1.77&f=h - remove unused xfs_physmem & friends. fs/xfs/linux-2.4/xfs_super.c - 1.337 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.4/xfs_super.c.diff?r1=text&tr1=1.337&r2=text&tr2=1.336&f=h - remove unused xfs_physmem & friends. From owner-xfs@oss.sgi.com Thu Aug 2 04:50:01 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:50:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Bnvbm012906 for ; Thu, 2 Aug 2007 04:50:00 -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 VAA09968; Thu, 2 Aug 2007 21:49:56 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 2AF9858F4B6D; Thu, 2 Aug 2007 21:49:56 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - move linux/log2.h header to xfs_linux.h Message-Id: <20070802114956.2AF9858F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:49:56 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12451 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs move linux/log2.h header to xfs_linux.h Generally we try not to directly include linux header files in core xfs code; xfs_linux.h is the spot for that. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:49:33 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29326a fs/xfs/xfs_inode.c - 1.470 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.470&r2=text&tr2=1.469&f=h - move linux/log2.h header to xfs_linux.h fs/xfs/linux-2.6/xfs_linux.h - 1.155 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_linux.h.diff?r1=text&tr1=1.155&r2=text&tr2=1.154&f=h - move linux/log2.h header to xfs_linux.h fs/xfs/linux-2.4/xfs_linux.h - 1.163 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.4/xfs_linux.h.diff?r1=text&tr1=1.163&r2=text&tr2=1.162&f=h - move linux/log2.h header to xfs_linux.h From owner-xfs@oss.sgi.com Thu Aug 2 04:54:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 04:54:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72Bs7bm014544 for ; Thu, 2 Aug 2007 04:54: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 VAA10083; Thu, 2 Aug 2007 21:53:54 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id D5C9258F4B6D; Thu, 2 Aug 2007 21:53:53 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - clean up xfs_start_flags Message-Id: <20070802115353.D5C9258F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 21:53:53 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12452 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs clean up xfs_start_flags xfs_start_flags can make use of is_power_of_2 to tidy up the test a little bit. Signed-off-by: Eric Sandeen Date: Thu Aug 2 21:53:18 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29327a fs/xfs/xfs_log_priv.h - 1.119 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_priv.h.diff?r1=text&tr1=1.119&r2=text&tr2=1.118&f=h - use of is_power_of_2 rather than explicitly testing all the possible power of 2 log buffer sizes. fs/xfs/xfs_vfsops.c - 1.523 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.523&r2=text&tr2=1.522&f=h - use of is_power_of_2 rather than explicitly testing all the possible power of 2 log buffer sizes. From owner-xfs@oss.sgi.com Thu Aug 2 05:12:05 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 05:12:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l72CC2bm021988 for ; Thu, 2 Aug 2007 05:12:04 -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 WAA10672; Thu, 2 Aug 2007 22:12:01 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id F402E58F4B6D; Thu, 2 Aug 2007 22:12:00 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - Fix a potential NULL pointer deref in XFS on failed mount. Message-Id: <20070802121200.F402E58F4B6D@chook.melbourne.sgi.com> Date: Thu, 2 Aug 2007 22:12:00 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12453 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Fix a potential NULL pointer deref in XFS on failed mount. If we fail to open the the log device buftarg, we can fall through to error handling code that fails to check for a NULL log device buftarg before calling xfs_free_buftarg(). This patch fixes the issue by checking mp->m_logdev_targp against NULL in xfs_unmountfs_close() and doing the proper xfs_blkdev_put(logdev); and xfs_blkdev_put(rtdev); on (!mp->m_rtdev_targp) in xfs_mount(). Discovered by the Coverity checker. Signed-off-by: Jesper Juhl Date: Thu Aug 2 22:11:36 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: jesper.juhl@gmail.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:29328a fs/xfs/xfs_vfsops.c - 1.524 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.524&r2=text&tr2=1.523&f=h - Ensure we only ever attempt to free a log device buftarg if we allocated one in teh first place. fs/xfs/xfs_mount.c - 1.401 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.401&r2=text&tr2=1.400&f=h - Ensure we only ever attempt to free a log device buftarg if we allocated one in teh first place. From owner-xfs@oss.sgi.com Thu Aug 2 07:15:13 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 07:15:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_23, J_CHICKENPOX_33,J_CHICKENPOX_62 autolearn=no version=3.2.0-pre1-r499012 Received: from bay0-omc1-s16.bay0.hotmail.com (bay0-omc1-s16.bay0.hotmail.com [65.54.246.88]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l72EFCbm000427 for ; Thu, 2 Aug 2007 07:15:13 -0700 Received: from hotmail.com ([65.54.174.76]) by bay0-omc1-s16.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 2 Aug 2007 07:15:16 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 2 Aug 2007 07:15:15 -0700 Message-ID: Received: from 85.36.106.198 by BAY103-DAV4.phx.gbl with DAV; Thu, 02 Aug 2007 14:15:10 +0000 X-Originating-IP: [85.36.106.198] X-Originating-Email: [pupilla@hotmail.com] X-Sender: pupilla@hotmail.com From: "Marco Berizzi" To: Cc: "Christoph Lameter" , "David Chinner" , , "Marco Berizzi" Subject: kernel BUG at mm/slab.c:2980 (was Re: [] xfs_bmap_search_multi_extents+0x6f/0xe0) Date: Thu, 2 Aug 2007 16:14:25 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 X-OriginalArrivalTime: 02 Aug 2007 14:15:15.0515 (UTC) FILETIME=[8C1AF0B0:01C7D50F] X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12454 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pupilla@hotmail.com Precedence: bulk X-list: xfs Marco Berizzi wrote: > Hello everybody. > I'm running linux 2.6.22 on Slackware. > This box is running openswan 2.4.9 > and squid 2.6S13 > I get tons of these messages: > > Jul 20 01:17:09 Gemini kernel: msnt_auth S 00000000 0 8356 819 > (NOTLB) > Jul 20 01:17:09 Gemini kernel: c2bd5d54 00000086 00000001 > 00000000 00000000 00000001 00000000 c11df050 > Jul 20 01:17:09 Gemini kernel: 00000014 c2bd5e24 c2bd5e78 > c2bd5e78 c11df050 c1255b7c c019c63f 00006559 > Jul 20 01:17:09 Gemini kernel: 7601a27a 0002faa4 7fffffff > 7fffffff c8af2d00 c2bd5db0 c02e9fc6 c2bd5e50 > Jul 20 01:17:09 Gemini kernel: Call Trace: > Jul 20 01:17:09 Gemini kernel: [] > xfs_bmap_search_multi_extents+0x6f/0xe0 > Jul 20 01:17:09 Gemini kernel: [] schedule_timeout+0x96/0xa0 > Jul 20 01:17:09 Gemini kernel: [] > unix_stream_data_wait+0xa9/0xd0 > Jul 20 01:17:09 Gemini kernel: [] > autoremove_wake_function+0x0/0x50 > Jul 20 01:17:09 Gemini kernel: [] > autoremove_wake_function+0x0/0x50 > Jul 20 01:17:09 Gemini kernel: [] > unix_stream_recvmsg+0x37c/0x3e0 > Jul 20 01:17:09 Gemini kernel: [] do_sock_read+0x9d/0xb0 > Jul 20 01:17:09 Gemini kernel: [] sock_aio_read+0x78/0x80 > Jul 20 01:17:09 Gemini kernel: [] do_sync_read+0xc0/0x100 > Jul 20 01:17:09 Gemini kernel: [] > autoremove_wake_function+0x0/0x50 > Jul 20 01:17:09 Gemini kernel: [] do_mmap_pgoff+0x3f3/0x730 > Jul 20 01:17:09 Gemini kernel: [] vfs_read+0x100/0x110 > Jul 20 01:17:09 Gemini kernel: [] sys_read+0x47/0x80 > Jul 20 01:17:09 Gemini kernel: [] syscall_call+0x7/0xb > Jul 20 01:17:09 Gemini kernel: ======================= > Jul 20 09:01:35 Gemini kernel: atkbd.c: Spurious NAK on isa0060/serio0. > Some program might be trying access hardware directly. > Jul 20 09:02:05 Gemini kernel: atkbd.c: Spurious NAK on isa0060/serio0. > Some program might be trying access hardware directly. > Jul 20 09:05:39 Gemini kernel: atkbd.c: Spurious ACK on isa0060/serio0. > Some program might be trying access hardware directly. > > Here is the dmesg and .config output: > > Linux version 2.6.22 (root@Gemini) (gcc version 3.3.6) #1 Mon Jul 9 > 13:48:37 CEST 2007 > BIOS-provided physical RAM map: > BIOS-e820: 0000000000000000 - 000000000009f800 (usable) > BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) > BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) > BIOS-e820: 0000000000100000 - 000000000a000000 (usable) > BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) > 160MB LOWMEM available. > Entering add_active_range(0, 0, 40960) 0 entries of 256 used > Zone PFN ranges: > DMA 0 -> 4096 > Normal 4096 -> 40960 > early_node_map[1] active PFN ranges > 0: 0 -> 40960 > On node 0 totalpages: 40960 > DMA zone: 32 pages used for memmap > DMA zone: 0 pages reserved > DMA zone: 4064 pages, LIFO batch:0 > Normal zone: 288 pages used for memmap > Normal zone: 36576 pages, LIFO batch:7 > DMI 2.1 present. > Allocating PCI resources starting at 10000000 (gap: 0a000000:f5ff0000) > Built 1 zonelists. Total pages: 40640 > Kernel command line: auto BOOT_IMAGE=Linux ro root=301 > Local APIC disabled by BIOS -- you can enable it with "lapic" > mapped APIC to ffffd000 (01141000) > Enabling fast FPU save and restore... done. > Initializing CPU#0 > PID hash table entries: 1024 (order: 10, 4096 bytes) > Detected 267.277 MHz processor. > Console: colour VGA+ 80x25 > Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) > Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) > Memory: 158964k/163840k available (1965k kernel code, 4444k reserved, > 626k data, 160k init, 0k highmem) > virtual kernel memory layout: > fixmap : 0xfffb7000 - 0xfffff000 ( 288 kB) > vmalloc : 0xca800000 - 0xfffb5000 ( 855 MB) > lowmem : 0xc0000000 - 0xca000000 ( 160 MB) > .init : 0xc038c000 - 0xc03b4000 ( 160 kB) > .data : 0xc02eb718 - 0xc0388300 ( 626 kB) > .text : 0xc0100000 - 0xc02eb718 (1965 kB) > Checking if this processor honours the WP bit even in supervisor mode... > Ok. > Calibrating delay using timer specific routine.. 535.18 BogoMIPS > (lpj=1070367) > Mount-cache hash table entries: 512 > CPU: After generic identify, caps: 0183f9ff 00000000 00000000 00000000 > 00000000 00000000 00000000 > CPU: L1 I cache: 16K, L1 D cache: 16K > CPU: After all inits, caps: 0183f9ff 00000000 00000000 00000040 00000000 > 00000000 00000000 > Compat vDSO mapped to ffffe000. > CPU: Intel Celeron (Covington) stepping 00 > Checking 'hlt' instruction... OK. > ACPI: Core revision 20070126 > ACPI Exception (tbxface-0618): AE_NO_ACPI_TABLES, While loading > namespace from ACPI tables [20070126] > ACPI: Unable to load the System Description Tables > NET: Registered protocol family 16 > PCI: PCI BIOS revision 2.10 entry at 0xfda61, last bus=1 > PCI: Using configuration type 1 > Setting up standard PCI resources > ACPI: Interpreter disabled. > Linux Plug and Play Support v0.97 (c) Adam Belay > pnp: PnP ACPI: disabled > PCI: Probing PCI hardware > PCI: Probing PCI hardware (bus 00) > * Found PM-Timer Bug on the chipset. Due to workarounds for a bug, > * this clock source is slow. Consider trying other clock sources > PCI quirk: region 6100-613f claimed by PIIX4 ACPI > PCI quirk: region 5f00-5f0f claimed by PIIX4 SMB > PCI: Using IRQ router PIIX/ICH [8086/7110] at 0000:00:07.0 > PCI: setting IRQ 11 as level-triggered > PCI: Found IRQ 11 for device 0000:00:07.2 > PCI: Sharing IRQ 11 with 0000:00:0b.0 > Time: tsc clocksource has been installed. > PCI: Bridge: 0000:00:01.0 > IO window: b000-bfff > MEM window: efe00000-efefffff > PREFETCH window: e5c00000-e7cfffff > NET: Registered protocol family 2 > IP route cache hash table entries: 2048 (order: 1, 8192 bytes) > TCP established hash table entries: 8192 (order: 4, 65536 bytes) > TCP bind hash table entries: 8192 (order: 3, 32768 bytes) > TCP: Hash tables configured (established 8192 bind 8192) > TCP reno registered > SGI XFS with no debug enabled > io scheduler noop registered > io scheduler deadline registered (default) > Limiting direct PCI/PCI transfers. > Boot video device is 0000:01:00.0 > Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 > ide: Assuming 33MHz system bus speed for PIO modes; override with > idebus=xx > PIIX4: IDE controller at PCI slot 0000:00:07.1 > PIIX4: chipset revision 1 > PIIX4: not 100% native mode: will probe irqs later > ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio > ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:pio, hdd:pio > Probing IDE interface ide0... > hda: QUANTUM FIREBALL EX3.2A, ATA DISK drive > hda: selected mode 0x42 > ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 > Probing IDE interface ide1... > hda: max request size: 128KiB > hda: 6306048 sectors (3228 MB) w/418KiB Cache, CHS=6256/16/63, UDMA(33) > hda: cache flushes not supported > hda: hda1 hda2 < hda5 hda6 hda7 hda8 hda9 > > PNP: No PS/2 controller found. Probing ports directly. > 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 > nf_conntrack version 0.5.0 (1280 buckets, 10240 max) > ip_tables: (C) 2000-2006 Netfilter Core Team > TCP cubic registered > Initializing XFRM netlink socket > NET: Registered protocol family 1 > NET: Registered protocol family 17 > NET: Registered protocol family 15 > Using IPI Shortcut mode > Filesystem "hda1": Disabling barriers, not supported by the underlying > device > XFS mounting filesystem hda1 > Ending clean XFS mount for filesystem: hda1 > VFS: Mounted root (xfs filesystem) readonly. > Freeing unused kernel memory: 160k freed > input: AT Translated Set 2 keyboard as /class/input/input0 > Adding 209624k swap on /dev/hda9. Priority:-1 extents:1 across:209624k > Filesystem "hda1": Disabling barriers, not supported by the underlying > device > Filesystem "hda1": Disabling barriers, not supported by the underlying > device > PCI: setting IRQ 9 as level-triggered > PCI: Found IRQ 9 for device 0000:00:09.0 > 3c59x: Donald Becker and others. > 0000:00:09.0: 3Com PCI 3c905 Boomerang 100baseTx at 0001de00. > PCI: setting IRQ 10 as level-triggered > PCI: Found IRQ 10 for device 0000:00:0a.0 > 0000:00:0a.0: 3Com PCI 3c905 Boomerang 100baseTx at 0001dc00. > PCI: Found IRQ 11 for device 0000:00:0b.0 > PCI: Sharing IRQ 11 with 0000:00:07.2 > 0000:00:0b.0: 3Com PCI 3c905 Boomerang 100baseTx at 0001da00. > Filesystem "hda5": Disabling barriers, not supported by the underlying > device > XFS mounting filesystem hda5 > Ending clean XFS mount for filesystem: hda5 > Filesystem "hda6": Disabling barriers, not supported by the underlying > device > XFS mounting filesystem hda6 > Ending clean XFS mount for filesystem: hda6 > Filesystem "hda7": Disabling barriers, not supported by the underlying > device > XFS mounting filesystem hda7 > Ending clean XFS mount for filesystem: hda7 > Filesystem "hda8": Disabling barriers, not supported by the underlying > device > XFS mounting filesystem hda8 > Ending clean XFS mount for filesystem: hda8 > > # > # Automatically generated make config: don't edit > # Linux kernel version: 2.6.22 > # Mon Jul 9 11:57:41 2007 > # > CONFIG_X86_32=y > CONFIG_GENERIC_TIME=y > CONFIG_CLOCKSOURCE_WATCHDOG=y > CONFIG_GENERIC_CLOCKEVENTS=y > CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y > CONFIG_LOCKDEP_SUPPORT=y > CONFIG_STACKTRACE_SUPPORT=y > CONFIG_SEMAPHORE_SLEEPERS=y > CONFIG_X86=y > CONFIG_MMU=y > CONFIG_ZONE_DMA=y > CONFIG_QUICKLIST=y > CONFIG_GENERIC_ISA_DMA=y > CONFIG_GENERIC_IOMAP=y > CONFIG_GENERIC_BUG=y > CONFIG_GENERIC_HWEIGHT=y > CONFIG_ARCH_MAY_HAVE_PC_FDC=y > CONFIG_DMI=y > CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" > > # > # Code maturity level options > # > # CONFIG_EXPERIMENTAL is not set > CONFIG_BROKEN_ON_SMP=y > CONFIG_INIT_ENV_ARG_LIMIT=32 > > # > # General setup > # > CONFIG_LOCALVERSION="" > # CONFIG_LOCALVERSION_AUTO is not set > CONFIG_SWAP=y > CONFIG_SYSVIPC=y > # CONFIG_IPC_NS is not set > CONFIG_SYSVIPC_SYSCTL=y > CONFIG_BSD_PROCESS_ACCT=y > # CONFIG_BSD_PROCESS_ACCT_V3 is not set > # CONFIG_TASKSTATS is not set > # CONFIG_UTS_NS is not set > # CONFIG_AUDIT is not set > # CONFIG_IKCONFIG is not set > CONFIG_LOG_BUF_SHIFT=14 > # CONFIG_SYSFS_DEPRECATED is not set > # CONFIG_RELAY is not set > # CONFIG_BLK_DEV_INITRD is not set > CONFIG_SYSCTL=y > # CONFIG_EMBEDDED is not set > CONFIG_UID16=y > CONFIG_SYSCTL_SYSCALL=y > CONFIG_KALLSYMS=y > # CONFIG_KALLSYMS_EXTRA_PASS is not set > CONFIG_HOTPLUG=y > CONFIG_PRINTK=y > CONFIG_BUG=y > CONFIG_ELF_CORE=y > CONFIG_BASE_FULL=y > CONFIG_FUTEX=y > CONFIG_ANON_INODES=y > CONFIG_EPOLL=y > CONFIG_SIGNALFD=y > CONFIG_TIMERFD=y > CONFIG_EVENTFD=y > CONFIG_SHMEM=y > CONFIG_VM_EVENT_COUNTERS=y > CONFIG_SLAB=y > # CONFIG_SLUB is not set > # CONFIG_SLOB is not set > CONFIG_RT_MUTEXES=y > # CONFIG_TINY_SHMEM is not set > CONFIG_BASE_SMALL=0 > > # > # Loadable module support > # > CONFIG_MODULES=y > CONFIG_MODULE_UNLOAD=y > # CONFIG_MODVERSIONS is not set > # CONFIG_MODULE_SRCVERSION_ALL is not set > # CONFIG_KMOD is not set > > # > # Block layer > # > CONFIG_BLOCK=y > # CONFIG_LBD is not set > # CONFIG_BLK_DEV_IO_TRACE is not set > # CONFIG_LSF is not set > > # > # IO Schedulers > # > CONFIG_IOSCHED_NOOP=y > # CONFIG_IOSCHED_AS is not set > CONFIG_IOSCHED_DEADLINE=y > # CONFIG_IOSCHED_CFQ is not set > # CONFIG_DEFAULT_AS is not set > CONFIG_DEFAULT_DEADLINE=y > # CONFIG_DEFAULT_CFQ is not set > # CONFIG_DEFAULT_NOOP is not set > CONFIG_DEFAULT_IOSCHED="deadline" > > # > # Processor type and features > # > # CONFIG_TICK_ONESHOT is not set > # CONFIG_NO_HZ is not set > # CONFIG_HIGH_RES_TIMERS is not set > # CONFIG_SMP is not set > CONFIG_X86_PC=y > # CONFIG_X86_ELAN is not set > # CONFIG_X86_VOYAGER is not set > # CONFIG_X86_NUMAQ is not set > # CONFIG_X86_SUMMIT is not set > # CONFIG_X86_BIGSMP is not set > # CONFIG_X86_VISWS is not set > # CONFIG_X86_GENERICARCH is not set > # CONFIG_X86_ES7000 is not set > # CONFIG_M386 is not set > # CONFIG_M486 is not set > # CONFIG_M586 is not set > # CONFIG_M586TSC is not set > # CONFIG_M586MMX is not set > # CONFIG_M686 is not set > CONFIG_MPENTIUMII=y > # CONFIG_MPENTIUMIII is not set > # CONFIG_MPENTIUMM is not set > # CONFIG_MCORE2 is not set > # CONFIG_MPENTIUM4 is not set > # CONFIG_MK6 is not set > # CONFIG_MK7 is not set > # CONFIG_MK8 is not set > # CONFIG_MCRUSOE is not set > # CONFIG_MEFFICEON is not set > # CONFIG_MWINCHIPC6 is not set > # CONFIG_MWINCHIP2 is not set > # CONFIG_MWINCHIP3D is not set > # CONFIG_MGEODEGX1 is not set > # CONFIG_MGEODE_LX is not set > # CONFIG_MCYRIXIII is not set > # CONFIG_MVIAC3_2 is not set > # CONFIG_MVIAC7 is not set > # CONFIG_X86_GENERIC is not set > CONFIG_X86_CMPXCHG=y > CONFIG_X86_L1_CACHE_SHIFT=5 > CONFIG_X86_XADD=y > CONFIG_RWSEM_XCHGADD_ALGORITHM=y > # CONFIG_ARCH_HAS_ILOG2_U32 is not set > # CONFIG_ARCH_HAS_ILOG2_U64 is not set > CONFIG_GENERIC_CALIBRATE_DELAY=y > CONFIG_X86_WP_WORKS_OK=y > CONFIG_X86_INVLPG=y > CONFIG_X86_BSWAP=y > CONFIG_X86_POPAD_OK=y > CONFIG_X86_GOOD_APIC=y > CONFIG_X86_INTEL_USERCOPY=y > CONFIG_X86_USE_PPRO_CHECKSUM=y > CONFIG_X86_TSC=y > CONFIG_X86_CMOV=y > CONFIG_X86_MINIMUM_CPU_MODEL=4 > # CONFIG_HPET_TIMER is not set > CONFIG_PREEMPT_NONE=y > # CONFIG_PREEMPT_VOLUNTARY is not set > # CONFIG_PREEMPT is not set > CONFIG_X86_UP_APIC=y > CONFIG_X86_UP_IOAPIC=y > CONFIG_X86_LOCAL_APIC=y > CONFIG_X86_IO_APIC=y > # CONFIG_X86_MCE is not set > CONFIG_VM86=y > # CONFIG_TOSHIBA is not set > # CONFIG_I8K is not set > # CONFIG_X86_REBOOTFIXUPS is not set > # CONFIG_MICROCODE is not set > # CONFIG_X86_MSR is not set > # CONFIG_X86_CPUID is not set > > # > # Firmware Drivers > # > # CONFIG_EDD is not set > # CONFIG_DELL_RBU is not set > # CONFIG_DCDBAS is not set > CONFIG_NOHIGHMEM=y > # CONFIG_HIGHMEM4G is not set > # CONFIG_HIGHMEM64G is not set > CONFIG_PAGE_OFFSET=0xC0000000 > CONFIG_ARCH_POPULATES_NODE_MAP=y > CONFIG_FLATMEM=y > CONFIG_FLAT_NODE_MEM_MAP=y > # CONFIG_SPARSEMEM_STATIC is not set > CONFIG_SPLIT_PTLOCK_CPUS=4 > # CONFIG_RESOURCES_64BIT is not set > CONFIG_ZONE_DMA_FLAG=1 > CONFIG_NR_QUICK=1 > # CONFIG_MATH_EMULATION is not set > # CONFIG_MTRR is not set > # CONFIG_EFI is not set > CONFIG_SECCOMP=y > # CONFIG_HZ_100 is not set > CONFIG_HZ_250=y > # CONFIG_HZ_300 is not set > # CONFIG_HZ_1000 is not set > CONFIG_HZ=250 > # CONFIG_KEXEC is not set > CONFIG_PHYSICAL_START=0x100000 > CONFIG_PHYSICAL_ALIGN=0x100000 > # CONFIG_COMPAT_VDSO is not set > > # > # Power management options (ACPI, APM) > # > CONFIG_PM=y > # CONFIG_PM_LEGACY is not set > # CONFIG_PM_DEBUG is not set > # CONFIG_PM_SYSFS_DEPRECATED is not set > # CONFIG_SOFTWARE_SUSPEND is not set > > # > # ACPI (Advanced Configuration and Power Interface) Support > # > CONFIG_ACPI=y > # CONFIG_ACPI_SLEEP is not set > # CONFIG_ACPI_PROCFS is not set > # CONFIG_ACPI_AC is not set > # CONFIG_ACPI_BATTERY is not set > # CONFIG_ACPI_BUTTON is not set > # CONFIG_ACPI_FAN is not set > # CONFIG_ACPI_PROCESSOR is not set > # CONFIG_ACPI_ASUS is not set > # CONFIG_ACPI_TOSHIBA is not set > CONFIG_ACPI_BLACKLIST_YEAR=0 > # CONFIG_ACPI_DEBUG is not set > CONFIG_ACPI_EC=y > CONFIG_ACPI_POWER=y > CONFIG_ACPI_SYSTEM=y > CONFIG_X86_PM_TIMER=y > # CONFIG_APM is not set > > # > # CPU Frequency scaling > # > # CONFIG_CPU_FREQ is not set > > # > # Bus options (PCI, PCMCIA, EISA, MCA, ISA) > # > CONFIG_PCI=y > # CONFIG_PCI_GOBIOS is not set > # CONFIG_PCI_GOMMCONFIG is not set > # CONFIG_PCI_GODIRECT is not set > CONFIG_PCI_GOANY=y > CONFIG_PCI_BIOS=y > CONFIG_PCI_DIRECT=y > CONFIG_PCI_MMCONFIG=y > # CONFIG_PCIEPORTBUS is not set > CONFIG_ARCH_SUPPORTS_MSI=y > # CONFIG_PCI_MSI is not set > # CONFIG_HT_IRQ is not set > CONFIG_ISA_DMA_API=y > # CONFIG_ISA is not set > # CONFIG_MCA is not set > # CONFIG_SCx200 is not set > > # > # PCCARD (PCMCIA/CardBus) support > # > # CONFIG_PCCARD is not set > > # > # Executable file formats > # > CONFIG_BINFMT_ELF=y > # CONFIG_BINFMT_AOUT is not set > # CONFIG_BINFMT_MISC is not set > > # > # Networking > # > CONFIG_NET=y > > # > # Networking options > # > CONFIG_PACKET=y > CONFIG_PACKET_MMAP=y > CONFIG_UNIX=y > CONFIG_XFRM=y > CONFIG_XFRM_USER=y > CONFIG_NET_KEY=y > CONFIG_INET=y > # CONFIG_IP_MULTICAST is not set > CONFIG_IP_ADVANCED_ROUTER=y > CONFIG_ASK_IP_FIB_HASH=y > # CONFIG_IP_FIB_TRIE is not set > CONFIG_IP_FIB_HASH=y > CONFIG_IP_MULTIPLE_TABLES=y > CONFIG_IP_ROUTE_MULTIPATH=y > # CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set > CONFIG_IP_ROUTE_VERBOSE=y > # CONFIG_IP_PNP is not set > # CONFIG_NET_IPIP is not set > # CONFIG_NET_IPGRE is not set > CONFIG_SYN_COOKIES=y > # CONFIG_INET_AH is not set > CONFIG_INET_ESP=y > CONFIG_INET_IPCOMP=y > CONFIG_INET_XFRM_TUNNEL=y > CONFIG_INET_TUNNEL=y > CONFIG_INET_XFRM_MODE_TRANSPORT=y > CONFIG_INET_XFRM_MODE_TUNNEL=y > # CONFIG_INET_XFRM_MODE_BEET is not set > CONFIG_INET_DIAG=y > CONFIG_INET_TCP_DIAG=y > # CONFIG_TCP_CONG_ADVANCED is not set > CONFIG_TCP_CONG_CUBIC=y > CONFIG_DEFAULT_TCP_CONG="cubic" > # CONFIG_IP_VS is not set > # CONFIG_IPV6 is not set > # CONFIG_INET6_XFRM_TUNNEL is not set > # CONFIG_INET6_TUNNEL is not set > # CONFIG_NETWORK_SECMARK is not set > CONFIG_NETFILTER=y > # CONFIG_NETFILTER_DEBUG is not set > > # > # Core Netfilter Configuration > # > CONFIG_NETFILTER_NETLINK=m > CONFIG_NETFILTER_NETLINK_QUEUE=m > CONFIG_NETFILTER_NETLINK_LOG=m > CONFIG_NF_CONNTRACK_ENABLED=y > CONFIG_NF_CONNTRACK=y > CONFIG_NF_CT_ACCT=y > CONFIG_NF_CONNTRACK_MARK=y > CONFIG_NF_CT_PROTO_GRE=m > # CONFIG_NF_CONNTRACK_AMANDA is not set > CONFIG_NF_CONNTRACK_FTP=m > # CONFIG_NF_CONNTRACK_IRC is not set > CONFIG_NF_CONNTRACK_PPTP=m > # CONFIG_NF_CONNTRACK_TFTP is not set > CONFIG_NETFILTER_XTABLES=y > CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m > CONFIG_NETFILTER_XT_TARGET_CONNMARK=m > CONFIG_NETFILTER_XT_TARGET_DSCP=m > CONFIG_NETFILTER_XT_TARGET_MARK=y > CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m > CONFIG_NETFILTER_XT_TARGET_NFLOG=m > CONFIG_NETFILTER_XT_TARGET_NOTRACK=m > CONFIG_NETFILTER_XT_TARGET_TCPMSS=m > CONFIG_NETFILTER_XT_MATCH_COMMENT=m > CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m > CONFIG_NETFILTER_XT_MATCH_CONNMARK=m > CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m > CONFIG_NETFILTER_XT_MATCH_DCCP=m > CONFIG_NETFILTER_XT_MATCH_DSCP=m > CONFIG_NETFILTER_XT_MATCH_ESP=m > CONFIG_NETFILTER_XT_MATCH_HELPER=y > CONFIG_NETFILTER_XT_MATCH_LENGTH=m > CONFIG_NETFILTER_XT_MATCH_LIMIT=y > CONFIG_NETFILTER_XT_MATCH_MAC=m > CONFIG_NETFILTER_XT_MATCH_MARK=y > CONFIG_NETFILTER_XT_MATCH_POLICY=y > CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y > CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m > CONFIG_NETFILTER_XT_MATCH_QUOTA=m > CONFIG_NETFILTER_XT_MATCH_REALM=m > CONFIG_NETFILTER_XT_MATCH_STATE=y > CONFIG_NETFILTER_XT_MATCH_STATISTIC=m > CONFIG_NETFILTER_XT_MATCH_STRING=m > CONFIG_NETFILTER_XT_MATCH_TCPMSS=y > CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m > > # > # IP: Netfilter Configuration > # > CONFIG_NF_CONNTRACK_IPV4=y > # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set > # CONFIG_IP_NF_QUEUE is not set > CONFIG_IP_NF_IPTABLES=y > CONFIG_IP_NF_MATCH_IPRANGE=m > CONFIG_IP_NF_MATCH_TOS=m > # CONFIG_IP_NF_MATCH_RECENT is not set > CONFIG_IP_NF_MATCH_ECN=m > CONFIG_IP_NF_MATCH_AH=m > CONFIG_IP_NF_MATCH_TTL=m > CONFIG_IP_NF_MATCH_OWNER=m > CONFIG_IP_NF_MATCH_ADDRTYPE=m > CONFIG_IP_NF_FILTER=y > CONFIG_IP_NF_TARGET_REJECT=y > CONFIG_IP_NF_TARGET_LOG=m > CONFIG_IP_NF_TARGET_ULOG=m > CONFIG_NF_NAT=y > CONFIG_NF_NAT_NEEDED=y > CONFIG_IP_NF_TARGET_MASQUERADE=m > CONFIG_IP_NF_TARGET_REDIRECT=m > CONFIG_IP_NF_TARGET_NETMAP=m > CONFIG_IP_NF_TARGET_SAME=m > CONFIG_NF_NAT_PROTO_GRE=m > CONFIG_NF_NAT_FTP=m > # CONFIG_NF_NAT_IRC is not set > # CONFIG_NF_NAT_TFTP is not set > # CONFIG_NF_NAT_AMANDA is not set > CONFIG_NF_NAT_PPTP=m > # CONFIG_NF_NAT_H323 is not set > # CONFIG_NF_NAT_SIP is not set > CONFIG_IP_NF_MANGLE=y > CONFIG_IP_NF_TARGET_TOS=m > CONFIG_IP_NF_TARGET_ECN=m > CONFIG_IP_NF_TARGET_TTL=m > CONFIG_IP_NF_RAW=m > CONFIG_IP_NF_ARPTABLES=m > CONFIG_IP_NF_ARPFILTER=m > CONFIG_IP_NF_ARP_MANGLE=m > # CONFIG_BRIDGE is not set > # CONFIG_VLAN_8021Q is not set > # CONFIG_DECNET is not set > # CONFIG_LLC2 is not set > # CONFIG_IPX is not set > # CONFIG_ATALK is not set > > # > # QoS and/or fair queueing > # > CONFIG_NET_SCHED=y > CONFIG_NET_SCH_FIFO=y > > # > # Queueing/Scheduling > # > # CONFIG_NET_SCH_CBQ is not set > CONFIG_NET_SCH_HTB=m > CONFIG_NET_SCH_HFSC=m > CONFIG_NET_SCH_PRIO=m > CONFIG_NET_SCH_RED=m > CONFIG_NET_SCH_SFQ=m > CONFIG_NET_SCH_TEQL=m > CONFIG_NET_SCH_TBF=m > CONFIG_NET_SCH_GRED=m > CONFIG_NET_SCH_DSMARK=m > # CONFIG_NET_SCH_NETEM is not set > CONFIG_NET_SCH_INGRESS=m > > # > # Classification > # > CONFIG_NET_CLS=y > CONFIG_NET_CLS_BASIC=m > CONFIG_NET_CLS_TCINDEX=m > CONFIG_NET_CLS_ROUTE4=m > CONFIG_NET_CLS_ROUTE=y > CONFIG_NET_CLS_FW=m > CONFIG_NET_CLS_U32=m > CONFIG_CLS_U32_PERF=y > CONFIG_CLS_U32_MARK=y > CONFIG_NET_CLS_RSVP=m > # CONFIG_NET_CLS_RSVP6 is not set > CONFIG_NET_EMATCH=y > CONFIG_NET_EMATCH_STACK=32 > CONFIG_NET_EMATCH_CMP=m > CONFIG_NET_EMATCH_NBYTE=m > CONFIG_NET_EMATCH_U32=m > CONFIG_NET_EMATCH_META=m > CONFIG_NET_EMATCH_TEXT=m > CONFIG_NET_CLS_ACT=y > CONFIG_NET_ACT_POLICE=m > CONFIG_NET_ACT_GACT=m > CONFIG_GACT_PROB=y > CONFIG_NET_ACT_MIRRED=m > CONFIG_NET_ACT_IPT=m > CONFIG_NET_ACT_PEDIT=m > # CONFIG_NET_ACT_SIMP is not set > # CONFIG_NET_CLS_IND is not set > CONFIG_NET_ESTIMATOR=y > > # > # Network testing > # > # CONFIG_NET_PKTGEN is not set > # CONFIG_HAMRADIO is not set > # CONFIG_IRDA is not set > # CONFIG_BT is not set > CONFIG_FIB_RULES=y > > # > # Wireless > # > # CONFIG_CFG80211 is not set > # CONFIG_WIRELESS_EXT is not set > # CONFIG_IEEE80211 is not set > # CONFIG_RFKILL is not set > > # > # Device Drivers > # > > # > # Generic Driver Options > # > CONFIG_STANDALONE=y > # CONFIG_PREVENT_FIRMWARE_BUILD is not set > # CONFIG_FW_LOADER is not set > # CONFIG_SYS_HYPERVISOR is not set > > # > # Connector - unified userspace <-> kernelspace linker > # > # CONFIG_CONNECTOR is not set > # CONFIG_MTD is not set > > # > # Parallel port support > # > # CONFIG_PARPORT is not set > > # > # Plug and Play support > # > CONFIG_PNP=y > # CONFIG_PNP_DEBUG is not set > > # > # Protocols > # > CONFIG_PNPACPI=y > > # > # Block devices > # > CONFIG_BLK_DEV_FD=m > # CONFIG_BLK_CPQ_DA is not set > # CONFIG_BLK_CPQ_CISS_DA is not set > # CONFIG_BLK_DEV_DAC960 is not set > # CONFIG_BLK_DEV_COW_COMMON is not set > # CONFIG_BLK_DEV_LOOP is not set > # CONFIG_BLK_DEV_NBD is not set > # CONFIG_BLK_DEV_SX8 is not set > # CONFIG_BLK_DEV_RAM is not set > # CONFIG_CDROM_PKTCDVD is not set > # CONFIG_ATA_OVER_ETH is not set > > # > # Misc devices > # > # CONFIG_PHANTOM is not set > # CONFIG_SGI_IOC4 is not set > # CONFIG_SONY_LAPTOP is not set > # CONFIG_THINKPAD_ACPI is not set > CONFIG_IDE=y > CONFIG_BLK_DEV_IDE=y > > # > # Please see Documentation/ide.txt for help/info on IDE drives > # > # CONFIG_BLK_DEV_IDE_SATA is not set > # CONFIG_BLK_DEV_HD_IDE is not set > CONFIG_BLK_DEV_IDEDISK=y > # CONFIG_IDEDISK_MULTI_MODE is not set > CONFIG_BLK_DEV_IDECD=m > # CONFIG_BLK_DEV_IDEFLOPPY is not set > # CONFIG_BLK_DEV_IDEACPI is not set > # CONFIG_IDE_TASK_IOCTL is not set > # CONFIG_IDE_PROC_FS is not set > > # > # IDE chipset support/bugfixes > # > # CONFIG_IDE_GENERIC is not set > # CONFIG_BLK_DEV_CMD640 is not set > # CONFIG_BLK_DEV_IDEPNP is not set > CONFIG_BLK_DEV_IDEPCI=y > CONFIG_IDEPCI_SHARE_IRQ=y > CONFIG_IDEPCI_PCIBUS_ORDER=y > # CONFIG_BLK_DEV_OFFBOARD is not set > # CONFIG_BLK_DEV_GENERIC is not set > # CONFIG_BLK_DEV_RZ1000 is not set > CONFIG_BLK_DEV_IDEDMA_PCI=y > # CONFIG_BLK_DEV_IDEDMA_FORCED is not set > CONFIG_IDEDMA_ONLYDISK=y > # CONFIG_BLK_DEV_AEC62XX is not set > # CONFIG_BLK_DEV_ALI15X3 is not set > # CONFIG_BLK_DEV_AMD74XX is not set > # CONFIG_BLK_DEV_ATIIXP is not set > # CONFIG_BLK_DEV_CMD64X is not set > # CONFIG_BLK_DEV_TRIFLEX is not set > # CONFIG_BLK_DEV_CY82C693 is not set > # CONFIG_BLK_DEV_CS5530 is not set > # CONFIG_BLK_DEV_CS5535 is not set > # CONFIG_BLK_DEV_HPT34X is not set > # CONFIG_BLK_DEV_HPT366 is not set > # CONFIG_BLK_DEV_JMICRON is not set > # CONFIG_BLK_DEV_SC1200 is not set > CONFIG_BLK_DEV_PIIX=y > # CONFIG_BLK_DEV_IT8213 is not set > # CONFIG_BLK_DEV_IT821X is not set > # CONFIG_BLK_DEV_NS87415 is not set > # CONFIG_BLK_DEV_PDC202XX_OLD is not set > # CONFIG_BLK_DEV_PDC202XX_NEW is not set > # CONFIG_BLK_DEV_SVWKS is not set > # CONFIG_BLK_DEV_SIIMAGE is not set > # CONFIG_BLK_DEV_SIS5513 is not set > # CONFIG_BLK_DEV_SLC90E66 is not set > # CONFIG_BLK_DEV_TRM290 is not set > # CONFIG_BLK_DEV_VIA82CXXX is not set > # CONFIG_BLK_DEV_TC86C001 is not set > # CONFIG_IDE_ARM is not set > CONFIG_BLK_DEV_IDEDMA=y > # CONFIG_IDEDMA_IVB is not set > # CONFIG_BLK_DEV_HD is not set > > # > # SCSI device support > # > # CONFIG_RAID_ATTRS is not set > # CONFIG_SCSI is not set > # CONFIG_SCSI_NETLINK is not set > # CONFIG_ATA is not set > > # > # Multi-device support (RAID and LVM) > # > # CONFIG_MD is not set > > # > # Fusion MPT device support > # > # CONFIG_FUSION is not set > > # > # IEEE 1394 (FireWire) support > # > > # > # An alternative FireWire stack is available with EXPERIMENTAL=y > # > # CONFIG_IEEE1394 is not set > > # > # I2O device support > # > # CONFIG_I2O is not set > # CONFIG_MACINTOSH_DRIVERS is not set > > # > # Network device support > # > CONFIG_NETDEVICES=y > CONFIG_IFB=m > # CONFIG_DUMMY is not set > # CONFIG_BONDING is not set > # CONFIG_EQUALIZER is not set > CONFIG_TUN=m > # CONFIG_NET_SB1000 is not set > # CONFIG_ARCNET is not set > # CONFIG_PHYLIB is not set > > # > # Ethernet (10 or 100Mbit) > # > CONFIG_NET_ETHERNET=y > CONFIG_MII=m > # CONFIG_HAPPYMEAL is not set > # CONFIG_SUNGEM is not set > # CONFIG_CASSINI is not set > CONFIG_NET_VENDOR_3COM=y > CONFIG_VORTEX=m > # CONFIG_TYPHOON is not set > > # > # Tulip family network device support > # > # CONFIG_NET_TULIP is not set > # CONFIG_HP100 is not set > # CONFIG_NET_PCI is not set > # CONFIG_NETDEV_1000 is not set > # CONFIG_NETDEV_10000 is not set > # CONFIG_TR is not set > > # > # Wireless LAN > # > # CONFIG_WLAN_PRE80211 is not set > # CONFIG_WLAN_80211 is not set > # CONFIG_WAN is not set > # CONFIG_FDDI is not set > # CONFIG_PPP is not set > # CONFIG_SLIP is not set > # CONFIG_NETPOLL is not set > # CONFIG_NET_POLL_CONTROLLER is not set > > # > # ISDN subsystem > # > # CONFIG_ISDN is not set > > # > # Telephony Support > # > # CONFIG_PHONE is not set > > # > # Input device support > # > CONFIG_INPUT=y > # CONFIG_INPUT_FF_MEMLESS is not set > # CONFIG_INPUT_POLLDEV is not set > > # > # Userland interfaces > # > CONFIG_INPUT_MOUSEDEV=y > # CONFIG_INPUT_MOUSEDEV_PSAUX is not set > CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 > CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 > # CONFIG_INPUT_JOYDEV is not set > # CONFIG_INPUT_TSDEV is not set > # CONFIG_INPUT_EVDEV is not set > # CONFIG_INPUT_EVBUG is not set > > # > # Input Device Drivers > # > CONFIG_INPUT_KEYBOARD=y > CONFIG_KEYBOARD_ATKBD=y > # CONFIG_KEYBOARD_SUNKBD is not set > # CONFIG_KEYBOARD_LKKBD is not set > # CONFIG_KEYBOARD_XTKBD is not set > # CONFIG_KEYBOARD_NEWTON is not set > # CONFIG_KEYBOARD_STOWAWAY is not set > # CONFIG_INPUT_MOUSE is not set > # CONFIG_INPUT_JOYSTICK is not set > # CONFIG_INPUT_TABLET is not set > # CONFIG_INPUT_TOUCHSCREEN is not set > # CONFIG_INPUT_MISC is not set > > # > # Hardware I/O ports > # > CONFIG_SERIO=y > CONFIG_SERIO_I8042=y > # CONFIG_SERIO_SERPORT is not set > # CONFIG_SERIO_CT82C710 is not set > # CONFIG_SERIO_PCIPS2 is not set > CONFIG_SERIO_LIBPS2=y > # CONFIG_SERIO_RAW is not set > # CONFIG_GAMEPORT is not set > > # > # Character devices > # > CONFIG_VT=y > CONFIG_VT_CONSOLE=y > CONFIG_HW_CONSOLE=y > # CONFIG_VT_HW_CONSOLE_BINDING is not set > # CONFIG_SERIAL_NONSTANDARD is not set > > # > # Serial drivers > # > # CONFIG_SERIAL_8250 is not set > > # > # Non-8250 serial port support > # > # CONFIG_SERIAL_JSM is not set > CONFIG_UNIX98_PTYS=y > # CONFIG_LEGACY_PTYS is not set > > # > # IPMI > # > # CONFIG_IPMI_HANDLER is not set > # CONFIG_WATCHDOG is not set > # CONFIG_HW_RANDOM is not set > # CONFIG_NVRAM is not set > # CONFIG_RTC is not set > # CONFIG_GEN_RTC is not set > # CONFIG_R3964 is not set > # CONFIG_APPLICOM is not set > # CONFIG_AGP is not set > # CONFIG_DRM is not set > # CONFIG_MWAVE is not set > # CONFIG_PC8736x_GPIO is not set > # CONFIG_NSC_GPIO is not set > # CONFIG_CS5535_GPIO is not set > # CONFIG_RAW_DRIVER is not set > # CONFIG_HPET is not set > # CONFIG_HANGCHECK_TIMER is not set > > # > # TPM devices > # > CONFIG_DEVPORT=y > # CONFIG_I2C is not set > > # > # SPI support > # > # CONFIG_SPI is not set > # CONFIG_SPI_MASTER is not set > > # > # Dallas's 1-wire bus > # > # CONFIG_W1 is not set > # CONFIG_HWMON is not set > > # > # Multifunction device drivers > # > # CONFIG_MFD_SM501 is not set > > # > # Multimedia devices > # > # CONFIG_VIDEO_DEV is not set > # CONFIG_DVB_CORE is not set > # CONFIG_DAB is not set > > # > # Graphics support > # > # CONFIG_BACKLIGHT_LCD_SUPPORT is not set > > # > # Display device support > # > # CONFIG_DISPLAY_SUPPORT is not set > # CONFIG_VGASTATE is not set > # CONFIG_FB is not set > > # > # Console display driver support > # > CONFIG_VGA_CONSOLE=y > # CONFIG_VGACON_SOFT_SCROLLBACK is not set > # CONFIG_VIDEO_SELECT is not set > CONFIG_DUMMY_CONSOLE=y > > # > # Sound > # > # CONFIG_SOUND is not set > > # > # HID Devices > # > # CONFIG_HID is not set > > # > # USB support > # > CONFIG_USB_ARCH_HAS_HCD=y > CONFIG_USB_ARCH_HAS_OHCI=y > CONFIG_USB_ARCH_HAS_EHCI=y > # CONFIG_USB is not set > > # > # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' > # > > # > # USB Gadget Support > # > # CONFIG_USB_GADGET is not set > # CONFIG_MMC is not set > > # > # LED devices > # > # CONFIG_NEW_LEDS is not set > > # > # LED drivers > # > > # > # LED Triggers > # > > # > # InfiniBand support > # > # CONFIG_INFINIBAND is not set > > # > # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) > # > > # > # Real Time Clock > # > > # > # DMA Engine support > # > # CONFIG_DMA_ENGINE is not set > > # > # DMA Clients > # > > # > # DMA Devices > # > > # > # Virtualization > # > > # > # File systems > # > CONFIG_EXT2_FS=m > # CONFIG_EXT2_FS_XATTR is not set > # CONFIG_EXT2_FS_XIP is not set > # CONFIG_EXT3_FS is not set > # CONFIG_REISERFS_FS is not set > # CONFIG_JFS_FS is not set > # CONFIG_FS_POSIX_ACL is not set > CONFIG_XFS_FS=y > # CONFIG_XFS_QUOTA is not set > # CONFIG_XFS_SECURITY is not set > # CONFIG_XFS_POSIX_ACL is not set > # CONFIG_XFS_RT is not set > # CONFIG_OCFS2_FS is not set > # CONFIG_MINIX_FS is not set > # CONFIG_ROMFS_FS is not set > CONFIG_INOTIFY=y > CONFIG_INOTIFY_USER=y > # CONFIG_QUOTA is not set > CONFIG_DNOTIFY=y > # CONFIG_AUTOFS_FS is not set > # CONFIG_AUTOFS4_FS is not set > # CONFIG_FUSE_FS is not set > > # > # CD-ROM/DVD Filesystems > # > CONFIG_ISO9660_FS=m > # CONFIG_JOLIET is not set > # CONFIG_ZISOFS is not set > # CONFIG_UDF_FS is not set > > # > # DOS/FAT/NT Filesystems > # > # CONFIG_MSDOS_FS is not set > # CONFIG_VFAT_FS is not set > # CONFIG_NTFS_FS is not set > > # > # Pseudo filesystems > # > CONFIG_PROC_FS=y > CONFIG_PROC_KCORE=y > CONFIG_PROC_SYSCTL=y > CONFIG_SYSFS=y > # CONFIG_TMPFS is not set > # CONFIG_HUGETLBFS is not set > # CONFIG_HUGETLB_PAGE is not set > CONFIG_RAMFS=y > > # > # Miscellaneous filesystems > # > # CONFIG_HFSPLUS_FS is not set > # CONFIG_CRAMFS is not set > # CONFIG_VXFS_FS is not set > # CONFIG_HPFS_FS is not set > # CONFIG_QNX4FS_FS is not set > # CONFIG_SYSV_FS is not set > # CONFIG_UFS_FS is not set > > # > # Network File Systems > # > # CONFIG_NFS_FS is not set > # CONFIG_NFSD is not set > # CONFIG_SMB_FS is not set > # CONFIG_CIFS is not set > # CONFIG_NCP_FS is not set > # CONFIG_CODA_FS is not set > > # > # Partition Types > # > # CONFIG_PARTITION_ADVANCED is not set > CONFIG_MSDOS_PARTITION=y > > # > # Native Language Support > # > # CONFIG_NLS is not set > > # > # Kernel hacking > # > CONFIG_TRACE_IRQFLAGS_SUPPORT=y > # CONFIG_PRINTK_TIME is not set > # CONFIG_ENABLE_MUST_CHECK is not set > # CONFIG_MAGIC_SYSRQ is not set > # CONFIG_UNUSED_SYMBOLS is not set > # CONFIG_DEBUG_FS is not set > # CONFIG_HEADERS_CHECK is not set > # CONFIG_DEBUG_KERNEL is not set > CONFIG_DEBUG_BUGVERBOSE=y > CONFIG_EARLY_PRINTK=y > CONFIG_X86_FIND_SMP_CONFIG=y > CONFIG_X86_MPPARSE=y > CONFIG_DOUBLEFAULT=y > > # > # Security options > # > # CONFIG_KEYS is not set > # CONFIG_SECURITY is not set > > # > # Cryptographic options > # > CONFIG_CRYPTO=y > CONFIG_CRYPTO_ALGAPI=y > CONFIG_CRYPTO_BLKCIPHER=y > CONFIG_CRYPTO_HASH=y > CONFIG_CRYPTO_MANAGER=y > CONFIG_CRYPTO_HMAC=y > # CONFIG_CRYPTO_NULL is not set > # CONFIG_CRYPTO_MD4 is not set > CONFIG_CRYPTO_MD5=y > CONFIG_CRYPTO_SHA1=y > CONFIG_CRYPTO_SHA256=y > CONFIG_CRYPTO_SHA512=y > # CONFIG_CRYPTO_WP512 is not set > # CONFIG_CRYPTO_TGR192 is not set > CONFIG_CRYPTO_ECB=m > CONFIG_CRYPTO_CBC=y > # CONFIG_CRYPTO_PCBC is not set > # CONFIG_CRYPTO_CRYPTD is not set > CONFIG_CRYPTO_DES=y > # CONFIG_CRYPTO_FCRYPT is not set > CONFIG_CRYPTO_BLOWFISH=m > # CONFIG_CRYPTO_TWOFISH is not set > CONFIG_CRYPTO_TWOFISH_COMMON=m > CONFIG_CRYPTO_TWOFISH_586=m > CONFIG_CRYPTO_SERPENT=m > # CONFIG_CRYPTO_AES is not set > CONFIG_CRYPTO_AES_586=y > # CONFIG_CRYPTO_CAST5 is not set > # CONFIG_CRYPTO_CAST6 is not set > # CONFIG_CRYPTO_TEA is not set > # CONFIG_CRYPTO_ARC4 is not set > # CONFIG_CRYPTO_KHAZAD is not set > # CONFIG_CRYPTO_ANUBIS is not set > CONFIG_CRYPTO_DEFLATE=y > # CONFIG_CRYPTO_MICHAEL_MIC is not set > # CONFIG_CRYPTO_CRC32C is not set > # CONFIG_CRYPTO_CAMELLIA is not set > # CONFIG_CRYPTO_TEST is not set > > # > # Hardware crypto devices > # > # CONFIG_CRYPTO_DEV_PADLOCK is not set > # CONFIG_CRYPTO_DEV_GEODE is not set > > # > # Library routines > # > CONFIG_BITREVERSE=m > CONFIG_CRC_CCITT=m > CONFIG_CRC16=m > # CONFIG_CRC_ITU_T is not set > CONFIG_CRC32=m > CONFIG_LIBCRC32C=m > CONFIG_ZLIB_INFLATE=y > CONFIG_ZLIB_DEFLATE=y > CONFIG_TEXTSEARCH=y > CONFIG_TEXTSEARCH_KMP=m > CONFIG_TEXTSEARCH_BM=m > CONFIG_TEXTSEARCH_FSM=m > CONFIG_PLIST=y > CONFIG_HAS_IOMEM=y > CONFIG_HAS_IOPORT=y > CONFIG_HAS_DMA=y > CONFIG_GENERIC_HARDIRQS=y > CONFIG_GENERIC_IRQ_PROBE=y > CONFIG_X86_BIOS_REBOOT=y > CONFIG_KTIME_SCALAR=y Me again. Just few minutes ago linux has been definitely crashed. This is the dmesg: Aug 2 15:24:36 Gemini kernel: BUG: unable to handle kernel paging request at virtual address cbb93164 Aug 2 15:24:36 Gemini kernel: printing eip: Aug 2 15:24:36 Gemini kernel: c014e83f Aug 2 15:24:36 Gemini kernel: *pde = 00000000 Aug 2 15:24:36 Gemini kernel: Oops: 0002 [#1] Aug 2 15:24:36 Gemini kernel: Modules linked in: nf_nat_pptp nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp nf_conntrack_ftp 3c59x mii Aug 2 15:24:36 Gemini kernel: CPU: 0 Aug 2 15:24:36 Gemini kernel: EIP: 0060:[] Not tainted VLI Aug 2 15:24:36 Gemini kernel: EFLAGS: 00010807 (2.6.22 #1) Aug 2 15:24:36 Gemini kernel: EIP is at slab_put_obj+0x1f/0x40 Aug 2 15:24:36 Gemini kernel: eax: ffffffff ebx: c925a000 ecx: 5a2cdcd1 edx: 00a4e452 Aug 2 15:24:36 Gemini kernel: esi: c11ff1e0 edi: c925a000 ebp: 0000000b esp: c9fe9ed0 Aug 2 15:24:36 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0000 ss: 0068 Aug 2 15:24:37 Gemini kernel: Process xfssyncd (pid: 223, ti=c9fe8000 task=c11b2a90 task.ti=c9fe8000) Aug 2 15:24:37 Gemini kernel: Stack: c925a000 c11c06a0 c11ff1e0 c014ec16 00000000 0000003c c11b9010 c11b9010 Aug 2 15:24:37 Gemini kernel: c11ff1e0 c11ff1e0 00000000 c014ecdf 00000000 0000003c c11b9000 c11b9000 Aug 2 15:24:37 Gemini kernel: 00000246 c11ff1e0 c9a3aaf0 c014f069 c9dce3e0 c9dce3e0 00000001 00000002 Aug 2 15:24:37 Gemini kernel: Call Trace: Aug 2 15:24:37 Gemini kernel: [] free_block+0x86/0x100 Aug 2 15:24:37 Gemini kernel: [] cache_flusharray+0x4f/0xc0 Aug 2 15:24:37 Gemini kernel: [] kmem_cache_free+0x69/0x90 Aug 2 15:24:37 Gemini kernel: [] xfs_idestroy+0x40/0x90 Aug 2 15:24:37 Gemini kernel: [] xfs_finish_reclaim+0xb3/0x120 Aug 2 15:24:37 Gemini kernel: [] xfs_finish_reclaim_all+0xc9/0xf0 Aug 2 15:24:37 Gemini kernel: [] xfs_syncsub+0x63/0x290 Aug 2 15:24:37 Gemini kernel: [] schedule_timeout+0x55/0xa0 Aug 2 15:24:37 Gemini kernel: [] vfs_sync+0x22/0x30 Aug 2 15:24:37 Gemini kernel: [] vfs_sync_worker+0x41/0x50 Aug 2 15:24:37 Gemini kernel: [] xfssyncd+0x109/0x180 Aug 2 15:24:37 Gemini kernel: [] xfssyncd+0x0/0x180 Aug 2 15:24:37 Gemini kernel: [] kthread+0x6a/0x70 Aug 2 15:24:37 Gemini kernel: [] kthread+0x0/0x70 Aug 2 15:24:37 Gemini kernel: [] kernel_thread_helper+0x7/0x10 Aug 2 15:24:37 Gemini kernel: ======================= Aug 2 15:24:37 Gemini kernel: Code: 4a 14 c3 89 f6 8d bc 27 00 00 00 00 83 ec 0c 89 74 24 04 89 c6 89 7c 24 08 89 d7 89 1c 24 8b 42 0c 29 c1 89 c8 f7 66 14 8b 47 14 <89> 44 97 1c 8b 1c 24 89 57 14 8b 74 24 04 ff 4f 10 8b 7c 24 08 Aug 2 15:24:37 Gemini kernel: EIP: [] slab_put_obj+0x1f/0x40 SS:ESP 0068:c9fe9ed0 Aug 2 15:24:40 Gemini kernel: BUG: unable to handle kernel paging request at virtual address 00100104 Aug 2 15:24:40 Gemini kernel: printing eip: Aug 2 15:24:40 Gemini kernel: c014ebf4 Aug 2 15:24:40 Gemini kernel: *pde = 00000000 Aug 2 15:24:40 Gemini kernel: Oops: 0002 [#2] Aug 2 15:24:40 Gemini kernel: Modules linked in: nf_nat_pptp nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp nf_conntrack_ftp 3c59x mii Aug 2 15:24:40 Gemini kernel: CPU: 0 Aug 2 15:24:40 Gemini kernel: EIP: 0060:[] Not tainted VLI Aug 2 15:24:40 Gemini kernel: EFLAGS: 00010082 (2.6.22 #1) Aug 2 15:24:40 Gemini kernel: EIP is at free_block+0x64/0x100 Aug 2 15:24:40 Gemini kernel: eax: 00100100 ebx: c925a000 ecx: c925a4ec edx: 00200200 Aug 2 15:24:40 Gemini kernel: esi: c11c06a0 edi: c11ff1e0 ebp: 0000000b esp: c11a3f14 Aug 2 15:24:40 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0000 ss: 0068 Aug 2 15:24:40 Gemini kernel: Process events/0 (pid: 4, ti=c11a2000 task=c1195a50 task.ti=c11a2000) Aug 2 15:24:40 Gemini kernel: Stack: 00000000 00000018 c11b9010 c11b9010 c11b9000 00000018 c11ff1e0 c014f4e1 Aug 2 15:24:40 Gemini kernel: 00000000 c11c06a0 c11ff1e0 c03cdc20 00000000 c014f55b 00000000 00000000 Aug 2 15:24:40 Gemini kernel: 00038e6b c03cdc20 c117e8a0 c014f500 c01228ea 00005ead 7180abb4 00073f12 Aug 2 15:24:40 Gemini kernel: Call Trace: Aug 2 15:24:40 Gemini kernel: [] drain_array+0x91/0xb0 Aug 2 15:24:40 Gemini kernel: [] cache_reap+0x5b/0x100 Aug 2 15:24:40 Gemini kernel: [] cache_reap+0x0/0x100 Aug 2 15:24:40 Gemini kernel: [] run_workqueue+0x4a/0x100 Aug 2 15:24:40 Gemini kernel: [] worker_thread+0xcb/0x100 Aug 2 15:24:40 Gemini kernel: [] autoremove_wake_function+0x0/0x50 Aug 2 15:24:40 Gemini kernel: [] __wake_up_common+0x37/0x70 Aug 2 15:24:40 Gemini kernel: [] autoremove_wake_function+0x0/0x50 Aug 2 15:24:40 Gemini kernel: [] worker_thread+0x0/0x100 Aug 2 15:24:40 Gemini kernel: [] kthread+0x6a/0x70 Aug 2 15:24:40 Gemini kernel: [] kthread+0x0/0x70 Aug 2 15:24:40 Gemini kernel: [] kernel_thread_helper+0x7/0x10 Aug 2 15:24:40 Gemini kernel: ======================= Aug 2 15:24:40 Gemini kernel: Code: da 25 00 40 02 00 3d 00 40 02 00 0f 84 a8 00 00 00 8b 02 a8 80 0f 84 8b 00 00 00 8b 5a 1c 8b 44 24 20 8b 53 04 8b 74 87 4c 8b 03 <89> 50 04 89 02 89 da c7 03 00 01 10 00 c7 43 04 00 02 20 00 8b Aug 2 15:24:40 Gemini kernel: EIP: [] free_block+0x64/0x100 SS:ESP 0068:c11a3f14 Aug 2 15:29:03 Gemini kernel: ------------[ cut here ]------------ Aug 2 15:29:03 Gemini kernel: kernel BUG at mm/slab.c:2980! Aug 2 15:29:03 Gemini kernel: invalid opcode: 0000 [#3] Aug 2 15:29:03 Gemini kernel: Modules linked in: nf_nat_pptp nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp nf_conntrack_ftp 3c59x mii Aug 2 15:29:03 Gemini kernel: CPU: 0 Aug 2 15:29:03 Gemini kernel: EIP: 0060:[] Not tainted VLI Aug 2 15:29:03 Gemini kernel: EFLAGS: 00010046 (2.6.22 #1) Aug 2 15:29:03 Gemini kernel: EIP is at cache_alloc_refill+0x16d/0x1c0 Aug 2 15:29:03 Gemini kernel: eax: 0000001c ebx: 00000005 ecx: 00000036 edx: c11ff1e0 Aug 2 15:29:03 Gemini kernel: esi: c8a40000 edi: c11c06a0 ebp: c11b9000 esp: c8da7dc8 Aug 2 15:29:03 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0033 ss: 0068 Aug 2 15:29:03 Gemini kernel: Process unlinkd (pid: 2476, ti=c8da6000 task=c11b3ab0 task.ti=c8da6000) Aug 2 15:29:03 Gemini kernel: Stack: c9fb1400 c11c06a8 00000036 00000250 c11ff1e0 00000286 c11ff1e0 00000250 Aug 2 15:29:03 Gemini kernel: c11ff1e0 c014ed8f 00000000 00000001 c01de776 c9fb1400 00025638 c01c5554 Aug 2 15:29:03 Gemini kernel: c6355800 c9fb1400 c11ff1e0 c64340d4 c01de805 c6355800 c9fb1400 00000004 Aug 2 15:29:03 Gemini kernel: Call Trace: Aug 2 15:29:03 Gemini kernel: [] kmem_cache_alloc+0x3f/0x50 Aug 2 15:29:03 Gemini kernel: [] kmem_zone_alloc+0x46/0xc0 Aug 2 15:29:03 Gemini kernel: [] xfs_log_reserve+0xa4/0xb0 Aug 2 15:29:03 Gemini kernel: [] kmem_zone_zalloc+0x15/0x50 Aug 2 15:29:03 Gemini kernel: [] xfs_inode_item_init+0x1d/0x80 Aug 2 15:29:03 Gemini kernel: [] xfs_trans_ijoin+0x6f/0x80 Aug 2 15:29:03 Gemini kernel: [] xfs_remove+0x1c3/0x460 Aug 2 15:29:03 Gemini kernel: [] xfs_vn_unlink+0x23/0x60 Aug 2 15:29:03 Gemini kernel: [] xfs_dir_lookup_int+0x9b/0x100 Aug 2 15:29:03 Gemini kernel: [] xfs_trans_unlocked_item+0x38/0x60 Aug 2 15:29:03 Gemini kernel: [] xfs_lookup+0x6a/0x80 Aug 2 15:29:03 Gemini kernel: [] d_instantiate+0x30/0x50 Aug 2 15:29:03 Gemini kernel: [] d_splice_alias+0x2d/0xa0 Aug 2 15:29:03 Gemini kernel: [] permission+0x89/0xd0 Aug 2 15:29:03 Gemini kernel: [] vfs_unlink+0x88/0x90 Aug 2 15:29:03 Gemini kernel: [] do_unlinkat+0x94/0x110 Aug 2 15:29:03 Gemini kernel: [] vfs_read+0xe8/0x110 Aug 2 15:29:03 Gemini kernel: [] sys_read+0x47/0x80 Aug 2 15:29:03 Gemini kernel: [] syscall_call+0x7/0xb Aug 2 15:29:03 Gemini kernel: ======================= Aug 2 15:29:03 Gemini kernel: Code: d2 0f 84 cb fe ff ff eb ba 8b 55 00 31 c0 85 d2 75 b1 eb c0 8b 47 08 89 70 04 89 06 8b 44 24 04 89 77 08 89 46 04 e9 7a ff ff ff <0f> 0b 90 eb fe c7 47 30 01 00 00 00 8b 77 10 8d 47 10 39 c6 0f Aug 2 15:29:03 Gemini kernel: EIP: [] cache_alloc_refill+0x16d/0x1c0 SS:ESP 0068:c8da7dc8 From owner-xfs@oss.sgi.com Thu Aug 2 07:34:21 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 07:34:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l72EYEbm007625 for ; Thu, 2 Aug 2007 07:34:17 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l72EYHA5030564 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 2 Aug 2007 16:34:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l72EYH8i030562 for xfs@oss.sgi.com; Thu, 2 Aug 2007 16:34:17 +0200 Date: Thu, 2 Aug 2007 16:34:17 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] remove unessecary vfs argument to DM_EVENT_ENABLED Message-ID: <20070802143417.GA30414@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-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12455 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 We can easily derive the vfs from the inode passed in. Also kill the unused DM_EVENT_ENABLED_IO macro. 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 2007-08-01 19:53:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-08-01 19:53:42.000000000 +0200 @@ -3271,8 +3271,7 @@ xfs_dm_send_mmap_event( xfs_ilock(ip, iolock); /* If write possible, try a DMAPI write event */ - if ((max_event == DM_EVENT_WRITE) && - DM_EVENT_ENABLED(vp->v_vfsp, ip, max_event)){ + if (max_event == DM_EVENT_WRITE && DM_EVENT_ENABLED(ip, max_event)) { error = xfs_dm_send_data_event(max_event, vp, offset, evsize, 0, &locktype); goto out_unlock; @@ -3281,7 +3280,7 @@ xfs_dm_send_mmap_event( /* Try a read event if max_event was != DM_EVENT_WRITE or if it * was DM_EVENT_WRITE but the WRITE event was not enabled. */ - if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_READ)) { + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) { error = xfs_dm_send_data_event(DM_EVENT_READ, vp, offset, evsize, 0, &locktype); } 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 2007-08-01 19:53:22.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2007-08-01 19:53:42.000000000 +0200 @@ -384,7 +384,7 @@ xfs_file_open_exec( if (!ip) return -EINVAL; - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)) + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-01 19:53:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-01 19:56:14.000000000 +0200 @@ -245,8 +245,7 @@ xfs_read( mutex_lock(&inode->i_mutex); xfs_ilock(ip, XFS_IOLOCK_SHARED); - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && - !(ioflags & IO_INVIS)) { + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { bhv_vrwlock_t locktype = VRWLOCK_READ; int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); @@ -307,8 +306,7 @@ xfs_sendfile( xfs_ilock(ip, XFS_IOLOCK_SHARED); - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && - (!(ioflags & IO_INVIS))) { + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { bhv_vrwlock_t locktype = VRWLOCK_READ; int error; @@ -351,8 +349,7 @@ xfs_splice_read( xfs_ilock(ip, XFS_IOLOCK_SHARED); - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && - (!(ioflags & IO_INVIS))) { + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { bhv_vrwlock_t locktype = VRWLOCK_READ; int error; @@ -398,8 +395,7 @@ xfs_splice_write( xfs_ilock(ip, XFS_IOLOCK_EXCL); - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_WRITE) && - (!(ioflags & IO_INVIS))) { + if (DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS)) { bhv_vrwlock_t locktype = VRWLOCK_WRITE; int error; @@ -724,7 +720,7 @@ start: goto out_unlock_mutex; } - if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) && + if ((DM_EVENT_ENABLED(xip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS) && !eventsent)) { int dmflags = FILP_DELAY_FLAG(file); @@ -876,10 +872,8 @@ retry: if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) ret = wait_on_sync_kiocb(iocb); - if ((ret == -ENOSPC) && - DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_NOSPACE) && - !(ioflags & IO_INVIS)) { - + if (ret == -ENOSPC && + DM_EVENT_ENABLED(xip, DM_EVENT_NOSPACE) && !(ioflags & IO_INVIS)) { xfs_rwunlock(bdp, locktype); if (need_i_mutex) mutex_unlock(&inode->i_mutex); Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2007-08-01 19:53:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2007-08-01 19:53:42.000000000 +0200 @@ -5811,10 +5811,9 @@ xfs_getbmap( * could misinterpret holes in a DMAPI file as true holes, * when in fact they may represent offline user data. */ - if ( (interface & BMV_IF_NO_DMAPI_READ) == 0 - && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) - && whichfork == XFS_DATA_FORK) { - + if ((interface & BMV_IF_NO_DMAPI_READ) == 0 && + DM_EVENT_ENABLED(ip, DM_EVENT_READ) && + whichfork == XFS_DATA_FORK) { error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL); if (error) return XFS_ERROR(error); Index: linux-2.6-xfs/fs/xfs/xfs_dmapi.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dmapi.h 2007-08-01 19:53:16.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dmapi.h 2007-08-01 19:53:42.000000000 +0200 @@ -67,18 +67,12 @@ typedef enum { #define HAVE_DM_RIGHT_T /* Defines for determining if an event message should be sent. */ -#define DM_EVENT_ENABLED(vfsp, ip, event) ( \ - unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ +#define DM_EVENT_ENABLED(ip, event) ( \ + unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \ ( ((ip)->i_d.di_dmevmask & (1 << event)) || \ ((ip)->i_mount->m_dmevmask & (1 << event)) ) \ ) -#define DM_EVENT_ENABLED_IO(vfsp, io, event) ( \ - unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ - ( ((io)->io_dmevmask & (1 << event)) || \ - ((io)->io_mount->m_dmevmask & (1 << event)) ) \ - ) - #define DM_XFS_VALID_FS_EVENTS ( \ (1 << DM_EVENT_PREUNMOUNT) | \ (1 << DM_EVENT_UNMOUNT) | \ Index: linux-2.6-xfs/fs/xfs/xfs_rename.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2007-08-01 19:53:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2007-08-01 19:53:42.000000000 +0200 @@ -264,9 +264,8 @@ xfs_rename( src_dp = XFS_BHVTOI(src_dir_bdp); mp = src_dp->i_mount; - if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) || - DM_EVENT_ENABLED(target_dir_vp->v_vfsp, - target_dp, DM_EVENT_RENAME)) { + if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || + DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, src_dir_vp, DM_RIGHT_NULL, target_dir_vp, DM_RIGHT_NULL, @@ -603,9 +602,8 @@ xfs_rename( /* Fall through to std_return with error = 0 or errno from * xfs_trans_commit */ std_return: - if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_POSTRENAME) || - DM_EVENT_ENABLED(target_dir_vp->v_vfsp, - target_dp, DM_EVENT_POSTRENAME)) { + if (DM_EVENT_ENABLED(src_dp, DM_EVENT_POSTRENAME) || + DM_EVENT_ENABLED(target_dp, DM_EVENT_POSTRENAME)) { (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME, src_dir_vp, DM_RIGHT_NULL, target_dir_vp, DM_RIGHT_NULL, Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-08-01 19:53:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-08-01 19:58:06.000000000 +0200 @@ -337,7 +337,7 @@ xfs_setattr( } } } else { - if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) && + if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && !(flags & ATTR_DMI)) { int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp, @@ -896,7 +896,7 @@ xfs_setattr( return code; } - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_ATTRIBUTE) && + if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && !(flags & ATTR_DMI)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, NULL, NULL, @@ -1651,8 +1651,7 @@ xfs_inactive( mp = ip->i_mount; - if (ip->i_d.di_nlink == 0 && - DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_DESTROY)) { + if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_DESTROY)) { (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL); } @@ -1907,7 +1906,7 @@ xfs_create( dm_di_mode = vap->va_mode; namelen = VNAMELEN(dentry); - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, name, NULL, @@ -2072,9 +2071,8 @@ xfs_create( /* Fallthrough to std_return with error = 0 */ std_return: - if ( (*vpp || (error != 0 && dm_event_sent != 0)) && - DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), - DM_EVENT_POSTCREATE)) { + if ((*vpp || (error != 0 && dm_event_sent != 0)) && + DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, dir_vp, DM_RIGHT_NULL, *vpp ? vp:NULL, @@ -2408,7 +2406,7 @@ xfs_remove( IRELE(ip); } - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, name, NULL, dm_di_mode, 0, 0); @@ -2584,8 +2582,7 @@ xfs_remove( /* Fall through to std_return with error = 0 */ std_return: - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, - DM_EVENT_POSTREMOVE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, @@ -2662,7 +2659,7 @@ xfs_link( if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); - if (DM_EVENT_ENABLED(src_vp->v_vfsp, tdp, DM_EVENT_LINK)) { + if (DM_EVENT_ENABLED(tdp, DM_EVENT_LINK)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK, target_dir_vp, DM_RIGHT_NULL, src_vp, DM_RIGHT_NULL, @@ -2773,8 +2770,7 @@ xfs_link( /* Fall through to std_return with error = 0. */ std_return: - if (DM_EVENT_ENABLED(src_vp->v_vfsp, sip, - DM_EVENT_POSTLINK)) { + if (DM_EVENT_ENABLED(sip, DM_EVENT_POSTLINK)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK, target_dir_vp, DM_RIGHT_NULL, src_vp, DM_RIGHT_NULL, @@ -2838,7 +2834,7 @@ xfs_mkdir( dp_joined_to_trans = B_FALSE; dm_di_mode = vap->va_mode; - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, dir_name, NULL, @@ -2995,9 +2991,8 @@ xfs_mkdir( * xfs_trans_commit. */ std_return: - if ( (created || (error != 0 && dm_event_sent != 0)) && - DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), - DM_EVENT_POSTCREATE)) { + if ((created || (error != 0 && dm_event_sent != 0)) && + DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, dir_vp, DM_RIGHT_NULL, created ? XFS_ITOV(cdp):NULL, @@ -3066,7 +3061,7 @@ xfs_rmdir( IRELE(cdp); } - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, @@ -3255,7 +3250,7 @@ xfs_rmdir( /* Fall through to std_return with error = 0 or the errno * from xfs_trans_commit. */ std_return: - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_POSTREMOVE)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, @@ -3359,7 +3354,7 @@ xfs_symlink( } } - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_SYMLINK)) { + if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, link_name, target_path, 0, 0, 0); @@ -3559,8 +3554,7 @@ xfs_symlink( /* Fall through to std_return with error = 0 or errno from * xfs_trans_commit */ std_return: - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), - DM_EVENT_POSTSYMLINK)) { + if (DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTSYMLINK)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK, dir_vp, DM_RIGHT_NULL, error ? NULL : XFS_ITOV(ip), @@ -4062,7 +4056,7 @@ xfs_alloc_file_space( /* Generate a DMAPI event if needed. */ if (alloc_type != 0 && offset < ip->i_size && (attr_flags&ATTR_DMI) == 0 && - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { + DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { xfs_off_t end_dmi_offset; end_dmi_offset = offset+len; @@ -4176,9 +4170,8 @@ retry: allocatesize_fsb -= allocated_fsb; } dmapi_enospc_check: - if (error == ENOSPC && (attr_flags&ATTR_DMI) == 0 && - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_NOSPACE)) { - + if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && + DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, XFS_ITOV(ip), DM_RIGHT_NULL, XFS_ITOV(ip), DM_RIGHT_NULL, @@ -4322,9 +4315,8 @@ xfs_free_file_space( end_dmi_offset = offset + len; endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); - if (offset < ip->i_size && - (attr_flags & ATTR_DMI) == 0 && - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { + if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 && + DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { if (end_dmi_offset > ip->i_size) end_dmi_offset = ip->i_size; error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, From owner-xfs@oss.sgi.com Thu Aug 2 14:29:26 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 14:29:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l72LTNbm031203 for ; Thu, 2 Aug 2007 14:29:26 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l72LTQA5024914 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 2 Aug 2007 23:29:26 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l72LTQQp024912 for xfs@oss.sgi.com; Thu, 2 Aug 2007 23:29:26 +0200 Date: Thu, 2 Aug 2007 23:29:26 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] dmapi: simplify slab cache creation Message-ID: <20070802212926.GA24834@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-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12456 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 two out of three slab caches are created on-demand on dmapi_register. Move them into dmapi_init as the others are to clean up all the mess about checking whether dmapi_register has been called before or is in the process of beeing called. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_mountinfo.c 2007-08-02 16:00:52.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c 2007-08-02 16:07:13.000000000 +0200 @@ -471,40 +471,7 @@ dmapi_register( struct filesystem_dmapi_operations *dmapiops) { dm_vector_map_t *proto; - static int initialized = 0; -wait_cache: - spin_lock(&dm_fsys_lock); - if (initialized == -1) { - spin_unlock(&dm_fsys_lock); - goto wait_cache; - } - if (initialized == 0) - initialized = -1; - spin_unlock(&dm_fsys_lock); - - if (initialized == -1) { - ASSERT(dm_fsys_map_cachep == NULL); - ASSERT(dm_fsys_vptr_cachep == NULL); - - dm_fsys_map_cachep = kmem_cache_create("dm_fsys_map", - sizeof(dm_vector_map_t), 0, 0, NULL, NULL); - - dm_fsys_vptr_cachep = kmem_cache_create("dm_fsys_vptr", - sizeof(dm_fsys_vector_t), 0, 0, NULL, NULL); - - spin_lock(&dm_fsys_lock); - if ((dm_fsys_map_cachep == NULL) || - (dm_fsys_map_cachep == NULL)) { - initialized = 0; - spin_unlock(&dm_fsys_lock); - goto out_cache_free; - } - initialized = 1; - spin_unlock(&dm_fsys_lock); - } - - ASSERT_ALWAYS(initialized == 1); 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__); @@ -521,21 +488,8 @@ wait_cache: list_add(&proto->ftype_list, &dm_fsys_map); ftype_list(); spin_unlock(&dm_fsys_lock); - - return; - -out_cache_free: - if (dm_fsys_map_cachep) { - kmem_cache_destroy(dm_fsys_map_cachep); - dm_fsys_map_cachep = NULL; - } - if (dm_fsys_vptr_cachep) { - kmem_cache_destroy(dm_fsys_vptr_cachep); - dm_fsys_vptr_cachep = NULL; - } } - /* Called by a filesystem module that is unloading from the kernel */ void dmapi_unregister( Index: linux-2.6-xfs/fs/dmapi/dmapi_sysent.c =================================================================== --- linux-2.6-xfs.orig/fs/dmapi/dmapi_sysent.c 2007-08-02 16:03:21.000000000 +0200 +++ linux-2.6-xfs/fs/dmapi/dmapi_sysent.c 2007-08-02 16:09:46.000000000 +0200 @@ -740,35 +740,47 @@ int __init dmapi_init(void) dm_tokdata_cachep = kmem_cache_create("dm_tokdata", sizeof(struct dm_tokdata), 0, 0, NULL, NULL); if (dm_tokdata_cachep == NULL) - goto out_cache_free; + goto out; dm_fsreg_cachep = kmem_cache_create("dm_fsreg", sizeof(struct dm_fsreg), 0, 0, NULL, NULL); if (dm_fsreg_cachep == NULL) - goto out_cache_free; + goto out_free_tokdata_cachep; dm_session_cachep = kmem_cache_create("dm_session", sizeof(struct dm_session), 0, 0, NULL, NULL); if (dm_session_cachep == NULL) - goto out_cache_free; + goto out_free_fsreg_cachep; + + dm_fsys_map_cachep = kmem_cache_create("dm_fsys_map", + sizeof(dm_vector_map_t), 0, 0, NULL, 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, NULL); + if (dm_fsys_vptr_cachep == NULL) + goto out_free_fsys_map_cachep; ret = misc_register(&dmapi_dev); - if( ret != 0 ) + if (ret) { printk(KERN_ERR "dmapi_init: misc_register returned %d\n", ret); + goto out_free_fsys_vptr_cachep; + } + dmapi_init_procfs(dmapi_dev.minor); return 0; -out_cache_free: - if (dm_tokdata_cachep) - kmem_cache_destroy(dm_tokdata_cachep); - if (dm_fsreg_cachep) - kmem_cache_destroy(dm_fsreg_cachep); - if (dm_session_cachep) - kmem_cache_destroy(dm_session_cachep); - if (dm_fsys_map_cachep) - kmem_cache_destroy(dm_fsys_map_cachep); - if (dm_fsys_vptr_cachep) - kmem_cache_destroy(dm_fsys_vptr_cachep); + 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: + kmem_cache_destroy(dm_fsreg_cachep); + out_free_tokdata_cachep: + kmem_cache_destroy(dm_tokdata_cachep); + out: return -ENOMEM; } From owner-xfs@oss.sgi.com Thu Aug 2 17:29:29 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 17:29:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l730TQbm030483 for ; Thu, 2 Aug 2007 17:29:28 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l730TSA5003121 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 3 Aug 2007 02:29:29 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l730TSAb003119; Fri, 3 Aug 2007 02:29:28 +0200 Date: Fri, 3 Aug 2007 02:29:28 +0200 From: Christoph Hellwig To: David Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH] dinode endianess annotations Message-ID: <20070803002928.GA2830@lst.de> References: <20070720163026.GA6902@lst.de> <20070723002121.GK31489@sgi.com> <20070723084419.GA1003@lst.de> <20070728175900.GA6557@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070728175900.GA6557@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12457 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 28, 2007 at 07:59:00PM +0200, Christoph Hellwig wrote: > The updated patch didn't actually compile with dmapi enabled. Here's > a fixed version: And here's another iteration. I started doing some local patches that include xfs_inode.h in a lot more places and really got nnoyed by the tail of includes xfs_dinode.h requires to compile. So this patch includes the move of xfs_icdinode to xfs_inode.h that I suggested previously. 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 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-08-03 01:18:08.000000000 +0200 @@ -345,20 +345,19 @@ _xfs_dic2dmflags( STATIC uint xfs_ip2dmflags( - xfs_inode_t *ip) + xfs_inode_t *ip) { - xfs_dinode_core_t *dic = &ip->i_d; - - return _xfs_dic2dmflags(dic->di_flags) | - (XFS_CFORK_Q(dic) ? DM_XFLAG_HASATTR : 0); + return _xfs_dic2dmflags(ip->i_d.di_flags) | + (XFS_CFORK_Q(&ip->i_d) ? DM_XFLAG_HASATTR : 0); } STATIC uint xfs_dic2dmflags( - xfs_dinode_core_t *dic) + xfs_dinode_t *dip) { - return _xfs_dic2dmflags(INT_GET(dic->di_flags, ARCH_CONVERT)) | - (XFS_CFORK_Q_DISK(dic) ? DM_XFLAG_HASATTR : 0); + return _xfs_dic2dmflags(be16_to_cpu(dip->di_core.di_flags)) | + (XFS_CFORK_Q_DISK(&dip->di_core) ? + DM_XFLAG_HASATTR : 0); } /* @@ -387,32 +386,33 @@ xfs_dip_to_stat( * the new format. We don't change the version number so that we * can distinguish this from a real new format inode. */ - if (INT_GET(dic->di_version, ARCH_CONVERT) == XFS_DINODE_VERSION_1) { - buf->dt_nlink = INT_GET(dic->di_onlink, ARCH_CONVERT); + if (dic->di_version == XFS_DINODE_VERSION_1) { + buf->dt_nlink = be16_to_cpu(dic->di_onlink); /*buf->dt_xfs_projid = 0;*/ } else { - buf->dt_nlink = INT_GET(dic->di_nlink, ARCH_CONVERT); - /*buf->dt_xfs_projid = INT_GET(dic->di_projid, ARCH_CONVERT);*/ + buf->dt_nlink = be32_to_cpu(dic->di_nlink); + /*buf->dt_xfs_projid = be16_to_cpu(dic->di_projid);*/ } buf->dt_ino = ino; buf->dt_dev = XFS_TO_HOST_DEVT(mp); - buf->dt_mode = INT_GET(dic->di_mode, ARCH_CONVERT); - buf->dt_uid = INT_GET(dic->di_uid, ARCH_CONVERT); - buf->dt_gid = INT_GET(dic->di_gid, ARCH_CONVERT); - buf->dt_size = INT_GET(dic->di_size, ARCH_CONVERT); - buf->dt_atime = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT); - buf->dt_mtime = INT_GET(dic->di_mtime.t_sec, ARCH_CONVERT); - buf->dt_ctime = INT_GET(dic->di_ctime.t_sec, ARCH_CONVERT); - buf->dt_xfs_xflags = xfs_dic2dmflags(dic); - buf->dt_xfs_extsize = INT_GET(dic->di_extsize, ARCH_CONVERT) << mp->m_sb.sb_blocklog; - buf->dt_xfs_extents = INT_GET(dic->di_nextents, ARCH_CONVERT); - buf->dt_xfs_aextents = INT_GET(dic->di_anextents, ARCH_CONVERT); - buf->dt_xfs_igen = INT_GET(dic->di_gen, ARCH_CONVERT); - buf->dt_xfs_dmstate = INT_GET(dic->di_dmstate, ARCH_CONVERT); + buf->dt_mode = be16_to_cpu(dic->di_mode); + buf->dt_uid = be32_to_cpu(dic->di_uid); + buf->dt_gid = be32_to_cpu(dic->di_gid); + buf->dt_size = be64_to_cpu(dic->di_size); + buf->dt_atime = be32_to_cpu(dic->di_atime.t_sec); + buf->dt_mtime = be32_to_cpu(dic->di_mtime.t_sec); + buf->dt_ctime = be32_to_cpu(dic->di_ctime.t_sec); + buf->dt_xfs_xflags = xfs_dic2dmflags(dip); + buf->dt_xfs_extsize = + be32_to_cpu(dic->di_extsize) << mp->m_sb.sb_blocklog; + buf->dt_xfs_extents = be32_to_cpu(dic->di_nextents); + buf->dt_xfs_aextents = be16_to_cpu(dic->di_anextents); + buf->dt_xfs_igen = be32_to_cpu(dic->di_gen); + buf->dt_xfs_dmstate = be16_to_cpu(dic->di_dmstate); - switch (INT_GET(dic->di_format, ARCH_CONVERT)) { + switch (dic->di_format) { case XFS_DINODE_FMT_DEV: - buf->dt_rdev = INT_GET(dip->di_u.di_dev, ARCH_CONVERT); + buf->dt_rdev = be32_to_cpu(dip->di_u.di_dev); buf->dt_blksize = BLKDEV_IOSIZE; buf->dt_blocks = 0; break; @@ -426,8 +426,8 @@ xfs_dip_to_stat( case XFS_DINODE_FMT_BTREE: buf->dt_rdev = 0; buf->dt_blksize = mp->m_sb.sb_blocksize; - buf->dt_blocks = XFS_FSB_TO_BB(mp, - INT_GET(dic->di_nblocks, ARCH_CONVERT)); + buf->dt_blocks = + XFS_FSB_TO_BB(mp, be64_to_cpu(dic->di_nblocks)); break; } @@ -439,8 +439,8 @@ xfs_dip_to_stat( buf->dt_pers = 0; buf->dt_change = 0; buf->dt_nevents = DM_EVENT_MAX; - buf->dt_emask = INT_GET(dic->di_dmevmask, ARCH_CONVERT); - buf->dt_dtime = INT_GET(dic->di_ctime.t_sec, ARCH_CONVERT); + buf->dt_emask = be32_to_cpu(dic->di_dmevmask); + buf->dt_dtime = be32_to_cpu(dic->di_ctime.t_sec); /* Set if one of READ, WRITE or TRUNCATE bits is set in emask */ buf->dt_pmanreg = (DMEV_ISSET(DM_EVENT_READ, buf->dt_emask) || DMEV_ISSET(DM_EVENT_WRITE, buf->dt_emask) || @@ -458,7 +458,7 @@ xfs_ip_to_stat( xfs_inode_t *ip, dm_stat_t *buf) { - xfs_dinode_core_t *dic = &ip->i_d; + xfs_icdinode_t *dic = &ip->i_d; bhv_vnode_t *vp = XFS_ITOV(ip); buf->dt_ino = ino; @@ -604,8 +604,7 @@ xfs_dm_inline_attr( caddr_t attr_buf, int *value_lenp) { - if (INT_GET(dip->di_core.di_aformat, ARCH_CONVERT) == - XFS_DINODE_FMT_LOCAL) { + if (dip->di_core.di_aformat == XFS_DINODE_FMT_LOCAL) { xfs_attr_shortform_t *sf; xfs_attr_sf_entry_t *sfe; unsigned int namelen = strlen(attr_name); @@ -649,7 +648,7 @@ dm_dip_to_handle( xfid->fid_len = sizeof(xfs_fid2_t) - sizeof(xfid->fid_len); xfid->fid_pad = 0; xfid->fid_ino = ino; - xfid->fid_gen = INT_GET(dip->di_core.di_gen, ARCH_CONVERT); + xfid->fid_gen = be32_to_cpu(dip->di_core.di_gen); memcpy(&handlep->ha_fsid, fsid, sizeof(*fsid)); memcpy(&handlep->ha_fid, &fid, fid.dm_fid_len + sizeof(fid.dm_fid_len)); Index: linux-2.6-xfs/fs/xfs/xfs_dinode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dinode.h 2007-08-03 01:00:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dinode.h 2007-08-03 01:21:31.000000000 +0200 @@ -34,41 +34,41 @@ struct xfs_mount; * because we only need the core part in the in-core inode. */ typedef struct xfs_timestamp { - __int32_t t_sec; /* timestamp seconds */ - __int32_t t_nsec; /* timestamp nanoseconds */ + __be32 t_sec; /* timestamp seconds */ + __be32 t_nsec; /* timestamp nanoseconds */ } xfs_timestamp_t; /* * Note: Coordinate changes to this structure with the XFS_DI_* #defines - * below and the offsets table in xfs_ialloc_log_di(). + * below, the offsets table in xfs_ialloc_log_di() and struct xfs_icdinode + * in xfs_inode.h. */ -typedef struct xfs_dinode_core -{ - __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ - __uint16_t di_mode; /* mode and type of file */ - __int8_t di_version; /* inode version */ - __int8_t di_format; /* format of di_c data */ - __uint16_t di_onlink; /* old number of links to file */ - __uint32_t di_uid; /* owner's user id */ - __uint32_t di_gid; /* owner's group id */ - __uint32_t di_nlink; /* number of links to file */ - __uint16_t di_projid; /* owner's project id */ - __uint8_t di_pad[8]; /* unused, zeroed space */ - __uint16_t di_flushiter; /* incremented on flush */ +typedef struct xfs_dinode_core { + __be16 di_magic; /* inode magic # = XFS_DINODE_MAGIC */ + __be16 di_mode; /* mode and type of file */ + __u8 di_version; /* inode version */ + __u8 di_format; /* format of di_c data */ + __be16 di_onlink; /* old number of links to file */ + __be32 di_uid; /* owner's user id */ + __be32 di_gid; /* owner's group id */ + __be32 di_nlink; /* number of links to file */ + __be16 di_projid; /* owner's project id */ + __u8 di_pad[8]; /* unused, zeroed space */ + __be16 di_flushiter; /* incremented on flush */ xfs_timestamp_t di_atime; /* time last accessed */ xfs_timestamp_t di_mtime; /* time last modified */ xfs_timestamp_t di_ctime; /* time created/inode modified */ - xfs_fsize_t di_size; /* number of bytes in file */ - xfs_drfsbno_t di_nblocks; /* # of direct & btree blocks used */ - xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ - xfs_extnum_t di_nextents; /* number of extents in data fork */ - xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ - __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ - __int8_t di_aformat; /* format of attr fork's data */ - __uint32_t di_dmevmask; /* DMIG event mask */ - __uint16_t di_dmstate; /* DMIG state info */ - __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ - __uint32_t di_gen; /* generation number */ + __be64 di_size; /* number of bytes in file */ + __be64 di_nblocks; /* # of direct & btree blocks used */ + __be32 di_extsize; /* basic/minimum extent size for file */ + __be32 di_nextents; /* number of extents in data fork */ + __be16 di_anextents; /* number of extents in attribute fork*/ + __u8 di_forkoff; /* attr fork offs, <<3 for 64b align */ + __s8 di_aformat; /* format of attr fork's data */ + __be32 di_dmevmask; /* DMIG event mask */ + __be16 di_dmstate; /* DMIG state info */ + __be16 di_flags; /* random flags, XFS_DIFLAG_... */ + __be32 di_gen; /* generation number */ } xfs_dinode_core_t; #define DI_MAX_FLUSH 0xffff @@ -81,13 +81,13 @@ typedef struct xfs_dinode * sure to update the macros like XFS_LITINO below and * XFS_BMAP_RBLOCK_DSIZE in xfs_bmap_btree.h. */ - xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */ + __be32 di_next_unlinked;/* agi unlinked list ptr */ union { xfs_bmdr_block_t di_bmbt; /* btree root block */ xfs_bmbt_rec_32_t di_bmx[1]; /* extent list */ xfs_dir2_sf_t di_dir2sf; /* shortform directory v2 */ char di_c[1]; /* local contents */ - xfs_dev_t di_dev; /* device for S_IFCHR/S_IFBLK */ + __be32 di_dev; /* device for S_IFCHR/S_IFBLK */ uuid_t di_muuid; /* mount point value */ char di_symlink[1]; /* local symbolic link */ } di_u; @@ -175,8 +175,7 @@ typedef enum xfs_dinode_fmt #define XFS_CFORK_Q_DISK(dcp) ((dcp)->di_forkoff != 0) #define XFS_CFORK_BOFF(dcp) ((int)((dcp)->di_forkoff << 3)) -#define XFS_CFORK_BOFF_DISK(dcp) \ - ((int)(INT_GET((dcp)->di_forkoff, ARCH_CONVERT) << 3)) +#define XFS_CFORK_BOFF_DISK(dcp) ((int)((dcp)->di_forkoff << 3)) #define XFS_CFORK_DSIZE_DISK(dcp,mp) \ (XFS_CFORK_Q_DISK(dcp) ? XFS_CFORK_BOFF_DISK(dcp) : XFS_LITINO(mp)) @@ -225,8 +224,8 @@ typedef enum xfs_dinode_fmt #define XFS_CFORK_NEXTENTS_DISK(dcp,w) \ ((w) == XFS_DATA_FORK ? \ - INT_GET((dcp)->di_nextents, ARCH_CONVERT) : \ - INT_GET((dcp)->di_anextents, ARCH_CONVERT)) + be32_to_cpu((dcp)->di_nextents) : \ + be16_to_cpu((dcp)->di_anextents)) #define XFS_CFORK_NEXTENTS(dcp,w) \ ((w) == XFS_DATA_FORK ? (dcp)->di_nextents : (dcp)->di_anextents) #define XFS_DFORK_NEXTENTS(dip,w) XFS_CFORK_NEXTENTS_DISK(&(dip)->di_core, w) Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2007-08-03 01:00:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2007-08-03 01:06:39.000000000 +0200 @@ -293,9 +293,9 @@ xfs_ialloc_ag_alloc( xfs_biozero(fbuf, 0, ninodes << args.mp->m_sb.sb_inodelog); for (i = 0; i < ninodes; i++) { free = XFS_MAKE_IPTR(args.mp, fbuf, i); - INT_SET(free->di_core.di_magic, ARCH_CONVERT, XFS_DINODE_MAGIC); - INT_SET(free->di_core.di_version, ARCH_CONVERT, version); - INT_SET(free->di_next_unlinked, ARCH_CONVERT, NULLAGINO); + free->di_core.di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + free->di_core.di_version = version; + free->di_next_unlinked = cpu_to_be32(NULLAGINO); xfs_ialloc_log_di(tp, fbuf, i, XFS_DI_CORE_BITS | XFS_DI_NEXT_UNLINKED); } Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2007-08-03 01:17:08.000000000 +0200 @@ -193,8 +193,8 @@ xfs_inotobp( } dip = (xfs_dinode_t *)xfs_buf_offset(bp, 0); di_ok = - INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC && - XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT)); + be16_to_cpu(dip->di_core.di_magic) == XFS_DINODE_MAGIC && + XFS_DINODE_GOOD_VERSION(dip->di_core.di_version); if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, XFS_RANDOM_ITOBP_INOTOBP))) { XFS_CORRUPTION_ERROR("xfs_inotobp", XFS_ERRLEVEL_LOW, mp, dip); @@ -338,8 +338,8 @@ xfs_itobp( dip = (xfs_dinode_t *)xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog)); - di_ok = INT_GET(dip->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC && - XFS_DINODE_GOOD_VERSION(INT_GET(dip->di_core.di_version, ARCH_CONVERT)); + di_ok = be16_to_cpu(dip->di_core.di_magic) == XFS_DINODE_MAGIC && + XFS_DINODE_GOOD_VERSION(dip->di_core.di_version); if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, XFS_RANDOM_ITOBP_INOTOBP))) { @@ -353,7 +353,7 @@ xfs_itobp( "daddr %lld #%d (magic=%x)", XFS_BUFTARG_NAME(mp->m_ddev_targp), (unsigned long long)imap.im_blkno, i, - INT_GET(dip->di_core.di_magic, ARCH_CONVERT)); + be16_to_cpu(dip->di_core.di_magic)); #endif XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH, mp, dip); @@ -399,27 +399,26 @@ xfs_iformat( XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); error = 0; - if (unlikely( - INT_GET(dip->di_core.di_nextents, ARCH_CONVERT) + - INT_GET(dip->di_core.di_anextents, ARCH_CONVERT) > - INT_GET(dip->di_core.di_nblocks, ARCH_CONVERT))) { + if (unlikely(be32_to_cpu(dip->di_core.di_nextents) + + be16_to_cpu(dip->di_core.di_anextents) > + be64_to_cpu(dip->di_core.di_nblocks))) { xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, "corrupt dinode %Lu, extent total = %d, nblocks = %Lu.", (unsigned long long)ip->i_ino, - (int)(INT_GET(dip->di_core.di_nextents, ARCH_CONVERT) - + INT_GET(dip->di_core.di_anextents, ARCH_CONVERT)), + (int)(be32_to_cpu(dip->di_core.di_nextents) + + be16_to_cpu(dip->di_core.di_anextents)), (unsigned long long) - INT_GET(dip->di_core.di_nblocks, ARCH_CONVERT)); + be64_to_cpu(dip->di_core.di_nblocks)); XFS_CORRUPTION_ERROR("xfs_iformat(1)", XFS_ERRLEVEL_LOW, ip->i_mount, dip); return XFS_ERROR(EFSCORRUPTED); } - if (unlikely(INT_GET(dip->di_core.di_forkoff, ARCH_CONVERT) > ip->i_mount->m_sb.sb_inodesize)) { + if (unlikely(dip->di_core.di_forkoff > ip->i_mount->m_sb.sb_inodesize)) { xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, "corrupt dinode %Lu, forkoff = 0x%x.", (unsigned long long)ip->i_ino, - (int)(INT_GET(dip->di_core.di_forkoff, ARCH_CONVERT))); + dip->di_core.di_forkoff); XFS_CORRUPTION_ERROR("xfs_iformat(2)", XFS_ERRLEVEL_LOW, ip->i_mount, dip); return XFS_ERROR(EFSCORRUPTED); @@ -430,25 +429,25 @@ xfs_iformat( case S_IFCHR: case S_IFBLK: case S_IFSOCK: - if (unlikely(INT_GET(dip->di_core.di_format, ARCH_CONVERT) != XFS_DINODE_FMT_DEV)) { + if (unlikely(dip->di_core.di_format != XFS_DINODE_FMT_DEV)) { XFS_CORRUPTION_ERROR("xfs_iformat(3)", XFS_ERRLEVEL_LOW, ip->i_mount, dip); return XFS_ERROR(EFSCORRUPTED); } ip->i_d.di_size = 0; ip->i_size = 0; - ip->i_df.if_u2.if_rdev = INT_GET(dip->di_u.di_dev, ARCH_CONVERT); + ip->i_df.if_u2.if_rdev = be32_to_cpu(dip->di_u.di_dev); break; case S_IFREG: case S_IFLNK: case S_IFDIR: - switch (INT_GET(dip->di_core.di_format, ARCH_CONVERT)) { + switch (dip->di_core.di_format) { case XFS_DINODE_FMT_LOCAL: /* * no local regular files yet */ - if (unlikely((INT_GET(dip->di_core.di_mode, ARCH_CONVERT) & S_IFMT) == S_IFREG)) { + if (unlikely((be16_to_cpu(dip->di_core.di_mode) & S_IFMT) == S_IFREG)) { xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, "corrupt inode %Lu " "(local format for regular file).", @@ -459,7 +458,7 @@ xfs_iformat( return XFS_ERROR(EFSCORRUPTED); } - di_size = INT_GET(dip->di_core.di_size, ARCH_CONVERT); + di_size = be64_to_cpu(dip->di_core.di_size); if (unlikely(di_size > XFS_DFORK_DSIZE(dip, ip->i_mount))) { xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, "corrupt inode %Lu " @@ -501,7 +500,7 @@ xfs_iformat( ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP); ip->i_afp->if_ext_max = XFS_IFORK_ASIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); - switch (INT_GET(dip->di_core.di_aformat, ARCH_CONVERT)) { + switch (dip->di_core.di_aformat) { case XFS_DINODE_FMT_LOCAL: atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); size = be16_to_cpu(atp->hdr.totsize); @@ -709,70 +708,74 @@ xfs_iformat_btree( return 0; } -/* - * xfs_xlate_dinode_core - translate an xfs_inode_core_t between ondisk - * and native format - * - * buf = on-disk representation - * dip = native representation - * dir = direction - +ve -> disk to native - * -ve -> native to disk - */ void -xfs_xlate_dinode_core( - xfs_caddr_t buf, - xfs_dinode_core_t *dip, - int dir) -{ - xfs_dinode_core_t *buf_core = (xfs_dinode_core_t *)buf; - xfs_dinode_core_t *mem_core = (xfs_dinode_core_t *)dip; - xfs_arch_t arch = ARCH_CONVERT; - - ASSERT(dir); - - INT_XLATE(buf_core->di_magic, mem_core->di_magic, dir, arch); - INT_XLATE(buf_core->di_mode, mem_core->di_mode, dir, arch); - INT_XLATE(buf_core->di_version, mem_core->di_version, dir, arch); - INT_XLATE(buf_core->di_format, mem_core->di_format, dir, arch); - INT_XLATE(buf_core->di_onlink, mem_core->di_onlink, dir, arch); - INT_XLATE(buf_core->di_uid, mem_core->di_uid, dir, arch); - INT_XLATE(buf_core->di_gid, mem_core->di_gid, dir, arch); - INT_XLATE(buf_core->di_nlink, mem_core->di_nlink, dir, arch); - INT_XLATE(buf_core->di_projid, mem_core->di_projid, dir, arch); - - if (dir > 0) { - memcpy(mem_core->di_pad, buf_core->di_pad, - sizeof(buf_core->di_pad)); - } else { - memcpy(buf_core->di_pad, mem_core->di_pad, - sizeof(buf_core->di_pad)); - } - - INT_XLATE(buf_core->di_flushiter, mem_core->di_flushiter, dir, arch); +xfs_dinode_from_disk( + xfs_icdinode_t *to, + xfs_dinode_core_t *from) +{ + to->di_magic = be16_to_cpu(from->di_magic); + to->di_mode = be16_to_cpu(from->di_mode); + to->di_version = from ->di_version; + to->di_format = from->di_format; + to->di_onlink = be16_to_cpu(from->di_onlink); + to->di_uid = be32_to_cpu(from->di_uid); + to->di_gid = be32_to_cpu(from->di_gid); + to->di_nlink = be32_to_cpu(from->di_nlink); + to->di_projid = be16_to_cpu(from->di_projid); + memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + to->di_flushiter = be16_to_cpu(from->di_flushiter); + to->di_atime.t_sec = be32_to_cpu(from->di_atime.t_sec); + to->di_atime.t_nsec = be32_to_cpu(from->di_atime.t_nsec); + to->di_mtime.t_sec = be32_to_cpu(from->di_mtime.t_sec); + to->di_mtime.t_nsec = be32_to_cpu(from->di_mtime.t_nsec); + to->di_ctime.t_sec = be32_to_cpu(from->di_ctime.t_sec); + to->di_ctime.t_nsec = be32_to_cpu(from->di_ctime.t_nsec); + to->di_size = be64_to_cpu(from->di_size); + to->di_nblocks = be64_to_cpu(from->di_nblocks); + to->di_extsize = be32_to_cpu(from->di_extsize); + to->di_nextents = be32_to_cpu(from->di_nextents); + to->di_anextents = be16_to_cpu(from->di_anextents); + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = be32_to_cpu(from->di_dmevmask); + to->di_dmstate = be16_to_cpu(from->di_dmstate); + to->di_flags = be16_to_cpu(from->di_flags); + to->di_gen = be32_to_cpu(from->di_gen); +} - INT_XLATE(buf_core->di_atime.t_sec, mem_core->di_atime.t_sec, - dir, arch); - INT_XLATE(buf_core->di_atime.t_nsec, mem_core->di_atime.t_nsec, - dir, arch); - INT_XLATE(buf_core->di_mtime.t_sec, mem_core->di_mtime.t_sec, - dir, arch); - INT_XLATE(buf_core->di_mtime.t_nsec, mem_core->di_mtime.t_nsec, - dir, arch); - INT_XLATE(buf_core->di_ctime.t_sec, mem_core->di_ctime.t_sec, - dir, arch); - INT_XLATE(buf_core->di_ctime.t_nsec, mem_core->di_ctime.t_nsec, - dir, arch); - INT_XLATE(buf_core->di_size, mem_core->di_size, dir, arch); - INT_XLATE(buf_core->di_nblocks, mem_core->di_nblocks, dir, arch); - INT_XLATE(buf_core->di_extsize, mem_core->di_extsize, dir, arch); - INT_XLATE(buf_core->di_nextents, mem_core->di_nextents, dir, arch); - INT_XLATE(buf_core->di_anextents, mem_core->di_anextents, dir, arch); - INT_XLATE(buf_core->di_forkoff, mem_core->di_forkoff, dir, arch); - INT_XLATE(buf_core->di_aformat, mem_core->di_aformat, dir, arch); - INT_XLATE(buf_core->di_dmevmask, mem_core->di_dmevmask, dir, arch); - INT_XLATE(buf_core->di_dmstate, mem_core->di_dmstate, dir, arch); - INT_XLATE(buf_core->di_flags, mem_core->di_flags, dir, arch); - INT_XLATE(buf_core->di_gen, mem_core->di_gen, dir, arch); +void +xfs_dinode_to_disk( + xfs_dinode_core_t *to, + xfs_icdinode_t *from) +{ + to->di_magic = cpu_to_be16(from->di_magic); + to->di_mode = cpu_to_be16(from->di_mode); + to->di_version = from ->di_version; + to->di_format = from->di_format; + to->di_onlink = cpu_to_be16(from->di_onlink); + to->di_uid = cpu_to_be32(from->di_uid); + to->di_gid = cpu_to_be32(from->di_gid); + to->di_nlink = cpu_to_be32(from->di_nlink); + to->di_projid = cpu_to_be16(from->di_projid); + memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); + to->di_flushiter = cpu_to_be16(from->di_flushiter); + to->di_atime.t_sec = cpu_to_be32(from->di_atime.t_sec); + to->di_atime.t_nsec = cpu_to_be32(from->di_atime.t_nsec); + to->di_mtime.t_sec = cpu_to_be32(from->di_mtime.t_sec); + to->di_mtime.t_nsec = cpu_to_be32(from->di_mtime.t_nsec); + to->di_ctime.t_sec = cpu_to_be32(from->di_ctime.t_sec); + to->di_ctime.t_nsec = cpu_to_be32(from->di_ctime.t_nsec); + to->di_size = cpu_to_be64(from->di_size); + to->di_nblocks = cpu_to_be64(from->di_nblocks); + to->di_extsize = cpu_to_be32(from->di_extsize); + to->di_nextents = cpu_to_be32(from->di_nextents); + to->di_anextents = cpu_to_be16(from->di_anextents); + to->di_forkoff = from->di_forkoff; + to->di_aformat = from->di_aformat; + to->di_dmevmask = cpu_to_be32(from->di_dmevmask); + to->di_dmstate = cpu_to_be16(from->di_dmstate); + to->di_flags = cpu_to_be16(from->di_flags); + to->di_gen = cpu_to_be32(from->di_gen); } STATIC uint @@ -819,7 +822,7 @@ uint xfs_ip2xflags( xfs_inode_t *ip) { - xfs_dinode_core_t *dic = &ip->i_d; + xfs_icdinode_t *dic = &ip->i_d; return _xfs_dic2xflags(dic->di_flags) | (XFS_CFORK_Q(dic) ? XFS_XFLAG_HASATTR : 0); @@ -829,7 +832,7 @@ uint xfs_dic2xflags( xfs_dinode_core_t *dic) { - return _xfs_dic2xflags(INT_GET(dic->di_flags, ARCH_CONVERT)) | + return _xfs_dic2xflags(be16_to_cpu(dic->di_flags)) | (XFS_CFORK_Q_DISK(dic) ? XFS_XFLAG_HASATTR : 0); } @@ -899,14 +902,14 @@ xfs_iread( * If we got something that isn't an inode it means someone * (nfs or dmi) has a stale handle. */ - if (INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC) { + if (be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC) { kmem_zone_free(xfs_inode_zone, ip); xfs_trans_brelse(tp, bp); #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: " "dip->di_core.di_magic (0x%x) != " "XFS_DINODE_MAGIC (0x%x)", - INT_GET(dip->di_core.di_magic, ARCH_CONVERT), + be16_to_cpu(dip->di_core.di_magic), XFS_DINODE_MAGIC); #endif /* DEBUG */ return XFS_ERROR(EINVAL); @@ -920,8 +923,7 @@ xfs_iread( * Otherwise, just get the truly permanent information. */ if (dip->di_core.di_mode) { - xfs_xlate_dinode_core((xfs_caddr_t)&dip->di_core, - &(ip->i_d), 1); + xfs_dinode_from_disk(&ip->i_d, &dip->di_core); error = xfs_iformat(ip, dip); if (error) { kmem_zone_free(xfs_inode_zone, ip); @@ -934,10 +936,10 @@ xfs_iread( return error; } } else { - ip->i_d.di_magic = INT_GET(dip->di_core.di_magic, ARCH_CONVERT); - ip->i_d.di_version = INT_GET(dip->di_core.di_version, ARCH_CONVERT); - ip->i_d.di_gen = INT_GET(dip->di_core.di_gen, ARCH_CONVERT); - ip->i_d.di_flushiter = INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT); + ip->i_d.di_magic = be16_to_cpu(dip->di_core.di_magic); + ip->i_d.di_version = dip->di_core.di_version; + ip->i_d.di_gen = be32_to_cpu(dip->di_core.di_gen); + ip->i_d.di_flushiter = be16_to_cpu(dip->di_core.di_flushiter); /* * Make sure to pull in the mode here as well in * case the inode is released without being used. @@ -1959,8 +1961,7 @@ xfs_iunlink( if (error) { return error; } - ASSERT(INT_GET(dip->di_next_unlinked, ARCH_CONVERT) == NULLAGINO); - ASSERT(dip->di_next_unlinked); + ASSERT(be32_to_cpu(dip->di_next_unlinked) == NULLAGINO); /* both on-disk, don't endian flip twice */ dip->di_next_unlinked = agi->agi_unlinked[bucket_index]; offset = ip->i_boffset + @@ -2071,10 +2072,10 @@ xfs_iunlink_remove( error, mp->m_fsname); return error; } - next_agino = INT_GET(dip->di_next_unlinked, ARCH_CONVERT); + next_agino = be32_to_cpu(dip->di_next_unlinked); ASSERT(next_agino != 0); if (next_agino != NULLAGINO) { - INT_SET(dip->di_next_unlinked, ARCH_CONVERT, NULLAGINO); + dip->di_next_unlinked = cpu_to_be32(NULLAGINO); offset = ip->i_boffset + offsetof(xfs_dinode_t, di_next_unlinked); xfs_trans_inode_buf(tp, ibp); @@ -2118,7 +2119,7 @@ xfs_iunlink_remove( error, mp->m_fsname); return error; } - next_agino = INT_GET(last_dip->di_next_unlinked, ARCH_CONVERT); + next_agino = be32_to_cpu(last_dip->di_next_unlinked); ASSERT(next_agino != NULLAGINO); ASSERT(next_agino != 0); } @@ -2133,11 +2134,11 @@ xfs_iunlink_remove( error, mp->m_fsname); return error; } - next_agino = INT_GET(dip->di_next_unlinked, ARCH_CONVERT); + next_agino = be32_to_cpu(dip->di_next_unlinked); ASSERT(next_agino != 0); ASSERT(next_agino != agino); if (next_agino != NULLAGINO) { - INT_SET(dip->di_next_unlinked, ARCH_CONVERT, NULLAGINO); + dip->di_next_unlinked = cpu_to_be32(NULLAGINO); offset = ip->i_boffset + offsetof(xfs_dinode_t, di_next_unlinked); xfs_trans_inode_buf(tp, ibp); @@ -2150,7 +2151,7 @@ xfs_iunlink_remove( /* * Point the previous inode on the list to the next inode. */ - INT_SET(last_dip->di_next_unlinked, ARCH_CONVERT, next_agino); + last_dip->di_next_unlinked = cpu_to_be32(next_agino); ASSERT(next_agino != 0); offset = last_offset + offsetof(xfs_dinode_t, di_next_unlinked); xfs_trans_inode_buf(tp, last_ibp); @@ -3009,7 +3010,7 @@ xfs_iflush_fork( case XFS_DINODE_FMT_DEV: if (iip->ili_format.ilf_fields & XFS_ILOG_DEV) { ASSERT(whichfork == XFS_DATA_FORK); - INT_SET(dip->di_u.di_dev, ARCH_CONVERT, ip->i_df.if_u2.if_rdev); + dip->di_u.di_dev = cpu_to_be32(ip->i_df.if_u2.if_rdev); } break; @@ -3358,11 +3359,11 @@ xfs_iflush_int( */ xfs_synchronize_atime(ip); - if (XFS_TEST_ERROR(INT_GET(dip->di_core.di_magic,ARCH_CONVERT) != XFS_DINODE_MAGIC, + if (XFS_TEST_ERROR(be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC, mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) { xfs_cmn_err(XFS_PTAG_IFLUSH, CE_ALERT, mp, "xfs_iflush: Bad inode %Lu magic number 0x%x, ptr 0x%p", - ip->i_ino, (int) INT_GET(dip->di_core.di_magic, ARCH_CONVERT), dip); + ip->i_ino, be16_to_cpu(dip->di_core.di_magic), dip); goto corrupt_out; } if (XFS_TEST_ERROR(ip->i_d.di_magic != XFS_DINODE_MAGIC, @@ -3425,7 +3426,7 @@ xfs_iflush_int( * because if the inode is dirty at all the core must * be. */ - xfs_xlate_dinode_core((xfs_caddr_t)&(dip->di_core), &(ip->i_d), -1); + xfs_dinode_to_disk(&dip->di_core, &ip->i_d); /* Wrap, we never let the log put out DI_MAX_FLUSH */ if (ip->i_d.di_flushiter == DI_MAX_FLUSH) @@ -3445,7 +3446,7 @@ xfs_iflush_int( * Convert it back. */ ASSERT(ip->i_d.di_nlink <= XFS_MAXLINK_1); - INT_SET(dip->di_core.di_onlink, ARCH_CONVERT, ip->i_d.di_nlink); + dip->di_core.di_onlink = cpu_to_be16(ip->i_d.di_nlink); } else { /* * The superblock version has already been bumped, @@ -3453,7 +3454,7 @@ xfs_iflush_int( * format permanent. */ ip->i_d.di_version = XFS_DINODE_VERSION_2; - INT_SET(dip->di_core.di_version, ARCH_CONVERT, XFS_DINODE_VERSION_2); + dip->di_core.di_version = XFS_DINODE_VERSION_2; ip->i_d.di_onlink = 0; dip->di_core.di_onlink = 0; memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2007-08-03 01:00:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2007-08-03 01:06:39.000000000 +0200 @@ -57,7 +57,7 @@ xfs_bulkstat_one_iget( xfs_bstat_t *buf, /* return buffer */ int *stat) /* BULKSTAT_RV_... */ { - xfs_dinode_core_t *dic; /* dinode core info pointer */ + xfs_icdinode_t *dic; /* dinode core info pointer */ xfs_inode_t *ip; /* incore inode pointer */ bhv_vnode_t *vp; int error; @@ -151,37 +151,37 @@ xfs_bulkstat_one_dinode( * the new format. We don't change the version number so that we * can distinguish this from a real new format inode. */ - if (INT_GET(dic->di_version, ARCH_CONVERT) == XFS_DINODE_VERSION_1) { - buf->bs_nlink = INT_GET(dic->di_onlink, ARCH_CONVERT); + if (dic->di_version == XFS_DINODE_VERSION_1) { + buf->bs_nlink = be16_to_cpu(dic->di_onlink); buf->bs_projid = 0; } else { - buf->bs_nlink = INT_GET(dic->di_nlink, ARCH_CONVERT); - buf->bs_projid = INT_GET(dic->di_projid, ARCH_CONVERT); + buf->bs_nlink = be32_to_cpu(dic->di_nlink); + buf->bs_projid = be16_to_cpu(dic->di_projid); } buf->bs_ino = ino; - buf->bs_mode = INT_GET(dic->di_mode, ARCH_CONVERT); - buf->bs_uid = INT_GET(dic->di_uid, ARCH_CONVERT); - buf->bs_gid = INT_GET(dic->di_gid, ARCH_CONVERT); - buf->bs_size = INT_GET(dic->di_size, ARCH_CONVERT); - buf->bs_atime.tv_sec = INT_GET(dic->di_atime.t_sec, ARCH_CONVERT); - buf->bs_atime.tv_nsec = INT_GET(dic->di_atime.t_nsec, ARCH_CONVERT); - buf->bs_mtime.tv_sec = INT_GET(dic->di_mtime.t_sec, ARCH_CONVERT); - buf->bs_mtime.tv_nsec = INT_GET(dic->di_mtime.t_nsec, ARCH_CONVERT); - buf->bs_ctime.tv_sec = INT_GET(dic->di_ctime.t_sec, ARCH_CONVERT); - buf->bs_ctime.tv_nsec = INT_GET(dic->di_ctime.t_nsec, ARCH_CONVERT); + buf->bs_mode = be16_to_cpu(dic->di_mode); + buf->bs_uid = be32_to_cpu(dic->di_uid); + buf->bs_gid = be32_to_cpu(dic->di_gid); + buf->bs_size = be64_to_cpu(dic->di_size); + buf->bs_atime.tv_sec = be32_to_cpu(dic->di_atime.t_sec); + buf->bs_atime.tv_nsec = be32_to_cpu(dic->di_atime.t_nsec); + buf->bs_mtime.tv_sec = be32_to_cpu(dic->di_mtime.t_sec); + buf->bs_mtime.tv_nsec = be32_to_cpu(dic->di_mtime.t_nsec); + buf->bs_ctime.tv_sec = be32_to_cpu(dic->di_ctime.t_sec); + buf->bs_ctime.tv_nsec = be32_to_cpu(dic->di_ctime.t_nsec); buf->bs_xflags = xfs_dic2xflags(dic); - buf->bs_extsize = INT_GET(dic->di_extsize, ARCH_CONVERT) << mp->m_sb.sb_blocklog; - buf->bs_extents = INT_GET(dic->di_nextents, ARCH_CONVERT); - buf->bs_gen = INT_GET(dic->di_gen, ARCH_CONVERT); + buf->bs_extsize = be32_to_cpu(dic->di_extsize) << mp->m_sb.sb_blocklog; + buf->bs_extents = be32_to_cpu(dic->di_nextents); + buf->bs_gen = be32_to_cpu(dic->di_gen); memset(buf->bs_pad, 0, sizeof(buf->bs_pad)); - buf->bs_dmevmask = INT_GET(dic->di_dmevmask, ARCH_CONVERT); - buf->bs_dmstate = INT_GET(dic->di_dmstate, ARCH_CONVERT); - buf->bs_aextents = INT_GET(dic->di_anextents, ARCH_CONVERT); + buf->bs_dmevmask = be32_to_cpu(dic->di_dmevmask); + buf->bs_dmstate = be16_to_cpu(dic->di_dmstate); + buf->bs_aextents = be16_to_cpu(dic->di_anextents); - switch (INT_GET(dic->di_format, ARCH_CONVERT)) { + switch (dic->di_format) { case XFS_DINODE_FMT_DEV: - buf->bs_rdev = INT_GET(dip->di_u.di_dev, ARCH_CONVERT); + buf->bs_rdev = be32_to_cpu(dip->di_u.di_dev); buf->bs_blksize = BLKDEV_IOSIZE; buf->bs_blocks = 0; break; @@ -195,7 +195,7 @@ xfs_bulkstat_one_dinode( case XFS_DINODE_FMT_BTREE: buf->bs_rdev = 0; buf->bs_blksize = mp->m_sb.sb_blocksize; - buf->bs_blocks = INT_GET(dic->di_nblocks, ARCH_CONVERT); + buf->bs_blocks = be64_to_cpu(dic->di_nblocks); break; } @@ -290,16 +290,15 @@ xfs_bulkstat_use_dinode( return 1; dip = (xfs_dinode_t *) xfs_buf_offset(bp, clustidx << mp->m_sb.sb_inodelog); - if (INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC || - !XFS_DINODE_GOOD_VERSION( - INT_GET(dip->di_core.di_version, ARCH_CONVERT))) + if (be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC || + !XFS_DINODE_GOOD_VERSION(dip->di_core.di_version)) return 0; if (flags & BULKSTAT_FG_QUICK) { *dipp = dip; return 1; } /* BULKSTAT_FG_INLINE: if attr fork is local, or not there, use it */ - aformat = INT_GET(dip->di_core.di_aformat, ARCH_CONVERT); + aformat = dip->di_core.di_aformat; if ((XFS_CFORK_Q(&dip->di_core) == 0) || (aformat == XFS_DINODE_FMT_LOCAL) || (aformat == XFS_DINODE_FMT_EXTENTS && !dip->di_core.di_anextents)) { Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c 2007-08-03 01:18:09.000000000 +0200 @@ -2245,7 +2245,7 @@ xlog_recover_do_inode_trans( int error; int attr_index; uint fields; - xfs_dinode_core_t *dicp; + xfs_icdinode_t *dicp; int need_free = 0; if (pass == XLOG_RECOVER_PASS1) { @@ -2309,7 +2309,7 @@ xlog_recover_do_inode_trans( * Make sure the place we're flushing out to really looks * like an inode! */ - if (unlikely(INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC)) { + if (unlikely(be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC)) { xfs_buf_relse(bp); xfs_fs_cmn_err(CE_ALERT, mp, "xfs_inode_recover: Bad inode magic number, dino ptr = 0x%p, dino bp = 0x%p, ino = %Ld", @@ -2319,7 +2319,7 @@ xlog_recover_do_inode_trans( error = EFSCORRUPTED; goto error; } - dicp = (xfs_dinode_core_t*)(item->ri_buf[1].i_addr); + dicp = (xfs_icdinode_t *)(item->ri_buf[1].i_addr); if (unlikely(dicp->di_magic != XFS_DINODE_MAGIC)) { xfs_buf_relse(bp); xfs_fs_cmn_err(CE_ALERT, mp, @@ -2332,15 +2332,13 @@ xlog_recover_do_inode_trans( } /* Skip replay when the on disk inode is newer than the log one */ - if (dicp->di_flushiter < - INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT)) { + if (dicp->di_flushiter < be16_to_cpu(dip->di_core.di_flushiter)) { /* * Deal with the wrap case, DI_MAX_FLUSH is less * than smaller numbers */ - if ((INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT) - == DI_MAX_FLUSH) && - (dicp->di_flushiter < (DI_MAX_FLUSH>>1))) { + if (be16_to_cpu(dip->di_core.di_flushiter) == DI_MAX_FLUSH && + dicp->di_flushiter < (DI_MAX_FLUSH >> 1)) { /* do nothing */ } else { xfs_buf_relse(bp); @@ -2411,8 +2409,8 @@ xlog_recover_do_inode_trans( } /* The core is in in-core format */ - xfs_xlate_dinode_core((xfs_caddr_t)&dip->di_core, - (xfs_dinode_core_t*)item->ri_buf[1].i_addr, -1); + xfs_dinode_to_disk(&dip->di_core, + (xfs_icdinode_t *)item->ri_buf[1].i_addr); /* the rest is in on-disk format */ if (item->ri_buf[1].i_len > sizeof(xfs_dinode_core_t)) { @@ -2424,8 +2422,7 @@ xlog_recover_do_inode_trans( fields = in_f->ilf_fields; switch (fields & (XFS_ILOG_DEV | XFS_ILOG_UUID)) { case XFS_ILOG_DEV: - INT_SET(dip->di_u.di_dev, ARCH_CONVERT, in_f->ilf_u.ilfu_rdev); - + dip->di_u.di_dev = cpu_to_be32(in_f->ilf_u.ilfu_rdev); break; case XFS_ILOG_UUID: dip->di_u.di_muuid = in_f->ilf_u.ilfu_uuid; @@ -3234,8 +3231,8 @@ xlog_recover_process_iunlinks( ASSERT(ip->i_d.di_nlink == 0); /* setup for the next pass */ - agino = INT_GET(dip->di_next_unlinked, - ARCH_CONVERT); + agino = be32_to_cpu( + dip->di_next_unlinked); xfs_buf_relse(ibp); /* * Prevent any DMAPI event from Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2007-08-03 01:18:09.000000000 +0200 @@ -232,7 +232,7 @@ static char * xfs_fmtsize(size_t i); static char * xfs_fmtuuid(uuid_t *); static void xfs_inode_item_print(xfs_inode_log_item_t *ilip, int summary); static void xfs_inodebuf(xfs_buf_t *bp); -static void xfs_prdinode_core(xfs_dinode_core_t *dip); +static void xfs_prdinode_incore(xfs_icdinode_t *dip); static void xfs_qoff_item_print(xfs_qoff_logitem_t *lip, int summary); static void xfs_xexlist_fork(xfs_inode_t *ip, int whichfork); static void xfs_xnode_fork(char *name, xfs_ifork_t *f); @@ -3828,7 +3828,7 @@ static void xfs_inodebuf(xfs_buf_t *bp) { xfs_dinode_t *di; - xfs_dinode_core_t dic; + xfs_icdinode_t dic; int n, i; n = XFS_BUF_COUNT(bp) >> 8; @@ -3836,11 +3836,10 @@ xfs_inodebuf(xfs_buf_t *bp) di = (xfs_dinode_t *)xfs_buf_offset(bp, i * 256); - xfs_xlate_dinode_core((xfs_caddr_t)&di->di_core, &dic, 1); - xfs_prdinode_core(&dic); + xfs_dinode_from_disk(&dic, &di->di_core); + xfs_prdinode_incore(&dic); kdb_printf("next_unlinked 0x%x u@0x%p\n", - INT_GET(di->di_next_unlinked, ARCH_CONVERT), - &di->di_u); + be32_to_cpu(di->di_next_unlinked), &di->di_u); } } @@ -3981,7 +3980,7 @@ xfs_inval_cached_trace_entry(ktrace_entr * Print disk inode core. */ static void -xfs_prdinode_core(xfs_dinode_core_t *dip) +xfs_prdinode_incore(xfs_icdinode_t *dip) { static char *diflags[] = { "realtime", /* XFS_DIFLAG_REALTIME */ @@ -5059,7 +5058,7 @@ xfsidbg_xbuf_real(xfs_buf_t *bp, int sum kdb_printf("buf 0x%p dir/attr node 0x%p\n", bp, node); xfsidbg_xdanode(node); } - } else if (INT_GET((di = d)->di_core.di_magic, ARCH_CONVERT) == XFS_DINODE_MAGIC) { + } else if (be16_to_cpu((di = d)->di_core.di_magic) == XFS_DINODE_MAGIC) { if (summary) { kdb_printf("Disk Inode (at 0x%p)\n", di); } else { @@ -6906,7 +6905,7 @@ xfsidbg_xnode(xfs_inode_t *ip) xfs_xnode_fork("data", &ip->i_df); xfs_xnode_fork("attr", ip->i_afp); kdb_printf("\n"); - xfs_prdinode_core(&ip->i_d); + xfs_prdinode_incore(&ip->i_d); } static void 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 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2007-08-03 01:18:09.000000000 +0200 @@ -329,7 +329,7 @@ EXPORT_SYMBOL(xfs_vfsops); EXPORT_SYMBOL(xfs_vnodeops); EXPORT_SYMBOL(xfs_vtoi); EXPORT_SYMBOL(xfs_write_clear_setuid); -EXPORT_SYMBOL(xfs_xlate_dinode_core); +EXPORT_SYMBOL(xfs_dinode_from_disk); EXPORT_SYMBOL(xfs_xlatesb); EXPORT_SYMBOL(xfs_zero_eof); EXPORT_SYMBOL(xlog_recover_process_iunlinks); Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2007-08-03 01:22:01.000000000 +0200 @@ -227,6 +227,43 @@ typedef struct xfs_chash { * chain off the mount structure by xfs_sync calls. */ +typedef struct xfs_ictimestamp { + __int32_t t_sec; /* timestamp seconds */ + __int32_t t_nsec; /* timestamp nanoseconds */ +} xfs_ictimestamp_t; + +/* + * NOTE: This structure must be kept identical to struct xfs_dinode_core + * in xfs_dinode.h except for the endianess annotations. + */ +typedef struct xfs_icincore { + __uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */ + __uint16_t di_mode; /* mode and type of file */ + __int8_t di_version; /* inode version */ + __int8_t di_format; /* format of di_c data */ + __uint16_t di_onlink; /* old number of links to file */ + __uint32_t di_uid; /* owner's user id */ + __uint32_t di_gid; /* owner's group id */ + __uint32_t di_nlink; /* number of links to file */ + __uint16_t di_projid; /* owner's project id */ + __uint8_t di_pad[8]; /* unused, zeroed space */ + __uint16_t di_flushiter; /* incremented on flush */ + xfs_ictimestamp_t di_atime; /* time last accessed */ + xfs_ictimestamp_t di_mtime; /* time last modified */ + xfs_ictimestamp_t di_ctime; /* time created/inode modified */ + xfs_fsize_t di_size; /* number of bytes in file */ + xfs_drfsbno_t di_nblocks; /* # of direct & btree blocks used */ + xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ + xfs_extnum_t di_nextents; /* number of extents in data fork */ + xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ + __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ + __int8_t di_aformat; /* format of attr fork's data */ + __uint32_t di_dmevmask; /* DMIG event mask */ + __uint16_t di_dmstate; /* DMIG state info */ + __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ + __uint32_t di_gen; /* generation number */ +} xfs_icdinode_t; + typedef struct { struct xfs_ihash *ip_hash; /* pointer to hash header */ struct xfs_inode *ip_next; /* inode hash link forw */ @@ -282,7 +319,7 @@ typedef struct xfs_inode { unsigned int i_gen; /* generation count */ unsigned int i_delayed_blks; /* count of delay alloc blks */ - xfs_dinode_core_t i_d; /* most of ondisk inode */ + xfs_icdinode_t i_d; /* most of ondisk inode */ xfs_chashlist_t *i_chash; /* cluster hash list header */ struct xfs_inode *i_cnext; /* cluster hash link forward */ struct xfs_inode *i_cprev; /* cluster hash link backward */ @@ -514,8 +551,11 @@ int xfs_iread_extents(struct xfs_trans 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_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, - int); +void xfs_dinode_from_disk(xfs_icdinode_t *, + xfs_dinode_core_t *); +void xfs_dinode_to_disk(xfs_dinode_core_t *, + xfs_icdinode_t *); + uint xfs_ip2xflags(struct xfs_inode *); uint xfs_dic2xflags(struct xfs_dinode_core *); int xfs_ifree(struct xfs_trans *, xfs_inode_t *, From owner-xfs@oss.sgi.com Thu Aug 2 18:21:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 18:21:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l731L7bm015320 for ; Thu, 2 Aug 2007 18:21:08 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l731LAA5006750 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 3 Aug 2007 03:21:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l731LAfW006748 for xfs@oss.sgi.com; Fri, 3 Aug 2007 03:21:10 +0200 Date: Fri, 3 Aug 2007 03:21:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] replace some large xfs_log_priv.h macros by proper functions Message-ID: <20070803012110.GA6590@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-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12458 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 ... or in the case of XLOG_TIC_ADD_OPHDR remove a useless macro entirely. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_log.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log.c 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log.c 2007-08-03 01:10:41.000000000 +0200 @@ -252,6 +252,29 @@ xlog_grant_add_space(struct log *log, in xlog_grant_add_space_reserve(log, bytes); } +static void +xlog_tic_reset_res(xlog_ticket_t *tic) +{ + tic->t_res_num = 0; + tic->t_res_arr_sum = 0; + tic->t_res_num_ophdrs = 0; +} + +static void +xlog_tic_add_region(xlog_ticket_t *tic, uint len, uint type) +{ + if (tic->t_res_num == XLOG_TIC_LEN_MAX) { + /* add to overflow and start again */ + tic->t_res_o_flow += tic->t_res_arr_sum; + tic->t_res_num = 0; + tic->t_res_arr_sum = 0; + } + + tic->t_res_arr[tic->t_res_num].r_len = len; + tic->t_res_arr[tic->t_res_num].r_type = type; + tic->t_res_arr_sum += len; + tic->t_res_num++; +} /* * NOTES: @@ -1765,14 +1788,14 @@ xlog_write(xfs_mount_t * mp, len = 0; if (ticket->t_flags & XLOG_TIC_INITED) { /* acct for start rec of xact */ len += sizeof(xlog_op_header_t); - XLOG_TIC_ADD_OPHDR(ticket); + ticket->t_res_num_ophdrs++; } for (index = 0; index < nentries; index++) { len += sizeof(xlog_op_header_t); /* each region gets >= 1 */ - XLOG_TIC_ADD_OPHDR(ticket); + ticket->t_res_num_ophdrs++; len += reg[index].i_len; - XLOG_TIC_ADD_REGION(ticket, reg[index].i_len, reg[index].i_type); + xlog_tic_add_region(ticket, reg[index].i_len, reg[index].i_type); } contwr = *start_lsn = 0; @@ -1881,7 +1904,7 @@ xlog_write(xfs_mount_t * mp, len += sizeof(xlog_op_header_t); /* from splitting of region */ /* account for new log op header */ ticket->t_curr_res -= sizeof(xlog_op_header_t); - XLOG_TIC_ADD_OPHDR(ticket); + ticket->t_res_num_ophdrs++; } xlog_verify_dest_ptr(log, ptr); @@ -2379,7 +2402,7 @@ restart: */ if (log_offset == 0) { ticket->t_curr_res -= log->l_iclog_hsize; - XLOG_TIC_ADD_REGION(ticket, + xlog_tic_add_region(ticket, log->l_iclog_hsize, XLOG_REG_TYPE_LRHEADER); INT_SET(head->h_cycle, ARCH_CONVERT, log->l_curr_cycle); @@ -2567,7 +2590,7 @@ xlog_regrant_write_log_space(xlog_t * #endif tic->t_curr_res = tic->t_unit_res; - XLOG_TIC_RESET_RES(tic); + xlog_tic_reset_res(tic); if (tic->t_cnt > 0) return 0; @@ -2708,7 +2731,7 @@ xlog_regrant_reserve_log_space(xlog_t s = GRANT_LOCK(log); xlog_grant_sub_space(log, ticket->t_curr_res); ticket->t_curr_res = ticket->t_unit_res; - XLOG_TIC_RESET_RES(ticket); + xlog_tic_reset_res(ticket); xlog_trace_loggrant(log, ticket, "xlog_regrant_reserve_log_space: sub current res"); xlog_verify_grant_head(log, 1); @@ -2725,7 +2748,7 @@ xlog_regrant_reserve_log_space(xlog_t xlog_verify_grant_head(log, 0); GRANT_UNLOCK(log, s); ticket->t_curr_res = ticket->t_unit_res; - XLOG_TIC_RESET_RES(ticket); + xlog_tic_reset_res(ticket); } /* xlog_regrant_reserve_log_space */ @@ -3348,7 +3371,7 @@ xlog_ticket_get(xlog_t *log, tic->t_flags |= XLOG_TIC_PERM_RESERV; sv_init(&(tic->t_sema), SV_DEFAULT, "logtick"); - XLOG_TIC_RESET_RES(tic); + xlog_tic_reset_res(tic); return tic; } /* xlog_ticket_get */ Index: linux-2.6-xfs/fs/xfs/xfs_log_priv.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_priv.h 2007-08-03 01:02:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_priv.h 2007-08-03 01:10:17.000000000 +0200 @@ -249,22 +249,6 @@ typedef __uint32_t xlog_tid_t; /* Ticket reservation region accounting */ #define XLOG_TIC_LEN_MAX 15 -#define XLOG_TIC_RESET_RES(t) ((t)->t_res_num = \ - (t)->t_res_arr_sum = (t)->t_res_num_ophdrs = 0) -#define XLOG_TIC_ADD_OPHDR(t) ((t)->t_res_num_ophdrs++) -#define XLOG_TIC_ADD_REGION(t, len, type) \ - do { \ - if ((t)->t_res_num == XLOG_TIC_LEN_MAX) { \ - /* add to overflow and start again */ \ - (t)->t_res_o_flow += (t)->t_res_arr_sum; \ - (t)->t_res_num = 0; \ - (t)->t_res_arr_sum = 0; \ - } \ - (t)->t_res_arr[(t)->t_res_num].r_len = (len); \ - (t)->t_res_arr[(t)->t_res_num].r_type = (type); \ - (t)->t_res_arr_sum += (len); \ - (t)->t_res_num++; \ - } while (0) /* * Reservation region From owner-xfs@oss.sgi.com Thu Aug 2 19:31:14 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 19:31:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l732V6bm003064 for ; Thu, 2 Aug 2007 19:31:10 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA02748; Fri, 3 Aug 2007 12:19:09 +1000 Message-ID: <46B2911A.60308@sgi.com> Date: Fri, 03 Aug 2007 12:21:14 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] remove unessecary vfs argument to DM_EVENT_ENABLED References: <20070802143417.GA30414@lst.de> In-Reply-To: <20070802143417.GA30414@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12459 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs It is looking good Christoph. I built it and ran DMAPI QA and all went fine. Dave is also looking at it and would provide a feedback. Regards, Vlad Christoph Hellwig wrote: > We can easily derive the vfs from the inode passed in. Also kill > the unused DM_EVENT_ENABLED_IO macro. > > > 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 2007-08-01 19:53:27.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-08-01 19:53:42.000000000 +0200 > @@ -3271,8 +3271,7 @@ xfs_dm_send_mmap_event( > > xfs_ilock(ip, iolock); > /* If write possible, try a DMAPI write event */ > - if ((max_event == DM_EVENT_WRITE) && > - DM_EVENT_ENABLED(vp->v_vfsp, ip, max_event)){ > + if (max_event == DM_EVENT_WRITE && DM_EVENT_ENABLED(ip, max_event)) { > error = xfs_dm_send_data_event(max_event, vp, offset, > evsize, 0, &locktype); > goto out_unlock; > @@ -3281,7 +3280,7 @@ xfs_dm_send_mmap_event( > /* Try a read event if max_event was != DM_EVENT_WRITE or if it > * was DM_EVENT_WRITE but the WRITE event was not enabled. > */ > - if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_READ)) { > + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) { > error = xfs_dm_send_data_event(DM_EVENT_READ, vp, offset, > evsize, 0, &locktype); > } > 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 2007-08-01 19:53:22.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2007-08-01 19:53:42.000000000 +0200 > @@ -384,7 +384,7 @@ xfs_file_open_exec( > > if (!ip) > return -EINVAL; > - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)) > + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) > return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, > 0, 0, 0, NULL); > } > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-01 19:53:27.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-01 19:56:14.000000000 +0200 > @@ -245,8 +245,7 @@ xfs_read( > mutex_lock(&inode->i_mutex); > xfs_ilock(ip, XFS_IOLOCK_SHARED); > > - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && > - !(ioflags & IO_INVIS)) { > + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { > bhv_vrwlock_t locktype = VRWLOCK_READ; > int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); > > @@ -307,8 +306,7 @@ xfs_sendfile( > > xfs_ilock(ip, XFS_IOLOCK_SHARED); > > - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && > - (!(ioflags & IO_INVIS))) { > + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { > bhv_vrwlock_t locktype = VRWLOCK_READ; > int error; > > @@ -351,8 +349,7 @@ xfs_splice_read( > > xfs_ilock(ip, XFS_IOLOCK_SHARED); > > - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && > - (!(ioflags & IO_INVIS))) { > + if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { > bhv_vrwlock_t locktype = VRWLOCK_READ; > int error; > > @@ -398,8 +395,7 @@ xfs_splice_write( > > xfs_ilock(ip, XFS_IOLOCK_EXCL); > > - if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_WRITE) && > - (!(ioflags & IO_INVIS))) { > + if (DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS)) { > bhv_vrwlock_t locktype = VRWLOCK_WRITE; > int error; > > @@ -724,7 +720,7 @@ start: > goto out_unlock_mutex; > } > > - if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) && > + if ((DM_EVENT_ENABLED(xip, DM_EVENT_WRITE) && > !(ioflags & IO_INVIS) && !eventsent)) { > int dmflags = FILP_DELAY_FLAG(file); > > @@ -876,10 +872,8 @@ retry: > if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) > ret = wait_on_sync_kiocb(iocb); > > - if ((ret == -ENOSPC) && > - DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_NOSPACE) && > - !(ioflags & IO_INVIS)) { > - > + if (ret == -ENOSPC && > + DM_EVENT_ENABLED(xip, DM_EVENT_NOSPACE) && !(ioflags & IO_INVIS)) { > xfs_rwunlock(bdp, locktype); > if (need_i_mutex) > mutex_unlock(&inode->i_mutex); > Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2007-08-01 19:53:27.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2007-08-01 19:53:42.000000000 +0200 > @@ -5811,10 +5811,9 @@ xfs_getbmap( > * could misinterpret holes in a DMAPI file as true holes, > * when in fact they may represent offline user data. > */ > - if ( (interface & BMV_IF_NO_DMAPI_READ) == 0 > - && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) > - && whichfork == XFS_DATA_FORK) { > - > + if ((interface & BMV_IF_NO_DMAPI_READ) == 0 && > + DM_EVENT_ENABLED(ip, DM_EVENT_READ) && > + whichfork == XFS_DATA_FORK) { > error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL); > if (error) > return XFS_ERROR(error); > Index: linux-2.6-xfs/fs/xfs/xfs_dmapi.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_dmapi.h 2007-08-01 19:53:16.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_dmapi.h 2007-08-01 19:53:42.000000000 +0200 > @@ -67,18 +67,12 @@ typedef enum { > #define HAVE_DM_RIGHT_T > > /* Defines for determining if an event message should be sent. */ > -#define DM_EVENT_ENABLED(vfsp, ip, event) ( \ > - unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ > +#define DM_EVENT_ENABLED(ip, event) ( \ > + unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \ > ( ((ip)->i_d.di_dmevmask & (1 << event)) || \ > ((ip)->i_mount->m_dmevmask & (1 << event)) ) \ > ) > > -#define DM_EVENT_ENABLED_IO(vfsp, io, event) ( \ > - unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ > - ( ((io)->io_dmevmask & (1 << event)) || \ > - ((io)->io_mount->m_dmevmask & (1 << event)) ) \ > - ) > - > #define DM_XFS_VALID_FS_EVENTS ( \ > (1 << DM_EVENT_PREUNMOUNT) | \ > (1 << DM_EVENT_UNMOUNT) | \ > Index: linux-2.6-xfs/fs/xfs/xfs_rename.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2007-08-01 19:53:27.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2007-08-01 19:53:42.000000000 +0200 > @@ -264,9 +264,8 @@ xfs_rename( > src_dp = XFS_BHVTOI(src_dir_bdp); > mp = src_dp->i_mount; > > - if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) || > - DM_EVENT_ENABLED(target_dir_vp->v_vfsp, > - target_dp, DM_EVENT_RENAME)) { > + if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || > + DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, > src_dir_vp, DM_RIGHT_NULL, > target_dir_vp, DM_RIGHT_NULL, > @@ -603,9 +602,8 @@ xfs_rename( > /* Fall through to std_return with error = 0 or errno from > * xfs_trans_commit */ > std_return: > - if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_POSTRENAME) || > - DM_EVENT_ENABLED(target_dir_vp->v_vfsp, > - target_dp, DM_EVENT_POSTRENAME)) { > + if (DM_EVENT_ENABLED(src_dp, DM_EVENT_POSTRENAME) || > + DM_EVENT_ENABLED(target_dp, DM_EVENT_POSTRENAME)) { > (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME, > src_dir_vp, DM_RIGHT_NULL, > target_dir_vp, DM_RIGHT_NULL, > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-08-01 19:53:27.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-08-01 19:58:06.000000000 +0200 > @@ -337,7 +337,7 @@ xfs_setattr( > } > } > } else { > - if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) && > + if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && > !(flags & ATTR_DMI)) { > int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; > code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp, > @@ -896,7 +896,7 @@ xfs_setattr( > return code; > } > > - if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_ATTRIBUTE) && > + if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && > !(flags & ATTR_DMI)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, vp, DM_RIGHT_NULL, > NULL, DM_RIGHT_NULL, NULL, NULL, > @@ -1651,8 +1651,7 @@ xfs_inactive( > > mp = ip->i_mount; > > - if (ip->i_d.di_nlink == 0 && > - DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_DESTROY)) { > + if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_DESTROY)) { > (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL); > } > > @@ -1907,7 +1906,7 @@ xfs_create( > dm_di_mode = vap->va_mode; > namelen = VNAMELEN(dentry); > > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, > dir_vp, DM_RIGHT_NULL, NULL, > DM_RIGHT_NULL, name, NULL, > @@ -2072,9 +2071,8 @@ xfs_create( > /* Fallthrough to std_return with error = 0 */ > > std_return: > - if ( (*vpp || (error != 0 && dm_event_sent != 0)) && > - DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), > - DM_EVENT_POSTCREATE)) { > + if ((*vpp || (error != 0 && dm_event_sent != 0)) && > + DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, > dir_vp, DM_RIGHT_NULL, > *vpp ? vp:NULL, > @@ -2408,7 +2406,7 @@ xfs_remove( > IRELE(ip); > } > > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, > DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, > name, NULL, dm_di_mode, 0, 0); > @@ -2584,8 +2582,7 @@ xfs_remove( > > /* Fall through to std_return with error = 0 */ > std_return: > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, > - DM_EVENT_POSTREMOVE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > dir_vp, DM_RIGHT_NULL, > NULL, DM_RIGHT_NULL, > @@ -2662,7 +2659,7 @@ xfs_link( > if (XFS_FORCED_SHUTDOWN(mp)) > return XFS_ERROR(EIO); > > - if (DM_EVENT_ENABLED(src_vp->v_vfsp, tdp, DM_EVENT_LINK)) { > + if (DM_EVENT_ENABLED(tdp, DM_EVENT_LINK)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK, > target_dir_vp, DM_RIGHT_NULL, > src_vp, DM_RIGHT_NULL, > @@ -2773,8 +2770,7 @@ xfs_link( > > /* Fall through to std_return with error = 0. */ > std_return: > - if (DM_EVENT_ENABLED(src_vp->v_vfsp, sip, > - DM_EVENT_POSTLINK)) { > + if (DM_EVENT_ENABLED(sip, DM_EVENT_POSTLINK)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK, > target_dir_vp, DM_RIGHT_NULL, > src_vp, DM_RIGHT_NULL, > @@ -2838,7 +2834,7 @@ xfs_mkdir( > dp_joined_to_trans = B_FALSE; > dm_di_mode = vap->va_mode; > > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, > dir_vp, DM_RIGHT_NULL, NULL, > DM_RIGHT_NULL, dir_name, NULL, > @@ -2995,9 +2991,8 @@ xfs_mkdir( > * xfs_trans_commit. */ > > std_return: > - if ( (created || (error != 0 && dm_event_sent != 0)) && > - DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), > - DM_EVENT_POSTCREATE)) { > + if ((created || (error != 0 && dm_event_sent != 0)) && > + DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, > dir_vp, DM_RIGHT_NULL, > created ? XFS_ITOV(cdp):NULL, > @@ -3066,7 +3061,7 @@ xfs_rmdir( > IRELE(cdp); > } > > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, > dir_vp, DM_RIGHT_NULL, > NULL, DM_RIGHT_NULL, > @@ -3255,7 +3250,7 @@ xfs_rmdir( > /* Fall through to std_return with error = 0 or the errno > * from xfs_trans_commit. */ > std_return: > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_POSTREMOVE)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > dir_vp, DM_RIGHT_NULL, > NULL, DM_RIGHT_NULL, > @@ -3359,7 +3354,7 @@ xfs_symlink( > } > } > > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_SYMLINK)) { > + if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dir_vp, > DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, > link_name, target_path, 0, 0, 0); > @@ -3559,8 +3554,7 @@ xfs_symlink( > /* Fall through to std_return with error = 0 or errno from > * xfs_trans_commit */ > std_return: > - if (DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), > - DM_EVENT_POSTSYMLINK)) { > + if (DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTSYMLINK)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK, > dir_vp, DM_RIGHT_NULL, > error ? NULL : XFS_ITOV(ip), > @@ -4062,7 +4056,7 @@ xfs_alloc_file_space( > /* Generate a DMAPI event if needed. */ > if (alloc_type != 0 && offset < ip->i_size && > (attr_flags&ATTR_DMI) == 0 && > - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { > + DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { > xfs_off_t end_dmi_offset; > > end_dmi_offset = offset+len; > @@ -4176,9 +4170,8 @@ retry: > allocatesize_fsb -= allocated_fsb; > } > dmapi_enospc_check: > - if (error == ENOSPC && (attr_flags&ATTR_DMI) == 0 && > - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_NOSPACE)) { > - > + if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && > + DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, > XFS_ITOV(ip), DM_RIGHT_NULL, > XFS_ITOV(ip), DM_RIGHT_NULL, > @@ -4322,9 +4315,8 @@ xfs_free_file_space( > end_dmi_offset = offset + len; > endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); > > - if (offset < ip->i_size && > - (attr_flags & ATTR_DMI) == 0 && > - DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { > + if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 && > + DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { > if (end_dmi_offset > ip->i_size) > end_dmi_offset = ip->i_size; > error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, > > From owner-xfs@oss.sgi.com Thu Aug 2 20:09:22 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 20:10:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7339Jbm016377 for ; Thu, 2 Aug 2007 20:09:21 -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 NAA03976; Fri, 3 Aug 2007 13:09:22 +1000 Date: Fri, 03 Aug 2007 13:13:34 +1000 To: "xfs@oss.sgi.com" , xfs-dev Subject: REVIEW: fix xfs_repair phase 4 ag_stride with prefetch From: "Barry Naujok" Organization: SGI Content-Type: multipart/mixed; boundary=----------gjkibzd07A5PDL7qz04KI3 MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.10 (Win32) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12460 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 ------------gjkibzd07A5PDL7qz04KI3 Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 Content-Transfer-Encoding: Quoted-Printable AG stride testing was performed on a system with ample amounts of memory, so prefetching with AG stride during Phase 4 was missed. The attached patch fixes this. 32 AGs, ag_stride =3D 4: Phase 3 - for each AG... - scan and clear agi unlinked lists... - process known inodes and perform inode discovery... - agno =3D 0 - agno =3D 4 - agno =3D 8 - agno =3D 12 - agno =3D 16 - agno =3D 20 - agno =3D 24 - agno =3D 28 which is correct... but in Phase 4: Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno =3D 0 - agno =3D 1 - agno =3D 2 - agno =3D 5 - agno =3D 6 - agno =3D 4 - agno =3D 7 - agno =3D 3= ------------gjkibzd07A5PDL7qz04KI3 Content-Disposition: attachment; filename=fix_ag_stride Content-Type: application/octet-stream; name=fix_ag_stride Content-Transfer-Encoding: Base64 SW5kZXg6IHJlcGFpci94ZnNwcm9ncy9yZXBhaXIvcGhhc2U0LmMKPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PQotLS0gcmVwYWlyLm9yaWcveGZzcHJvZ3MvcmVw YWlyL3BoYXNlNC5jCTIwMDctMDctMjQgMTU6MzQ6MzkuMDAwMDAwMDAwICsx MDAwCisrKyByZXBhaXIveGZzcHJvZ3MvcmVwYWlyL3BoYXNlNC5jCTIwMDct MDgtMDMgMTI6MDQ6MzguMjAxMTc2MjgzICsxMDAwCkBAIC0xMzcsNiArMTM3 LDcgQEAKIAl4ZnNfbW91bnRfdAkJKm1wKQogewogCWludCAJCQlpLCBqOwor CXhmc19hZ251bWJlcl90IAkJYWdubzsKIAl3b3JrX3F1ZXVlX3QJCSpxdWV1 ZXM7CiAJcHJlZmV0Y2hfYXJnc190CQkqcGZfYXJnc1syXTsKIApAQCAtMTUz LDEyICsxNTQsMTMgQEAKIAkJCS8qCiAJCQkgKiBjcmVhdGUgb25lIHdvcmtl ciB0aHJlYWQgZm9yIGVhY2ggc2VnbWVudCBvZiB0aGUgdm9sdW1lCiAJCQkg Ki8KLQkJCWZvciAoaSA9IDA7IGkgPCB0aHJlYWRfY291bnQ7IGkrKykgewor CQkJZm9yIChpID0gMCwgYWdubyA9IDA7IGkgPCB0aHJlYWRfY291bnQ7IGkr KykgewogCQkJCWNyZWF0ZV93b3JrX3F1ZXVlKCZxdWV1ZXNbaV0sIG1wLCAx KTsKIAkJCQlwZl9hcmdzWzBdID0gTlVMTDsKLQkJCQlmb3IgKGogPSBpOyBq IDwgbXAtPm1fc2Iuc2JfYWdjb3VudDsgaiArPSBhZ19zdHJpZGUpIHsKLQkJ CQkJcGZfYXJnc1swXSA9IHN0YXJ0X2lub2RlX3ByZWZldGNoKGosIDAsIHBm X2FyZ3NbMF0pOwotCQkJCQlxdWV1ZV93b3JrKCZxdWV1ZXNbaV0sIHByb2Nl c3NfYWdfZnVuYywgaiwgcGZfYXJnc1swXSk7CisJCQkJZm9yIChqID0gMDsg aiA8IGFnX3N0cmlkZSAmJiBhZ25vIDwgbXAtPm1fc2Iuc2JfYWdjb3VudDsK KwkJCQkJCWorKywgYWdubysrKSB7CisJCQkJCXBmX2FyZ3NbMF0gPSBzdGFy dF9pbm9kZV9wcmVmZXRjaChhZ25vLCAwLCBwZl9hcmdzWzBdKTsKKwkJCQkJ cXVldWVfd29yaygmcXVldWVzW2ldLCBwcm9jZXNzX2FnX2Z1bmMsIGFnbm8s IHBmX2FyZ3NbMF0pOwogCQkJCX0KIAkJCX0KIAkJCS8qCg== ------------gjkibzd07A5PDL7qz04KI3-- From owner-xfs@oss.sgi.com Thu Aug 2 23:17:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 02 Aug 2007 23:17:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.5 required=5.0 tests=BAYES_99,HELO_DYNAMIC_DHCP, RCVD_IN_DNSWL_LOW,RDNS_DYNAMIC autolearn=no version=3.2.0-pre1-r499012 Received: from cmx01.servicemail24.de (cmx01.servicemail24.de [195.71.127.228]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l736HHbm023338 for ; Thu, 2 Aug 2007 23:17:19 -0700 Received: from dehzbkana01 (145.228.48.201) by cmx01.servicemail24.de (PowerMTA(TM) v3.0r14) id hmb478064cc5 for ; Fri, 3 Aug 2007 08:07:15 +0200 (envelope-from ) Message-ID: <24860348.1186121235657.JavaMail.SYSTEM@dehzbkana01> Date: Fri, 3 Aug 2007 08:07:15 +0200 (CEST) From: "certpartner@msdirectservices.com" To: Subject: Re: information (KMM7984527I17898L0KM) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit x-mailer: KANA Response 7.6.1.43 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12461 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: certpartner@msdirectservices.com Precedence: bulk X-list: xfs Dear Partner, Thank you for your query regarding the Microsoft Partner Program. We are currently researching your query and will respond as soon as possible. If we can be of any further assistance to you, please do not hesitate to contact us. If you would like some further information on the Microsoft partner program, please visit our web sites at http://www.microsoft.com/partner/program We look forward to your company's participation in the Microsoft Partner Program. Kind Regards, Your Microsoft Partner Program Team Microsoft highly recommends that users with Internet access update their Microsoft software to protect against viruses and security vulnerabilities. The easiest way to do this is to visit the following website: http://www.Microsoft.com/protect From owner-xfs@oss.sgi.com Fri Aug 3 07:37:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 03 Aug 2007 07:37:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.3 required=5.0 tests=AWL,BAYES_50,FAKE_REPLY_C, J_CHICKENPOX_23,NORMAL_HTTP_TO_IP autolearn=no version=3.2.0-pre1-r499012 Received: from bay0-omc2-s29.bay0.hotmail.com (bay0-omc2-s29.bay0.hotmail.com [65.54.246.165]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l73Eb8bm029136 for ; Fri, 3 Aug 2007 07:37:09 -0700 Received: from hotmail.com ([65.54.174.83]) by bay0-omc2-s29.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 3 Aug 2007 07:37:12 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 3 Aug 2007 07:37:12 -0700 Message-ID: Received: from 85.36.106.198 by BAY103-DAV11.phx.gbl with DAV; Fri, 03 Aug 2007 14:37:11 +0000 X-Originating-IP: [85.36.106.198] X-Originating-Email: [pupilla@hotmail.com] X-Sender: pupilla@hotmail.com From: "Marco Berizzi" To: Cc: "Christoph Lameter" , "David Chinner" , , "Marco Berizzi" Subject: Re: kernel BUG at mm/slab.c:2980 (was Re: [] xfs_bmap_search_multi_extents+0x6f/0xe0) Date: Fri, 3 Aug 2007 16:36:25 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 X-OriginalArrivalTime: 03 Aug 2007 14:37:12.0591 (UTC) FILETIME=[C78E89F0:01C7D5DB] X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12462 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pupilla@hotmail.com Precedence: bulk X-list: xfs Marco Berizzi wrote: > Marco Berizzi wrote: > > > Hello everybody. > > I'm running linux 2.6.22 on Slackware. > > This box is running openswan 2.4.9 > > and squid 2.6S13 > > I get tons of these messages: > > > > Jul 20 01:17:09 Gemini kernel: msnt_auth S 00000000 0 8356 > 819 > > (NOTLB) > > Jul 20 01:17:09 Gemini kernel: c2bd5d54 00000086 00000001 > > 00000000 00000000 00000001 00000000 c11df050 > > Jul 20 01:17:09 Gemini kernel: 00000014 c2bd5e24 c2bd5e78 > > c2bd5e78 c11df050 c1255b7c c019c63f 00006559 > > Jul 20 01:17:09 Gemini kernel: 7601a27a 0002faa4 7fffffff > > 7fffffff c8af2d00 c2bd5db0 c02e9fc6 c2bd5e50 > > Jul 20 01:17:09 Gemini kernel: Call Trace: > > Jul 20 01:17:09 Gemini kernel: [] > > xfs_bmap_search_multi_extents+0x6f/0xe0 > > Jul 20 01:17:09 Gemini kernel: [] > schedule_timeout+0x96/0xa0 > > Jul 20 01:17:09 Gemini kernel: [] > > unix_stream_data_wait+0xa9/0xd0 > > Jul 20 01:17:09 Gemini kernel: [] > > autoremove_wake_function+0x0/0x50 > > Jul 20 01:17:09 Gemini kernel: [] > > autoremove_wake_function+0x0/0x50 > > Jul 20 01:17:09 Gemini kernel: [] > > unix_stream_recvmsg+0x37c/0x3e0 > > Jul 20 01:17:09 Gemini kernel: [] do_sock_read+0x9d/0xb0 > > Jul 20 01:17:09 Gemini kernel: [] sock_aio_read+0x78/0x80 > > Jul 20 01:17:09 Gemini kernel: [] do_sync_read+0xc0/0x100 > > Jul 20 01:17:09 Gemini kernel: [] > > autoremove_wake_function+0x0/0x50 > > Jul 20 01:17:09 Gemini kernel: [] do_mmap_pgoff+0x3f3/0x730 > > Jul 20 01:17:09 Gemini kernel: [] vfs_read+0x100/0x110 > > Jul 20 01:17:09 Gemini kernel: [] sys_read+0x47/0x80 > > Jul 20 01:17:09 Gemini kernel: [] syscall_call+0x7/0xb > > Jul 20 01:17:09 Gemini kernel: ======================= > > Jul 20 09:01:35 Gemini kernel: atkbd.c: Spurious NAK on > isa0060/serio0. > > Some program might be trying access hardware directly. > > Jul 20 09:02:05 Gemini kernel: atkbd.c: Spurious NAK on > isa0060/serio0. > > Some program might be trying access hardware directly. > > Jul 20 09:05:39 Gemini kernel: atkbd.c: Spurious ACK on > isa0060/serio0. > > Some program might be trying access hardware directly. > Me again. > Just few minutes ago linux has been definitely > crashed. This is the dmesg: > > Aug 2 15:24:36 Gemini kernel: BUG: unable to handle kernel paging > request at virtual address cbb93164 > Aug 2 15:24:36 Gemini kernel: printing eip: > Aug 2 15:24:36 Gemini kernel: c014e83f > Aug 2 15:24:36 Gemini kernel: *pde = 00000000 > Aug 2 15:24:36 Gemini kernel: Oops: 0002 [#1] > Aug 2 15:24:36 Gemini kernel: Modules linked in: nf_nat_pptp > nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp > nf_conntrack_ftp 3c59x mii > Aug 2 15:24:36 Gemini kernel: CPU: 0 > Aug 2 15:24:36 Gemini kernel: EIP: 0060:[] Not tainted > VLI > Aug 2 15:24:36 Gemini kernel: EFLAGS: 00010807 (2.6.22 #1) > Aug 2 15:24:36 Gemini kernel: EIP is at slab_put_obj+0x1f/0x40 > Aug 2 15:24:36 Gemini kernel: eax: ffffffff ebx: c925a000 ecx: > 5a2cdcd1 edx: 00a4e452 > Aug 2 15:24:36 Gemini kernel: esi: c11ff1e0 edi: c925a000 ebp: > 0000000b esp: c9fe9ed0 > Aug 2 15:24:36 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0000 > ss: 0068 > Aug 2 15:24:37 Gemini kernel: Process xfssyncd (pid: 223, ti=c9fe8000 > task=c11b2a90 task.ti=c9fe8000) > Aug 2 15:24:37 Gemini kernel: Stack: c925a000 c11c06a0 c11ff1e0 > c014ec16 00000000 0000003c c11b9010 c11b9010 > Aug 2 15:24:37 Gemini kernel: c11ff1e0 c11ff1e0 00000000 > c014ecdf 00000000 0000003c c11b9000 c11b9000 > Aug 2 15:24:37 Gemini kernel: 00000246 c11ff1e0 c9a3aaf0 > c014f069 c9dce3e0 c9dce3e0 00000001 00000002 > Aug 2 15:24:37 Gemini kernel: Call Trace: > Aug 2 15:24:37 Gemini kernel: [] free_block+0x86/0x100 > Aug 2 15:24:37 Gemini kernel: [] cache_flusharray+0x4f/0xc0 > Aug 2 15:24:37 Gemini kernel: [] kmem_cache_free+0x69/0x90 > Aug 2 15:24:37 Gemini kernel: [] xfs_idestroy+0x40/0x90 > Aug 2 15:24:37 Gemini kernel: [] > xfs_finish_reclaim+0xb3/0x120 > Aug 2 15:24:37 Gemini kernel: [] > xfs_finish_reclaim_all+0xc9/0xf0 > Aug 2 15:24:37 Gemini kernel: [] xfs_syncsub+0x63/0x290 > Aug 2 15:24:37 Gemini kernel: [] schedule_timeout+0x55/0xa0 > Aug 2 15:24:37 Gemini kernel: [] vfs_sync+0x22/0x30 > Aug 2 15:24:37 Gemini kernel: [] vfs_sync_worker+0x41/0x50 > Aug 2 15:24:37 Gemini kernel: [] xfssyncd+0x109/0x180 > Aug 2 15:24:37 Gemini kernel: [] xfssyncd+0x0/0x180 > Aug 2 15:24:37 Gemini kernel: [] kthread+0x6a/0x70 > Aug 2 15:24:37 Gemini kernel: [] kthread+0x0/0x70 > Aug 2 15:24:37 Gemini kernel: [] > kernel_thread_helper+0x7/0x10 > Aug 2 15:24:37 Gemini kernel: ======================= > Aug 2 15:24:37 Gemini kernel: Code: 4a 14 c3 89 f6 8d bc 27 00 00 00 00 > 83 ec 0c 89 74 24 04 89 c6 89 7c 24 08 89 d7 89 1c 24 8b 42 0c 29 c1 89 > c8 f7 66 14 8b 47 14 <89> 44 97 1c 8b 1c 24 89 57 14 8b 74 24 04 ff 4f > 10 8b 7c 24 08 > Aug 2 15:24:37 Gemini kernel: EIP: [] slab_put_obj+0x1f/0x40 > SS:ESP 0068:c9fe9ed0 > Aug 2 15:24:40 Gemini kernel: BUG: unable to handle kernel paging > request at virtual address 00100104 > Aug 2 15:24:40 Gemini kernel: printing eip: > Aug 2 15:24:40 Gemini kernel: c014ebf4 > Aug 2 15:24:40 Gemini kernel: *pde = 00000000 > Aug 2 15:24:40 Gemini kernel: Oops: 0002 [#2] > Aug 2 15:24:40 Gemini kernel: Modules linked in: nf_nat_pptp > nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp > nf_conntrack_ftp 3c59x mii > Aug 2 15:24:40 Gemini kernel: CPU: 0 > Aug 2 15:24:40 Gemini kernel: EIP: 0060:[] Not tainted > VLI > Aug 2 15:24:40 Gemini kernel: EFLAGS: 00010082 (2.6.22 #1) > Aug 2 15:24:40 Gemini kernel: EIP is at free_block+0x64/0x100 > Aug 2 15:24:40 Gemini kernel: eax: 00100100 ebx: c925a000 ecx: > c925a4ec edx: 00200200 > Aug 2 15:24:40 Gemini kernel: esi: c11c06a0 edi: c11ff1e0 ebp: > 0000000b esp: c11a3f14 > Aug 2 15:24:40 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0000 > ss: 0068 > Aug 2 15:24:40 Gemini kernel: Process events/0 (pid: 4, ti=c11a2000 > task=c1195a50 task.ti=c11a2000) > Aug 2 15:24:40 Gemini kernel: Stack: 00000000 00000018 c11b9010 > c11b9010 c11b9000 00000018 c11ff1e0 c014f4e1 > Aug 2 15:24:40 Gemini kernel: 00000000 c11c06a0 c11ff1e0 > c03cdc20 00000000 c014f55b 00000000 00000000 > Aug 2 15:24:40 Gemini kernel: 00038e6b c03cdc20 c117e8a0 > c014f500 c01228ea 00005ead 7180abb4 00073f12 > Aug 2 15:24:40 Gemini kernel: Call Trace: > Aug 2 15:24:40 Gemini kernel: [] drain_array+0x91/0xb0 > Aug 2 15:24:40 Gemini kernel: [] cache_reap+0x5b/0x100 > Aug 2 15:24:40 Gemini kernel: [] cache_reap+0x0/0x100 > Aug 2 15:24:40 Gemini kernel: [] run_workqueue+0x4a/0x100 > Aug 2 15:24:40 Gemini kernel: [] worker_thread+0xcb/0x100 > Aug 2 15:24:40 Gemini kernel: [] > autoremove_wake_function+0x0/0x50 > Aug 2 15:24:40 Gemini kernel: [] __wake_up_common+0x37/0x70 > Aug 2 15:24:40 Gemini kernel: [] > autoremove_wake_function+0x0/0x50 > Aug 2 15:24:40 Gemini kernel: [] worker_thread+0x0/0x100 > Aug 2 15:24:40 Gemini kernel: [] kthread+0x6a/0x70 > Aug 2 15:24:40 Gemini kernel: [] kthread+0x0/0x70 > Aug 2 15:24:40 Gemini kernel: [] > kernel_thread_helper+0x7/0x10 > Aug 2 15:24:40 Gemini kernel: ======================= > Aug 2 15:24:40 Gemini kernel: Code: da 25 00 40 02 00 3d 00 40 02 00 0f > 84 a8 00 00 00 8b 02 a8 80 0f 84 8b 00 00 00 8b 5a 1c 8b 44 24 20 8b 53 > 04 8b 74 87 4c 8b 03 <89> 50 04 89 02 89 da c7 03 00 01 10 00 c7 43 04 > 00 02 20 00 8b > Aug 2 15:24:40 Gemini kernel: EIP: [] free_block+0x64/0x100 > SS:ESP 0068:c11a3f14 > Aug 2 15:29:03 Gemini kernel: ------------[ cut here ]------------ > Aug 2 15:29:03 Gemini kernel: kernel BUG at mm/slab.c:2980! > Aug 2 15:29:03 Gemini kernel: invalid opcode: 0000 [#3] > Aug 2 15:29:03 Gemini kernel: Modules linked in: nf_nat_pptp > nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat_ftp > nf_conntrack_ftp 3c59x mii > Aug 2 15:29:03 Gemini kernel: CPU: 0 > Aug 2 15:29:03 Gemini kernel: EIP: 0060:[] Not tainted > VLI > Aug 2 15:29:03 Gemini kernel: EFLAGS: 00010046 (2.6.22 #1) > Aug 2 15:29:03 Gemini kernel: EIP is at cache_alloc_refill+0x16d/0x1c0 > Aug 2 15:29:03 Gemini kernel: eax: 0000001c ebx: 00000005 ecx: > 00000036 edx: c11ff1e0 > Aug 2 15:29:03 Gemini kernel: esi: c8a40000 edi: c11c06a0 ebp: > c11b9000 esp: c8da7dc8 > Aug 2 15:29:03 Gemini kernel: ds: 007b es: 007b fs: 0000 gs: 0033 > ss: 0068 > Aug 2 15:29:03 Gemini kernel: Process unlinkd (pid: 2476, ti=c8da6000 > task=c11b3ab0 task.ti=c8da6000) > Aug 2 15:29:03 Gemini kernel: Stack: c9fb1400 c11c06a8 00000036 > 00000250 c11ff1e0 00000286 c11ff1e0 00000250 > Aug 2 15:29:03 Gemini kernel: c11ff1e0 c014ed8f 00000000 > 00000001 c01de776 c9fb1400 00025638 c01c5554 > Aug 2 15:29:03 Gemini kernel: c6355800 c9fb1400 c11ff1e0 > c64340d4 c01de805 c6355800 c9fb1400 00000004 > Aug 2 15:29:03 Gemini kernel: Call Trace: > Aug 2 15:29:03 Gemini kernel: [] kmem_cache_alloc+0x3f/0x50 > Aug 2 15:29:03 Gemini kernel: [] kmem_zone_alloc+0x46/0xc0 > Aug 2 15:29:03 Gemini kernel: [] xfs_log_reserve+0xa4/0xb0 > Aug 2 15:29:03 Gemini kernel: [] kmem_zone_zalloc+0x15/0x50 > Aug 2 15:29:03 Gemini kernel: [] > xfs_inode_item_init+0x1d/0x80 > Aug 2 15:29:03 Gemini kernel: [] xfs_trans_ijoin+0x6f/0x80 > Aug 2 15:29:03 Gemini kernel: [] xfs_remove+0x1c3/0x460 > Aug 2 15:29:03 Gemini kernel: [] xfs_vn_unlink+0x23/0x60 > Aug 2 15:29:03 Gemini kernel: [] > xfs_dir_lookup_int+0x9b/0x100 > Aug 2 15:29:03 Gemini kernel: [] > xfs_trans_unlocked_item+0x38/0x60 > Aug 2 15:29:03 Gemini kernel: [] xfs_lookup+0x6a/0x80 > Aug 2 15:29:03 Gemini kernel: [] d_instantiate+0x30/0x50 > Aug 2 15:29:03 Gemini kernel: [] d_splice_alias+0x2d/0xa0 > Aug 2 15:29:03 Gemini kernel: [] permission+0x89/0xd0 > Aug 2 15:29:03 Gemini kernel: [] vfs_unlink+0x88/0x90 > Aug 2 15:29:03 Gemini kernel: [] do_unlinkat+0x94/0x110 > Aug 2 15:29:03 Gemini kernel: [] vfs_read+0xe8/0x110 > Aug 2 15:29:03 Gemini kernel: [] sys_read+0x47/0x80 > Aug 2 15:29:03 Gemini kernel: [] syscall_call+0x7/0xb > Aug 2 15:29:03 Gemini kernel: ======================= > Aug 2 15:29:03 Gemini kernel: Code: d2 0f 84 cb fe ff ff eb ba 8b 55 00 > 31 c0 85 d2 75 b1 eb c0 8b 47 08 89 70 04 89 06 8b 44 24 04 89 77 08 89 > 46 04 e9 7a ff ff ff <0f> 0b 90 eb fe c7 47 30 01 00 00 00 8b 77 10 8d > 47 10 39 c6 0f > Aug 2 15:29:03 Gemini kernel: EIP: [] > cache_alloc_refill+0x16d/0x1c0 SS:ESP 0068:c8da7dc8 Me again. This morning a system with a similar .config (only different hardware) has been crashed. Only a monitor bitmap at http://80.204.235.230/foto3.jpg is available. No error was written under /var/log/kernel Here is dmesg and .config Linux version 2.6.22 (root@Pleiadi) (gcc version 3.4.6) #1 SMP Mon Jul 9 16:20:51 CEST 2007 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009ac00 (usable) BIOS-e820: 000000000009ac00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ce000 - 00000000000d0000 (reserved) BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000003fef0000 (usable) BIOS-e820: 000000003fef0000 - 000000003fefb000 (ACPI data) BIOS-e820: 000000003fefb000 - 000000003ff00000 (ACPI NVS) BIOS-e820: 000000003ff00000 - 000000003ff80000 (usable) BIOS-e820: 000000003ff80000 - 0000000040000000 (reserved) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fed00400 (reserved) BIOS-e820: 00000000fee00000 - 00000000fef00000 (reserved) BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved) BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved) 127MB HIGHMEM available. 896MB LOWMEM available. found SMP MP-table at 000f6c10 Entering add_active_range(0, 0, 262016) 0 entries of 256 used Zone PFN ranges: DMA 0 -> 4096 Normal 4096 -> 229376 HighMem 229376 -> 262016 early_node_map[1] active PFN ranges 0: 0 -> 262016 On node 0 totalpages: 262016 DMA zone: 32 pages used for memmap DMA zone: 0 pages reserved DMA zone: 4064 pages, LIFO batch:0 Normal zone: 1760 pages used for memmap Normal zone: 223520 pages, LIFO batch:31 HighMem zone: 255 pages used for memmap HighMem zone: 32385 pages, LIFO batch:7 DMI present. ACPI: RSDP 000F6BA0, 0024 (r2 PTLTD ) ACPI: XSDT 3FEF5381, 004C (r1 PTLTD XSDT 6040001 LTP 0) ACPI: FACP 3FEF5441, 00F4 (r3 FSC 6040001 F4240) ACPI: DSDT 3FEF5535, 597B (r1 FSC D1649 6040001 MSFT 2000002) ACPI: FACS 3FEFBFC0, 0040 ACPI: SPCR 3FEFAEB0, 0050 (r1 PTLTD $UCRTBL$ 6040001 PTL 1) ACPI: MCFG 3FEFAF00, 0040 (r1 PTLTD MCFG 6040001 LTP 0) ACPI: APIC 3FEFAF40, 0098 (r1 PTLTD APIC 6040001 LTP 0) ACPI: BOOT 3FEFAFD8, 0028 (r1 PTLTD $SBFTBL$ 6040001 LTP 1) ACPI: PM-Timer IO Port: 0xf008 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 15:4 APIC version 20 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled) Processor #1 15:4 APIC version 20 ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23 ACPI: IOAPIC (id[0x03] address[0xfec80000] gsi_base[24]) IOAPIC[1]: apic_id 3, version 32, address 0xfec80000, GSI 24-47 ACPI: IOAPIC (id[0x04] address[0xfec80800] gsi_base[48]) IOAPIC[2]: apic_id 4, version 32, address 0xfec80800, GSI 48-71 ACPI: IOAPIC (id[0x05] address[0xfec84000] gsi_base[72]) IOAPIC[3]: apic_id 5, version 32, address 0xfec84000, GSI 72-95 ACPI: IOAPIC (id[0x06] address[0xfec84800] gsi_base[96]) IOAPIC[4]: apic_id 6, version 32, address 0xfec84800, GSI 96-119 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ9 used by override. Enabling APIC mode: Flat. Using 5 I/O APICs Using ACPI (MADT) for SMP configuration information Allocating PCI resources starting at 50000000 (gap: 40000000:a0000000) Built 1 zonelists. Total pages: 259969 Kernel command line: BOOT_IMAGE=Linux ro root=801 mapped APIC to ffffd000 (fee00000) mapped IOAPIC to ffffc000 (fec00000) mapped IOAPIC to ffffb000 (fec80000) mapped IOAPIC to ffffa000 (fec80800) mapped IOAPIC to ffff9000 (fec84000) mapped IOAPIC to ffff8000 (fec84800) Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Initializing CPU#0 PID hash table entries: 4096 (order: 12, 16384 bytes) Detected 3200.438 MHz processor. Console: colour VGA+ 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 1035204k/1048064k available (2069k kernel code, 12224k reserved, 626k data, 204k init, 130496k highmem) virtual kernel memory layout: fixmap : 0xfff9d000 - 0xfffff000 ( 392 kB) pkmap : 0xff800000 - 0xffc00000 (4096 kB) vmalloc : 0xf8800000 - 0xff7fe000 ( 111 MB) lowmem : 0xc0000000 - 0xf8000000 ( 896 MB) .init : 0xc03a7000 - 0xc03da000 ( 204 kB) .data : 0xc03055e4 - 0xc03a2000 ( 626 kB) .text : 0xc0100000 - 0xc03055e4 (2069 kB) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 6403.73 BogoMIPS (lpj=32018667) Mount-cache hash table entries: 512 CPU: After generic identify, caps: bfebfbff 20100000 00000000 00000000 0000641d 00000000 00000001 monitor/mwait feature present. using mwait in idle threads. CPU: Trace cache: 12K uops, L1 D cache: 16K CPU: L2 cache: 2048K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 20100000 00000000 0000b180 0000641d 00000000 00000001 Compat vDSO mapped to ffffe000. Checking 'hlt' instruction... OK. Freeing SMP alternatives: 10k freed ACPI: Core revision 20070126 CPU0: Intel(R) Xeon(TM) CPU 3.20GHz stepping 0a Booting processor 1/1 eip 2000 Initializing CPU#1 Calibrating delay using timer specific routine.. 6400.45 BogoMIPS (lpj=32002272) CPU: After generic identify, caps: bfebfbff 20100000 00000000 00000000 0000641d 00000000 00000001 monitor/mwait feature present. CPU: Trace cache: 12K uops, L1 D cache: 16K CPU: L2 cache: 2048K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 20100000 00000000 0000b180 0000641d 00000000 00000001 CPU1: Intel(R) Xeon(TM) CPU 3.20GHz stepping 0a Total of 2 processors activated (12804.18 BogoMIPS). ENABLING IO-APIC IRQs .TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1 checking TSC synchronization [CPU#0 -> CPU#1]: passed. Brought up 2 CPUs migration_cost=62 NET: Registered protocol family 16 ACPI: bus type pci registered PCI: Found Intel Corporation E7520 Memory Controller Hub with MMCONFIG support. PCI: Using MMCONFIG Setting up standard PCI resources ACPI: Interpreter enabled ACPI: Using IOAPIC for interrupt routing ACPI: Device [PS2M] status [00000008]: functional but not present; setting present ACPI: Device [ECP] status [00000008]: functional but not present; setting present ACPI: Device [COM1] status [00000008]: functional but not present; setting present ACPI: PCI Root Bridge [PCI0] (0000:00) PCI: Probing PCI hardware (bus 00) PCI quirk: region f000-f07f claimed by ICH4 ACPI/GPIO/TCO PCI quirk: region f180-f1bf claimed by ICH4 GPIO PCI: PXH quirk detected, disabling MSI for SHPC device PCI: PXH quirk detected, disabling MSI for SHPC device PCI: Transparent bridge - 0000:00:1e.0 ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEA0.DOB0._PRT] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEA0.DOB2._PRT] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEC0.PXH0._PRT] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEC0.PXH2._PRT] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15) ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 *9 10 11 12 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 6 7 9 10 11 12 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 *10 11 12 14 15) ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKH] (IRQs 3 *4 5 6 7 9 10 11 12 14 15) Linux Plug and Play Support v0.97 (c) Adam Belay pnp: PnP ACPI init ACPI: bus type pnp registered pnp: PnP ACPI: found 11 devices ACPI: ACPI bus type pnp unregistered SCSI subsystem initialized PCI: Using ACPI for IRQ routing PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report Time: tsc clocksource has been installed. pnp: 00:02: iomem range 0xfee00000-0xfeefffff could not be reserved pnp: 00:02: iomem range 0xfec00000-0xfecfffff could not be reserved PCI: Bridge: 0000:01:00.0 IO window: 3000-3fff MEM window: de100000-de3fffff PREFETCH window: 50000000-501fffff PCI: Bridge: 0000:01:00.2 IO window: 4000-4fff MEM window: de400000-de4fffff PREFETCH window: 50200000-502fffff PCI: Bridge: 0000:00:02.0 IO window: 3000-4fff MEM window: de100000-de4fffff PREFETCH window: 50000000-502fffff PCI: Bridge: 0000:00:04.0 IO window: disabled. MEM window: de500000-de5fffff PREFETCH window: disabled. PCI: Bridge: 0000:00:05.0 IO window: disabled. MEM window: de600000-de6fffff PREFETCH window: disabled. PCI: Bridge: 0000:06:00.0 IO window: disabled. MEM window: disabled. PREFETCH window: disabled. PCI: Bridge: 0000:06:00.2 IO window: disabled. MEM window: disabled. PREFETCH window: disabled. PCI: Bridge: 0000:00:06.0 IO window: disabled. MEM window: de700000-de7fffff PREFETCH window: disabled. PCI: Bridge: 0000:00:1e.0 IO window: 5000-5fff MEM window: de800000-dfffffff PREFETCH window: 50300000-503fffff ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:00:02.0 to 64 PCI: Setting latency timer of device 0000:01:00.0 to 64 PCI: Setting latency timer of device 0000:01:00.2 to 64 ACPI: PCI Interrupt 0000:00:04.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:00:04.0 to 64 ACPI: PCI Interrupt 0000:00:05.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:00:05.0 to 64 ACPI: PCI Interrupt 0000:00:06.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:00:06.0 to 64 ACPI: PCI Interrupt 0000:06:00.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:06:00.0 to 64 ACPI: PCI Interrupt 0000:06:00.2[B] -> GSI 17 (level, low) -> IRQ 17 PCI: Setting latency timer of device 0000:06:00.2 to 64 PCI: Setting latency timer of device 0000:00:1e.0 to 64 NET: Registered protocol family 2 IP route cache hash table entries: 32768 (order: 5, 131072 bytes) TCP established hash table entries: 131072 (order: 8, 1572864 bytes) TCP bind hash table entries: 65536 (order: 7, 524288 bytes) TCP: Hash tables configured (established 131072 bind 65536) TCP reno registered Simple Boot Flag at 0x5c set to 0x80 highmem bounce pool size: 64 pages SGI XFS with no debug enabled io scheduler noop registered io scheduler deadline registered (default) Boot video device is 0000:09:05.0 Fusion MPT base driver 3.04.04 Copyright (c) 1999-2007 LSI Logic Corporation Fusion MPT SPI Host driver 3.04.04 ACPI: PCI Interrupt 0000:02:08.0[A] -> GSI 24 (level, low) -> IRQ 18 mptbase: Initiating ioc0 bringup ioc0: 53C1030: Capabilities={Initiator} scsi0 : ioc0: LSI53C1030, FwRev=01033000h, Ports=1, MaxQ=222, IRQ=18 scsi 0:0:0:0: Direct-Access LSILOGIC 1030 IM 1000 PQ: 0 ANSI: 2 sd 0:0:0:0: [sda] 585728000 512-byte hardware sectors (299893 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 03 00 00 08 sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 585728000 512-byte hardware sectors (299893 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 03 00 00 08 sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sda2 < sda5 sda6 sda7 sda8 sda9 > sd 0:0:0:0: [sda] Attached SCSI disk scsi 0:0:8:0: Processor SDR GEM318P 1 PQ: 0 ANSI: 2 target0:0:8: Beginning Domain Validation target0:0:8: Ending Domain Validation target0:0:8: asynchronous scsi 0:1:0:0: Direct-Access HITACHI HUS103030FL3800 SK02 PQ: 0 ANSI: 3 mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0 mptbase: ioc0: volume is now optimal, enabled, quiesced mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0 id=0 mptbase: ioc0: PhysDisk is now online, quiesced mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 1 id=0 mptbase: ioc0: PhysDisk is now online, quiesced target0:1:0: Beginning Domain Validation target0:1:0: Ending Domain Validation mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0 mptbase: ioc0: volume is now optimal, enabled mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0 id=0 mptbase: ioc0: PhysDisk is now online mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 1 id=0 mptbase: ioc0: PhysDisk is now online target0:1:0: FAST-160 WIDE SCSI 320.0 MB/s DT IU QAS RTI WRFLOW PCOMP (6.25 ns, offset 80) scsi 0:1:1:0: Direct-Access HITACHI HUS103030FL3800 SK02 PQ: 0 ANSI: 3 mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0 mptbase: ioc0: volume is now optimal, enabled, quiesced mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0 id=0 mptbase: ioc0: PhysDisk is now online, quiesced mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 1 id=0 mptbase: ioc0: PhysDisk is now online, quiesced target0:1:1: Beginning Domain Validation target0:1:1: Ending Domain Validation mptbase: ioc0: RAID STATUS CHANGE for VolumeID 0 mptbase: ioc0: volume is now optimal, enabled mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 0 id=0 mptbase: ioc0: PhysDisk is now online mptbase: ioc0: RAID STATUS CHANGE for PhysDisk 1 id=0 mptbase: ioc0: PhysDisk is now online target0:1:1: FAST-160 WIDE SCSI 320.0 MB/s DT IU QAS RTI WRFLOW PCOMP (6.25 ns, offset 80) ACPI: PCI Interrupt 0000:02:08.1[B] -> GSI 25 (level, low) -> IRQ 19 mptbase: Initiating ioc1 bringup ioc1: 53C1030: Capabilities={Initiator} scsi1 : ioc1: LSI53C1030, FwRev=01033000h, Ports=1, MaxQ=222, IRQ=19 PNP: PS/2 Controller [PNP0303:KEYB] at 0x60,0x64 irq 1 PNP: PS/2 controller doesn't have AUX irq; using default 12 serio: i8042 KBD port at 0x60,0x64 irq 1 mice: PS/2 mouse device common for all mice nf_conntrack version 0.5.0 (8188 buckets, 65504 max) ip_tables: (C) 2000-2006 Netfilter Core Team TCP cubic registered Initializing XFRM netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 15 Starting balanced_irq Using IPI Shortcut mode input: AT Translated Set 2 keyboard as /class/input/input0 XFS mounting filesystem sda1 Starting XFS recovery on filesystem: sda1 (logdev: internal) Ending XFS recovery on filesystem: sda1 (logdev: internal) VFS: Mounted root (xfs filesystem) readonly. Freeing unused kernel memory: 204k freed Adding 875500k swap on /dev/sda9. Priority:-1 extents:1 across:875500k tg3.c:v3.77 (May 31, 2007) ACPI: PCI Interrupt 0000:04:00.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:04:00.0 to 64 eth0: Tigon3 [partno(BCM95721) rev 4101 PHY(5750)] (PCI Express) 10/100/1000Base-T Ethernet 00:30:05:cb:27:c1 eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] WireSpeed[1] TSOcap[1] eth0: dma_rwctrl[76180000] dma_mask[64-bit] ACPI: PCI Interrupt 0000:05:00.0[A] -> GSI 16 (level, low) -> IRQ 16 PCI: Setting latency timer of device 0000:05:00.0 to 64 eth1: Tigon3 [partno(BCM95721) rev 4101 PHY(5750)] (PCI Express) 10/100/1000Base-T Ethernet 00:30:05:c2:56:0e eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] WireSpeed[1] TSOcap[1] eth1: dma_rwctrl[76180000] dma_mask[64-bit] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI Copyright (c) 1999-2006 Intel Corporation. ACPI: PCI Interrupt 0000:03:04.0[A] -> GSI 52 (level, low) -> IRQ 20 e1000: 0000:03:04.0: e1000_probe: (PCI-X:100MHz:64-bit) 00:04:23:d0:0f:02 e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection XFS mounting filesystem sda5 Starting XFS recovery on filesystem: sda5 (logdev: internal) Ending XFS recovery on filesystem: sda5 (logdev: internal) XFS mounting filesystem sda6 Starting XFS recovery on filesystem: sda6 (logdev: internal) Ending XFS recovery on filesystem: sda6 (logdev: internal) XFS mounting filesystem sda7 Starting XFS recovery on filesystem: sda7 (logdev: internal) Ending XFS recovery on filesystem: sda7 (logdev: internal) XFS mounting filesystem sda8 Starting XFS recovery on filesystem: sda8 (logdev: internal) Ending XFS recovery on filesystem: sda8 (logdev: internal) e1000: eth2: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX tg3: eth1: Link is up at 100 Mbps, full duplex. tg3: eth1: Flow control is off for TX and off for RX. tg3: eth0: Link is up at 10 Mbps, full duplex. tg3: eth0: Flow control is off for TX and off for RX. # # Automatically generated make config: don't edit # Linux kernel version: 2.6.22 # Mon Jul 9 16:14:56 2007 # CONFIG_X86_32=y CONFIG_GENERIC_TIME=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_X86=y CONFIG_MMU=y CONFIG_ZONE_DMA=y CONFIG_QUICKLIST=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # # Code maturity level options # # CONFIG_EXPERIMENTAL is not set CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set CONFIG_SYSVIPC_SYSCTL=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set CONFIG_LOG_BUF_SHIFT=15 # CONFIG_CPUSETS is not set # CONFIG_SYSFS_DEPRECATED is not set # CONFIG_RELAY is not set # CONFIG_BLK_DEV_INITRD is not set CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_ANON_INODES=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y CONFIG_SHMEM=y CONFIG_VM_EVENT_COUNTERS=y CONFIG_SLAB=y # CONFIG_SLUB is not set # CONFIG_SLOB is not set CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set CONFIG_STOP_MACHINE=y # # Block layer # CONFIG_BLOCK=y # CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_LSF is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set CONFIG_IOSCHED_DEADLINE=y # CONFIG_IOSCHED_CFQ is not set # CONFIG_DEFAULT_AS is not set CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="deadline" # # Processor type and features # # CONFIG_TICK_ONESHOT is not set # CONFIG_NO_HZ is not set # CONFIG_HIGH_RES_TIMERS is not set CONFIG_SMP=y CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set # CONFIG_MPENTIUMM is not set # CONFIG_MCORE2 is not set CONFIG_MPENTIUM4=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_MVIAC7 is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_X86_XADD=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_TSC=y CONFIG_X86_CMOV=y CONFIG_X86_MINIMUM_CPU_MODEL=4 # CONFIG_HPET_TIMER is not set CONFIG_NR_CPUS=2 CONFIG_SCHED_SMT=y # CONFIG_SCHED_MC is not set CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set # CONFIG_PREEMPT_BKL is not set CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y # CONFIG_X86_MCE is not set CONFIG_VM86=y # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # # Firmware Drivers # # CONFIG_EDD is not set # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set CONFIG_ZONE_DMA_FLAG=1 CONFIG_NR_QUICK=1 CONFIG_HIGHPTE=y # CONFIG_MATH_EMULATION is not set # CONFIG_MTRR is not set # CONFIG_EFI is not set CONFIG_IRQBALANCE=y CONFIG_SECCOMP=y CONFIG_HZ_100=y # CONFIG_HZ_250 is not set # CONFIG_HZ_300 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=100 # CONFIG_KEXEC is not set CONFIG_PHYSICAL_START=0x100000 CONFIG_PHYSICAL_ALIGN=0x100000 # CONFIG_COMPAT_VDSO is not set CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y # # Power management options (ACPI, APM) # CONFIG_PM=y # CONFIG_PM_LEGACY is not set # CONFIG_PM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y # CONFIG_ACPI_PROCFS is not set # CONFIG_ACPI_AC is not set # CONFIG_ACPI_BATTERY is not set # CONFIG_ACPI_BUTTON is not set # CONFIG_ACPI_FAN is not set # CONFIG_ACPI_PROCESSOR is not set # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_TOSHIBA is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y CONFIG_X86_PM_TIMER=y # CONFIG_APM is not set # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GOMMCONFIG is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_PCIEPORTBUS is not set CONFIG_ARCH_SUPPORTS_MSI=y # CONFIG_PCI_MSI is not set # CONFIG_HT_IRQ is not set CONFIG_ISA_DMA_API=y # CONFIG_ISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set # # Networking # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=y CONFIG_NET_KEY=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set CONFIG_IP_ADVANCED_ROUTER=y CONFIG_ASK_IP_FIB_HASH=y # CONFIG_IP_FIB_TRIE is not set CONFIG_IP_FIB_HASH=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_MULTIPATH=y # CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_XFRM_TUNNEL=y CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y # CONFIG_INET_XFRM_MODE_BEET is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_IP_VS is not set # CONFIG_IPV6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set # CONFIG_NETWORK_SECMARK is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # # Core Netfilter Configuration # CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m CONFIG_NF_CONNTRACK_ENABLED=y CONFIG_NF_CONNTRACK=y CONFIG_NF_CT_ACCT=y CONFIG_NF_CONNTRACK_MARK=y CONFIG_NF_CT_PROTO_GRE=m # CONFIG_NF_CONNTRACK_AMANDA is not set CONFIG_NF_CONNTRACK_FTP=m # CONFIG_NF_CONNTRACK_IRC is not set CONFIG_NF_CONNTRACK_PPTP=m # CONFIG_NF_CONNTRACK_TFTP is not set CONFIG_NETFILTER_XTABLES=y CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_CONNMARK=m CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_MARK=y CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m CONFIG_NETFILTER_XT_TARGET_TCPMSS=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HELPER=y CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=y CONFIG_NETFILTER_XT_MATCH_MAC=m CONFIG_NETFILTER_XT_MATCH_MARK=y CONFIG_NETFILTER_XT_MATCH_POLICY=y CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m CONFIG_NETFILTER_XT_MATCH_QUOTA=m CONFIG_NETFILTER_XT_MATCH_REALM=m CONFIG_NETFILTER_XT_MATCH_STATE=y CONFIG_NETFILTER_XT_MATCH_STATISTIC=y CONFIG_NETFILTER_XT_MATCH_STRING=m CONFIG_NETFILTER_XT_MATCH_TCPMSS=y CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m # # IP: Netfilter Configuration # CONFIG_NF_CONNTRACK_IPV4=y # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set # CONFIG_IP_NF_QUEUE is not set CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_TOS=m # CONFIG_IP_NF_MATCH_RECENT is not set CONFIG_IP_NF_MATCH_ECN=m # CONFIG_IP_NF_MATCH_AH is not set CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=m # CONFIG_IP_NF_TARGET_ULOG is not set CONFIG_NF_NAT=y CONFIG_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m CONFIG_NF_NAT_PROTO_GRE=m CONFIG_NF_NAT_FTP=m # CONFIG_NF_NAT_IRC is not set # CONFIG_NF_NAT_TFTP is not set # CONFIG_NF_NAT_AMANDA is not set CONFIG_NF_NAT_PPTP=m # CONFIG_NF_NAT_H323 is not set # CONFIG_NF_NAT_SIP is not set CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_TTL=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_FIFO=y # # Queueing/Scheduling # # CONFIG_NET_SCH_CBQ is not set CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m # # Classification # CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_CLS_U32_PERF=y CONFIG_CLS_U32_MARK=y CONFIG_NET_CLS_RSVP=m # CONFIG_NET_CLS_RSVP6 is not set CONFIG_NET_EMATCH=y CONFIG_NET_EMATCH_STACK=32 CONFIG_NET_EMATCH_CMP=m CONFIG_NET_EMATCH_NBYTE=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_EMATCH_META=m CONFIG_NET_EMATCH_TEXT=m CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_GACT=m CONFIG_GACT_PROB=y CONFIG_NET_ACT_MIRRED=m CONFIG_NET_ACT_IPT=m CONFIG_NET_ACT_PEDIT=m # CONFIG_NET_ACT_SIMP is not set # CONFIG_NET_CLS_IND is not set CONFIG_NET_ESTIMATOR=y # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_FIB_RULES=y # # Wireless # # CONFIG_CFG80211 is not set # CONFIG_WIRELESS_EXT is not set # CONFIG_IEEE80211 is not set # CONFIG_RFKILL is not set # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set # CONFIG_SYS_HYPERVISOR is not set # # Connector - unified userspace <-> kernelspace linker # # CONFIG_CONNECTOR is not set # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # CONFIG_PNPACPI=y # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_COW_COMMON is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # Misc devices # # CONFIG_PHANTOM is not set # CONFIG_SGI_IOC4 is not set # CONFIG_SONY_LAPTOP is not set # CONFIG_THINKPAD_ACPI is not set CONFIG_IDE=m CONFIG_BLK_DEV_IDE=m # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_IDEDISK is not set # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_BLK_DEV_IDEACPI is not set # CONFIG_IDE_TASK_IOCTL is not set # CONFIG_IDE_PROC_FS is not set # # IDE chipset support/bugfixes # # CONFIG_IDE_GENERIC is not set # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_IDEPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_IDEPCI_PCIBUS_ORDER is not set # CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_GENERIC is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_ONLYDISK=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_CS5535 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_JMICRON is not set # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=m # CONFIG_BLK_DEV_IT8213 is not set # CONFIG_BLK_DEV_IT821X is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_BLK_DEV_TC86C001 is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set # CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_PROC_FS is not set # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set # CONFIG_BLK_DEV_SR is not set # CONFIG_CHR_DEV_SG is not set # CONFIG_CHR_DEV_SCH is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_SCAN_ASYNC is not set CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # CONFIG_SCSI_SAS_LIBSAS is not set # # SCSI low-level drivers # # CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_AIC94XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_ARCMSR is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_HPTIOP is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_STEX is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set # CONFIG_SCSI_QLA_ISCSI is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_SRP is not set # CONFIG_ATA is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # CONFIG_FUSION=y CONFIG_FUSION_SPI=y # CONFIG_FUSION_FC is not set # CONFIG_FUSION_SAS is not set CONFIG_FUSION_MAX_SGE=128 # CONFIG_FUSION_CTL is not set # # IEEE 1394 (FireWire) support # # # An alternative FireWire stack is available with EXPERIMENTAL=y # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # CONFIG_MACINTOSH_DRIVERS is not set # # Network device support # CONFIG_NETDEVICES=y CONFIG_IFB=m # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set CONFIG_TUN=m # CONFIG_NET_SB1000 is not set # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # # CONFIG_NET_ETHERNET is not set CONFIG_NETDEV_1000=y # CONFIG_ACENIC is not set # CONFIG_DL2K is not set CONFIG_E1000=m CONFIG_E1000_NAPI=y # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_R8169 is not set # CONFIG_SIS190 is not set # CONFIG_SKGE is not set # CONFIG_SKY2 is not set # CONFIG_SK98LIN is not set # CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # CONFIG_BNX2 is not set # CONFIG_QLA3XXX is not set # CONFIG_NETDEV_10000 is not set # CONFIG_TR is not set # # Wireless LAN # # CONFIG_WLAN_PRE80211 is not set # CONFIG_WLAN_80211 is not set # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # CONFIG_INPUT_FF_MEMLESS is not set # CONFIG_INPUT_POLLDEV is not set # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TABLET is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # CONFIG_GAMEPORT is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_VT_HW_CONSOLE_BINDING is not set # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # # CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # # CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_INTEL=m # CONFIG_HW_RANDOM_AMD is not set # CONFIG_HW_RANDOM_GEODE is not set # CONFIG_HW_RANDOM_VIA is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_MWAVE is not set # CONFIG_PC8736x_GPIO is not set # CONFIG_NSC_GPIO is not set # CONFIG_CS5535_GPIO is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set # CONFIG_HANGCHECK_TIMER is not set # # TPM devices # CONFIG_DEVPORT=y # CONFIG_I2C is not set # # SPI support # # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # CONFIG_HWMON is not set # # Multifunction device drivers # # CONFIG_MFD_SM501 is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # CONFIG_DVB_CORE is not set # CONFIG_DAB is not set # # Graphics support # # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Display device support # # CONFIG_DISPLAY_SUPPORT is not set # CONFIG_VGASTATE is not set # CONFIG_FB is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_VGACON_SOFT_SCROLLBACK is not set # CONFIG_VIDEO_SELECT is not set CONFIG_DUMMY_CONSOLE=y # # Sound # # CONFIG_SOUND is not set # # HID Devices # # CONFIG_HID is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_ARCH_HAS_EHCI=y # CONFIG_USB is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # CONFIG_MMC is not set # # LED devices # # CONFIG_NEW_LEDS is not set # # LED drivers # # # LED Triggers # # # InfiniBand support # # CONFIG_INFINIBAND is not set # # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) # # # Real Time Clock # # # DMA Engine support # # CONFIG_DMA_ENGINE is not set # # DMA Clients # # # DMA Devices # # # Virtualization # # # File systems # CONFIG_EXT2_FS=m # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set # CONFIG_EXT3_FS is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set CONFIG_XFS_FS=y # CONFIG_XFS_QUOTA is not set # CONFIG_XFS_SECURITY is not set # CONFIG_XFS_POSIX_ACL is not set # CONFIG_XFS_RT is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=m # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # # CONFIG_MSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y # CONFIG_TMPFS is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_HFSPLUS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # # CONFIG_NFS_FS is not set # CONFIG_NFSD is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # # CONFIG_NLS is not set # # Kernel hacking # CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_PRINTK_TIME is not set # CONFIG_ENABLE_MUST_CHECK is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_UNUSED_SYMBOLS is not set # CONFIG_DEBUG_FS is not set # CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_DEBUG_BUGVERBOSE=y CONFIG_EARLY_PRINTK=y CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y CONFIG_DOUBLEFAULT=y # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_ALGAPI=y CONFIG_CRYPTO_BLKCIPHER=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_HMAC=y # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set CONFIG_CRYPTO_ECB=m CONFIG_CRYPTO_CBC=y # CONFIG_CRYPTO_PCBC is not set # CONFIG_CRYPTO_CRYPTD is not set CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_FCRYPT is not set CONFIG_CRYPTO_BLOWFISH=m # CONFIG_CRYPTO_TWOFISH is not set CONFIG_CRYPTO_TWOFISH_COMMON=m CONFIG_CRYPTO_TWOFISH_586=m CONFIG_CRYPTO_SERPENT=m # CONFIG_CRYPTO_AES is not set CONFIG_CRYPTO_AES_586=y # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=y # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_CAMELLIA is not set # CONFIG_CRYPTO_TEST is not set # # Hardware crypto devices # # CONFIG_CRYPTO_DEV_PADLOCK is not set # CONFIG_CRYPTO_DEV_GEODE is not set # # Library routines # CONFIG_BITREVERSE=m CONFIG_CRC_CCITT=m CONFIG_CRC16=m # CONFIG_CRC_ITU_T is not set CONFIG_CRC32=m CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=m CONFIG_TEXTSEARCH_BM=m CONFIG_TEXTSEARCH_FSM=m CONFIG_PLIST=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y CONFIG_X86_TRAMPOLINE=y CONFIG_KTIME_SCALAR=y From owner-xfs@oss.sgi.com Fri Aug 3 10:24:04 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 03 Aug 2007 10:24:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.2.0-pre1-r499012 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l73HO1bm027356 for ; Fri, 3 Aug 2007 10:24:04 -0700 Received: from schroedinger.engr.sgi.com (schroedinger.engr.sgi.com [150.166.1.51]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id 7BBF1908A2 for ; Fri, 3 Aug 2007 10:08:01 -0700 (PDT) Received: from clameter (helo=localhost) by schroedinger.engr.sgi.com with local-esmtp (Exim 3.36 #1 (Debian)) id 1IH09q-0004Vl-00; Fri, 03 Aug 2007 09:37:46 -0700 Date: Fri, 3 Aug 2007 09:37:46 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Marco Berizzi cc: linux-kernel@vger.kernel.org, David Chinner , xfs@oss.sgi.com Subject: Re: kernel BUG at mm/slab.c:2980 (was Re: [] xfs_bmap_search_multi_extents+0x6f/0xe0) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12463 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: clameter@sgi.com Precedence: bulk X-list: xfs Could you try this with the SLUB allocator and then boot with "slub_debug"? From owner-xfs@oss.sgi.com Sat Aug 4 12:00:14 2007 Received: with ECARTIS (v1.0.0; list xfs); Sat, 04 Aug 2007 12:00:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.188]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l74J0Cbm010459 for ; Sat, 4 Aug 2007 12:00:13 -0700 Received: by mu-out-0910.google.com with SMTP id i10so1488937mue for ; Sat, 04 Aug 2007 12:00:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-disposition:content-type:content-transfer-encoding:message-id; b=W8M+yBqM+sxsS8HB/h35QwNHOH4gZhyTR87HZAmDoEkitIAF2JyPr5X3wBnvfJpumNlyISHKGTQwS4TX8gncmqqzIBL/XZfofUv+zSCycyoGefaU3+WJDjXD9KfTw5UjQQDrinpKjqPKDxsrJ+nn2OpXyWZT8lA2H9wkT44K81M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:cc:mime-version:content-disposition:content-type:content-transfer-encoding:message-id; b=OEEGYbe7ZxFzjHB8pUlmr/sc54z4FjU5Wsi/1Dwiw9hrbPVkh31MrDrT1vc9KXY4ugDjb/liVsYWOZAaMZlN3546VM0dpLB52UXYWz/XTT+GeoOaNrWMmBzyD8jMuq4FUxnNDn3CzCo+HaFJSh+Prdx7X8YdWCRO/4hWumIigX8= Received: by 10.86.26.11 with SMTP id 11mr3143511fgz.1186252335882; Sat, 04 Aug 2007 11:32:15 -0700 (PDT) Received: from ?192.168.1.34? ( [90.184.90.115]) by mx.google.com with ESMTPS id u9sm14099447muf.2007.08.04.11.32.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 04 Aug 2007 11:32:15 -0700 (PDT) From: Jesper Juhl To: Andrew Morton Subject: [PATCH][RESEND] fix a potential NULL pointer deref in XFS on failed mount. Date: Sat, 4 Aug 2007 20:30:21 +0200 User-Agent: KMail/1.9.7 Cc: Linux Kernel Mailing List , David Chinner , xfs@oss.sgi.com, xfs-masters@oss.sgi.com, Jesper Juhl MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200708042030.21375.jesper.juhl@gmail.com> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12464 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jesper.juhl@gmail.com Precedence: bulk X-list: xfs Back in 2006 (2006-10-31 to be specific, reposted on 2006-11-16), I submitted a patch to fix a potential NULL pointer deref in XFS on failed mount. The patch drew some comments and it turned out that my initial approach to a fix was wrong. David Chinner kindly offered some tips on how to implement a proper fix, and on 2006-11-20 I submitted a revised fix. This patch, unfortunately, didn't draw any comments, nor did it ever get merged anywhere. I believe that now sufficient time has passed to warrent a repost. And now, on August 4, 2007 - yet another resend. it would really be nice if this patch could either get merged or, if it is wrong for some reason, get an explicit NACK. Come on people, what's it going to be? The Coverity checker spotted (as bug #346) a potential problem in XFS. The problem is that if, in xfs_mount(), this code triggers: ... if (!mp->m_logdev_targp) goto error0; ... Then we'll end up calling xfs_unmountfs_close() with a NULL 'mp->m_logdev_targp'. This in turn will result in a call to xfs_free_buftarg() with its 'btp' argument == NULL. xfs_free_buftarg() dereferences 'btp' leading to a NULL pointer dereference and crash. I think this can happen, since the fatal call to xfs_free_buftarg() happens when 'm_logdev_targp != m_ddev_targp' and due to a check of 'm_ddev_targp' against NULL in xfs_mount() (and subsequent return if it is NULL) the two will never both be NULL when we hit the error0 label from the two lines cited above. This patch fixes the issue by checking mp->m_logdev_targp against NULL in xfs_unmountfs_close() and doing the proper xfs_blkdev_put(logdev); and xfs_blkdev_put(rtdev); on (!mp->m_rtdev_targp) in xfs_mount(). Compile tested. Comments and feedback welcome. Please consider merging. Signed-off-by: Jesper Juhl --- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index a66b398..215e041 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1275,7 +1275,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) void xfs_unmountfs_close(xfs_mount_t *mp, struct cred *cr) { - if (mp->m_logdev_targp != mp->m_ddev_targp) + if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) xfs_free_buftarg(mp->m_logdev_targp, 1); if (mp->m_rtdev_targp) xfs_free_buftarg(mp->m_rtdev_targp, 1); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 11f5ea2..6d4bc5d 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -482,13 +482,19 @@ xfs_mount( } if (rtdev) { mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev, 1); - if (!mp->m_rtdev_targp) + if (!mp->m_rtdev_targp) { + xfs_blkdev_put(logdev); + xfs_blkdev_put(rtdev); goto error0; + } } mp->m_logdev_targp = (logdev && logdev != ddev) ? xfs_alloc_buftarg(logdev, 1) : mp->m_ddev_targp; - if (!mp->m_logdev_targp) + if (!mp->m_logdev_targp) { + xfs_blkdev_put(logdev); + xfs_blkdev_put(rtdev); goto error0; + } /* * Setup flags based on mount(2) options and then the superblock From owner-xfs@oss.sgi.com Sun Aug 5 14:06:08 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 05 Aug 2007 14:06:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l75L66bm026047 for ; Sun, 5 Aug 2007 14:06:08 -0700 Received: from Liberator.local (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 4247D18015183 for ; Sun, 5 Aug 2007 16:06:10 -0500 (CDT) Message-ID: <46B63BC2.7020109@sandeen.net> Date: Sun, 05 Aug 2007 16:06:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH] fix nasty quota hashtable allocation bug Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12465 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 This git mod: 77e4635ae191774526ed695482a151ac986f3806 converted to a "greedy" allocation interface, but for the quota hashtables it switched from allocating XFS_QM_HASHSIZE (nr of elements) xfs_dqhash_t's to allocating only XFS_QM_HASHSIZE *bytes* - quite a lot smaller! Then when we converted hsize "back" to nr of elements (the division line) hsize went to 0. This was leading to oopses when running any quota tests on the Fedora 8 test kernel, but the problem has been there for almost a year. Signed-off-by: Eric Sandeen Index: linux-2.6.22-rc4/fs/xfs/quota/xfs_qm.c =================================================================== --- linux-2.6.22-rc4.orig/fs/xfs/quota/xfs_qm.c +++ linux-2.6.22-rc4/fs/xfs/quota/xfs_qm.c @@ -117,7 +117,8 @@ xfs_Gqm_init(void) * Initialize the dquot hash tables. */ udqhash = kmem_zalloc_greedy(&hsize, - XFS_QM_HASHSIZE_LOW, XFS_QM_HASHSIZE_HIGH, + XFS_QM_HASHSIZE_LOW * sizeof(xfs_dqhash_t), + XFS_QM_HASHSIZE_HIGH * sizeof(xfs_dqhash_t), KM_SLEEP | KM_MAYFAIL | KM_LARGE); gdqhash = kmem_zalloc(hsize, KM_SLEEP | KM_LARGE); hsize /= sizeof(xfs_dqhash_t); From owner-xfs@oss.sgi.com Sun Aug 5 22:56:42 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 05 Aug 2007 22:56:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l765udbm030668 for ; Sun, 5 Aug 2007 22:56:41 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA26031; Mon, 6 Aug 2007 15:56:35 +1000 Message-ID: <46B6B88F.1020401@sgi.com> Date: Mon, 06 Aug 2007 15:58:39 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] dmapi: simplify slab cache creation References: <20070802212926.GA24834@lst.de> In-Reply-To: <20070802212926.GA24834@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12466 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs It is looking good Christoph, Regards, Vlad Christoph Hellwig wrote: > Currently two out of three slab caches are created on-demand on > dmapi_register. Move them into dmapi_init as the others are to clean up > all the mess about checking whether dmapi_register has been called > before or is in the process of beeing called. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c > =================================================================== > --- linux-2.6-xfs.orig/fs/dmapi/dmapi_mountinfo.c 2007-08-02 16:00:52.000000000 +0200 > +++ linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c 2007-08-02 16:07:13.000000000 +0200 > @@ -471,40 +471,7 @@ dmapi_register( > struct filesystem_dmapi_operations *dmapiops) > { > dm_vector_map_t *proto; > - static int initialized = 0; > > -wait_cache: > - spin_lock(&dm_fsys_lock); > - if (initialized == -1) { > - spin_unlock(&dm_fsys_lock); > - goto wait_cache; > - } > - if (initialized == 0) > - initialized = -1; > - spin_unlock(&dm_fsys_lock); > - > - if (initialized == -1) { > - ASSERT(dm_fsys_map_cachep == NULL); > - ASSERT(dm_fsys_vptr_cachep == NULL); > - > - dm_fsys_map_cachep = kmem_cache_create("dm_fsys_map", > - sizeof(dm_vector_map_t), 0, 0, NULL, NULL); > - > - dm_fsys_vptr_cachep = kmem_cache_create("dm_fsys_vptr", > - sizeof(dm_fsys_vector_t), 0, 0, NULL, NULL); > - > - spin_lock(&dm_fsys_lock); > - if ((dm_fsys_map_cachep == NULL) || > - (dm_fsys_map_cachep == NULL)) { > - initialized = 0; > - spin_unlock(&dm_fsys_lock); > - goto out_cache_free; > - } > - initialized = 1; > - spin_unlock(&dm_fsys_lock); > - } > - > - ASSERT_ALWAYS(initialized == 1); > 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__); > @@ -521,21 +488,8 @@ wait_cache: > list_add(&proto->ftype_list, &dm_fsys_map); > ftype_list(); > spin_unlock(&dm_fsys_lock); > - > - return; > - > -out_cache_free: > - if (dm_fsys_map_cachep) { > - kmem_cache_destroy(dm_fsys_map_cachep); > - dm_fsys_map_cachep = NULL; > - } > - if (dm_fsys_vptr_cachep) { > - kmem_cache_destroy(dm_fsys_vptr_cachep); > - dm_fsys_vptr_cachep = NULL; > - } > } > > - > /* Called by a filesystem module that is unloading from the kernel */ > void > dmapi_unregister( > Index: linux-2.6-xfs/fs/dmapi/dmapi_sysent.c > =================================================================== > --- linux-2.6-xfs.orig/fs/dmapi/dmapi_sysent.c 2007-08-02 16:03:21.000000000 +0200 > +++ linux-2.6-xfs/fs/dmapi/dmapi_sysent.c 2007-08-02 16:09:46.000000000 +0200 > @@ -740,35 +740,47 @@ int __init dmapi_init(void) > dm_tokdata_cachep = kmem_cache_create("dm_tokdata", > sizeof(struct dm_tokdata), 0, 0, NULL, NULL); > if (dm_tokdata_cachep == NULL) > - goto out_cache_free; > + goto out; > > dm_fsreg_cachep = kmem_cache_create("dm_fsreg", > sizeof(struct dm_fsreg), 0, 0, NULL, NULL); > if (dm_fsreg_cachep == NULL) > - goto out_cache_free; > + goto out_free_tokdata_cachep; > > dm_session_cachep = kmem_cache_create("dm_session", > sizeof(struct dm_session), 0, 0, NULL, NULL); > if (dm_session_cachep == NULL) > - goto out_cache_free; > + goto out_free_fsreg_cachep; > + > + dm_fsys_map_cachep = kmem_cache_create("dm_fsys_map", > + sizeof(dm_vector_map_t), 0, 0, NULL, 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, NULL); > + if (dm_fsys_vptr_cachep == NULL) > + goto out_free_fsys_map_cachep; > > ret = misc_register(&dmapi_dev); > - if( ret != 0 ) > + if (ret) { > printk(KERN_ERR "dmapi_init: misc_register returned %d\n", ret); > + goto out_free_fsys_vptr_cachep; > + } > + > dmapi_init_procfs(dmapi_dev.minor); > return 0; > > -out_cache_free: > - if (dm_tokdata_cachep) > - kmem_cache_destroy(dm_tokdata_cachep); > - if (dm_fsreg_cachep) > - kmem_cache_destroy(dm_fsreg_cachep); > - if (dm_session_cachep) > - kmem_cache_destroy(dm_session_cachep); > - if (dm_fsys_map_cachep) > - kmem_cache_destroy(dm_fsys_map_cachep); > - if (dm_fsys_vptr_cachep) > - kmem_cache_destroy(dm_fsys_vptr_cachep); > + 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: > + kmem_cache_destroy(dm_fsreg_cachep); > + out_free_tokdata_cachep: > + kmem_cache_destroy(dm_tokdata_cachep); > + out: > return -ENOMEM; > } > > > From owner-xfs@oss.sgi.com Sun Aug 5 23:31:30 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 05 Aug 2007 23:31:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l766VQbm008584 for ; Sun, 5 Aug 2007 23:31:28 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA27016; Mon, 6 Aug 2007 16:31:24 +1000 Message-ID: <46B6C0B9.2050503@sgi.com> Date: Mon, 06 Aug 2007 16:33:29 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: TAKE 968690 - remove unessecary vfs argument to DM_EVENT_ENABLED Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12467 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Date: Mon Aug 6 16:27:33 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/linux-xfs-patch-reviews Inspected by: vapo The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29340a fs/xfs/xfs_vnodeops.c - 1.705 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.705&r2=text&tr2=1.704&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED fs/xfs/xfs_dmapi.h - 1.59 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dmapi.h.diff?r1=text&tr1=1.59&r2=text&tr2=1.58&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED fs/xfs/xfs_bmap.c - 1.376 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.376&r2=text&tr2=1.375&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED fs/xfs/xfs_rename.c - 1.71 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rename.c.diff?r1=text&tr1=1.71&r2=text&tr2=1.70&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED fs/xfs/linux-2.6/xfs_lrw.c - 1.262 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_lrw.c.diff?r1=text&tr1=1.262&r2=text&tr2=1.261&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED. fs/xfs/linux-2.6/xfs_file.c - 1.151 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_file.c.diff?r1=text&tr1=1.151&r2=text&tr2=1.150&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED fs/xfs/dmapi/xfs_dm.c - 1.41 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.41&r2=text&tr2=1.40&f=h - pv 968690, author Christoph Hellwig , rv vapo - remove unessecary vfs argument to DM_EVENT_ENABLED From owner-xfs@oss.sgi.com Sun Aug 5 23:43:08 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 05 Aug 2007 23:43:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l766h4bm012069 for ; Sun, 5 Aug 2007 23:43:07 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA27300; Mon, 6 Aug 2007 16:43:03 +1000 Message-ID: <46B6C374.8000808@sgi.com> Date: Mon, 06 Aug 2007 16:45:08 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: TAKE 968691 - dmapi: simplify slab cache creation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12468 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Date: Mon Aug 6 16:40:14 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/linux-xfs-patch-reviews Inspected by: vapo The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: linux-melb:dmapi:29343a fs/dmapi/dmapi_mountinfo.c - 1.31 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/fs/dmapi/dmapi_mountinfo.c.diff?r1=text&tr1=1.31&r2=text&tr2=1.30&f=h - pv 968691, author Christoph Hellwig , rv vapo - dmapi: simplify slab cache creation fs/dmapi/dmapi_sysent.c - 1.38 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/fs/dmapi/dmapi_sysent.c.diff?r1=text&tr1=1.38&r2=text&tr2=1.37&f=h - pv 968691, author Christoph Hellwig , rv vapo - dmapi: simplify slab cache creation From owner-xfs@oss.sgi.com Mon Aug 6 06:54:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 06:54:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_50, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76Ds9bm028490 for ; Mon, 6 Aug 2007 06:54:11 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds4k2031806; Mon, 6 Aug 2007 09:54:04 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds48l017071; Mon, 6 Aug 2007 09:54:04 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds3Yv007097; Mon, 6 Aug 2007 09:54:03 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76Ds3vb002256; Mon, 6 Aug 2007 09:54:03 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76Ds3mU002255; Mon, 6 Aug 2007 09:54:03 -0400 Date: Mon, 6 Aug 2007 09:54:03 -0400 Message-Id: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12470 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs Apologies for the resend, but the original sending had the date in the email header and it caused some of these to bounce... ( Please consider trimming the Cc list if discussing some aspect of this that doesn't concern everyone.) When an unprivileged process attempts to modify a file that has the setuid or setgid bits set, the VFS will attempt to clear these bits. The VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid mask, and then call notify_change to clear these bits and set the mode accordingly. With a networked filesystem (NFS in particular but most likely others), the client machine may not have credentials that allow for the clearing of these bits. In some situations, this can lead to file corruption, or to an operation failing outright because the setattr fails. In this situation, we'd like to just leave the handling of this to the server and ignore these bits. The problem is that by the time nfs_setattr is called, the VFS has already reinterpreted the ATTR_KILL_* bits into a mode change. We can't fix this in the filesystems where this is a problem, as doing so would leave us having to second-guess what the VFS wants us to do. So we need to change it so that filesystems have more flexibility in how to interpret the ATTR_KILL_* bits. The first patch in the following patchset moves this logic into a helper function, and then only calls this helper function for inodes that do not have a setattr operation defined. The subsequent patches fix up individual filesystem setattr functions to call this helper function. The upshot of this is that with this change, filesystems that define a setattr inode operation are now responsible for handling the ATTR_KILL bits as well. They can trivially do so by calling the helper, but they must do so. Some of the follow-on patches may not be strictly necessary, but I decided that it was better to take the conservative approach and call the helper when I wasn't sure. I've tried to CC the maintainers for the individual filesystems as well where I could find them, please let me know if there are others who should be informed. Comments and suggestions appreciated... Signed-off-by: Jeff Layton From owner-xfs@oss.sgi.com Mon Aug 6 06:54:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 06:54:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_46, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76DsAbm028500 for ; Mon, 6 Aug 2007 06:54:12 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds87T031853; Mon, 6 Aug 2007 09:54:08 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds7PT017116; Mon, 6 Aug 2007 09:54:07 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76Ds7nv007110; Mon, 6 Aug 2007 09:54:07 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76Ds6Y3002261; Mon, 6 Aug 2007 09:54:06 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76Ds6sq002260; Mon, 6 Aug 2007 09:54:06 -0400 Date: Mon, 6 Aug 2007 09:54:06 -0400 Message-Id: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12469 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs Separate the handling of the local ia_valid bitmask from the one in attr->ia_valid. This allows us to hand off the actual handling of the ATTR_KILL_* flags to the .setattr i_op when one is defined. notify_change still needs to process those flags for the local ia_valid variable, since it uses that to decide whether to return early, and to pass a (hopefully) appropriate bitmask to fsnotify_change. Signed-off-by: Jeff Layton --- fs/attr.c | 54 +++++++++++++++++++++++++++++++++------------------ include/linux/fs.h | 1 + 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index f8dfc22..47015e0 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -100,15 +100,39 @@ int inode_setattr(struct inode * inode, struct iattr * attr) } EXPORT_SYMBOL(inode_setattr); +void attr_kill_to_mode(struct inode *inode, struct iattr *attr) +{ + if (attr->ia_valid & ATTR_KILL_SUID) { + attr->ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = inode->i_mode; + } + attr->ia_mode &= ~S_ISUID; + } + } + if (attr->ia_valid & ATTR_KILL_SGID) { + attr->ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = inode->i_mode; + } + attr->ia_mode &= ~S_ISGID; + } + } +} +EXPORT_SYMBOL(attr_kill_to_mode); + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; - mode_t mode; int error; struct timespec now; unsigned int ia_valid = attr->ia_valid; - mode = inode->i_mode; now = current_fs_time(inode->i_sb); attr->ia_ctime = now; @@ -117,26 +141,17 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!(ia_valid & ATTR_MTIME_SET)) attr->ia_mtime = now; if (ia_valid & ATTR_KILL_SUID) { - attr->ia_valid &= ~ATTR_KILL_SUID; - if (mode & S_ISUID) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISUID; - } + ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) + ia_valid |= ATTR_MODE; } if (ia_valid & ATTR_KILL_SGID) { - attr->ia_valid &= ~ ATTR_KILL_SGID; - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISGID; - } + ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) + ia_valid |= ATTR_MODE; } - if (!attr->ia_valid) + if (!ia_valid) return 0; if (ia_valid & ATTR_SIZE) @@ -147,6 +162,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!error) error = inode->i_op->setattr(dentry, attr); } else { + attr_kill_to_mode(inode, attr); error = inode_change_ok(inode, attr); if (!error) error = security_inode_setattr(dentry, attr); diff --git a/include/linux/fs.h b/include/linux/fs.h index d33bead..f617b23 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1561,6 +1561,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif +extern void attr_kill_to_mode(struct inode *inode, struct iattr *attr); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 6 06:55:18 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 06:55:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76DtFbm028954 for ; Mon, 6 Aug 2007 06:55:17 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76DtGpf000476; Mon, 6 Aug 2007 09:55:16 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DtGYA017853; Mon, 6 Aug 2007 09:55:16 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DtFSS007797; Mon, 6 Aug 2007 09:55:16 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76DtFYU002382; Mon, 6 Aug 2007 09:55:15 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76DtFVO002381; Mon, 6 Aug 2007 09:55:15 -0400 Date: Mon, 6 Aug 2007 09:55:15 -0400 Message-Id: <200708061355.l76DtFVO002381@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 23/25] XFS: call attr_kill_to_mode from xfs_vn_setattr To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12471 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs ..and only save off ia_valid after it returns Signed-off-by: Jeff Layton --- fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 0b5fa12..67fba53 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -651,12 +651,15 @@ xfs_vn_setattr( struct iattr *attr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; bhv_vnode_t *vp = vn_from_inode(inode); bhv_vattr_t vattr = { 0 }; int flags = 0; int error; + attr_kill_to_mode(inode, attr); + ia_valid = attr->ia_valid; + if (ia_valid & ATTR_UID) { vattr.va_mask |= XFS_AT_UID; vattr.va_uid = attr->ia_uid; -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 6 07:54:19 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 07:54:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_96_XX,RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76EsIbm014916 for ; Mon, 6 Aug 2007 07:54:19 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76DIWhZ006286; Mon, 6 Aug 2007 09:18:32 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DIVJ2030684; Mon, 6 Aug 2007 09:18:31 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DIVLd027246; Mon, 6 Aug 2007 09:18:31 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76DIVGA001788; Mon, 6 Aug 2007 09:18:31 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76DIVoF001787; Mon, 6 Aug 2007 09:18:31 -0400 Message-Id: <200708061318.l76DIVoF001787@dantu.rdu.redhat.com> From: Jeff Layton Date: Tue, 24 Jul 2007 13:22:34 -0400 Subject: [PATCH 23/25] XFS: call attr_kill_to_mode from xfs_vn_setattr To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12472 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs ..and only save off ia_valid after it returns Signed-off-by: Jeff Layton --- fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 0b5fa12..67fba53 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -651,12 +651,15 @@ xfs_vn_setattr( struct iattr *attr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; bhv_vnode_t *vp = vn_from_inode(inode); bhv_vattr_t vattr = { 0 }; int flags = 0; int error; + attr_kill_to_mode(inode, attr); + ia_valid = attr->ia_valid; + if (ia_valid & ATTR_UID) { vattr.va_mask |= XFS_AT_UID; vattr.va_uid = attr->ia_uid; -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 6 07:56:44 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 07:56:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_96_XX,J_CHICKENPOX_46,RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76Euebo015851 for ; Mon, 6 Aug 2007 07:56:44 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHjCg005693; Mon, 6 Aug 2007 09:17:45 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHjix030281; Mon, 6 Aug 2007 09:17:45 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHisx026914; Mon, 6 Aug 2007 09:17:44 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76DHiE9001661; Mon, 6 Aug 2007 09:17:44 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76DHivu001660; Mon, 6 Aug 2007 09:17:44 -0400 Message-Id: <200708061317.l76DHivu001660@dantu.rdu.redhat.com> From: Jeff Layton Date: Wed, 25 Jul 2007 12:47:28 -0400 Subject: [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12474 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs Separate the handling of the local ia_valid bitmask from the one in attr->ia_valid. This allows us to hand off the actual handling of the ATTR_KILL_* flags to the .setattr i_op when one is defined. notify_change still needs to process those flags for the local ia_valid variable, since it uses that to decide whether to return early, and to pass a (hopefully) appropriate bitmask to fsnotify_change. Signed-off-by: Jeff Layton --- fs/attr.c | 54 +++++++++++++++++++++++++++++++++------------------ include/linux/fs.h | 1 + 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index f8dfc22..47015e0 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -100,15 +100,39 @@ int inode_setattr(struct inode * inode, struct iattr * attr) } EXPORT_SYMBOL(inode_setattr); +void attr_kill_to_mode(struct inode *inode, struct iattr *attr) +{ + if (attr->ia_valid & ATTR_KILL_SUID) { + attr->ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = inode->i_mode; + } + attr->ia_mode &= ~S_ISUID; + } + } + if (attr->ia_valid & ATTR_KILL_SGID) { + attr->ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = inode->i_mode; + } + attr->ia_mode &= ~S_ISGID; + } + } +} +EXPORT_SYMBOL(attr_kill_to_mode); + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; - mode_t mode; int error; struct timespec now; unsigned int ia_valid = attr->ia_valid; - mode = inode->i_mode; now = current_fs_time(inode->i_sb); attr->ia_ctime = now; @@ -117,26 +141,17 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!(ia_valid & ATTR_MTIME_SET)) attr->ia_mtime = now; if (ia_valid & ATTR_KILL_SUID) { - attr->ia_valid &= ~ATTR_KILL_SUID; - if (mode & S_ISUID) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISUID; - } + ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) + ia_valid |= ATTR_MODE; } if (ia_valid & ATTR_KILL_SGID) { - attr->ia_valid &= ~ ATTR_KILL_SGID; - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISGID; - } + ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) + ia_valid |= ATTR_MODE; } - if (!attr->ia_valid) + if (!ia_valid) return 0; if (ia_valid & ATTR_SIZE) @@ -147,6 +162,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!error) error = inode->i_op->setattr(dentry, attr); } else { + attr_kill_to_mode(inode, attr); error = inode_change_ok(inode, attr); if (!error) error = security_inode_setattr(dentry, attr); diff --git a/include/linux/fs.h b/include/linux/fs.h index d33bead..f617b23 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1561,6 +1561,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif +extern void attr_kill_to_mode(struct inode *inode, struct iattr *attr); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 6 07:56:42 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 07:56:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_96_XX,RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76Euebm015851 for ; Mon, 6 Aug 2007 07:56:42 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHhLM005671; Mon, 6 Aug 2007 09:17:43 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHgiH030274; Mon, 6 Aug 2007 09:17:42 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76DHgkN026903; Mon, 6 Aug 2007 09:17:42 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l76DHgH6001654; Mon, 6 Aug 2007 09:17:42 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l76DHc8e001653; Mon, 6 Aug 2007 09:17:38 -0400 Message-Id: <200708061317.l76DHc8e001653@dantu.rdu.redhat.com> From: Jeff Layton Date: Wed, 25 Jul 2007 12:47:28 -0400 Subject: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12473 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs ( Please consider trimming the Cc list if discussing some aspect of this that doesn't concern everyone ) When an unprivileged process attempts to modify a file that has the setuid or setgid bits set, the VFS will attempt to clear these bits. The VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid mask, and then call notify_change to clear these bits and set the mode accordingly. With a networked filesystem (NFS in particular but most likely others), the client machine may not have credentials that allow for the clearing of these bits. In some situations, this can lead to file corruption, or to an operation failing outright because the setattr fails. In this situation, we'd like to just leave the handling of this to the server and ignore these bits. The problem is that by the time nfs_setattr is called, the VFS has already reinterpreted the ATTR_KILL_* bits into a mode change. We can't fix this in the filesystems where this is a problem, as doing so would leave us having to second-guess what the VFS wants us to do. So we need to change it so that filesystems have more flexibility in how to interpret the ATTR_KILL_* bits. The first patch in the following patchset moves this logic into a helper function, and then only calls this helper function for inodes that do not have a setattr operation defined. The subsequent patches fix up individual filesystem setattr functions to call this helper function. The upshot of this is that with this change, filesystems that define a setattr inode operation are now responsible for handling the ATTR_KILL bits as well. They can trivially do so by calling the helper, but they must do so. Some of the follow-on patches may not be strictly necessary, but I decided that it was better to take the conservative approach and call the helper when I wasn't sure. I've tried to CC the maintainers for the individual filesystems as well where I could find them, please let me know if there are others who should be informed. Comments and suggestions appreciated... Signed-off-by: Jeff Layton From owner-xfs@oss.sgi.com Mon Aug 6 10:50:21 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 10:50:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail-gw2.sa.eol.hu (mail-gw2.sa.eol.hu [212.108.200.109]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76HoIbm005896 for ; Mon, 6 Aug 2007 10:50:21 -0700 Received: from dorka.pomaz.szeredi.hu (224-083.adsl.pool.ew.hu [193.226.224.83]) by mail-gw2.sa.eol.hu (mu) with ESMTP id l76HiStA001227; Mon, 6 Aug 2007 19:44:33 +0200 Received: from miko by dorka.pomaz.szeredi.hu with local (Exim 3.36 #1 (Debian)) id 1II6cM-0004yj-00; Mon, 06 Aug 2007 19:43:46 +0200 To: jlayton@redhat.com CC: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@TELEMANN.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-reply-to: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> (message from Jeff Layton on Mon, 6 Aug 2007 09:54:06 -0400) Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> Message-Id: From: Miklos Szeredi Date: Mon, 06 Aug 2007 19:43:46 +0200 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12475 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs > Separate the handling of the local ia_valid bitmask from the one in > attr->ia_valid. This allows us to hand off the actual handling of the > ATTR_KILL_* flags to the .setattr i_op when one is defined. > > notify_change still needs to process those flags for the local ia_valid > variable, since it uses that to decide whether to return early, and to pass > a (hopefully) appropriate bitmask to fsnotify_change. I agree with this change and fuse will make use of it as well. Maybe instead of unconditionally moving attr_kill_to_mode() inside ->setattr() it could be made conditional based on an inode flag similarly to S_NOCMTIME. Advantages: - no need to modify a lot of in-tree filesystems - no silent breakage of out-of-tree fs Actually I think the new flag would be used by exacly the same filesystems as S_NOCMTIME, so maybe it would make sense to rename S_NOCMTIME to something more generic (S_NOATTRUPDATE or whatever) and use that. But that could still break out-of-tree fs, so a separate flag is probably better. Miklos From owner-xfs@oss.sgi.com Mon Aug 6 11:14:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 11:14:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76IE9bm013784 for ; Mon, 6 Aug 2007 11:14:11 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l76IDarr030424; Mon, 6 Aug 2007 14:13:36 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l76IDaHl008738; Mon, 6 Aug 2007 14:13:36 -0400 Received: from tleilax.poochiereds.net (vpn-14-58.rdu.redhat.com [10.11.14.58]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l76IDYio003449; Mon, 6 Aug 2007 14:13:34 -0400 Date: Mon, 6 Aug 2007 14:13:33 -0400 From: Jeff Layton To: Miklos Szeredi Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@TELEMANN.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function Message-Id: <20070806141333.0f54ab17.jlayton@redhat.com> In-Reply-To: References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12476 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Mon, 06 Aug 2007 19:43:46 +0200 Miklos Szeredi wrote: > > Separate the handling of the local ia_valid bitmask from the one in > > attr->ia_valid. This allows us to hand off the actual handling of the > > ATTR_KILL_* flags to the .setattr i_op when one is defined. > > > > notify_change still needs to process those flags for the local ia_valid > > variable, since it uses that to decide whether to return early, and to pass > > a (hopefully) appropriate bitmask to fsnotify_change. > > I agree with this change and fuse will make use of it as well. > > Maybe instead of unconditionally moving attr_kill_to_mode() inside > ->setattr() it could be made conditional based on an inode flag > similarly to S_NOCMTIME. Advantages: > > - no need to modify a lot of in-tree filesystems > - no silent breakage of out-of-tree fs > > Actually I think the new flag would be used by exacly the same > filesystems as S_NOCMTIME, so maybe it would make sense to rename > S_NOCMTIME to something more generic (S_NOATTRUPDATE or whatever) and > use that. > > But that could still break out-of-tree fs, so a separate flag is > probably better. > In the past I've been told that adding new flags is something of a "last resort". Since it's not strictly necessary to fix this then it may be best to avoid that. That said, if the concensus is that we need a transition mechanism, then I'd be open to such a suggestion. -- Jeff Layton From owner-xfs@oss.sgi.com Mon Aug 6 11:29:16 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 11:29:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from mail-gw3.sa.ew.hu (mail-gw3.sa.ew.hu [212.108.200.82]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76ITEbm018293 for ; Mon, 6 Aug 2007 11:29:16 -0700 Received: from dorka.pomaz.szeredi.hu (224-083.adsl.pool.ew.hu [193.226.224.83]) by mail-gw3.sa.ew.hu (mu) with ESMTP id l76IS0JL029842; Mon, 6 Aug 2007 20:28:04 +0200 Received: from miko by dorka.pomaz.szeredi.hu with local (Exim 3.36 #1 (Debian)) id 1II7JR-0005BN-00; Mon, 06 Aug 2007 20:28:17 +0200 To: jlayton@redhat.com CC: miklos@szeredi.hu, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-reply-to: <20070806141333.0f54ab17.jlayton@redhat.com> (message from Jeff Layton on Mon, 6 Aug 2007 14:13:33 -0400) Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> <20070806141333.0f54ab17.jlayton@redhat.com> Message-Id: From: Miklos Szeredi Date: Mon, 06 Aug 2007 20:28:17 +0200 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12477 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs > > I agree with this change and fuse will make use of it as well. > > > > Maybe instead of unconditionally moving attr_kill_to_mode() inside > > ->setattr() it could be made conditional based on an inode flag > > similarly to S_NOCMTIME. Advantages: > > > > - no need to modify a lot of in-tree filesystems > > - no silent breakage of out-of-tree fs > > > > Actually I think the new flag would be used by exacly the same > > filesystems as S_NOCMTIME, so maybe it would make sense to rename > > S_NOCMTIME to something more generic (S_NOATTRUPDATE or whatever) and > > use that. > > > > But that could still break out-of-tree fs, so a separate flag is > > probably better. > > > > In the past I've been told that adding new flags is something of a > "last resort". Since it's not strictly necessary to fix this then > it may be best to avoid that. > > That said, if the concensus is that we need a transition mechanism, > then I'd be open to such a suggestion. I think there's really no other choice here. Your patch is changing the API in a very unsafe way, since there will be no error or warning on an unconverted fs. And that could lead to security holes. If we would rename the setattr method to setattr_new as well as changing it's behavior, that would be fine. But I guess we do not want to do that. Miklos From owner-xfs@oss.sgi.com Mon Aug 6 12:26:04 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 12:26:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pat.uio.no (pat.uio.no [129.240.10.15]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76JQ2bm007224 for ; Mon, 6 Aug 2007 12:26:04 -0700 Received: from mail-mx9.uio.no ([129.240.10.39]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1II7sz-00052h-1F; Mon, 06 Aug 2007 21:05:01 +0200 Received: from smtp.uio.no ([129.240.10.9] helo=mail-mx9.uio.no) by mail-mx9.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1II7sw-0006Iw-Sj; Mon, 06 Aug 2007 21:04:59 +0200 Received: from c-69-242-210-120.hsd1.mi.comcast.net ([69.242.210.120] helo=[192.168.0.101]) by mail-mx9.uio.no with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.67) (envelope-from ) id 1II7sw-0006Ef-20; Mon, 06 Aug 2007 21:04:58 +0200 Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function From: Trond Myklebust To: Miklos Szeredi Cc: jlayton@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-Reply-To: References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> <20070806141333.0f54ab17.jlayton@redhat.com> Content-Type: text/plain Date: Mon, 06 Aug 2007 15:04:23 -0400 Message-Id: <1186427063.6616.59.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-UiO-Resend: resent X-UiO-Spam-info: not spam, SpamAssassin (score=-0.1, required=12.0, autolearn=disabled, AWL=-0.072) X-UiO-Scanned: E871CF2CF44222422B0CA0EBF571F169B732228E X-UiO-SPAM-Test: remote_host: 129.240.10.9 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 71 total 3121728 max/h 8345 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12478 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: trond.myklebust@fys.uio.no Precedence: bulk X-list: xfs On Mon, 2007-08-06 at 20:28 +0200, Miklos Szeredi wrote: > Your patch is changing the API in a very unsafe way, since there will > be no error or warning on an unconverted fs. And that could lead to > security holes. > > If we would rename the setattr method to setattr_new as well as > changing it's behavior, that would be fine. But I guess we do not > want to do that. Which "unconverted fses"? If we're talking out of tree stuff, then too bad: it is _their_ responsibility to keep up with kernel changes. Trond From owner-xfs@oss.sgi.com Mon Aug 6 12:38:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 12:38:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail-gw3.sa.ew.hu (mail-gw3.sa.ew.hu [212.108.200.82]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76Jc8bm011252 for ; Mon, 6 Aug 2007 12:38:11 -0700 Received: from dorka.pomaz.szeredi.hu (224-083.adsl.pool.ew.hu [193.226.224.83]) by mail-gw3.sa.ew.hu (mu) with ESMTP id l76Jag2u025483; Mon, 6 Aug 2007 21:36:46 +0200 Received: from miko by dorka.pomaz.szeredi.hu with local (Exim 3.36 #1 (Debian)) id 1II8Nw-0005XH-00; Mon, 06 Aug 2007 21:37:00 +0200 To: trond.myklebust@fys.uio.no CC: miklos@szeredi.hu, jlayton@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-reply-to: <1186427063.6616.59.camel@localhost> (message from Trond Myklebust on Mon, 06 Aug 2007 15:04:23 -0400) Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> <20070806141333.0f54ab17.jlayton@redhat.com> <1186427063.6616.59.camel@localhost> Message-Id: From: Miklos Szeredi Date: Mon, 06 Aug 2007 21:37:00 +0200 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12479 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs > > Your patch is changing the API in a very unsafe way, since there will > > be no error or warning on an unconverted fs. And that could lead to > > security holes. > > > > If we would rename the setattr method to setattr_new as well as > > changing it's behavior, that would be fine. But I guess we do not > > want to do that. > > Which "unconverted fses"? If we're talking out of tree stuff, then too > bad: it is _their_ responsibility to keep up with kernel changes. It is usually a good idea to not change the semantics of an API in a backward incompatible way without changing the syntax as well. This is true regardless of whether we care about out-of-tree code or not (and we should care to some degree). And especially true if the change in question is security sensitive. Miklos From owner-xfs@oss.sgi.com Mon Aug 6 14:23:55 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 06 Aug 2007 14:24:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pat.uio.no (pat.uio.no [129.240.10.15]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l76LNqbm008349 for ; Mon, 6 Aug 2007 14:23:54 -0700 Received: from mail-mx2.uio.no ([129.240.10.30]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IIA3F-0006HQ-Sn; Mon, 06 Aug 2007 23:23:46 +0200 Received: from smtp.uio.no ([129.240.10.9] helo=mail-mx2.uio.no) by mail-mx2.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IIA3F-0004en-BV; Mon, 06 Aug 2007 23:23:45 +0200 Received: from c-69-242-210-120.hsd1.mi.comcast.net ([69.242.210.120] helo=[192.168.0.101]) by mail-mx2.uio.no with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.67) (envelope-from ) id 1IIA3E-0004ea-Kl; Mon, 06 Aug 2007 23:23:44 +0200 Subject: Re: [fuse-devel] [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function From: Trond Myklebust To: Miklos Szeredi Cc: jlayton@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, zippel@linux-m68k.org, xfs@oss.sgi.com, joel.becker@oracle.com, wli@holomorphy.com, reiserfs-devel@vger.kernel.org, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-Reply-To: References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> <20070806141333.0f54ab17.jlayton@redhat.com> <1186427063.6616.59.camel@localhost> Content-Type: text/plain Date: Mon, 06 Aug 2007 17:23:39 -0400 Message-Id: <1186435419.6616.136.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-UiO-Resend: resent X-UiO-Spam-info: not spam, SpamAssassin (score=-0.1, required=12.0, autolearn=disabled, AWL=-0.052) X-UiO-Scanned: EE5CF09D8275BCAE529DFB845F42ED9BCB7A24FB X-UiO-SPAM-Test: remote_host: 129.240.10.9 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 206 total 3123507 max/h 8345 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12480 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: trond.myklebust@fys.uio.no Precedence: bulk X-list: xfs On Mon, 2007-08-06 at 21:37 +0200, Miklos Szeredi wrote: > > > Your patch is changing the API in a very unsafe way, since there will > > > be no error or warning on an unconverted fs. And that could lead to > > > security holes. > > > > > > If we would rename the setattr method to setattr_new as well as > > > changing it's behavior, that would be fine. But I guess we do not > > > want to do that. > > > > Which "unconverted fses"? If we're talking out of tree stuff, then too > > bad: it is _their_ responsibility to keep up with kernel changes. > > It is usually a good idea to not change the semantics of an API in a > backward incompatible way without changing the syntax as well. We're taking two setattr flags ATTR_KILL_SGID, and ATTR_KILL_SUID which have existed for several years in the VFS, and making them visible to the filesystems. Out-of-tree filesystems that care can check for them in a completely backward compatible way: you don't even need to add a #define. > This is true regardless of whether we care about out-of-tree code or > not (and we should care to some degree). And especially true if the > change in question is security sensitive. It is not true "regardless": the in-tree code is being converted. Out-of-tree code is the only "problem" here, and their only problem is that they may have to add support for the new flags if they also support suid/sgid mode bits. Are you advocating reserving a new filesystem bit every time we need to add an attribute flag? Trond From owner-xfs@oss.sgi.com Tue Aug 7 02:20:57 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 02:21:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l779Kqbm009690 for ; Tue, 7 Aug 2007 02:20:57 -0700 Received: by wa-out-1112.google.com with SMTP id k22so2273633waf for ; Tue, 07 Aug 2007 02:20:57 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; 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; b=JWplrwHnRlJcICuhaljd6M3xtOTNU9e5/W5ulwctRp/f6o+F1jm6cSUw8ljJM8DuwE4Xq873dzkbPt6LhlmATQ+p/af6j51euAFNg/gLfIZSmwa2zerp3Yf7k5rYWzWvIjhGu8rXZwZFiOyqNcS3Gm1BVT+6X4oLkjfetps9EPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=k9B0+iv8ejFPm8+RBSBrm9iSC7dO/wKcqK4fxqTepIiaD1TL4oXZb4nsdyefR2HyAHGcNVHVL4O1niRbYiNgFmEQZ+vTr4VhL2MqrcS0t/btYQOXmNfWFt3kMCvJRBR/V5Bu7k0ky6oK7AMmQXL/0p64Bn4qtgBri6yo2kGNy1Q= Received: by 10.114.149.2 with SMTP id w2mr6556533wad.1186478456834; Tue, 07 Aug 2007 02:20:56 -0700 (PDT) Received: by 10.114.13.15 with HTTP; Tue, 7 Aug 2007 02:20:56 -0700 (PDT) Message-ID: <5d96567b0708070220u23c895ffk54849fca947b5100@mail.gmail.com> Date: Tue, 7 Aug 2007 12:20:56 +0300 From: Raz To: "David Chinner" Subject: Re: raid50 and 9TB volumes Cc: linux-xfs@oss.sgi.com In-Reply-To: <20070724010105.GN31489@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5d96567b0707160542t2144c382mbfe3da92f0990694@mail.gmail.com> <20070716130140.GC31489@sgi.com> <5d96567b0707160653m5951fac9v5a56bb4c92174d63@mail.gmail.com> <20070716221831.GE31489@sgi.com> <18076.1449.138328.66699@notabene.brown> <20070717001205.GI31489@sgi.com> <18076.4940.845633.149160@notabene.brown> <20070717005854.GL31489@sgi.com> <5d96567b0707222309y61480271xa8220a0b179764e0@mail.gmail.com> <20070724010105.GN31489@sgi.com> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12481 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: raziebe@gmail.com Precedence: bulk X-list: xfs On 7/24/07, David Chinner wrote: > On Mon, Jul 23, 2007 at 09:09:03AM +0300, Raz wrote: > > My QA to re-installed the system. same kernel, different results. now, > > /proc/paritions > > reports : > > 9 1 5114281984 md1 > > 9 2 5128001536 md2 > > 9 3 10242281472 md3 > > > > blockdev --getsize64 /dev/md3 > > 10488096227328 > > > > but xfs keeps on crashing. when formatting it ot 6.3 TB we're OK. when > > letting xfs's mkfs choose the > > So at 6.3TB everything is ok. At what point does it start having > problems? 6.4TB, 6.8TB, 8TB, 9TB? over 8 TB. we checked several times. in 8.5 it crashes. > I know Neil pointed out that you shouldn't have 10TB but closer to > 7TB - is this true? the drives are of 750 GB each. > Cheers, > > Dave. > -- > Dave Chinner > Principal Engineer > SGI Australian Software Group > -- Raz From owner-xfs@oss.sgi.com Tue Aug 7 07:27:38 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 07:27:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from m01.elite.ru (m01.elite.ru [89.108.83.249]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77ERZbm006911 for ; Tue, 7 Aug 2007 07:27:37 -0700 Received: from ethaniel (195.225.129.41 [195.225.129.41]) by m01.elite.ru (ISMS) with ESMTP id 51E52116A8 for ; Tue, 7 Aug 2007 18:10:15 +0400 (MSD) Date: Tue, 7 Aug 2007 18:10:22 +0400 From: Arkadiy Kulev X-Mailer: The Bat! (v3.99.3) Professional Reply-To: Arkadiy Kulev X-Priority: 3 (Normal) Message-ID: <337047880.20070807181022@ethaniel.com> To: xfs@oss.sgi.com Subject: many subdirectories, slow search. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12482 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: eth@ethaniel.com Precedence: bulk X-list: xfs Hello xfs, I have a external SATA storage, that is connected to my server via SCSI HBA. The server is a 32 bit core2duo with 1gb RAM. The server is used for storing millions of images that are accessed randomly (around 50-100 queries per second, total of 2-3 megabytes per second). I started noticing, that images are being accessed slowly (high lag of 5-10 seconds). Even when I connect via ssh and do "ls /data1" for instance (/data1 is my 2 terabyte xfs partition) it gives me a result only after a few seconds, even though the root folder is not big. I suppose that I am storing images incorrectly - placing images from the same group (album) to different folders: albums/00/00/1130000-h200.jpg .... albums/45/87/2334587-h200.jpg albums/45/87/2334587-10x10.jpg .... albums/99/99/5679999-h200.jpg (album subtree depends on the last 4 digits of photo id) I am asking for your advice as gurus. Is it better to place all images that are accessed from the same webpage (ordered access in other terms) in the same folder? Or it doesn't matter? Maybe there is some way of better storing of images? Switching to SCSI disks is not an option. Any ideas? Maybe I tuned ocfs2 wrong? meta-data=/dev/sdb1 isize=256 agcount=32, agsize=15258737 blks = sectsz=512 attr=0 data = bsize=4096 blocks=488279584, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=65536 blocks=0, rtextents=0 -- Best regards, Arkadiy mailto:eth@ethaniel.com From owner-xfs@oss.sgi.com Tue Aug 7 13:19:40 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 13:19:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77KJabm023283 for ; Tue, 7 Aug 2007 13:19:39 -0700 Received: by an-out-0708.google.com with SMTP id c38so404798ana for ; Tue, 07 Aug 2007 13:19:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; 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; b=MtO6G1PKLw0G/Wto5smgDowwn0+yVj0MEvEABncwxrQeTHPPua9KzY2JOoIckD9Hxi+givvzngmoJ+JJCuG5xthjXPsJZxyOs+i9vtDaE/mWzvCDQxWFDPZCcDDpfCtrLlYjjR78OMryKktFWGuMh23mn7OWpIa5pj9T9tAz6H8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gHybSHdWHrExFiLezCGjft+cn2I+i1Ki9lGe0V1FoRuBAoOYVskO2sf+DBSin1w4ENIeg8ogkt4zNYJho9hlJdxLmZ+cUqZdz2zltUFSSj3nU3coX6Ue2/+KBhS3Pc4xal+WOfMDx2QlxpPjs0W2356JMc/U1Sj8J02mrIvBnSs= Received: by 10.100.93.5 with SMTP id q5mr4125952anb.1186516300863; Tue, 07 Aug 2007 12:51:40 -0700 (PDT) Received: by 10.100.96.1 with HTTP; Tue, 7 Aug 2007 12:51:40 -0700 (PDT) Message-ID: <9a8748490708071251l72d1e564u3f0d3bd5b6e4110d@mail.gmail.com> Date: Tue, 7 Aug 2007 21:51:40 +0200 From: "Jesper Juhl" To: "David Chinner" Subject: Re: [PATCH][RESEND] fix a potential NULL pointer deref in XFS on failed mount. Cc: "Andrew Morton" , "Linux Kernel Mailing List" , xfs@oss.sgi.com, xfs-masters@oss.sgi.com In-Reply-To: <20070806005214.GK31489@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200708042030.21375.jesper.juhl@gmail.com> <20070806005214.GK31489@sgi.com> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12483 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jesper.juhl@gmail.com Precedence: bulk X-list: xfs On 06/08/07, David Chinner wrote: > On Sat, Aug 04, 2007 at 08:30:21PM +0200, Jesper Juhl wrote: > > Back in 2006 (2006-10-31 to be specific, reposted on 2006-11-16), I > > submitted a patch to fix a potential NULL pointer deref in XFS on > > failed mount. > > Already checked into xfs-dev tree. Will go to next mainline merge. > > http://oss.sgi.com/archives/xfs/2007-08/msg00030.html > Ok. Thanks a lot for the feedback David. -- Jesper Juhl Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html From owner-xfs@oss.sgi.com Tue Aug 7 14:14:43 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 14:14:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77LEfbm006443 for ; Tue, 7 Aug 2007 14:14:43 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IIVzJ-00082G-77; Tue, 07 Aug 2007 21:49:09 +0100 Date: Tue, 7 Aug 2007 21:49:09 +0100 From: Christoph Hellwig To: Jeff Layton Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-ID: <20070807204909.GA30159@infradead.org> Mail-Followup-To: Christoph Hellwig , Jeff Layton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12484 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 First thanks a lot for doing this work, it's been long needed. Second please don't send out that many patches. We encourage people to split things into small patches when the changes are logially separated. Which these are not - it's a flag day change (which btw is fine despite the rants soe people spewed in reply to this), so it should be one single patch. (Or one for all mainline filesystems + one per fs only in -mm to make Andrew's life a little easier if you really care.) From owner-xfs@oss.sgi.com Tue Aug 7 14:21:06 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 14:21:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77LL5bm008761 for ; Tue, 7 Aug 2007 14:21:06 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IIW1t-00088Q-H4; Tue, 07 Aug 2007 21:51:49 +0100 Date: Tue, 7 Aug 2007 21:51:49 +0100 From: Christoph Hellwig To: Jeff Layton Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function Message-ID: <20070807205145.GB30159@infradead.org> Mail-Followup-To: Christoph Hellwig , Jeff Layton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12485 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 > +void attr_kill_to_mode(struct inode *inode, struct iattr *attr) This function badly needs a kerneldoc description. Also I can't say I like the name a lot, but without a clearly better idea I should probably not complain :) We should at least add a generic_ prefix to indicate it's a generic helper valid for most filesystem (and the kerneldoc comment can explain the details) From owner-xfs@oss.sgi.com Tue Aug 7 15:16:34 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 15:16:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77MGVbm026371 for ; Tue, 7 Aug 2007 15:16:34 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l77MDqVt007031; Tue, 7 Aug 2007 18:13:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l77MDpAq013085; Tue, 7 Aug 2007 18:13:51 -0400 Received: from tleilax.poochiereds.net (vpn-14-145.rdu.redhat.com [10.11.14.145]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l77MDoQr019443; Tue, 7 Aug 2007 18:13:50 -0400 Date: Tue, 7 Aug 2007 18:13:49 -0400 From: Jeff Layton To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070807181349.5d4175c7.jlayton@redhat.com> In-Reply-To: <20070807204909.GA30159@infradead.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807204909.GA30159@infradead.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12486 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 7 Aug 2007 21:49:09 +0100 Christoph Hellwig wrote: > First thanks a lot for doing this work, it's been long needed. > > Second please don't send out that many patches. We encourage people > to split things into small patches when the changes are logially > separated. Which these are not - it's a flag day change (which btw > is fine despite the rants soe people spewed in reply to this), so it > should be one single patch. (Or one for all mainline filesystems + > one per fs only in -mm to make Andrew's life a little easier if you > really care.) Thanks. I debated about how best to split these up. A coworker mentioned that Andrew had tossed him back a single patch that touched several mainline filesystems and asked him to break it up. I took that to mean that the patches should generally be split out, but I guess I took that too far ;-) -- Jeff Layton From owner-xfs@oss.sgi.com Tue Aug 7 15:23:03 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 15:23:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l77MN0bm028238 for ; Tue, 7 Aug 2007 15:23:03 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l77MKlPT011649; Tue, 7 Aug 2007 18:20:47 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l77MKkXp015738; Tue, 7 Aug 2007 18:20:46 -0400 Received: from tleilax.poochiereds.net (vpn-14-145.rdu.redhat.com [10.11.14.145]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l77MKjRC021457; Tue, 7 Aug 2007 18:20:45 -0400 Date: Tue, 7 Aug 2007 18:20:44 -0400 From: Jeff Layton To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 01/25] VFS: move attr_kill logic from notify_change into helper function Message-Id: <20070807182044.06ce4675.jlayton@redhat.com> In-Reply-To: <20070807205145.GB30159@infradead.org> References: <200708061354.l76Ds6sq002260@dantu.rdu.redhat.com> <20070807205145.GB30159@infradead.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12487 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 7 Aug 2007 21:51:49 +0100 Christoph Hellwig wrote: > > +void attr_kill_to_mode(struct inode *inode, struct iattr *attr) > > This function badly needs a kerneldoc description. Also I can't say > I like the name a lot, but without a clearly better idea I should > probably not complain :) > Thanks for the comments. I'm not thrilled with the name either, but kill_suid and *remove_suid were already taken, and I really didn't want to name this something too similar since there are already so many similarly named functions that don't do the same thing. I'm definitely open to suggestions for something different. > We should at least add a generic_ prefix to indicate it's a generic > helper valid for most filesystem (and the kerneldoc comment can explain > the details) > Both good suggestions. I'll plan to incorporate them in the next respin of the set. Thanks, -- Jeff Layton From owner-xfs@oss.sgi.com Tue Aug 7 17:16:55 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 17:17:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from smtp2.linux-foundation.org (smtp2.linux-foundation.org [207.189.120.14]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l780Gqbm026924 for ; Tue, 7 Aug 2007 17:16:55 -0700 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [207.189.120.55]) by smtp2.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id l780F80F031122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Aug 2007 17:15:09 -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 l780F1rJ011883; Tue, 7 Aug 2007 17:15:01 -0700 Date: Tue, 7 Aug 2007 17:15:01 -0700 From: Andrew Morton To: Jeff Layton Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070807171501.e31c4a97.akpm@linux-foundation.org> In-Reply-To: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.184 $ X-Scanned-By: MIMEDefang 2.53 on 207.189.120.14 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12488 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, 6 Aug 2007 09:54:03 -0400 Jeff Layton wrote: > Apologies for the resend, but the original sending had the date in the > email header and it caused some of these to bounce... > > ( Please consider trimming the Cc list if discussing some aspect of this > that doesn't concern everyone.) > > When an unprivileged process attempts to modify a file that has the > setuid or setgid bits set, the VFS will attempt to clear these bits. The > VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid > mask, and then call notify_change to clear these bits and set the mode > accordingly. > > With a networked filesystem (NFS in particular but most likely others), > the client machine may not have credentials that allow for the clearing > of these bits. In some situations, this can lead to file corruption, or > to an operation failing outright because the setattr fails. > > In this situation, we'd like to just leave the handling of this to > the server and ignore these bits. The problem is that by the time > nfs_setattr is called, the VFS has already reinterpreted the ATTR_KILL_* > bits into a mode change. We can't fix this in the filesystems where > this is a problem, as doing so would leave us having to second-guess > what the VFS wants us to do. So we need to change it so that filesystems > have more flexibility in how to interpret the ATTR_KILL_* bits. > > The first patch in the following patchset moves this logic into a helper > function, and then only calls this helper function for inodes that do > not have a setattr operation defined. The subsequent patches fix up > individual filesystem setattr functions to call this helper function. > > The upshot of this is that with this change, filesystems that define > a setattr inode operation are now responsible for handling the ATTR_KILL > bits as well. They can trivially do so by calling the helper, but they > must do so. > > Some of the follow-on patches may not be strictly necessary, but I > decided that it was better to take the conservative approach and call > the helper when I wasn't sure. I've tried to CC the maintainers > for the individual filesystems as well where I could find them, > please let me know if there are others who should be informed. > > Comments and suggestions appreciated... > From a purely practical standpoint: it's a concern that all filesytems need patching to continue to correctly function after this change. There might be filesystems which you missed, and there are out-of-tree filesystems which won't be updated. And I think the impact upon the out-of-tree filesystems would be fairly severe: they quietly and subtly get their secutiry guarantees broken (I think?) Is there any way in which we can prevent these problems? Say - rename something so that unconverted filesystems will reliably fail to compile? - leave existing filesystems alone, but add a new inode_operations.setattr_jeff, which the networked filesytems can implement, and teach core vfs to call setattr_jeff in preference to setattr? Something else? From owner-xfs@oss.sgi.com Tue Aug 7 17:46:05 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 17:46:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54 autolearn=no version=3.2.0-pre1-r499012 Received: from pat.uio.no (pat.uio.no [129.240.10.15]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l780k2bm000877 for ; Tue, 7 Aug 2007 17:46:04 -0700 Received: from mail-mx1.uio.no ([129.240.10.29]) by pat.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IIZgK-0003Lj-13; Wed, 08 Aug 2007 02:45:48 +0200 Received: from smtp.uio.no ([129.240.10.9] helo=mail-mx1.uio.no) by mail-mx1.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1IIZgE-0004dH-B6; Wed, 08 Aug 2007 02:45:47 +0200 Received: from c-69-242-210-120.hsd1.mi.comcast.net ([69.242.210.120] helo=[192.168.0.101]) by mail-mx1.uio.no with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.67) (envelope-from ) id 1IIZgD-0004d1-JR; Wed, 08 Aug 2007 02:45:41 +0200 Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) From: Trond Myklebust To: Andrew Morton Cc: Jeff Layton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com In-Reply-To: <20070807171501.e31c4a97.akpm@linux-foundation.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> Content-Type: text/plain Date: Tue, 07 Aug 2007 20:45:34 -0400 Message-Id: <1186533934.6625.91.camel@heimdal.trondhjem.org> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-UiO-Resend: resent X-UiO-Spam-info: not spam, SpamAssassin (score=-0.1, required=12.0, autolearn=disabled, AWL=-0.105) X-UiO-Scanned: 5DD508554BB32E554F9CCDFECDEC7B1A489F08D0 X-UiO-SPAM-Test: remote_host: 129.240.10.9 spam_score: 0 maxlevel 200 minaction 2 bait 0 mail/h: 289 total 3142576 max/h 8345 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12489 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: trond.myklebust@fys.uio.no Precedence: bulk X-list: xfs On Tue, 2007-08-07 at 17:15 -0700, Andrew Morton wrote: > Is there any way in which we can prevent these problems? Say The problem here is that we occasionally DO need to add new flags, and yes, they MAY be security related. The whole reason why we're now having to change the semantics of setattr is because somebody tried to hack their way around the write+suid issue. I suspect we will see the exact same thing will happen again in a couple of years with Serge's ATTR_KILL_PRIV flag. > - rename something so that unconverted filesystems will reliably fail to > compile? > > - leave existing filesystems alone, but add a new > inode_operations.setattr_jeff, which the networked filesytems can > implement, and teach core vfs to call setattr_jeff in preference to > setattr? If you really need to know that the filesystem is handling the flags, then how about instead having ->setattr() return something which indicates which flags it actually handled? That is likely to be a far more intrusive change, but it is one which is future-proof. Trond From owner-xfs@oss.sgi.com Tue Aug 7 17:54:59 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 17:55:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from smtp2.linux-foundation.org (smtp2.linux-foundation.org [207.189.120.14]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l780swbm002985 for ; Tue, 7 Aug 2007 17:54:58 -0700 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [207.189.120.55]) by smtp2.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id l780s975032369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Aug 2007 17:54:10 -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 l780s3Q3013306; Tue, 7 Aug 2007 17:54:03 -0700 Date: Tue, 7 Aug 2007 17:54:02 -0700 From: Andrew Morton To: Trond Myklebust Cc: Jeff Layton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070807175402.03ceb0b7.akpm@linux-foundation.org> In-Reply-To: <1186533934.6625.91.camel@heimdal.trondhjem.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <1186533934.6625.91.camel@heimdal.trondhjem.org> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.184 $ X-Scanned-By: MIMEDefang 2.53 on 207.189.120.14 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12490 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 Tue, 07 Aug 2007 20:45:34 -0400 Trond Myklebust wrote: > > - rename something so that unconverted filesystems will reliably fail to > > compile? > > > > - leave existing filesystems alone, but add a new > > inode_operations.setattr_jeff, which the networked filesytems can > > implement, and teach core vfs to call setattr_jeff in preference to > > setattr? > > If you really need to know that the filesystem is handling the flags, > then how about instead having ->setattr() return something which > indicates which flags it actually handled? That is likely to be a far > more intrusive change, but it is one which is future-proof. If we change ->setattr so that it will return a positive, non-zero value which the caller can then check and reliably do printk("that filesystem needs updating") then that addresses my concern, sure. From owner-xfs@oss.sgi.com Tue Aug 7 18:34:40 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 18:34:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l781Yabm010073 for ; Tue, 7 Aug 2007 18:34:38 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA17185; Wed, 8 Aug 2007 11:34:35 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l781YXeW54154144; Wed, 8 Aug 2007 11:34:34 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l781YUZV35824320; Wed, 8 Aug 2007 11:34:30 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 11:34:30 +1000 From: David Chinner To: Arkadiy Kulev Cc: xfs@oss.sgi.com Subject: Re: many subdirectories, slow search. Message-ID: <20070808013430.GL12413810@sgi.com> References: <337047880.20070807181022@ethaniel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <337047880.20070807181022@ethaniel.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12491 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Aug 07, 2007 at 06:10:22PM +0400, Arkadiy Kulev wrote: > Hello xfs, > > I have a external SATA storage, that is connected to my server via > SCSI HBA. The server is a 32 bit core2duo with 1gb RAM. ..... > I started noticing, that images are being accessed slowly (high > lag of 5-10 seconds). Even when I connect via ssh and do "ls /data1" > for instance (/data1 is my 2 terabyte xfs partition) it gives me a > result only after a few seconds, even though the root folder is not > big. Is it always slow, or does it slow down after some runtime? Does that slow access correspond to running out of free memory on the machine? i.e. Does it speed up again if you: # echo 3 > /proc/sys/vm/drop_caches Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Aug 7 18:39:03 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 18:39:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_40,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l781d1bm011025 for ; Tue, 7 Aug 2007 18:39:02 -0700 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 7D7F61807DEFF for ; Tue, 7 Aug 2007 20:39:05 -0500 (CDT) Message-ID: <46B91EBA.10407@sandeen.net> Date: Tue, 07 Aug 2007 20:39:06 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: qa 166 failure on f8 kernel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12492 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 Posting this just in case it rings any bells, though I plan to investigate... [root@inode xfstests]# ./check 166 FSTYP -- xfs (non-debug) PLATFORM -- Linux/x86_64 inode 2.6.23-0.71.rc2.fc8 MKFS_OPTIONS -- -f -bsize=4096 /dev/sdb6 MOUNT_OPTIONS -- /dev/sdb6 /mnt/sdb6 166 - output mismatch (see 166.out.bad) 2,6c2,7 < 0: [0..31]: XX..YY AG (AA..BB) 32 < 1: [32..127]: XX..YY AG (AA..BB) 96 10000 < 2: [128..159]: XX..YY AG (AA..BB) 32 < 3: [160..223]: XX..YY AG (AA..BB) 64 10000 < 4: [224..255]: XX..YY AG (AA..BB) 32 --- > /mnt/sdb6/test_file: XX..YY AG (AA..BB) > 0: [0..7]: XX..YY AG (AA..BB) 8 > 1: [8..127]: XX..YY AG (AA..BB) 120 10000 > 2: [128..135]: XX..YY AG (AA..BB) 8 > 3: [136..247]: XX..YY AG (AA..BB) 112 10000 > 4: [248..255]: XX..YY AG (AA..BB) 8 Failures: 166 Failed 1 of 1 tests [root@inode xfstests]# uname -a Linux inode.lab.msp.redhat.com 2.6.23-0.71.rc2.fc8 #1 SMP Sat Aug 4 01:21:06 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux -Eric From owner-xfs@oss.sgi.com Tue Aug 7 18:43:35 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 18:43:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l781hSbm012164 for ; Tue, 7 Aug 2007 18:43:34 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA17432; Wed, 8 Aug 2007 11:43:27 +1000 Message-ID: <46B9203B.6050405@sgi.com> Date: Wed, 08 Aug 2007 11:45:31 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: PARTIAL TAKE 964111 - XFSQA 144 fails on i386 with TOT 26x_xfs kernel Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12493 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Date: Wed Aug 8 11:38:19 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/xfs-cmds Inspected by: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29347a xfstests/dmapi/src/suite1/cmd/print_event.c - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/suite1/print_event.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h - pv 964111, rv lachlan - terminate attribute name string From owner-xfs@oss.sgi.com Tue Aug 7 18:49:35 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 18:49:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l781nWbm013414 for ; Tue, 7 Aug 2007 18:49:34 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA17772; Wed, 8 Aug 2007 11:49:32 +1000 Message-ID: <46B921A8.1080102@sgi.com> Date: Wed, 08 Aug 2007 11:51:36 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: PARTIAL TAKE 966845 - XFSQA 168: test fails on i386 TOT 26x_xfs due to garbaged output Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12494 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Date: Wed Aug 8 11:38:19 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/xfs-cmds Inspected by: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29347a xfstests/dmapi/src/suite1/cmd/print_event.c - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/suite1/print_event.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h - pv 966845, rv lachlan - terminate attribute name string From owner-xfs@oss.sgi.com Tue Aug 7 19:43:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 19:43:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l782hCbm025043 for ; Tue, 7 Aug 2007 19:43:15 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA19182; Wed, 8 Aug 2007 12:43:11 +1000 Message-ID: <46B92E3B.7060908@sgi.com> Date: Wed, 08 Aug 2007 12:45:15 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: TAKE 968773 - minor fixes for XFS DMAPI tests Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12495 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Date: Wed Aug 8 12:41:15 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/xfs-cmds-patches Inspected by: vapo The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29348a xfstests/dmapi/src/suite2/src/dm_test_daemon.c - 1.4 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/suite2/src/dm_test_daemon.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.3&f=h xfstests/dmapi/src/suite1/cmd/print_event.c - 1.8 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/suite1/print_event.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.7&f=h xfstests/dmapi/src/simple/dm_getall_tokens.c - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/simple/dm_getall_tokens.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h xfstests/dmapi/src/common/lib/util.c - 1.5 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/dmapi/src/common/lib/util.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.4&f=h - pv 968773, author Chris Pascoe , rv vapo - minor fixes for XFS DMAPI tests From owner-xfs@oss.sgi.com Tue Aug 7 19:56:23 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 19:56:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l782uKbm028771 for ; Tue, 7 Aug 2007 19:56:22 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA20639; Wed, 8 Aug 2007 12:56:19 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l782uHeW54194245; Wed, 8 Aug 2007 12:56:18 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l782uG0M54136229; Wed, 8 Aug 2007 12:56:16 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 12:56:16 +1000 From: David Chinner To: Eric Sandeen Cc: xfs-oss Subject: Re: qa 166 failure on f8 kernel Message-ID: <20070808025615.GH52011508@sgi.com> References: <46B91EBA.10407@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46B91EBA.10407@sandeen.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12496 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Aug 07, 2007 at 08:39:06PM -0500, Eric Sandeen wrote: > Posting this just in case it rings any bells, though I plan to > investigate... > > [root@inode xfstests]# ./check 166 > FSTYP -- xfs (non-debug) > PLATFORM -- Linux/x86_64 inode 2.6.23-0.71.rc2.fc8 > MKFS_OPTIONS -- -f -bsize=4096 /dev/sdb6 > MOUNT_OPTIONS -- /dev/sdb6 /mnt/sdb6 > > 166 - output mismatch (see 166.out.bad) > 2,6c2,7 > < 0: [0..31]: XX..YY AG (AA..BB) 32 > < 1: [32..127]: XX..YY AG (AA..BB) 96 10000 > < 2: [128..159]: XX..YY AG (AA..BB) 32 > < 3: [160..223]: XX..YY AG (AA..BB) 64 10000 > < 4: [224..255]: XX..YY AG (AA..BB) 32 > --- > > /mnt/sdb6/test_file: XX..YY AG (AA..BB) > > 0: [0..7]: XX..YY AG (AA..BB) 8 > > 1: [8..127]: XX..YY AG (AA..BB) 120 10000 > > 2: [128..135]: XX..YY AG (AA..BB) 8 > > 3: [136..247]: XX..YY AG (AA..BB) 112 10000 > > 4: [248..255]: XX..YY AG (AA..BB) 8 When you post the failure, someone will say, "Duh, that's obvious". Well: Duh! That's obvious. ;) You've got 3x4k written blocks in the file which is *correct*. There's nothing wrong with the kernel code. It's just that the test is expecting 3x16k extents to be marked written. See the problem yet? mmap dirties entire pages. page size differs between platforms - ia64 = 16k, x86 = 4k - so the size of the extent allocated is different. Guess what platform I wrote the test on and use as my primary platform? The output needs better filtering, methinks. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Aug 7 19:58:47 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 19:58:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l782wjbm029428 for ; Tue, 7 Aug 2007 19:58:47 -0700 Received: from Liberator.local (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 958A318015183; Tue, 7 Aug 2007 21:58:49 -0500 (CDT) Message-ID: <46B9316A.40508@sandeen.net> Date: Tue, 07 Aug 2007 21:58:50 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> In-Reply-To: <20070808025615.GH52011508@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12497 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 David Chinner wrote: > On Tue, Aug 07, 2007 at 08:39:06PM -0500, Eric Sandeen wrote: >> Posting this just in case it rings any bells, though I plan to >> investigate... >> >> [root@inode xfstests]# ./check 166 >> FSTYP -- xfs (non-debug) >> PLATFORM -- Linux/x86_64 inode 2.6.23-0.71.rc2.fc8 >> MKFS_OPTIONS -- -f -bsize=4096 /dev/sdb6 >> MOUNT_OPTIONS -- /dev/sdb6 /mnt/sdb6 >> >> 166 - output mismatch (see 166.out.bad) >> 2,6c2,7 >> < 0: [0..31]: XX..YY AG (AA..BB) 32 >> < 1: [32..127]: XX..YY AG (AA..BB) 96 10000 >> < 2: [128..159]: XX..YY AG (AA..BB) 32 >> < 3: [160..223]: XX..YY AG (AA..BB) 64 10000 >> < 4: [224..255]: XX..YY AG (AA..BB) 32 >> --- >>> /mnt/sdb6/test_file: XX..YY AG (AA..BB) >>> 0: [0..7]: XX..YY AG (AA..BB) 8 >>> 1: [8..127]: XX..YY AG (AA..BB) 120 10000 >>> 2: [128..135]: XX..YY AG (AA..BB) 8 >>> 3: [136..247]: XX..YY AG (AA..BB) 112 10000 >>> 4: [248..255]: XX..YY AG (AA..BB) 8 > > When you post the failure, someone will say, "Duh, that's obvious". fine, fine ;-) > Well: Duh! That's obvious. ;) > > You've got 3x4k written blocks in the file which is *correct*. > There's nothing wrong with the kernel code. It's just that the test > is expecting 3x16k extents to be marked written. > > See the problem yet? > > mmap dirties entire pages. page size differs between platforms - > ia64 = 16k, x86 = 4k - so the size of the extent allocated is > different. Guess what platform I wrote the test on and use as my > primary platform? > > The output needs better filtering, methinks. yeah, figured it had something to do w/ the ia64 weenies when I saw the 32 vs. 8, factor of 4 ... fine, fine, my bad. :) Thanks, -Eric > Cheers, > > Dave. From owner-xfs@oss.sgi.com Tue Aug 7 21:08:29 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:08:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7848Nbm017415 for ; Tue, 7 Aug 2007 21:08:27 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA23530; Wed, 8 Aug 2007 14:08:08 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78486eW54190263; Wed, 8 Aug 2007 14:08:07 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78484UT54185838; Wed, 8 Aug 2007 14:08:04 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 14:08:04 +1000 From: David Chinner To: Eric Sandeen Cc: David Chinner , xfs-oss Subject: Re: qa 166 failure on f8 kernel Message-ID: <20070808040804.GJ52011508@sgi.com> References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46B9316A.40508@sandeen.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12498 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: > yeah, figured it had something to do w/ the ia64 weenies when I saw the > 32 vs. 8, factor of 4 ... fine, fine, my bad. :) No, not your bad. Mine if anyones because I wrote the test. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Aug 7 21:11:01 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:11:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_63,SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l784Axbm018436 for ; Tue, 7 Aug 2007 21:11:01 -0700 Received: from Liberator.local (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 50DB91807DEFF; Tue, 7 Aug 2007 23:11:04 -0500 (CDT) Message-ID: <46B94259.6060309@sandeen.net> Date: Tue, 07 Aug 2007 23:11:05 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> In-Reply-To: <20070808040804.GJ52011508@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12499 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 David Chinner wrote: > On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: > >> yeah, figured it had something to do w/ the ia64 weenies when I saw the >> 32 vs. 8, factor of 4 ... fine, fine, my bad. :) >> > > No, not your bad. Mine if anyones because I wrote the test. > > Cheers, > > Dave. > Well, I was going to look at it more closely before I sent it off :) What do you think of a patch like this, to munmap 16k chunks regardless of page size: --- src/unwritten_mmap.c.orig 2007-08-07 22:53:08.962031839 -0500 +++ src/unwritten_mmap.c 2007-08-07 23:02:05.939112618 -0500 @@ -12,6 +12,7 @@ */ int main(int argc, char **argv) { unsigned long long o; + int minsize; int fd, i; struct xfs_flock64 space; unsigned char *buf; @@ -23,6 +24,13 @@ errno = 0; o = strtoull(argv[1], NULL, 0); + + minsize = 3*16384; /* 3 ia64 pages */ + if (o < minsize) { + fprintf(stderr, "count must be at least %d\n", minsize); + exit(1); + } + if (errno) { perror("strtoull"); exit(errno); @@ -55,9 +63,9 @@ perror("mmap()"); exit(5); } else { + memset(buf, 0, 16384); + memset(buf+o/2, 0, 16384); + memset(buf+o-16384, 0, 16384); munmap(buf, o); } -Eric From owner-xfs@oss.sgi.com Tue Aug 7 21:15:45 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:15:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l784Fgbm020179 for ; Tue, 7 Aug 2007 21:15:44 -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 OAA23643; Wed, 8 Aug 2007 14:15:40 +1000 Date: Wed, 08 Aug 2007 14:19:00 +1000 To: "Eric Sandeen" , xfs-oss Subject: Re: qa 166 failure on f8 kernel From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 References: <46B91EBA.10407@sandeen.net> Message-ID: In-Reply-To: <46B91EBA.10407@sandeen.net> User-Agent: Opera Mail/9.10 (Win32) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 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 l784Fjbm020201 X-archive-position: 12500 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, 08 Aug 2007 11:39:06 +1000, Eric Sandeen wrote: > Posting this just in case it rings any bells, though I plan to > investigate... > > [root@inode xfstests]# ./check 166 > FSTYP -- xfs (non-debug) > PLATFORM -- Linux/x86_64 inode 2.6.23-0.71.rc2.fc8 > MKFS_OPTIONS -- -f -bsize=4096 /dev/sdb6 > MOUNT_OPTIONS -- /dev/sdb6 /mnt/sdb6 > > 166 - output mismatch (see 166.out.bad) > 2,6c2,7 > < 0: [0..31]: XX..YY AG (AA..BB) 32 > < 1: [32..127]: XX..YY AG (AA..BB) 96 10000 > < 2: [128..159]: XX..YY AG (AA..BB) 32 > < 3: [160..223]: XX..YY AG (AA..BB) 64 10000 > < 4: [224..255]: XX..YY AG (AA..BB) 32 > --- >> /mnt/sdb6/test_file: XX..YY AG (AA..BB) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I suspect this line is appearing in the output due to a number in the mountpoint. I think the _filter_blocks() is only extracting lines with numbers in it. >> 0: [0..7]: XX..YY AG (AA..BB) 8 >> 1: [8..127]: XX..YY AG (AA..BB) 120 10000 >> 2: [128..135]: XX..YY AG (AA..BB) 8 >> 3: [136..247]: XX..YY AG (AA..BB) 112 10000 >> 4: [248..255]: XX..YY AG (AA..BB) 8 > Failures: 166 > Failed 1 of 1 tests > [root@inode xfstests]# uname -a > Linux inode.lab.msp.redhat.com 2.6.23-0.71.rc2.fc8 #1 SMP Sat Aug 4 > 01:21:06 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux > > -Eric > > From owner-xfs@oss.sgi.com Tue Aug 7 21:16:38 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:16:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_63,SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l784Gbbm020786 for ; Tue, 7 Aug 2007 21:16:38 -0700 Received: from Liberator.local (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 341AD1807DF04; Tue, 7 Aug 2007 23:16:42 -0500 (CDT) Message-ID: <46B943AB.10807@sandeen.net> Date: Tue, 07 Aug 2007 23:16:43 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <46B94259.6060309@sandeen.net> In-Reply-To: <46B94259.6060309@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12501 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 Eric Sandeen wrote: > David Chinner wrote: > > >> On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: >> >> >>> yeah, figured it had something to do w/ the ia64 weenies when I saw the >>> 32 vs. 8, factor of 4 ... fine, fine, my bad. :) >>> >>> >> No, not your bad. Mine if anyones because I wrote the test. >> >> Cheers, >> >> Dave. >> >> > Well, I was going to look at it more closely before I sent it off :) > > What do you think of a patch like this, to munmap 16k chunks regardless > of page size: > Er, bad patch-ninja-boy, don't hand-edit :) --- src/unwritten_mmap.c.orig 2007-08-07 22:53:08.962031839 -0500 +++ src/unwritten_mmap.c 2007-08-07 23:04:14.230540957 -0500 @@ -12,6 +12,7 @@ */ int main(int argc, char **argv) { unsigned long long o; + int minsize; int fd, i; struct xfs_flock64 space; unsigned char *buf; @@ -23,6 +24,13 @@ errno = 0; o = strtoull(argv[1], NULL, 0); + + minsize = 3*16384; /* 3 ia64 pages */ + if (o < minsize) { + fprintf(stderr, "count must be at least %d\n", minsize); + exit(1); + } + if (errno) { perror("strtoull"); exit(errno); @@ -55,9 +63,9 @@ perror("mmap()"); exit(5); } else { - buf[o-1] = 0; - buf[o/2] = 0; - buf[0] = 0; + memset(buf, 0, 16384); + memset(buf+o/2, 0, 16384); + memset(buf+o-16384, 0, 16384); munmap(buf, o); } From owner-xfs@oss.sgi.com Tue Aug 7 21:18:07 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:18:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l784I5bm021705 for ; Tue, 7 Aug 2007 21:18:07 -0700 Received: from Liberator.local (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 9C5A51807DEFF; Tue, 7 Aug 2007 23:18:09 -0500 (CDT) Message-ID: <46B94402.5090801@sandeen.net> Date: Tue, 07 Aug 2007 23:18:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Barry Naujok CC: xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12502 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 Barry Naujok wrote: > On Wed, 08 Aug 2007 11:39:06 +1000, Eric Sandeen > wrote: > >> Posting this just in case it rings any bells, though I plan to >> investigate... >> >> [root@inode xfstests]# ./check 166 >> FSTYP -- xfs (non-debug) >> PLATFORM -- Linux/x86_64 inode 2.6.23-0.71.rc2.fc8 >> MKFS_OPTIONS -- -f -bsize=4096 /dev/sdb6 >> MOUNT_OPTIONS -- /dev/sdb6 /mnt/sdb6 >> >> 166 - output mismatch (see 166.out.bad) >> 2,6c2,7 >> < 0: [0..31]: XX..YY AG (AA..BB) 32 >> < 1: [32..127]: XX..YY AG (AA..BB) 96 10000 >> < 2: [128..159]: XX..YY AG (AA..BB) 32 >> < 3: [160..223]: XX..YY AG (AA..BB) 64 10000 >> < 4: [224..255]: XX..YY AG (AA..BB) 32 >> --- >>> /mnt/sdb6/test_file: XX..YY AG (AA..BB) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > I suspect this line is appearing in the output due to a number > in the mountpoint. I think the _filter_blocks() is only > extracting lines with numbers in it. Bingo. Yep, changing it to /mnt/foo, plus my change to the test, passes. thanks! -Eric From owner-xfs@oss.sgi.com Tue Aug 7 21:19:32 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:19:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l784JSbm022425 for ; Tue, 7 Aug 2007 21:19:31 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA23920; Wed, 8 Aug 2007 14:19:23 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l784JLeW54233522; Wed, 8 Aug 2007 14:19:22 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l784JK6f53277195; Wed, 8 Aug 2007 14:19:20 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 14:19:20 +1000 From: David Chinner To: Eric Sandeen Cc: David Chinner , xfs-oss Subject: Re: qa 166 failure on f8 kernel Message-ID: <20070808041920.GK52011508@sgi.com> References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <46B94259.6060309@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46B94259.6060309@sandeen.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12503 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Aug 07, 2007 at 11:11:05PM -0500, Eric Sandeen wrote: > David Chinner wrote: > > > On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: > > > >> yeah, figured it had something to do w/ the ia64 weenies when I saw the > >> 32 vs. 8, factor of 4 ... fine, fine, my bad. :) > >> > > > > No, not your bad. Mine if anyones because I wrote the test. > > > > Cheers, > > > > Dave. > > > Well, I was going to look at it more closely before I sent it off :) > > What do you think of a patch like this, to munmap 16k chunks regardless > of page size: That could be done, but will break on 64k page size machines ;) Perhaps the filter needs to use `getconf PAGE_SIZE` to filter the output down: ia64: % getconf PAGE_SIZE 16384 x86_64: % getconf PAGE_SIZE 4096 So the written extent sizes are output as a multiple of page size rather than basic blocks.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Aug 7 21:28:45 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:28:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l784Shbm025213 for ; Tue, 7 Aug 2007 21:28:45 -0700 Received: from Liberator.local (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 B7BA41807F9CC; Tue, 7 Aug 2007 23:28:47 -0500 (CDT) Message-ID: <46B94680.3070405@sandeen.net> Date: Tue, 07 Aug 2007 23:28:48 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <46B94259.6060309@sandeen.net> <20070808041920.GK52011508@sgi.com> In-Reply-To: <20070808041920.GK52011508@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12504 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 David Chinner wrote: > That could be done, but will break on 64k page size machines ;) > > Perhaps the filter needs to use `getconf PAGE_SIZE` to filter the > output down: > > ia64: > > % getconf PAGE_SIZE > 16384 > > x86_64: > > % getconf PAGE_SIZE > 4096 > > So the written extent sizes are output as a multiple of > page size rather than basic blocks.... yeah, computing all the numbers for the filter seemed nasty. Maybe just a dumbed-down filter that expects written unwritten written unwritten written would be sufficient for this test. --- 166.orig 2007-08-07 23:19:33.391317217 -0500 +++ 166 2007-08-07 23:21:11.111409407 -0500 @@ -31,9 +31,9 @@ { $AWK_PROG '/[0-9]/ { if ($7) - print $1, $2, "XX..YY", "AG", "(AA..BB)", $6, $7; + print $7 else - print $1, $2, "XX..YY", "AG", "(AA..BB)", $6; + print "no flags" }' } --- 166.out.orig 2007-08-07 23:21:25.299244961 -0500 +++ 166.out 2007-08-07 23:21:45.706131763 -0500 @@ -1,6 +1,6 @@ QA output created by 166 -0: [0..31]: XX..YY AG (AA..BB) 32 -1: [32..127]: XX..YY AG (AA..BB) 96 10000 -2: [128..159]: XX..YY AG (AA..BB) 32 -3: [160..223]: XX..YY AG (AA..BB) 64 10000 -4: [224..255]: XX..YY AG (AA..BB) 32 +no flags +10000 +no flags +10000 +no flags -Eric From owner-xfs@oss.sgi.com Tue Aug 7 21:54:29 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 21:54:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l784sPbm030830 for ; Tue, 7 Aug 2007 21:54:28 -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 OAA24637; Wed, 8 Aug 2007 14:54:21 +1000 To: "Eric Sandeen" , "David Chinner" Subject: Re: qa 166 failure on f8 kernel From: "Barry Naujok" Organization: SGI Cc: xfs-oss Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <46B94259.6060309@sandeen.net> <20070808041920.GK52011508@sgi.com> <46B94680.3070405@sandeen.net> Content-Transfer-Encoding: 7bit Date: Wed, 08 Aug 2007 14:57:55 +1000 Message-ID: In-Reply-To: <46B94680.3070405@sandeen.net> User-Agent: Opera Mail/9.10 (Win32) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12505 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, 08 Aug 2007 14:28:48 +1000, Eric Sandeen wrote: > David Chinner wrote: > >> That could be done, but will break on 64k page size machines ;) >> >> Perhaps the filter needs to use `getconf PAGE_SIZE` to filter the >> output down: >> >> ia64: >> >> % getconf PAGE_SIZE >> 16384 >> >> x86_64: >> >> % getconf PAGE_SIZE >> 4096 >> >> So the written extent sizes are output as a multiple of >> page size rather than basic blocks.... > > > yeah, computing all the numbers for the filter seemed nasty. > > Maybe just a dumbed-down filter that expects > > written > unwritten > written > unwritten > written > > would be sufficient for this test. > > --- 166.orig 2007-08-07 23:19:33.391317217 -0500 > +++ 166 2007-08-07 23:21:11.111409407 -0500 > @@ -31,9 +31,9 @@ > { > $AWK_PROG '/[0-9]/ { > if ($7) > - print $1, $2, "XX..YY", "AG", "(AA..BB)", $6, $7; > + print $7 > else > - print $1, $2, "XX..YY", "AG", "(AA..BB)", $6; > + print "no flags" > }' > } > > --- 166.out.orig 2007-08-07 23:21:25.299244961 -0500 > +++ 166.out 2007-08-07 23:21:45.706131763 -0500 > @@ -1,6 +1,6 @@ > QA output created by 166 > -0: [0..31]: XX..YY AG (AA..BB) 32 > -1: [32..127]: XX..YY AG (AA..BB) 96 10000 > -2: [128..159]: XX..YY AG (AA..BB) 32 > -3: [160..223]: XX..YY AG (AA..BB) 64 10000 > -4: [224..255]: XX..YY AG (AA..BB) 32 > +no flags > +10000 > +no flags > +10000 > +no flags > > > -Eric > Instead of "no flags", how about "00000" so the test doesn't break with xfsprogs 2.9.x and later. > From owner-xfs@oss.sgi.com Tue Aug 7 22:00:10 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 22:00:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78507bm032147 for ; Tue, 7 Aug 2007 22:00:10 -0700 Received: from Liberator.local (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 B20B41807DF04; Wed, 8 Aug 2007 00:00:11 -0500 (CDT) Message-ID: <46B94DDC.7040100@sandeen.net> Date: Wed, 08 Aug 2007 00:00:12 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Barry Naujok CC: David Chinner , xfs-oss Subject: Re: qa 166 failure on f8 kernel References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <46B94259.6060309@sandeen.net> <20070808041920.GK52011508@sgi.com> <46B94680.3070405@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12506 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 Barry Naujok wrote: > Instead of "no flags", how about "00000" so the test doesn't break > with xfsprogs 2.9.x and later. > > [root@inode xfstests]# rpm -q xfsprogs xfsprogs-2.9.3-1 I have that... but... whatever works :) -Eric From owner-xfs@oss.sgi.com Tue Aug 7 22:15:22 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 22:15:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from mail-gw2.sa.eol.hu (mail-gw2.sa.eol.hu [212.108.200.109]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l785FJbm002960 for ; Tue, 7 Aug 2007 22:15:22 -0700 Received: from dorka.pomaz.szeredi.hu (224-083.adsl.pool.ew.hu [193.226.224.83]) by mail-gw2.sa.eol.hu (mu) with ESMTP id l785FLgS024702; Wed, 8 Aug 2007 07:15:23 +0200 Received: from miko by dorka.pomaz.szeredi.hu with local (Exim 3.36 #1 (Debian)) id 1IIdsT-0001dn-00; Wed, 08 Aug 2007 07:14:37 +0200 To: akpm@linux-foundation.org CC: jlayton@redhat.com, codalist@telemann.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, reiserfs-devel@vger.kernel.org, zippel@linux-m68k.org, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, wli@holomorphy.com, joel.becker@oracle.com, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu In-reply-to: <20070807171501.e31c4a97.akpm@linux-foundation.org> (message from Andrew Morton on Tue, 7 Aug 2007 17:15:01 -0700) Subject: Re: [fuse-devel] [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> Message-Id: From: Miklos Szeredi Date: Wed, 08 Aug 2007 07:14:37 +0200 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12507 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs > >From a purely practical standpoint: it's a concern that all filesytems need > patching to continue to correctly function after this change. There might > be filesystems which you missed, and there are out-of-tree filesystems > which won't be updated. > > And I think the impact upon the out-of-tree filesystems would be fairly > severe: they quietly and subtly get their secutiry guarantees broken (I > think?) > > Is there any way in which we can prevent these problems? Say > > - rename something so that unconverted filesystems will reliably fail to > compile? Maybe renaming ATTR_MODE to ATTR_MODE_SET (changing it's value as well, so that binary stuff breaks visibly as well)? This would make sense, because we are changing what this attribute acually means. In the new code attr->ia_mode only contains the originally set mode, not the ones we've added to change the suid bits. Miklos From owner-xfs@oss.sgi.com Tue Aug 7 22:16:58 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 22:17:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l785Gvbm003434 for ; Tue, 7 Aug 2007 22:16:58 -0700 Received: from mtv-amer002e--3.americas.sgi.com (unknown [192.26.64.114]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id 14F6190898 for ; Tue, 7 Aug 2007 22:01:33 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: qa 166 failure on f8 kernel Date: Tue, 7 Aug 2007 21:13:15 -0700 Message-ID: In-Reply-To: <20070808025615.GH52011508@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: qa 166 failure on f8 kernel Thread-Index: AcfZZ8/+CsI7MncITCidZk+cUHULrAAClkhQ From: "Alex Elder" To: "David Chinner" , "Eric Sandeen" Cc: "xfs-oss" X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 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 l785Gwbm003440 X-archive-position: 12508 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: aelder@sgi.com Precedence: bulk X-list: xfs > From: xfs-bounce@oss.sgi.com > [mailto:xfs-bounce@oss.sgi.com]On Behalf Of > David Chinner > Sent: Tuesday, August 07, 2007 9:56 PM > To: Eric Sandeen > Cc: xfs-oss > Subject: Re: qa 166 failure on f8 kernel ... > mmap dirties entire pages. page size differs between platforms - > ia64 = 16k, x86 = 4k - so the size of the extent allocated is > different. Guess what platform I wrote the test on and use as my > primary platform? > > The output needs better filtering, methinks. Could the test be changed so the output is pagesize independent rather than filtering the output? Or maybe the test should use a buffer size that's the LCM of all supported page sizes. I'm not actually familiar with the test, so forgive me if I'm way off... -Alex From owner-xfs@oss.sgi.com Tue Aug 7 22:47:13 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 07 Aug 2007 22:47:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from postoffice.aconex.com (mail.app.aconex.com [203.89.192.138]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l785lBbm009371 for ; Tue, 7 Aug 2007 22:47:12 -0700 Received: from mail.aconex.com (castle.yarra.acx [192.168.3.3]) by postoffice.aconex.com (Postfix) with ESMTP id B1AD9120DDD2; Wed, 8 Aug 2007 15:47:14 +1000 (EST) Received: from 192.168.3.1 (proxying for 211.28.181.43) (SquirrelMail authenticated user nscott) by mail.aconex.com with HTTP; Wed, 8 Aug 2007 15:47:29 +1000 (EST) Message-ID: <37268.192.168.3.1.1186552049.squirrel@mail.aconex.com> In-Reply-To: References: Date: Wed, 8 Aug 2007 15:47:29 +1000 (EST) Subject: RE: qa 166 failure on f8 kernel From: nscott@aconex.com To: "Alex Elder" Cc: "David Chinner" , "Eric Sandeen" , "xfs-oss" User-Agent: SquirrelMail/1.4.8-4.el4.centos MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12509 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 >> From: xfs-bounce@oss.sgi.com >> [mailto:xfs-bounce@oss.sgi.com]On Behalf Of >> David Chinner >> Sent: Tuesday, August 07, 2007 9:56 PM >> To: Eric Sandeen >> Cc: xfs-oss >> Subject: Re: qa 166 failure on f8 kernel > ... >> mmap dirties entire pages. page size differs between platforms - >> ia64 = 16k, x86 = 4k - so the size of the extent allocated is >> different. Guess what platform I wrote the test on and use as my >> primary platform? >> >> The output needs better filtering, methinks. > > Could the test be changed so the output is pagesize independent > rather than filtering the output? Or maybe the test should > use a buffer size that's the LCM of all supported page sizes. > FWIW, xfs-cmds/xfstests/src/feature.c will tell you the page size (-s); with that you can accurately filter the output and not lose any info. cheers. -- Nathan From owner-xfs@oss.sgi.com Wed Aug 8 01:14:21 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 01:14:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l788EFbm011124 for ; Wed, 8 Aug 2007 01:14: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 SAA00573; Wed, 8 Aug 2007 18:14:14 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 4BF9458C1762; Wed, 8 Aug 2007 18:14:14 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 968837 - fix nasty quota hashtable allocation bug Message-Id: <20070808081414.4BF9458C1762@chook.melbourne.sgi.com> Date: Wed, 8 Aug 2007 18:14:14 +1000 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12510 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs fix nasty quota hashtable allocation bug This git mod: 77e4635ae191774526ed695482a151ac986f3806 converted to a "greedy" allocation interface, but for the quota hashtables it switched from allocating XFS_QM_HASHSIZE (nr of elements) xfs_dqhash_t's to allocating only XFS_QM_HASHSIZE *bytes* - quite a lot smaller! Then when we converted hsize "back" to nr of elements (the division line) hsize went to 0. This was leading to oopses when running any quota tests on the Fedora 8 test kernel, but the problem has been there for almost a year. Signed-off-by: Eric Sandeen Date: Wed Aug 8 18:13:50 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29354a fs/xfs/quota/xfs_qm.c - 1.52 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.52&r2=text&tr2=1.51&f=h - correct the quota hash allocation size so we allocate a hash the size we mean and not something a lot smaller. From owner-xfs@oss.sgi.com Wed Aug 8 03:40:23 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 03:40:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_HI autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78AeKbm022883 for ; Wed, 8 Aug 2007 03:40:22 -0700 Received: from Relay2.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 0A36D122A9 for ; Wed, 8 Aug 2007 12:40:25 +0200 (CEST) From: Andi Kleen Organization: SUSE Linux Products GmbH, Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) To: xfs@oss.sgi.com Subject: XFS thread inflation in 2.6.23rc Date: Wed, 8 Aug 2007 12:40:21 +0200 User-Agent: KMail/1.9.6 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081240.21548.ak@suse.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12511 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: xfs In 2.6.23rc I have a new kernel thread running from XFS: 30137 ? S< 0:00 [xfs_mru_cache] Is that one really needed? Can it be started only on demand when that MRU feature is used? Thanks, -Andi From owner-xfs@oss.sgi.com Wed Aug 8 05:14:08 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:14:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78CE3bm021823 for ; Wed, 8 Aug 2007 05:14:07 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id WAA07234; Wed, 8 Aug 2007 22:14:03 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78CE0eW54564834; Wed, 8 Aug 2007 22:14:01 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78CDxoH54624800; Wed, 8 Aug 2007 22:13:59 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 22:13:59 +1000 From: David Chinner To: Andi Kleen Cc: xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc Message-ID: <20070808121359.GP52011508@sgi.com> References: <200708081240.21548.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708081240.21548.ak@suse.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12512 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Aug 08, 2007 at 12:40:21PM +0200, Andi Kleen wrote: > > In 2.6.23rc I have a new kernel thread running from XFS: > > 30137 ? S< 0:00 [xfs_mru_cache] > > Is that one really needed? Can it be started only on demand when that MRU > feature is used? It uses a single threaded workqueue for reaping objects and the thread comes along with that. Creating the workqueue on demand would require creating a kernel thread inside a transaction and that's not some thing we want to do. It can't really be put into an existing thread/workqueue because of deadlock problems which is why it has it's own workqueue.... Besides, what's the point of having nice constructs like dedicated workqueues if people complain when they get used to solve problems? Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 8 05:22:13 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:22:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.0-pre1-r499012 Received: from mx2.suse.de (ns2.suse.de [195.135.220.15]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78CMBbm024435 for ; Wed, 8 Aug 2007 05:22:13 -0700 Received: from Relay2.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 mx2.suse.de (Postfix) with ESMTP id C042B21967; Wed, 8 Aug 2007 14:22:13 +0200 (CEST) From: Andi Kleen Organization: SUSE Linux Products GmbH, Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) To: David Chinner Subject: Re: XFS thread inflation in 2.6.23rc Date: Wed, 8 Aug 2007 14:22:10 +0200 User-Agent: KMail/1.9.6 Cc: xfs@oss.sgi.com References: <200708081240.21548.ak@suse.de> <20070808121359.GP52011508@sgi.com> In-Reply-To: <20070808121359.GP52011508@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081422.10373.ak@suse.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12513 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: xfs On Wednesday 08 August 2007 14:13:59 David Chinner wrote: > On Wed, Aug 08, 2007 at 12:40:21PM +0200, Andi Kleen wrote: > > > > In 2.6.23rc I have a new kernel thread running from XFS: > > > > 30137 ? S< 0:00 [xfs_mru_cache] > > > > Is that one really needed? Can it be started only on demand when that MRU > > feature is used? > > It uses a single threaded workqueue for reaping objects and the thread comes > along with that. Creating the workqueue on demand would require creating a > kernel thread inside a transaction and that's not some thing we want to do. Why not? I can't think of any possible problem except memory allocation recursion, but even that should be handled. > Besides, what's the point of having nice constructs like dedicated > workqueues It's a resource that shouldn't be overused. Especially for such a obscure feature -- i remember reviewing your rationale for the MRU cache and the probability of this applying to 99.9+% of users ever is pretty small. If you insist adding such things make them as least as unobtrusive as possible. > if people complain when they get used to solve problems? Does XFS really need that many threads? Seems doubtful to me. Ok part of the problem is that the workqueues are a little dumb. e.g. it's highly doubtful per SMT thread workqueues really make any sense. It would be probably enough to have one per socket or one per node. But that's a separate issue from just gratuitously adding new ones. -Andi From owner-xfs@oss.sgi.com Wed Aug 8 05:23:34 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:23:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78CNWbm025004 for ; Wed, 8 Aug 2007 05:23:34 -0700 Received: from dhcp-190-24.of.teamix.net (blackhole.teamix.net [194.150.191.251]) by mail.lichtvoll.de (Postfix) with ESMTP id 334245AD96 for ; Wed, 8 Aug 2007 14:27:39 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Impact of atime updates on XFS Date: Wed, 8 Aug 2007 14:23:34 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081423.34330.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12514 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 Hello! Today, I read about the impact of atime updates on ext3 and possible approaches on how to reduce that impact by using relatime, a modified version of relatime - Ingo Molnar posted a patch - or two different states of dirty inodes, atime dirty inodes which do not need to be flushed soon and dirty inodes with other changes which should be flushed soon[1]. What would be the impact of atime versus noatime on XFS? What is the recommended setting for XFS? Are there any plans to implement relatime logic - maybe even the improved one by Ingo Molnar - into XFS? I just remounted my partitions on the notebook and my workstation with noatime for testing and I have the feeling that it indeed does help. What are experiences of others? [1] http://kerneltrap.org/node/14148 Regards, -- 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 8 05:30:54 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:30:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_12 autolearn=no version=3.2.0-pre1-r499012 Received: from rproxy.teamix.net (team.teamix.net [194.150.191.72]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78CUqbm027228 for ; Wed, 8 Aug 2007 05:30:54 -0700 Received: from mango.of.teamix.net (unknown [172.21.123.1]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id 64A8347E4E for ; Wed, 8 Aug 2007 12:07:14 +0000 (UTC) From: Martin Steigerwald Organization: team(ix) GmbH To: xfs@oss.sgi.com Subject: Impact of atime updates on XFS Date: Wed, 8 Aug 2007 14:07:51 +0200 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6672721.czGhctzodD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200708081408.01817.ms@teamix.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12515 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs --nextPart6672721.czGhctzodD Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello! Today, I read about the impact of atime updates on ext3 and possible=20 approaches on how to reduce that impact by using relatime, a modified versi= on=20 of relatime - Ingo Molnar posted a patch - or two different states of dirty= =20 inodes, atime dirty inodes which do not need to be flushed soon and dirty= =20 inodes with other changes which should be flushed soon[1]. What would be the impact of atime versus noatime on XFS? What is the=20 recommended setting for XFS? Are there any plans to implement relatime=20 logic - maybe even the improved one by Ingo Molnar - into XFS? I just remounted my partitions on the notebook and my workstation with noat= ime=20 for testing and I have the feeling that it indeed does help. [1] http://kerneltrap.org/node/14148 Regards, --=20 Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 --nextPart6672721.czGhctzodD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGubIhHhDFkwOZrpARAgoYAJ91rpXXQFtBChdWm/ph9o5LhF1G/wCfazLx McgykjdGegfwbP7FMAYzZL0= =6q23 -----END PGP SIGNATURE----- --nextPart6672721.czGhctzodD-- From owner-xfs@oss.sgi.com Wed Aug 8 05:30:54 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:30:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_12 autolearn=no version=3.2.0-pre1-r499012 Received: from rproxy.teamix.net (team.teamix.net [194.150.191.72]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78CUqbm027227 for ; Wed, 8 Aug 2007 05:30:54 -0700 Received: from mango.of.teamix.net (unknown [172.21.123.1]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id 38F7547E4F for ; Wed, 8 Aug 2007 12:11:57 +0000 (UTC) From: Martin Steigerwald Organization: team(ix) GmbH To: xfs@oss.sgi.com Subject: Impact of atime updates on XFS User-Agent: KMail/1.9.5 MIME-Version: 1.0 X-UID: 1992 X-Length: 1965 Date: Wed, 8 Aug 2007 14:12:47 +0200 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081412.47772.ms@teamix.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12516 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs Hello! Today, I read about the impact of atime updates on ext3 and possible approaches on how to reduce that impact by using relatime, a modified version of relatime - Ingo Molnar posted a patch - or two different states of dirty inodes, atime dirty inodes which do not need to be flushed soon and dirty inodes with other changes which should be flushed soon[1]. What would be the impact of atime versus noatime on XFS? What is the recommended setting for XFS? Are there any plans to implement relatime logic - maybe even the improved one by Ingo Molnar - into XFS? I just remounted my partitions on the notebook and my workstation with noatime for testing and I have the feeling that it indeed does help. [1] http://kerneltrap.org/node/14148 Regards, -- Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 From owner-xfs@oss.sgi.com Wed Aug 8 05:56:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 05:56:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78Cu8bm002902 for ; Wed, 8 Aug 2007 05:56:11 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l78CsaLM029178; Wed, 8 Aug 2007 08:54:36 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l78CsaeP009617; Wed, 8 Aug 2007 08:54:36 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l78CsZ03013302; Wed, 8 Aug 2007 08:54:35 -0400 Date: Wed, 8 Aug 2007 08:54:35 -0400 From: Jeff Layton To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070808085435.722f2b10.jlayton@redhat.com> In-Reply-To: <20070807171501.e31c4a97.akpm@linux-foundation.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12517 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 7 Aug 2007 17:15:01 -0700 Andrew Morton wrote: > On Mon, 6 Aug 2007 09:54:03 -0400 > Jeff Layton wrote: > > > Apologies for the resend, but the original sending had the date in the > > email header and it caused some of these to bounce... > > > > ( Please consider trimming the Cc list if discussing some aspect of this > > that doesn't concern everyone.) > > > > When an unprivileged process attempts to modify a file that has the > > setuid or setgid bits set, the VFS will attempt to clear these bits. The > > VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid > > mask, and then call notify_change to clear these bits and set the mode > > accordingly. > > > > With a networked filesystem (NFS in particular but most likely others), > > the client machine may not have credentials that allow for the clearing > > of these bits. In some situations, this can lead to file corruption, or > > to an operation failing outright because the setattr fails. > > > > In this situation, we'd like to just leave the handling of this to > > the server and ignore these bits. The problem is that by the time > > nfs_setattr is called, the VFS has already reinterpreted the ATTR_KILL_* > > bits into a mode change. We can't fix this in the filesystems where > > this is a problem, as doing so would leave us having to second-guess > > what the VFS wants us to do. So we need to change it so that filesystems > > have more flexibility in how to interpret the ATTR_KILL_* bits. > > > > The first patch in the following patchset moves this logic into a helper > > function, and then only calls this helper function for inodes that do > > not have a setattr operation defined. The subsequent patches fix up > > individual filesystem setattr functions to call this helper function. > > > > The upshot of this is that with this change, filesystems that define > > a setattr inode operation are now responsible for handling the ATTR_KILL > > bits as well. They can trivially do so by calling the helper, but they > > must do so. > > > > Some of the follow-on patches may not be strictly necessary, but I > > decided that it was better to take the conservative approach and call > > the helper when I wasn't sure. I've tried to CC the maintainers > > for the individual filesystems as well where I could find them, > > please let me know if there are others who should be informed. > > > > Comments and suggestions appreciated... > > > > From a purely practical standpoint: it's a concern that all filesytems need > patching to continue to correctly function after this change. There might > be filesystems which you missed, and there are out-of-tree filesystems > which won't be updated. > > And I think the impact upon the out-of-tree filesystems would be fairly > severe: they quietly and subtly get their secutiry guarantees broken (I > think?) > Yep. Any filesystem that declares a setattr op will have to deal with the ATTR_KILL_S* flags themselves. The breakage will be silent too. > Is there any way in which we can prevent these problems? Say > > - rename something so that unconverted filesystems will reliably fail to > compile? > I suppose we could rename the .setattr inode operation to something else, but then we'll be stuck with it for at least a while. That seems sort of kludgey too... > - leave existing filesystems alone, but add a new > inode_operations.setattr_jeff, which the networked filesytems can > implement, and teach core vfs to call setattr_jeff in preference to > setattr? > > Something else? There's also the approach suggested by Miklos: Add a new inode flag that tells notify_change not to convert ATTR_KILL_S* flags into a mode change. Basically, allow filesystems to "opt out" of that behavior. I'd definitly pick that over a new inode op. That would also allow the default case be for the VFS to continue handling these flags. Everything would continue to work but filesystems that need to handle these flags differently would be able to do so. Thoughts? -- Jeff Layton From owner-xfs@oss.sgi.com Wed Aug 8 06:14:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 06:14:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78DE7bm008349 for ; Wed, 8 Aug 2007 06:14:09 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id XAA09308; Wed, 8 Aug 2007 23:14:07 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78DE5eW54573008; Wed, 8 Aug 2007 23:14:06 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78DE4bN54739235; Wed, 8 Aug 2007 23:14:04 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 23:14:04 +1000 From: David Chinner To: Andi Kleen Cc: xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc Message-ID: <20070808131404.GQ52011508@sgi.com> References: <200708081240.21548.ak@suse.de> <20070808121359.GP52011508@sgi.com> <200708081422.10373.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708081422.10373.ak@suse.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12518 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Aug 08, 2007 at 02:22:10PM +0200, Andi Kleen wrote: > On Wednesday 08 August 2007 14:13:59 David Chinner wrote: > > On Wed, Aug 08, 2007 at 12:40:21PM +0200, Andi Kleen wrote: > > > > > > In 2.6.23rc I have a new kernel thread running from XFS: > > > > > > 30137 ? S< 0:00 [xfs_mru_cache] > > > > > > Is that one really needed? Can it be started only on demand when that MRU > > > feature is used? > > > > It uses a single threaded workqueue for reaping objects and the thread comes > > along with that. Creating the workqueue on demand would require creating a > > kernel thread inside a transaction and that's not some thing we want to do. > > Why not? I can't think of any possible problem except memory allocation > recursion, but even that should be handled. Memory allocation failure + dirty transaction == filesystem shutdown. Bad, bad, bad, bad. > > Besides, what's the point of having nice constructs like dedicated > > workqueues > > It's a resource that shouldn't be overused. A workqueue + thread uses, what, 10-15k of memory? That's the cost of about 10 cached inodes. It is insignificant... > Especially for such a obscure feature -- i remember reviewing your > rationale for the MRU cache and the probability of this applying > to 99.9+% of users ever is pretty small. If you insist adding such > things make them as least as unobtrusive as possible. Sure, it was written for a small market, but it's useful for other workloads. e.g. got a heavy tmp file load? Mark /tmp as a filestream directory and all your temp files end up in one location on disk and don't pollute and fragment everything else. Got a PVR that records multiple streams at once? I wouldn't reject this out of hand as not useful. It was created for the specific purpose of workload isolation and that can be used in many different ways.... > > if people complain when they get used to solve problems? > > Does XFS really need that many threads? Seems doubtful to me. XFS is much more threaded than any other linux filesystem. It does lots of stuff asynchronously and that's where the threads and workqueues come in. They fit in very closely with the nature of XFS which is to do as much stuff concurrently as possible on as many CPUs as possible. Hmmm. I guess you are really not going to like the patch I have that moves the AIL pushing to a new thread to solve some of scalability issues in the transaction subsystem...... > Ok part of the problem is that the workqueues are a little dumb. > e.g. it's highly doubtful per SMT thread workqueues really make > any sense. It would be probably enough to have one per socket or > one per node. Agreed, but that is a workqueue implementation detail, not a reason for preventing ppl from using workqueues. > But that's a separate issue from just gratuitously adding new ones. Call it what you will. Threads and workqueues are there to be used and they cost very little for the flexibility and concurrency they provide us. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 8 06:17:23 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 06:17:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78DHHbm010303 for ; Wed, 8 Aug 2007 06:17:21 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id XAA09531; Wed, 8 Aug 2007 23:17:17 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78DHFeW54677942; Wed, 8 Aug 2007 23:17:15 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78DHDG854739979; Wed, 8 Aug 2007 23:17:13 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 8 Aug 2007 23:17:13 +1000 From: David Chinner To: Christoph Hellwig Cc: David Chinner , Eric Sandeen , xfs-oss Subject: Re: qa 166 failure on f8 kernel Message-ID: <20070808131713.GR52011508@sgi.com> References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> <20070808131319.GA11451@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070808131319.GA11451@infradead.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12519 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Aug 08, 2007 at 02:13:19PM +0100, Christoph Hellwig wrote: > On Wed, Aug 08, 2007 at 02:08:04PM +1000, David Chinner wrote: > > On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: > > > yeah, figured it had something to do w/ the ia64 weenies when I saw the > > > 32 vs. 8, factor of 4 ... fine, fine, my bad. :) > > > > No, not your bad. Mine if anyones because I wrote the test. > > Ia64 supports 4k, 8k, 16k and 64k base pagesize. Time to add a little > script to make the pagesize random for your kernel builds? Interesting idea. Definitely worth considering for the randomised mkfs/mount option config QA runs we already do.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 8 06:26:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 06:26:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-7.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78DQ5bm013309 for ; Wed, 8 Aug 2007 06:26:08 -0700 Received: from Relay2.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 68715124CE; Wed, 8 Aug 2007 15:26:09 +0200 (CEST) From: Andi Kleen Organization: SUSE Linux Products GmbH, Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) To: David Chinner Subject: Re: XFS thread inflation in 2.6.23rc Date: Wed, 8 Aug 2007 15:26:06 +0200 User-Agent: KMail/1.9.6 Cc: xfs@oss.sgi.com References: <200708081240.21548.ak@suse.de> <200708081422.10373.ak@suse.de> <20070808131404.GQ52011508@sgi.com> In-Reply-To: <20070808131404.GQ52011508@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081526.06860.ak@suse.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12520 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: xfs On Wednesday 08 August 2007 15:14:04 David Chinner wrote: > Memory allocation failure + dirty transaction == filesystem shutdown. You mean if the workqueue creation would fail? Surely not having the MRU cache is not a catastrophe and would allow the transaction to commit anyways? The other alternative would be to start it when a directory with the flag is first seen. That should be before any transactions. The other thing is that it would be nasty to switch do_fork to use GFP_NOFS, but I doubt that's really needed. > > > Besides, what's the point of having nice constructs like dedicated > > > workqueues > > > > It's a resource that shouldn't be overused. > > A workqueue + thread uses, what, 10-15k of memory? That's the cost of about > 10 cached inodes. It is insignificant... A little bloat here and a little bloat there and soon we're talking about serious memory. e.g. on a dual core box in a standard configuration we're going towards ~50 kernel threads out of the box now and that's just too much IMNSHO. Given there are other really bad wastes of memory (don't get me started on some of the hash tables), but it's not totally insignificant. Threads also have some CPU costs even when sleeping, e.g. there is still code which walks all threads to do various things. > Hmmm. I guess you are really not going to like the patch I > have that moves the AIL pushing to a new thread to solve > some of scalability issues in the transaction subsystem...... Per CPU or single? If the later definitely the workqueues would need to be fixed first. -Andi From owner-xfs@oss.sgi.com Wed Aug 8 06:29:01 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 06:29:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78DSvbm014427 for ; Wed, 8 Aug 2007 06:29:00 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IIlLj-0003AC-HQ; Wed, 08 Aug 2007 14:13:19 +0100 Date: Wed, 8 Aug 2007 14:13:19 +0100 From: Christoph Hellwig To: David Chinner Cc: Eric Sandeen , xfs-oss Subject: Re: qa 166 failure on f8 kernel Message-ID: <20070808131319.GA11451@infradead.org> References: <46B91EBA.10407@sandeen.net> <20070808025615.GH52011508@sgi.com> <46B9316A.40508@sandeen.net> <20070808040804.GJ52011508@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070808040804.GJ52011508@sgi.com> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12521 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 08, 2007 at 02:08:04PM +1000, David Chinner wrote: > On Tue, Aug 07, 2007 at 09:58:50PM -0500, Eric Sandeen wrote: > > yeah, figured it had something to do w/ the ia64 weenies when I saw the > > 32 vs. 8, factor of 4 ... fine, fine, my bad. :) > > No, not your bad. Mine if anyones because I wrote the test. Ia64 supports 4k, 8k, 16k and 64k base pagesize. Time to add a little script to make the pagesize random for your kernel builds? From owner-xfs@oss.sgi.com Wed Aug 8 06:56:38 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 06:56:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78Duabm022139 for ; Wed, 8 Aug 2007 06:56:37 -0700 Received: from dhcp-190-24.of.teamix.net (blackhole.teamix.net [194.150.191.251]) by mail.lichtvoll.de (Postfix) with ESMTP id 93A155AD96 for ; Wed, 8 Aug 2007 16:00:45 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Re: Impact of atime updates on XFS Date: Wed, 8 Aug 2007 15:56:40 +0200 User-Agent: KMail/1.9.7 References: <200708081423.34330.Martin@lichtvoll.de> (sfid-20070808_143744_321805_8011EA5B) In-Reply-To: <200708081423.34330.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708081556.40222.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12522 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 Sorry for three of these... I should have exercised more patience. Well at least the spamfilter lets my mails through again... -- 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 8 09:09:29 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 09:09:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53, J_CHICKENPOX_63,SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78G9Sbm028949 for ; Wed, 8 Aug 2007 09:09:29 -0700 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 66DEB1807E35C; Wed, 8 Aug 2007 11:09:32 -0500 (CDT) Message-ID: <46B9EABD.9010901@sandeen.net> Date: Wed, 08 Aug 2007 11:09:33 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: James Pearson CC: xfs@oss.sgi.com, James Braid Subject: Re: New CentOS4/RHEL4-compatible xfs module rpms References: <46B9E98D.9070401@moving-picture.com> In-Reply-To: <46B9E98D.9070401@moving-picture.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12523 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 James Pearson wrote: >>> That's odd. You have the module on the server, exporting an xfs >>> filesystem, and you're getting permission denied on the client? >> Yep. And rmmod'ing the updated XFS module and insmod'ing the older >> module makes it work again. > > The 'stock' RHEL4/CentOS4 kernels don't have xfs modules - so, I guess > you have rebuilt your kernel with the XFS code that is there by default? > > If this is the case, then this _may be_ the cause of the problem ... the > updated xfs module code uses any existing XFS configs in the kernel you > are building against - the Makefile states: > > # Set up our config. > # > # If the kernel already has an XFS config, use it. > # Else if config.xfs is here, use it for our config. Otherwise, > # Else default to only CONFIG_XFS_FS=m (simplest config) > > The problem is that the 'stock' 2.6.9 kernel doesn't define (or use) > CONFIG_XFS_EXPORT - but the updated xfs module code requires this to > allow NFS exports of a XFS file system ... > > So my guess is that your re-built updated xfs modules don't use > CONFIG_XFS_EXPORT > > I guess with a bit of hacking to the Makefile, you could force > 'CONFIG_XFS_EXPORT=y' to be added - you might even be able to do this > via the rpmbuild command line ... although I don't know how. Ah, that may well be it. yeah, the rpm needs to set its own config options since the centos kernel has no xfs config. (Sorry, I just haven't had time to look into it yet) - but I bet you're right that setting the config option in the makefile in the rpm will fix things right up! -Eric From owner-xfs@oss.sgi.com Wed Aug 8 09:22:37 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 09:22:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_50,J_CHICKENPOX_53, J_CHICKENPOX_63 autolearn=no version=3.2.0-pre1-r499012 Received: from moving-picture.com (mpc-26.sohonet.co.uk [193.203.82.251]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78GMYbm000519 for ; Wed, 8 Aug 2007 09:22:36 -0700 Received: from minion.mpc.local ([172.16.11.112]:37937 helo=moving-picture.com) by moving-picture.com with esmtp (Exim 4.43) id 1IIo1N-00048A-Lv; Wed, 08 Aug 2007 17:04:29 +0100 Message-ID: <46B9E98D.9070401@moving-picture.com> Date: Wed, 08 Aug 2007 17:04:29 +0100 From: James Pearson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040524 X-Accept-Language: en-us, en MIME-Version: 1.0 To: xfs@oss.sgi.com, James Braid CC: Eric Sandeen Subject: Re: New CentOS4/RHEL4-compatible xfs module rpms Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Disclaimer: This email and any attachments are confidential, may be legally X-Disclaimer: privileged and intended solely for the use of addressee. If you X-Disclaimer: are not the intended recipient of this message, any disclosure, X-Disclaimer: copying, distribution or any action taken in reliance on it is X-Disclaimer: strictly prohibited and may be unlawful. If you have received X-Disclaimer: this message in error, please notify the sender and delete all X-Disclaimer: copies from your system. X-Disclaimer: X-Disclaimer: Email may be susceptible to data corruption, interception and X-Disclaimer: unauthorised amendment, and we do not accept liability for any X-Disclaimer: such corruption, interception or amendment or the consequences X-Disclaimer: thereof. X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12524 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: james-p@moving-picture.com Precedence: bulk X-list: xfs >> That's odd. You have the module on the server, exporting an xfs >> filesystem, and you're getting permission denied on the client? > > Yep. And rmmod'ing the updated XFS module and insmod'ing the older > module makes it work again. The 'stock' RHEL4/CentOS4 kernels don't have xfs modules - so, I guess you have rebuilt your kernel with the XFS code that is there by default? If this is the case, then this _may be_ the cause of the problem ... the updated xfs module code uses any existing XFS configs in the kernel you are building against - the Makefile states: # Set up our config. # # If the kernel already has an XFS config, use it. # Else if config.xfs is here, use it for our config. Otherwise, # Else default to only CONFIG_XFS_FS=m (simplest config) The problem is that the 'stock' 2.6.9 kernel doesn't define (or use) CONFIG_XFS_EXPORT - but the updated xfs module code requires this to allow NFS exports of a XFS file system ... So my guess is that your re-built updated xfs modules don't use CONFIG_XFS_EXPORT I guess with a bit of hacking to the Makefile, you could force 'CONFIG_XFS_EXPORT=y' to be added - you might even be able to do this via the rpmbuild command line ... although I don't know how. James Pearson From owner-xfs@oss.sgi.com Wed Aug 8 09:50:52 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 09:51:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from smtp2.linux-foundation.org (smtp2.linux-foundation.org [207.189.120.14]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78Gombm007329 for ; Wed, 8 Aug 2007 09:50:51 -0700 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [207.189.120.55]) by smtp2.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id l78Gn02f020740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Aug 2007 09:49:01 -0700 Received: from box (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id l78GmrP8015532; Wed, 8 Aug 2007 09:48:53 -0700 Date: Wed, 8 Aug 2007 09:48:53 -0700 From: Andrew Morton To: Jeff Layton Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070808094853.8c27450c.akpm@linux-foundation.org> In-Reply-To: <20070808085435.722f2b10.jlayton@redhat.com> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <20070808085435.722f2b10.jlayton@redhat.com> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.184 $ X-Scanned-By: MIMEDefang 2.53 on 207.189.120.14 X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12525 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, 8 Aug 2007 08:54:35 -0400 Jeff Layton wrote: > On Tue, 7 Aug 2007 17:15:01 -0700 > Andrew Morton wrote: > > > On Mon, 6 Aug 2007 09:54:03 -0400 > > Jeff Layton wrote: > > > > Is there any way in which we can prevent these problems? Say > > > > - rename something so that unconverted filesystems will reliably fail to > > compile? > > > > I suppose we could rename the .setattr inode operation to something > else, but then we'll be stuck with it for at least a while. That seems > sort of kludgey too... Sure. We're changing the required behaviour of .setattr. Changing its name is a fine and reasonably reliable way to communicate that fact. > > - leave existing filesystems alone, but add a new > > inode_operations.setattr_jeff, which the networked filesytems can > > implement, and teach core vfs to call setattr_jeff in preference to > > setattr? > > > > Something else? > > There's also the approach suggested by Miklos: Add a new inode flag that > tells notify_change not to convert ATTR_KILL_S* flags into a mode > change. Basically, allow filesystems to "opt out" of that behavior. > > I'd definitly pick that over a new inode op. That would also allow the > default case be for the VFS to continue handling these flags. > Everything would continue to work but filesystems that need to handle > these flags differently would be able to do so. > We should opt for whatever produces the best end state in the kernel tree. ie: if it takes more work and a larger patch to create a better result, let's go for the better result. We merge large patches all the time. We prefer to smash through, get it right whatever the transient cost. But quietly making out-of-tree filesystems less secure is a pretty high cost. I'm suspecting that adding more flags and some code to test them purely to minimise the size of the patch and to retain compatibility with the old .setattr is not a good tradeoff, given that we'd carry the flags and tests for evermore. So I'd suggest s/setattr/something_else/g. From owner-xfs@oss.sgi.com Wed Aug 8 13:29:00 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 13:29:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l78KSvbm030959 for ; Wed, 8 Aug 2007 13:28:59 -0700 Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id F0A11180E1C5F; Wed, 8 Aug 2007 22:05:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id E84371C012256; Wed, 8 Aug 2007 22:05:13 +0200 (CEST) Date: Wed, 8 Aug 2007 22:05:13 +0200 (CEST) From: Jan Engelhardt To: Andrew Morton cc: Jeff Layton , codalist@TELEMANN.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, reiserfs-devel@vger.kernel.org, zippel@linux-m68k.org, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, wli@holomorphy.com, joel.becker@oracle.com, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu Subject: Re: [fuse-devel] [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) In-Reply-To: <20070808094853.8c27450c.akpm@linux-foundation.org> Message-ID: References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <20070808085435.722f2b10.jlayton@redhat.com> <20070808094853.8c27450c.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12526 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@computergmbh.de Precedence: bulk X-list: xfs On Aug 8 2007 09:48, Andrew Morton wrote: >> > On Mon, 6 Aug 2007 09:54:03 -0400 >> > Jeff Layton wrote: >> > >> > Is there any way in which we can prevent these problems? Say >> > >> > - rename something so that unconverted filesystems will reliably fail to >> > compile? >> > >> >> I suppose we could rename the .setattr inode operation to something >> else, but then we'll be stuck with it for at least a while. That seems >> sort of kludgey too... > >Sure. We're changing the required behaviour of .setattr. Changing its >name is a fine and reasonably reliable way to communicate that fact. Maybe ->chattr/->chgattr? Jan -- From owner-xfs@oss.sgi.com Wed Aug 8 16:08:46 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:08:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_40,J_CHICKENPOX_43 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78N8cbm010542 for ; Wed, 8 Aug 2007 16:08:43 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA27837; Thu, 9 Aug 2007 09:08:38 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78N8beW55615922; Thu, 9 Aug 2007 09:08:38 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78N8arx55484114; Thu, 9 Aug 2007 09:08:36 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:08:36 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 1 of 4] Convert inode hash chains to radix trees Message-ID: <20070808230836.GP12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12528 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Convert the inode cache hash to a radix tree. A radix tree has been chosen to replace the hash because of a neat alignment of XFS inode structures and the kernel radix tree fanout. XFS allocates inodes in clusters of 64 inodes and the radix tree keeps 64 sequential entries per node. That means all fo the inodes in a cluster will always sit in the same node of the radix tree. A single radix tree with a read/write lock does not provide enough parallelism to prevent performance regressions on multi-processor machines, so we hash the inode clusters into different radix trees each with their own read/write lock. The default is to create (2*ncpus)-1 radix trees up to a maximum of 15. The ihashsize mount option is still present, but it's mostly irrelevant now. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 321 +++++++++++++++++++++-------------------------------- fs/xfs/xfs_inode.c | 5 fs/xfs/xfs_inode.h | 8 - fs/xfs/xfsidbg.c | 6 4 files changed, 136 insertions(+), 204 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2007-01-31 13:26:32.636232335 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2007-01-31 13:55:37.117047088 +1100 @@ -49,25 +49,24 @@ void xfs_ihash_init(xfs_mount_t *mp) { - __uint64_t icount; uint i; - if (!mp->m_ihsize) { - icount = mp->m_maxicount ? mp->m_maxicount : - (mp->m_sb.sb_dblocks << mp->m_sb.sb_inopblog); - mp->m_ihsize = 1 << max_t(uint, 8, - (xfs_highbit64(icount) + 1) / 2); - mp->m_ihsize = min_t(uint, mp->m_ihsize, - (64 * NBPP) / sizeof(xfs_ihash_t)); + if (!mp->m_ihsize || mp->m_ihsize > 128) { + /* default to (2*cpus) - 1 or 15. */ + mp->m_ihsize = (2 * num_online_cpus()) - 1; + mp->m_ihsize = min_t(size_t, 15, mp->m_ihsize); + printk("mp->m_ihsize %ld\n", mp->m_ihsize); } - mp->m_ihash = kmem_zalloc_greedy(&mp->m_ihsize, + mp->m_ihash = kmem_zalloc_greedy((size_t *)&mp->m_ihsize, NBPC * sizeof(xfs_ihash_t), mp->m_ihsize * sizeof(xfs_ihash_t), KM_SLEEP | KM_MAYFAIL | KM_LARGE); mp->m_ihsize /= sizeof(xfs_ihash_t); - for (i = 0; i < mp->m_ihsize; i++) + for (i = 0; i < mp->m_ihsize; i++) { rwlock_init(&(mp->m_ihash[i].ih_lock)); + INIT_RADIX_TREE(&(mp->m_ihash[i].ih_root), GFP_ATOMIC); + } } /* @@ -89,9 +88,7 @@ xfs_chash_init(xfs_mount_t *mp) { uint i; - mp->m_chsize = max_t(uint, 1, mp->m_ihsize / - (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)); - mp->m_chsize = min_t(uint, mp->m_chsize, mp->m_ihsize); + mp->m_chsize = mp->m_ihsize * 2049; mp->m_chash = (xfs_chash_t *)kmem_zalloc(mp->m_chsize * sizeof(xfs_chash_t), KM_SLEEP | KM_LARGE); @@ -117,40 +114,6 @@ xfs_chash_free(xfs_mount_t *mp) } /* - * Try to move an inode to the front of its hash list if possible - * (and if its not there already). Called right after obtaining - * the list version number and then dropping the read_lock on the - * hash list in question (which is done right after looking up the - * inode in question...). - */ -STATIC void -xfs_ihash_promote( - xfs_ihash_t *ih, - xfs_inode_t *ip, - ulong version) -{ - xfs_inode_t *iq; - - if ((ip->i_prevp != &ih->ih_next) && write_trylock(&ih->ih_lock)) { - if (likely(version == ih->ih_version)) { - /* remove from list */ - if ((iq = ip->i_next)) { - iq->i_prevp = ip->i_prevp; - } - *ip->i_prevp = iq; - - /* insert at list head */ - iq = ih->ih_next; - iq->i_prevp = &ip->i_next; - ip->i_next = iq; - ip->i_prevp = &ih->ih_next; - ih->ih_next = ip; - } - write_unlock(&ih->ih_lock); - } -} - -/* * Look up an inode by number in the given file system. * The inode is looked up in the hash table for the file system * represented by the mount point parameter mp. Each bucket of @@ -209,140 +172,135 @@ xfs_iget_core( again: read_lock(&ih->ih_lock); - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == ino) { + ip = (xfs_inode_t *)radix_tree_lookup(&ih->ih_root, (unsigned long)ino); + if (ip != NULL) { + /* + * If INEW is set this inode is being set up + * we need to pause and try again. + */ + if (xfs_iflags_test(ip, XFS_INEW)) { + read_unlock(&ih->ih_lock); + delay(1); + XFS_STATS_INC(xs_ig_frecycle); + + goto again; + } + + inode_vp = XFS_ITOV_NULL(ip); + if (inode_vp == 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)) { + if (xfs_iflags_test(ip, XFS_IRECLAIM)) { read_unlock(&ih->ih_lock); delay(1); XFS_STATS_INC(xs_ig_frecycle); goto again; } + ASSERT(xfs_iflags_test(ip, XFS_IRECLAIMABLE)); - inode_vp = XFS_ITOV_NULL(ip); - if (inode_vp == 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(&ih->ih_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(&ih->ih_lock); - return ENOENT; - } - - /* - * There may be transactions sitting in the - * incore log buffers or being flushed to disk - * at this time. We can't clear the - * XFS_IRECLAIMABLE flag until these - * transactions have hit the disk, otherwise we - * will void the guarantee the flag provides - * xfs_iunpin() - */ - if (xfs_ipincount(ip)) { - read_unlock(&ih->ih_lock); - xfs_log_force(mp, 0, - XFS_LOG_FORCE|XFS_LOG_SYNC); - XFS_STATS_INC(xs_ig_frecycle); - goto again; - } - - vn_trace_exit(vp, "xfs_iget.alloc", - (inst_t *)__return_address); - - XFS_STATS_INC(xs_ig_found); - - xfs_iflags_clear(ip, XFS_IRECLAIMABLE); - version = ih->ih_version; + /* + * 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(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - - XFS_MOUNT_ILOCK(mp); - list_del_init(&ip->i_reclaim); - XFS_MOUNT_IUNLOCK(mp); - - goto finish_inode; - - } else if (vp != inode_vp) { - struct inode *inode = vn_to_inode(inode_vp); - - /* The inode is being torn down, pause and - * try again. - */ - if (inode->i_state & (I_FREEING | I_CLEAR)) { - read_unlock(&ih->ih_lock); - delay(1); - XFS_STATS_INC(xs_ig_frecycle); - - goto again; - } -/* 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", - inode_vp, vp); + return ENOENT; } /* - * Inode cache hit: if ip is not at the front of - * its hash chain, move it there now. - * Do this with the lock held for update, but - * do statistics after releasing the lock. + * There may be transactions sitting in the + * incore log buffers or being flushed to disk + * at this time. We can't clear the + * XFS_IRECLAIMABLE flag until these + * transactions have hit the disk, otherwise we + * will void the guarantee the flag provides + * xfs_iunpin() */ + if (xfs_ipincount(ip)) { + read_unlock(&ih->ih_lock); + xfs_log_force(mp, 0, + XFS_LOG_FORCE|XFS_LOG_SYNC); + XFS_STATS_INC(xs_ig_frecycle); + goto again; + } + + vn_trace_exit(vp, "xfs_iget.alloc", + (inst_t *)__return_address); + + XFS_STATS_INC(xs_ig_found); + + xfs_iflags_clear(ip, XFS_IRECLAIMABLE); version = ih->ih_version; read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - XFS_STATS_INC(xs_ig_found); -finish_inode: - if (ip->i_d.di_mode == 0) { - if (!(flags & XFS_IGET_CREATE)) - return ENOENT; - xfs_iocore_inode_reinit(ip); + XFS_MOUNT_ILOCK(mp); + list_del_init(&ip->i_reclaim); + XFS_MOUNT_IUNLOCK(mp); + + goto finish_inode; + + } else if (vp != inode_vp) { + struct inode *inode = vn_to_inode(inode_vp); + + /* The inode is being torn down, pause and + * try again. + */ + if (inode->i_state & (I_FREEING | I_CLEAR)) { + read_unlock(&ih->ih_lock); + delay(1); + XFS_STATS_INC(xs_ig_frecycle); + + goto again; } +/* 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", + inode_vp, vp); + } - if (lock_flags != 0) - xfs_ilock(ip, lock_flags); + /* + * Inode cache hit: if ip is not at the front of + * its hash chain, move it there now. + * Do this with the lock held for update, but + * do statistics after releasing the lock. + */ + version = ih->ih_version; + read_unlock(&ih->ih_lock); + XFS_STATS_INC(xs_ig_found); - xfs_iflags_clear(ip, XFS_ISTALE); - vn_trace_exit(vp, "xfs_iget.found", - (inst_t *)__return_address); - goto return_ip; +finish_inode: + if (ip->i_d.di_mode == 0) { + if (!(flags & XFS_IGET_CREATE)) + return ENOENT; + xfs_iocore_inode_reinit(ip); } + + if (lock_flags != 0) + xfs_ilock(ip, lock_flags); + + xfs_iflags_clear(ip, XFS_ISTALE); + vn_trace_exit(vp, "xfs_iget.found", + (inst_t *)__return_address); + goto return_ip; } /* * Inode cache miss: save the hash chain version stamp and unlock * the chain, so we don't deadlock in vn_alloc. */ - XFS_STATS_INC(xs_ig_missed); - version = ih->ih_version; - read_unlock(&ih->ih_lock); + XFS_STATS_INC(xs_ig_missed); /* * Read the disk inode attributes into a new inode structure and get @@ -370,34 +328,32 @@ finish_inode: * Put ip on its hash chain, unless someone else hashed a duplicate * after we released the hash lock. */ + if (radix_tree_preload(GFP_KERNEL)) { + delay(1); + goto again; + } write_lock(&ih->ih_lock); - if (ih->ih_version != version) { - for (iq = ih->ih_next; iq != NULL; iq = iq->i_next) { - if (iq->i_ino == ino) { - write_unlock(&ih->ih_lock); - xfs_idestroy(ip); - - XFS_STATS_INC(xs_ig_dup); - goto again; - } - } + error = radix_tree_insert(&ih->ih_root, (unsigned long)ino, (void *)ip); + if (unlikely(error)) { + BUG_ON(error != -EEXIST); + write_unlock(&ih->ih_lock); + radix_tree_preload_end(); + xfs_idestroy(ip); + ASSERT(ih->ih_version != version); + XFS_STATS_INC(xs_ig_dup); + goto again; } /* * These values _must_ be set before releasing ihlock! */ ip->i_hash = ih; - if ((iq = ih->ih_next)) { - iq->i_prevp = &ip->i_next; - } - ip->i_next = iq; - ip->i_prevp = &ih->ih_next; - ih->ih_next = ip; ip->i_udquot = ip->i_gdquot = NULL; ih->ih_version++; xfs_iflags_set(ip, XFS_INEW); write_unlock(&ih->ih_lock); + radix_tree_preload_end(); /* * put ip on its cluster's hash chain @@ -589,30 +545,16 @@ xfs_inode_incore(xfs_mount_t *mp, { xfs_ihash_t *ih; xfs_inode_t *ip; - ulong version; ih = XFS_IHASH(mp, ino); read_lock(&ih->ih_lock); - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == ino) { - /* - * If we find it and tp matches, return it. - * Also move it to the front of the hash list - * if we find it and it is not already there. - * Otherwise break from the loop and return - * NULL. - */ - if (ip->i_transp == tp) { - version = ih->ih_version; - read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - return (ip); - } - break; - } - } + ip = (xfs_inode_t *) radix_tree_lookup(&ih->ih_root, (unsigned long)ino); read_unlock(&ih->ih_lock); - return (NULL); + + /* the returned inode must match the transaction */ + if (ip && (ip->i_transp != tp)) + return NULL; + return ip; } /* @@ -727,10 +669,7 @@ xfs_iextract( ih = ip->i_hash; write_lock(&ih->ih_lock); - if ((iq = ip->i_next)) { - iq->i_prevp = ip->i_prevp; - } - *ip->i_prevp = iq; + radix_tree_delete(&ih->ih_root, ip->i_ino); ih->ih_version++; write_unlock(&ih->ih_lock); Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2007-01-31 13:48:33.744203521 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2007-01-31 13:55:37.141043962 +1100 @@ -2183,10 +2183,7 @@ xfs_ifree_cluster( for (i = 0; i < ninodes; i++) { ih = XFS_IHASH(mp, inum + i); read_lock(&ih->ih_lock); - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == inum + i) - break; - } + ip = (xfs_inode_t *)radix_tree_lookup(&ih->ih_root, inum + i); /* Inode not in memory or we found it already, * nothing to do Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2007-01-31 13:26:32.636232335 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2007-01-31 13:55:37.141043962 +1100 @@ -175,12 +175,12 @@ extern void xfs_iocore_inode_reinit(stru * file system to hash the inodes for that file system. */ typedef struct xfs_ihash { - struct xfs_inode *ih_next; + struct radix_tree_root ih_root; rwlock_t ih_lock; uint ih_version; } xfs_ihash_t; -#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)(ino)) % (mp)->m_ihsize)) +#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)((ino) >> 6)) % (mp)->m_ihsize)) /* * This is the xfs inode cluster hash. This hash is used by xfs_iflush to @@ -229,20 +229,16 @@ typedef struct xfs_chash { typedef struct { struct xfs_ihash *ip_hash; /* pointer to hash header */ - struct xfs_inode *ip_next; /* inode hash link forw */ struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_inode **ip_prevp; /* ptr to prev i_next */ struct xfs_mount *ip_mount; /* fs mount struct ptr */ } xfs_iptr_t; typedef struct xfs_inode { /* Inode linking and identification information. */ struct xfs_ihash *i_hash; /* pointer to hash header */ - struct xfs_inode *i_next; /* inode hash link forw */ struct xfs_inode *i_mnext; /* next inode in mount list */ struct xfs_inode *i_mprev; /* ptr to prev inode */ - struct xfs_inode **i_prevp; /* ptr to prev i_next */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ struct bhv_desc i_bhv_desc; /* inode behavior descriptor*/ Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2007-01-31 13:53:28.253834613 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2007-01-31 13:55:37.145043441 +1100 @@ -6581,6 +6581,7 @@ xfsidbg_xmount(xfs_mount_t *mp) static void xfsidbg_xihash(xfs_mount_t *mp) { +#if 0 xfs_ihash_t *ih; int i; int j; @@ -6641,6 +6642,7 @@ xfsidbg_xihash(xfs_mount_t *mp) } kdb_printf("\n"); kfree(hist); +#endif } /* @@ -6658,10 +6660,8 @@ xfsidbg_xnode(xfs_inode_t *ip) NULL }; - kdb_printf("hash 0x%p next 0x%p prevp 0x%p mount 0x%p\n", + kdb_printf("hash 0x%p mount 0x%p\n", ip->i_hash, - ip->i_next, - ip->i_prevp, ip->i_mount); kdb_printf("mnext 0x%p mprev 0x%p vnode 0x%p \n", ip->i_mnext, From owner-xfs@oss.sgi.com Wed Aug 8 16:07:14 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:07:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78N78bm009951 for ; Wed, 8 Aug 2007 16:07:12 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA27776; Thu, 9 Aug 2007 09:07:08 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78N77eW55620626; Thu, 9 Aug 2007 09:07:08 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78N77oa55635210; Thu, 9 Aug 2007 09:07:07 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:07:07 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 0 of 4] Radix tree based inode caching Message-ID: <20070808230706.GO12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12527 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs One of the perpetual scaling problems XFS has is indexing it's incore inodes. We currently uses hashes and the default hash sizes chosen can only ever be a tradeoff between memory consumption and the maximum realistic size of the cache. As a result, anyone who has millions of inodes cached on a filesystem needs to tunes the size of the cache via the ihashsize mount option to allow decent scalability with inode cache operations. A further problem is the separate inode cluster hash, whose size is based on the ihashsize but is smaller, and so under certain conditions (sparse cluster cache population) this can become a limitation long before the inode hash is causing issues. The following patchset removes the inode hash and cluster hash and replaces them with radix trees to avoid the scalability limitations of the hashes. It also reduces the size of the inodes by 3 pointers.... -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 8 16:10:22 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:10:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78NAIbm011693 for ; Wed, 8 Aug 2007 16:10:21 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA27934; Thu, 9 Aug 2007 09:10:18 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78NAHeW55450563; Thu, 9 Aug 2007 09:10:18 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78NAGld55637430; Thu, 9 Aug 2007 09:10:16 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:10:16 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 2 of 4] Per cluster-object inode chain locks Message-ID: <20070808231016.GQ12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12529 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Per cluster-object inode chain locks. Currently, the cluster inode chain is protected by the cluster hash chain lock. This means that any operation on the cluster inode chain can hold out searches of the cluster hash. It also means that the cluster inode chain is not independent of the cluster hash and hence cannot be cleanly separated. Give the cluster object it's own lock so that inode chain operations can be done independently of the cluster hash. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 26 +++++++++++++++++++++----- fs/xfs/xfs_inode.c | 10 +++------- fs/xfs/xfs_inode.h | 1 + 3 files changed, 25 insertions(+), 12 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2006-10-19 10:52:04.731953950 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2006-10-19 10:52:24.661381439 +1000 @@ -367,7 +367,9 @@ finish_inode: if (chl->chl_blkno == ip->i_blkno) { /* insert this inode into the doubly-linked list - * where chl points */ + * where chl points. lock the chl to protect against + * others traversing the chl list */ + spin_lock(&chl->chl_lock); if ((iq = chl->chl_ip)) { ip->i_cprev = iq->i_cprev; iq->i_cprev->i_cnext = ip; @@ -379,6 +381,7 @@ finish_inode: } chl->chl_ip = ip; ip->i_chash = chl; + spin_unlock(&chl->chl_lock); break; } } @@ -392,8 +395,11 @@ finish_inode: kmem_zone_alloc(xfs_chashlist_zone, KM_SLEEP); ASSERT(chlnew != NULL); + spin_lock_init(&chlnew->chl_lock); goto chlredo; } else { + /* exclusive access to this chl thanks to the ch_lock + * in write mode, so no lock really needed */ ip->i_cnext = ip; ip->i_cprev = ip; ip->i_chash = chlnew; @@ -679,13 +685,21 @@ xfs_iextract( */ mp = ip->i_mount; ch = XFS_CHASH(mp, ip->i_blkno); - s = mutex_spinlock(&ch->ch_lock); - - if (ip->i_cnext == ip) { + spin_lock(&ip->i_chash->chl_lock); + if (unlikely(ip->i_cnext == ip)) { /* Last inode on chashlist */ ASSERT(ip->i_cnext == ip && ip->i_cprev == ip); ASSERT(ip->i_chash != NULL); chm=NULL; + + spin_unlock(&ip->i_chash->chl_lock); + spin_lock(&ch->ch_lock); + spin_lock(&ip->i_chash->chl_lock); + if (ip->i_cnext != ip) { + spin_unlock(&ch->ch_lock); + goto delete; + } + spin_unlock(&ip->i_chash->chl_lock); chl = ip->i_chash; if (chl->chl_prev) chl->chl_prev->chl_next = chl->chl_next; @@ -693,20 +707,22 @@ xfs_iextract( ch->ch_list = chl->chl_next; if (chl->chl_next) chl->chl_next->chl_prev = chl->chl_prev; + spin_unlock(&ch->ch_lock); kmem_zone_free(xfs_chashlist_zone, chl); } else { /* delete one inode from a non-empty list */ +delete: iq = ip->i_cnext; iq->i_cprev = ip->i_cprev; ip->i_cprev->i_cnext = iq; if (ip->i_chash->chl_ip == ip) { ip->i_chash->chl_ip = iq; } + spin_unlock(&ip->i_chash->chl_lock); ip->i_chash = __return_address; ip->i_cprev = __return_address; ip->i_cnext = __return_address; } - mutex_spinunlock(&ch->ch_lock, s); /* * Remove from mount's inode list. Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2006-10-19 10:45:26.243612163 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2006-10-19 10:52:24.661381439 +1000 @@ -3004,7 +3004,6 @@ xfs_iflush( xfs_mount_t *mp; int error; /* REFERENCED */ - xfs_chash_t *ch; xfs_inode_t *iq; int clcount; /* count of inodes clustered */ int bufwasdelwri; @@ -3123,12 +3122,9 @@ xfs_iflush( * inode clustering: * see if other inodes can be gathered into this write */ - + spin_lock(&ip->i_chash->chl_lock); ip->i_chash->chl_buf = bp; - ch = XFS_CHASH(mp, ip->i_blkno); - s = mutex_spinlock(&ch->ch_lock); - clcount = 0; for (iq = ip->i_cnext; iq != ip; iq = iq->i_cnext) { /* @@ -3181,7 +3177,7 @@ xfs_iflush( xfs_iunlock(iq, XFS_ILOCK_SHARED); } } - mutex_spinunlock(&ch->ch_lock, s); + spin_unlock(&ip->i_chash->chl_lock); if (clcount) { XFS_STATS_INC(xs_icluster_flushcnt); @@ -3218,7 +3214,7 @@ cluster_corrupt_out: /* Corruption detected in the clustering loop. Invalidate the * inode buffer and shut down the filesystem. */ - mutex_spinunlock(&ch->ch_lock, s); + spin_unlock(&ip->i_chash->chl_lock); /* * Clean up the buffer. If it was B_DELWRI, just release it -- Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2006-10-19 10:45:26.243612163 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2006-10-19 10:52:24.665380923 +1000 @@ -194,6 +194,7 @@ typedef struct xfs_chashlist { xfs_daddr_t chl_blkno; /* starting block number of * the cluster */ struct xfs_buf *chl_buf; /* the inode buffer */ + lock_t chl_lock; /* inode list lock */ } xfs_chashlist_t; typedef struct xfs_chash { From owner-xfs@oss.sgi.com Wed Aug 8 16:11:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:11:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78NBkbm012697 for ; Wed, 8 Aug 2007 16:11:48 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA28000; Thu, 9 Aug 2007 09:11:46 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78NBjeW55599802; Thu, 9 Aug 2007 09:11:45 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78NBhEA55533950; Thu, 9 Aug 2007 09:11:43 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:11:43 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 3 of 4] Remove the cluster hash lists Message-ID: <20070808231143.GR12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12530 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Remove the cluster hash lists and replace with lookups into the new radix tree. This removes scalability limitations inherent in the cluster hash sizing algorithms. We can do this due to the fact that all inodes in a cluster have sequential numbers and have a defined alignment. This means we can mask out the inode number within the cluster to give us the cluster address that the inode belongs to. We can then do a gang lookup on the radix tree to find out if there is already an existing cached inode in the cluster. if there is, then we can obtain the cluster object from the existing cached inode. If there isn't we simply allocate a new one and attach it to the inode we are inserting into the radix tree. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_ksyms.c | 2 fs/xfs/xfs_iget.c | 201 +++++++++++++------------------------------ fs/xfs/xfs_inode.c | 11 +- fs/xfs/xfs_inode.h | 32 ++---- fs/xfs/xfs_mount.c | 4 fs/xfs/xfs_vfsops.c | 8 - fs/xfs/xfsidbg.c | 96 -------------------- 7 files changed, 84 insertions(+), 270 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2007-07-23 11:11:10.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2007-07-23 11:13:19.414234814 +1000 @@ -80,40 +80,6 @@ xfs_ihash_free(xfs_mount_t *mp) } /* - * Initialize the inode cluster hash table for the newly mounted file system. - * Its size is derived from the ihash table size. - */ -void -xfs_chash_init(xfs_mount_t *mp) -{ - uint i; - - mp->m_chsize = mp->m_ihsize * 2049; - mp->m_chash = (xfs_chash_t *)kmem_zalloc(mp->m_chsize - * sizeof(xfs_chash_t), - KM_SLEEP | KM_LARGE); - for (i = 0; i < mp->m_chsize; i++) { - spinlock_init(&mp->m_chash[i].ch_lock,"xfshash"); - } -} - -/* - * Free up structures allocated by xfs_chash_init, at unmount time. - */ -void -xfs_chash_free(xfs_mount_t *mp) -{ - int i; - - for (i = 0; i < mp->m_chsize; i++) { - spinlock_destroy(&mp->m_chash[i].ch_lock); - } - - kmem_free(mp->m_chash, mp->m_chsize*sizeof(xfs_chash_t)); - mp->m_chash = NULL; -} - -/* * Look up an inode by number in the given file system. * The inode is looked up in the hash table for the file system * represented by the mount point parameter mp. Each bucket of @@ -161,10 +127,8 @@ xfs_iget_core( bhv_vnode_t *inode_vp; ulong version; int error; - /* REFERENCED */ - xfs_chash_t *ch; - xfs_chashlist_t *chl, *chlnew; - SPLDECL(s); + xfs_icluster_t *icl, *new_icl = NULL; + unsigned long first_index, mask; ih = XFS_IHASH(mp, ino); @@ -325,15 +289,31 @@ finish_inode: } /* - * Put ip on its hash chain, unless someone else hashed a duplicate - * after we released the hash lock. + * This is a bit messy - we preallocate everything we _might_ + * need before we pick up the hash lock. That way we donnn't have to + * juggle locks and go all the way back to the start. */ + new_icl = (xfs_icluster_t *)kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); if (radix_tree_preload(GFP_KERNEL)) { delay(1); goto again; } + mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); + first_index = ino & mask; write_lock(&ih->ih_lock); + /* + * Find the cluster if it exists + */ + icl = NULL; + if (radix_tree_gang_lookup(&ih->ih_root, (void**)&iq, first_index, 1)) { + if ((iq->i_ino & mask) == first_index) + icl = iq->i_cluster; + } + + /* + * insert the new inode + */ error = radix_tree_insert(&ih->ih_root, (unsigned long)ino, (void *)ip); if (unlikely(error)) { BUG_ON(error != -EEXIST); @@ -352,76 +332,36 @@ finish_inode: ip->i_udquot = ip->i_gdquot = NULL; ih->ih_version++; xfs_iflags_set(ip, XFS_INEW); - write_unlock(&ih->ih_lock); - radix_tree_preload_end(); - /* - * put ip on its cluster's hash chain - */ - ASSERT(ip->i_chash == NULL && ip->i_cprev == NULL && + ASSERT(ip->i_cluster == NULL && ip->i_cprev == NULL && ip->i_cnext == NULL); - chlnew = NULL; - ch = XFS_CHASH(mp, ip->i_blkno); - chlredo: - s = mutex_spinlock(&ch->ch_lock); - for (chl = ch->ch_list; chl != NULL; chl = chl->chl_next) { - if (chl->chl_blkno == ip->i_blkno) { - - /* insert this inode into the doubly-linked list - * where chl points. lock the chl to protect against - * others traversing the chl list */ - spin_lock(&chl->chl_lock); - if ((iq = chl->chl_ip)) { - ip->i_cprev = iq->i_cprev; - iq->i_cprev->i_cnext = ip; - iq->i_cprev = ip; - ip->i_cnext = iq; - } else { - ip->i_cnext = ip; - ip->i_cprev = ip; - } - chl->chl_ip = ip; - ip->i_chash = chl; - spin_unlock(&chl->chl_lock); - break; - } - } - - /* no hash list found for this block; add a new hash list */ - if (chl == NULL) { - if (chlnew == NULL) { - mutex_spinunlock(&ch->ch_lock, s); - ASSERT(xfs_chashlist_zone != NULL); - chlnew = (xfs_chashlist_t *) - kmem_zone_alloc(xfs_chashlist_zone, - KM_SLEEP); - ASSERT(chlnew != NULL); - spin_lock_init(&chlnew->chl_lock); - goto chlredo; - } else { - /* exclusive access to this chl thanks to the ch_lock - * in write mode, so no lock really needed */ - ip->i_cnext = ip; - ip->i_cprev = ip; - ip->i_chash = chlnew; - chlnew->chl_ip = ip; - chlnew->chl_blkno = ip->i_blkno; - if (ch->ch_list) - ch->ch_list->chl_prev = chlnew; - chlnew->chl_next = ch->ch_list; - chlnew->chl_prev = NULL; - ch->ch_list = chlnew; - chlnew = NULL; - } + if (icl) { + /* insert this inode into the doubly-linked list + * where icl points. lock the icl to protect against + * others traversing the icl list */ + spin_lock(&icl->icl_lock); + ASSERT(icl->icl_ip != NULL); + iq = icl->icl_ip; + ip->i_cprev = iq->i_cprev; + iq->i_cprev->i_cnext = ip; + iq->i_cprev = ip; + ip->i_cnext = iq; + icl->icl_ip = ip; + ip->i_cluster = icl; + spin_unlock(&icl->icl_lock); } else { - if (chlnew != NULL) { - kmem_zone_free(xfs_chashlist_zone, chlnew); - } + ip->i_cnext = ip; + ip->i_cprev = ip; + ip->i_cluster = new_icl; + new_icl->icl_ip = ip; + spin_lock_init(&new_icl->icl_lock); + new_icl = NULL; } - - mutex_spinunlock(&ch->ch_lock, s); - + write_unlock(&ih->ih_lock); + radix_tree_preload_end(); + if (new_icl) + kmem_zone_free(xfs_icluster_zone, new_icl); /* * Link ip to its mount and thread it on the mount's inode list. @@ -669,9 +609,6 @@ xfs_iextract( xfs_ihash_t *ih; xfs_inode_t *iq; xfs_mount_t *mp; - xfs_chash_t *ch; - xfs_chashlist_t *chl, *chm; - SPLDECL(s); ih = ip->i_hash; write_lock(&ih->ih_lock); @@ -680,48 +617,34 @@ xfs_iextract( write_unlock(&ih->ih_lock); /* - * Remove from cluster hash list - * 1) delete the chashlist if this is the last inode on the chashlist - * 2) unchain from list of inodes - * 3) point chashlist->chl_ip to 'chl_next' if to this inode. + * Remove from cluster list */ mp = ip->i_mount; - ch = XFS_CHASH(mp, ip->i_blkno); - spin_lock(&ip->i_chash->chl_lock); + spin_lock(&ip->i_cluster->icl_lock); if (unlikely(ip->i_cnext == ip)) { - /* Last inode on chashlist */ + /* + * Last inode in cluster object. + * + * We've been removed from the inode radix tree, and + * we are the last inode to reference the cluster. + * We can simply drop our loks and free it at this point + * because nothing can find us or the cluster. + */ ASSERT(ip->i_cnext == ip && ip->i_cprev == ip); - ASSERT(ip->i_chash != NULL); - chm=NULL; + ASSERT(ip->i_cluster != NULL); - spin_unlock(&ip->i_chash->chl_lock); - spin_lock(&ch->ch_lock); - spin_lock(&ip->i_chash->chl_lock); - if (ip->i_cnext != ip) { - spin_unlock(&ch->ch_lock); - goto delete; - } - spin_unlock(&ip->i_chash->chl_lock); - chl = ip->i_chash; - if (chl->chl_prev) - chl->chl_prev->chl_next = chl->chl_next; - else - ch->ch_list = chl->chl_next; - if (chl->chl_next) - chl->chl_next->chl_prev = chl->chl_prev; - spin_unlock(&ch->ch_lock); - kmem_zone_free(xfs_chashlist_zone, chl); + spin_unlock(&ip->i_cluster->icl_lock); + kmem_zone_free(xfs_icluster_zone, ip->i_cluster); } else { /* delete one inode from a non-empty list */ -delete: iq = ip->i_cnext; iq->i_cprev = ip->i_cprev; ip->i_cprev->i_cnext = iq; - if (ip->i_chash->chl_ip == ip) { - ip->i_chash->chl_ip = iq; + if (ip->i_cluster->icl_ip == ip) { + ip->i_cluster->icl_ip = iq; } - spin_unlock(&ip->i_chash->chl_lock); - ip->i_chash = __return_address; + spin_unlock(&ip->i_cluster->icl_lock); + ip->i_cluster = __return_address; ip->i_cprev = __return_address; ip->i_cnext = __return_address; } Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2007-07-23 11:11:10.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2007-07-23 11:13:19.414234814 +1000 @@ -187,23 +187,13 @@ typedef struct xfs_ihash { * find inodes that share a cluster and can be flushed to disk at the same * time. */ -typedef struct xfs_chashlist { - struct xfs_chashlist *chl_next; - struct xfs_chashlist *chl_prev; - struct xfs_inode *chl_ip; - xfs_daddr_t chl_blkno; /* starting block number of +typedef struct xfs_icluster { + struct xfs_inode *icl_ip; + xfs_daddr_t icl_blkno; /* starting block number of * the cluster */ - struct xfs_buf *chl_buf; /* the inode buffer */ - lock_t chl_lock; /* inode list lock */ -} xfs_chashlist_t; - -typedef struct xfs_chash { - xfs_chashlist_t *ch_list; - lock_t ch_lock; -} xfs_chash_t; - -#define XFS_CHASH(mp,blk) ((mp)->m_chash + (((uint)blk) % (mp)->m_chsize)) - + struct xfs_buf *icl_buf; /* the inode buffer */ + lock_t icl_lock; /* inode list lock */ +} xfs_icluster_t; /* * This is the xfs in-core inode structure. @@ -280,9 +270,9 @@ typedef struct xfs_inode { unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ - xfs_chashlist_t *i_chash; /* cluster hash list header */ - struct xfs_inode *i_cnext; /* cluster hash link forward */ - struct xfs_inode *i_cprev; /* cluster hash link backward */ + xfs_icluster_t *i_cluster; /* cluster list header */ + struct xfs_inode *i_cnext; /* cluster link forward */ + struct xfs_inode *i_cprev; /* cluster link backward */ xfs_fsize_t i_size; /* in-memory size */ /* Trace buffers per inode. */ @@ -477,8 +467,6 @@ xfs_iflags_test(xfs_inode_t *ip, unsigne */ void xfs_ihash_init(struct xfs_mount *); void xfs_ihash_free(struct xfs_mount *); -void xfs_chash_init(struct xfs_mount *); -void xfs_chash_free(struct xfs_mount *); xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t, struct xfs_trans *); void xfs_inode_lock_init(xfs_inode_t *, struct bhv_vnode *); @@ -589,7 +577,7 @@ void xfs_inobp_check(struct xfs_mount * #define xfs_inobp_check(mp, bp) #endif /* DEBUG */ -extern struct kmem_zone *xfs_chashlist_zone; +extern struct kmem_zone *xfs_icluster_zone; extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2007-07-23 11:11:02.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c 2007-07-23 11:13:19.426233246 +1000 @@ -233,7 +233,7 @@ EXPORT_SYMBOL(xfs_bulkstat); EXPORT_SYMBOL(xfs_bunmapi); EXPORT_SYMBOL(xfs_bwrite); EXPORT_SYMBOL(xfs_change_file_space); -EXPORT_SYMBOL(xfs_chashlist_zone); +EXPORT_SYMBOL(xfs_icluster_zone); EXPORT_SYMBOL(xfs_dev_is_read_only); EXPORT_SYMBOL(xfs_dir_getdents); EXPORT_SYMBOL(xfs_dir_ialloc); Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2007-07-23 11:11:10.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2007-07-23 11:13:19.430232723 +1000 @@ -52,7 +52,7 @@ kmem_zone_t *xfs_ifork_zone; kmem_zone_t *xfs_inode_zone; -kmem_zone_t *xfs_chashlist_zone; +kmem_zone_t *xfs_icluster_zone; /* * Used in xfs_itruncate(). This is the maximum number of extents @@ -3051,7 +3051,6 @@ xfs_iflush( int clcount; /* count of inodes clustered */ int bufwasdelwri; enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; - SPLDECL(s); XFS_STATS_INC(xs_iflush_count); @@ -3165,8 +3164,8 @@ xfs_iflush( * inode clustering: * see if other inodes can be gathered into this write */ - spin_lock(&ip->i_chash->chl_lock); - ip->i_chash->chl_buf = bp; + spin_lock(&ip->i_cluster->icl_lock); + ip->i_cluster->icl_buf = bp; clcount = 0; for (iq = ip->i_cnext; iq != ip; iq = iq->i_cnext) { @@ -3220,7 +3219,7 @@ xfs_iflush( xfs_iunlock(iq, XFS_ILOCK_SHARED); } } - spin_unlock(&ip->i_chash->chl_lock); + spin_unlock(&ip->i_cluster->icl_lock); if (clcount) { XFS_STATS_INC(xs_icluster_flushcnt); @@ -3257,7 +3256,7 @@ cluster_corrupt_out: /* Corruption detected in the clustering loop. Invalidate the * inode buffer and shut down the filesystem. */ - spin_unlock(&ip->i_chash->chl_lock); + spin_unlock(&ip->i_cluster->icl_lock); /* * Clean up the buffer. If it was B_DELWRI, just release it -- Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-07-23 11:09:52.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-07-23 11:13:19.430232723 +1000 @@ -117,8 +117,8 @@ xfs_init(void) xfs_ili_zone = kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili", KM_ZONE_SPREAD, NULL); - xfs_chashlist_zone = - kmem_zone_init_flags(sizeof(xfs_chashlist_t), "xfs_chashlist", + xfs_icluster_zone = + kmem_zone_init_flags(sizeof(xfs_icluster_t), "xfs_icluster", KM_ZONE_SPREAD, NULL); /* @@ -163,7 +163,7 @@ xfs_cleanup(void) extern kmem_zone_t *xfs_efd_zone; extern kmem_zone_t *xfs_efi_zone; extern kmem_zone_t *xfs_buf_item_zone; - extern kmem_zone_t *xfs_chashlist_zone; + extern kmem_zone_t *xfs_icluster_zone; xfs_cleanup_procfs(); xfs_sysctl_unregister(); @@ -199,7 +199,7 @@ xfs_cleanup(void) kmem_zone_destroy(xfs_efi_zone); kmem_zone_destroy(xfs_ifork_zone); kmem_zone_destroy(xfs_ili_zone); - kmem_zone_destroy(xfs_chashlist_zone); + kmem_zone_destroy(xfs_icluster_zone); } /* Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2007-07-23 11:11:10.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2007-07-23 11:13:19.434232200 +1000 @@ -135,8 +135,6 @@ static void xfsidbg_xbuf(xfs_buf_t *); static void xfsidbg_xbuf_real(xfs_buf_t *, int); static void xfsidbg_xarg(int); static void xfsidbg_xchksum(uint *); -static void xfsidbg_xchash(xfs_mount_t *mp); -static void xfsidbg_xchashlist(xfs_chashlist_t *chl); static void xfsidbg_xdaargs(xfs_da_args_t *); static void xfsidbg_xdabuf(xfs_dabuf_t *); static void xfsidbg_xdanode(xfs_da_intnode_t *); @@ -1020,46 +1018,6 @@ static int kdbm_xfs_xchksum( return 0; } - -static int kdbm_xfs_xchash( - 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_xchash((xfs_mount_t *) addr); - return 0; -} - -static int kdbm_xfs_xchashlist( - 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_xchashlist((xfs_chashlist_t *) addr); - return 0; -} - - static int kdbm_xfs_xdaargs( int argc, const char **argv) @@ -2670,10 +2628,6 @@ static struct xif xfsidbg_funcs[] = { { "xbxstrc", kdbm_xfs_xbxstrace, "", "Dump XFS bmap extent inode trace" }, #endif - { "xchash", kdbm_xfs_xchash, "", - "Dump XFS cluster hash"}, - { "xchlist", kdbm_xfs_xchashlist, "", - "Dump XFS cluster hash list"}, { "xchksum", kdbm_xfs_xchksum, "", "Dump chksum" }, #ifdef XFS_DIR2_TRACE { "xd2atrc", kdbm_xfs_xdir2atrace, "", @@ -6756,8 +6710,6 @@ xfsidbg_xmount(xfs_mount_t *mp) (xfs_dfiloff_t)mp->m_dirdatablk, (xfs_dfiloff_t)mp->m_dirleafblk, (xfs_dfiloff_t)mp->m_dirfreeblk); - kdb_printf("chsize %d chash 0x%p\n", - mp->m_chsize, mp->m_chash); if (mp->m_fsname != NULL) kdb_printf("mountpoint \"%s\"\n", mp->m_fsname); else @@ -6898,8 +6850,8 @@ xfsidbg_xnode(xfs_inode_t *ip) qprintf(" dir trace 0x%p\n", ip->i_dir_trace); #endif kdb_printf("\n"); - kdb_printf("chash 0x%p cnext 0x%p cprev 0x%p\n", - ip->i_chash, + kdb_printf("icluster 0x%p cnext 0x%p cprev 0x%p\n", + ip->i_cluster, ip->i_cnext, ip->i_cprev); xfs_xnode_fork("data", &ip->i_df); @@ -6917,50 +6869,6 @@ xfsidbg_xcore(xfs_iocore_t *io) } /* - * Command to print xfs inode cluster hash table: kp xchash - */ -static void -xfsidbg_xchash(xfs_mount_t *mp) -{ - int i; - xfs_chash_t *ch; - - kdb_printf("m_chash 0x%p size %d\n", - mp->m_chash, mp->m_chsize); - for (i = 0; i < mp->m_chsize; i++) { - ch = mp->m_chash + i; - kdb_printf("[%3d] ch 0x%p chashlist 0x%p\n", i, ch, ch->ch_list); - xfsidbg_xchashlist(ch->ch_list); - } -} - -/* - * Command to print xfs inode cluster hash list: kp xchashlist - */ -static void -xfsidbg_xchashlist(xfs_chashlist_t *chl) -{ - xfs_inode_t *ip; - - while (chl != NULL) { - kdb_printf("hashlist inode 0x%p blkno %lld buf 0x%p", - chl->chl_ip, (long long) chl->chl_blkno, chl->chl_buf); - - kdb_printf("\n"); - - /* print inodes on chashlist */ - ip = chl->chl_ip; - do { - kdb_printf("0x%p ", ip); - ip = ip->i_cnext; - } while (ip != chl->chl_ip); - kdb_printf("\n"); - - chl=chl->chl_next; - } -} - -/* * Print xfs per-ag data structures for filesystem. */ static void Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.c 2007-07-23 11:11:02.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.c 2007-07-23 11:13:19.438231678 +1000 @@ -162,8 +162,6 @@ xfs_mount_free( { if (mp->m_ihash) xfs_ihash_free(mp); - if (mp->m_chash) - xfs_chash_free(mp); if (mp->m_perag) { int agno; @@ -1037,7 +1035,6 @@ xfs_mountfs( * file system. */ xfs_ihash_init(mp); - xfs_chash_init(mp); /* * Allocate and initialize the per-ag data. @@ -1191,7 +1188,6 @@ xfs_mountfs( xfs_log_unmount_dealloc(mp); error2: xfs_ihash_free(mp); - xfs_chash_free(mp); for (agno = 0; agno < sbp->sb_agcount; agno++) if (mp->m_perag[agno].pagb_list) kmem_free(mp->m_perag[agno].pagb_list, From owner-xfs@oss.sgi.com Wed Aug 8 16:13:19 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:13:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_43, J_CHICKENPOX_54,J_CHICKENPOX_75 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78NDDbm013676 for ; Wed, 8 Aug 2007 16:13:15 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA28058; Thu, 9 Aug 2007 09:13:12 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78NDBeW55202362; Thu, 9 Aug 2007 09:13:12 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78NDAPX55606608; Thu, 9 Aug 2007 09:13:10 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:13:10 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 4 of 4] Per Allocation Group inode radix trees Message-ID: <20070808231310.GS12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12531 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs One of the big problems with the hash of radix trees is that they require 64 bit inode number indexing and hence would prevent the use of 64 bit inodes on a 32 bit platform. Also, the hashing only provides limited parallelism as inodes in different allocation groups that can be operated on in parallel in all other might shared the same radix tree. The hash sizing is also uses relatively basic heuristics for sizing that were provided just to get "sufficient" trees rather than a more optimal number. By moving to a radix tree per AG, we can use the agino number as the index rather than the inode number, thereby rducing the radix tree key to 32 bits enabling this to be used for 64 bit inodes on 32 bit machines. In doing so, we also grately reduce the sparseness of the radix trees because the agino is a more compact representation of the inode location than the inode number. It also provides inherent parallelism in the same manner as the rest of XFS without the need for heuristics. i.e. we parallelise operations by keeping structures and operations within AGs. This removes the need for the ihashsize mount parameter altogether as the inode caches should never need size hints anymore. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_export.c | 4 - fs/xfs/xfs_ag.h | 4 + fs/xfs/xfs_buf_item.c | 1 fs/xfs/xfs_clnt.h | 1 fs/xfs/xfs_dir2_block.c | 1 fs/xfs/xfs_dir2_data.c | 1 fs/xfs/xfs_dir2_node.c | 1 fs/xfs/xfs_dir2_sf.c | 1 fs/xfs/xfs_error.c | 1 fs/xfs/xfs_extfree_item.c | 1 fs/xfs/xfs_iget.c | 158 +++++++++++++++--------------------------- fs/xfs/xfs_inode.c | 18 ++-- fs/xfs/xfs_inode.h | 22 ----- fs/xfs/xfs_mount.c | 20 ++--- fs/xfs/xfs_mount.h | 22 ++++- fs/xfs/xfs_rename.c | 1 fs/xfs/xfs_trans_ail.c | 1 fs/xfs/xfs_trans_extfree.c | 1 fs/xfs/xfs_vfsops.c | 16 ---- fs/xfs/xfs_vnodeops.c | 9 +- fs/xfs/xfsidbg.c | 103 --------------------------- 21 files changed, 121 insertions(+), 266 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_ag.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_ag.h 2007-08-01 10:36:25.763324913 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_ag.h 2007-08-01 15:43:34.078954812 +1000 @@ -197,6 +197,10 @@ typedef struct xfs_perag #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 */ } xfs_perag_t; #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2007-08-01 15:43:30.375434934 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2007-08-01 15:43:34.078954812 +1000 @@ -40,60 +40,13 @@ #include "xfs_utils.h" /* - * Initialize the inode hash table for the newly mounted file system. - * Choose an initial table size based on user specified value, else - * use a simple algorithm using the maximum number of inodes as an - * indicator for table size, and clamp it between one and some large - * number of pages. - */ -void -xfs_ihash_init(xfs_mount_t *mp) -{ - uint i; - - if (!mp->m_ihsize || mp->m_ihsize > 128) { - /* default to (2*cpus) - 1 or 15. */ - mp->m_ihsize = (2 * num_online_cpus()) - 1; - mp->m_ihsize = min_t(size_t, 15, mp->m_ihsize); - printk("mp->m_ihsize %ld\n", mp->m_ihsize); - } - - mp->m_ihash = kmem_zalloc_greedy((size_t *)&mp->m_ihsize, - NBPC * sizeof(xfs_ihash_t), - mp->m_ihsize * sizeof(xfs_ihash_t), - KM_SLEEP | KM_MAYFAIL | KM_LARGE); - mp->m_ihsize /= sizeof(xfs_ihash_t); - for (i = 0; i < mp->m_ihsize; i++) { - rwlock_init(&(mp->m_ihash[i].ih_lock)); - INIT_RADIX_TREE(&(mp->m_ihash[i].ih_root), GFP_ATOMIC); - } -} - -/* - * Free up structures allocated by xfs_ihash_init, at unmount time. - */ -void -xfs_ihash_free(xfs_mount_t *mp) -{ - kmem_free(mp->m_ihash, mp->m_ihsize * sizeof(xfs_ihash_t)); - mp->m_ihash = NULL; -} - -/* * Look up an inode by number in the given file system. - * The inode is looked up in the hash table for the file system - * represented by the mount point parameter mp. Each bucket of - * the hash table is guarded by an individual semaphore. - * - * If the inode is found in the hash table, its corresponding vnode - * is obtained with a call to vn_get(). This call takes care of - * coordination with the reclamation of the inode and vnode. Note - * that the vmap structure is filled in while holding the hash lock. - * This gives us the state of the inode/vnode when we found it and - * is used for coordination in vn_get(). + * 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 and - * add the inode into the hash table. + * 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 @@ -121,29 +74,37 @@ xfs_iget_core( xfs_inode_t **ipp, xfs_daddr_t bno) { - xfs_ihash_t *ih; xfs_inode_t *ip; xfs_inode_t *iq; bhv_vnode_t *inode_vp; - ulong version; int error; xfs_icluster_t *icl, *new_icl = NULL; unsigned long first_index, mask; + xfs_perag_t *pag; + xfs_agino_t agino; - - ih = XFS_IHASH(mp, ino); + /* 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: - read_lock(&ih->ih_lock); + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, agino); - ip = (xfs_inode_t *)radix_tree_lookup(&ih->ih_root, (unsigned long)ino); if (ip != NULL) { /* * If INEW is set this inode is being set up * we need to pause and try again. */ if (xfs_iflags_test(ip, XFS_INEW)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); delay(1); XFS_STATS_INC(xs_ig_frecycle); @@ -158,7 +119,7 @@ again: * we need to pause and try again. */ if (xfs_iflags_test(ip, XFS_IRECLAIM)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); delay(1); XFS_STATS_INC(xs_ig_frecycle); @@ -174,7 +135,8 @@ again: */ if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); + xfs_put_perag(mp, pag); return ENOENT; } @@ -188,7 +150,7 @@ again: * xfs_iunpin() */ if (xfs_ipincount(ip)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC); XFS_STATS_INC(xs_ig_frecycle); @@ -201,8 +163,7 @@ again: XFS_STATS_INC(xs_ig_found); xfs_iflags_clear(ip, XFS_IRECLAIMABLE); - version = ih->ih_version; - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); @@ -217,7 +178,7 @@ again: * try again. */ if (inode->i_state & (I_FREEING | I_CLEAR)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); delay(1); XFS_STATS_INC(xs_ig_frecycle); @@ -233,19 +194,17 @@ again: } /* - * Inode cache hit: if ip is not at the front of - * its hash chain, move it there now. - * Do this with the lock held for update, but - * do statistics after releasing the lock. + * Inode cache hit */ - version = ih->ih_version; - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); XFS_STATS_INC(xs_ig_found); finish_inode: if (ip->i_d.di_mode == 0) { - if (!(flags & XFS_IGET_CREATE)) + if (!(flags & XFS_IGET_CREATE)) { + xfs_put_perag(mp, pag); return ENOENT; + } xfs_iocore_inode_reinit(ip); } @@ -259,11 +218,9 @@ finish_inode: } /* - * Inode cache miss: save the hash chain version stamp and unlock - * the chain, so we don't deadlock in vn_alloc. + * Inode cache miss */ - version = ih->ih_version; - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); XFS_STATS_INC(xs_ig_missed); /* @@ -272,25 +229,27 @@ finish_inode: */ error = xfs_iread(mp, tp, ino, &ip, bno, (flags & XFS_IGET_BULKSTAT) ? XFS_IMAP_BULKSTAT : 0); - if (error) + if (error) { + xfs_put_perag(mp, pag); return error; + } vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); xfs_inode_lock_init(ip, vp); xfs_iocore_inode_init(ip); - if (lock_flags) 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; } /* * This is a bit messy - we preallocate everything we _might_ - * need before we pick up the hash lock. That way we donnn't have to + * need before we pick up the ici lock. That way we don't have to * juggle locks and go all the way back to the start. */ new_icl = (xfs_icluster_t *)kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); @@ -299,14 +258,15 @@ finish_inode: goto again; } mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); - first_index = ino & mask; - write_lock(&ih->ih_lock); + first_index = agino & mask; + write_lock(&pag->pag_ici_lock); /* * Find the cluster if it exists */ icl = NULL; - if (radix_tree_gang_lookup(&ih->ih_root, (void**)&iq, first_index, 1)) { + if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq, + first_index, 1)) { if ((iq->i_ino & mask) == first_index) icl = iq->i_cluster; } @@ -314,13 +274,12 @@ finish_inode: /* * insert the new inode */ - error = radix_tree_insert(&ih->ih_root, (unsigned long)ino, (void *)ip); + error = radix_tree_insert(&pag->pag_ici_root, agino, ip); if (unlikely(error)) { BUG_ON(error != -EEXIST); - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); xfs_idestroy(ip); - ASSERT(ih->ih_version != version); XFS_STATS_INC(xs_ig_dup); goto again; } @@ -328,9 +287,7 @@ finish_inode: /* * These values _must_ be set before releasing ihlock! */ - ip->i_hash = ih; ip->i_udquot = ip->i_gdquot = NULL; - ih->ih_version++; xfs_iflags_set(ip, XFS_INEW); ASSERT(ip->i_cluster == NULL && ip->i_cprev == NULL && @@ -358,7 +315,7 @@ finish_inode: spin_lock_init(&new_icl->icl_lock); new_icl = NULL; } - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); if (new_icl) kmem_zone_free(xfs_icluster_zone, new_icl); @@ -380,6 +337,7 @@ finish_inode: mp->m_inodes = ip; XFS_MOUNT_IUNLOCK(mp); + xfs_put_perag(mp, pag); return_ip: ASSERT(ip->i_df.if_ext_max == @@ -489,13 +447,14 @@ xfs_inode_incore(xfs_mount_t *mp, xfs_ino_t ino, xfs_trans_t *tp) { - xfs_ihash_t *ih; xfs_inode_t *ip; + xfs_perag_t *pag; - ih = XFS_IHASH(mp, ino); - read_lock(&ih->ih_lock); - ip = (xfs_inode_t *) radix_tree_lookup(&ih->ih_root, (unsigned long)ino); - read_unlock(&ih->ih_lock); + pag = xfs_get_perag(mp, ino); + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ino)); + read_unlock(&pag->pag_ici_lock); + xfs_put_perag(mp, pag); /* the returned inode must match the transaction */ if (ip && (ip->i_transp != tp)) @@ -606,15 +565,14 @@ void xfs_iextract( xfs_inode_t *ip) { - xfs_ihash_t *ih; + xfs_mount_t *mp = ip->i_mount; + xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); xfs_inode_t *iq; - xfs_mount_t *mp; - ih = ip->i_hash; - write_lock(&ih->ih_lock); - radix_tree_delete(&ih->ih_root, ip->i_ino); - ih->ih_version++; - write_unlock(&ih->ih_lock); + 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 cluster list Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2007-08-01 15:43:30.379434415 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2007-08-01 15:43:34.082954293 +1000 @@ -168,24 +168,10 @@ typedef struct xfs_iocore { extern void xfs_iocore_inode_init(struct xfs_inode *); extern void xfs_iocore_inode_reinit(struct xfs_inode *); - /* - * This is the type used in the xfs inode hash table. - * An array of these is allocated for each mounted - * file system to hash the inodes for that file system. - */ -typedef struct xfs_ihash { - struct radix_tree_root ih_root; - rwlock_t ih_lock; - uint ih_version; -} xfs_ihash_t; - -#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)((ino) >> 6)) % (mp)->m_ihsize)) - -/* - * This is the xfs inode cluster hash. This hash is used by xfs_iflush to - * find inodes that share a cluster and can be flushed to disk at the same - * time. + * This is the xfs inode cluster structure. This structure is used by + * xfs_iflush to find inodes that share a cluster and can be flushed to disk at + * the same time. */ typedef struct xfs_icluster { struct xfs_inode *icl_ip; @@ -219,7 +205,6 @@ typedef struct xfs_icluster { */ typedef struct { - struct xfs_ihash *ip_hash; /* pointer to hash header */ 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 */ @@ -227,7 +212,6 @@ typedef struct { typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_ihash *i_hash; /* pointer to hash header */ 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 */ Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.c 2007-08-01 15:43:30.391432860 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.c 2007-08-01 15:43:34.082954293 +1000 @@ -160,9 +160,6 @@ xfs_mount_free( xfs_mount_t *mp, int remove_bhv) { - if (mp->m_ihash) - xfs_ihash_free(mp); - if (mp->m_perag) { int agno; @@ -394,12 +391,22 @@ xfs_initialize_perag( pag->pagi_inodeok = 1; if (index < max_metadata) pag->pagf_metadata = 1; + if (!pag->pag_ici_init) { + rwlock_init(&pag->pag_ici_lock); + INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); + pag->pag_ici_init = 1; + } } } else { /* Setup default behavior for smaller filesystems */ for (index = 0; index < agcount; index++) { pag = &mp->m_perag[index]; pag->pagi_inodeok = 1; + if (!pag->pag_ici_init) { + rwlock_init(&pag->pag_ici_lock); + INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); + pag->pag_ici_init = 1; + } } } return index; @@ -1031,12 +1038,6 @@ xfs_mountfs( xfs_trans_init(mp); /* - * Allocate and initialize the inode hash table for this - * file system. - */ - xfs_ihash_init(mp); - - /* * Allocate and initialize the per-ag data. */ init_rwsem(&mp->m_peraglock); @@ -1187,7 +1188,6 @@ xfs_mountfs( error3: xfs_log_unmount_dealloc(mp); error2: - xfs_ihash_free(mp); for (agno = 0; agno < sbp->sb_agcount; agno++) if (mp->m_perag[agno].pagb_list) kmem_free(mp->m_perag[agno].pagb_list, Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.h 2007-08-01 10:43:15.490092795 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.h 2007-08-01 15:43:34.082954293 +1000 @@ -57,10 +57,7 @@ struct log; struct bhv_vfs; struct bhv_vnode; struct xfs_mount_args; -struct xfs_ihash; -struct xfs_chash; struct xfs_inode; -struct xfs_perag; struct xfs_iocore; struct xfs_bmbt_irec; struct xfs_bmap_free; @@ -335,8 +332,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ lock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - size_t m_ihsize; /* size of next field */ - struct xfs_ihash *m_ihash; /* fs private inode hash table*/ struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ @@ -458,7 +453,7 @@ typedef struct xfs_mount { #define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width * allocation */ -#define XFS_MOUNT_IHASHSIZE (1ULL << 20) /* inode hash table size */ + /* (1ULL << 20) -- currently unused */ #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred * I/O size in stat() */ @@ -572,6 +567,21 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, } /* + * perag get/put wrappers for eventual ref counting + */ +static inline xfs_perag_t * +xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino) +{ + return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)]; +} + +static inline void +xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag) +{ + /* nothing to see here, move along */ +} + +/* * Per-cpu superblock locking functions */ #ifdef HAVE_PERCPU_SB Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_export.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_export.c 2007-08-01 10:36:25.763324913 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_export.c 2007-08-01 15:43:34.094952738 +1000 @@ -17,10 +17,12 @@ */ #include "xfs.h" #include "xfs_types.h" -#include "xfs_dmapi.h" +#include "xfs_inum.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_export.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_buf_item.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_buf_item.c 2007-08-01 10:36:25.775323355 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_buf_item.c 2007-08-01 15:43:34.094952738 +1000 @@ -23,6 +23,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_buf_item.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_block.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_block.c 2007-08-01 15:06:25.800906516 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_block.c 2007-08-01 15:43:34.102951701 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_data.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_data.c 2007-08-01 10:36:25.791321277 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_data.c 2007-08-01 15:43:34.106951182 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_node.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_node.c 2007-08-01 10:36:25.791321277 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_node.c 2007-08-01 15:43:34.114950145 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_sf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_sf.c 2007-08-01 15:06:25.828902859 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_sf.c 2007-08-01 15:43:34.126948590 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_error.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_error.c 2007-08-01 10:36:25.791321277 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_error.c 2007-08-01 15:43:34.126948590 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_extfree_item.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_extfree_item.c 2007-08-01 10:36:25.791321277 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_extfree_item.c 2007-08-01 15:43:34.126948590 +1000 @@ -23,6 +23,7 @@ #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2007-08-01 15:43:30.383433897 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2007-08-01 15:43:34.130948071 +1000 @@ -2182,10 +2182,10 @@ xfs_ifree_cluster( int i, j, found, pre_flushed; xfs_daddr_t blkno; xfs_buf_t *bp; - xfs_ihash_t *ih; xfs_inode_t *ip, **ip_found; xfs_inode_log_item_t *iip; xfs_log_item_t *lip; + xfs_perag_t *pag = xfs_get_perag(mp, inum); SPLDECL(s); if (mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) { @@ -2220,20 +2220,20 @@ xfs_ifree_cluster( */ found = 0; for (i = 0; i < ninodes; i++) { - ih = XFS_IHASH(mp, inum + i); - read_lock(&ih->ih_lock); - ip = (xfs_inode_t *)radix_tree_lookup(&ih->ih_root, inum + i); + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, + XFS_INO_TO_AGINO(mp, (inum + i))); /* Inode not in memory or we found it already, * nothing to do */ if (!ip || xfs_iflags_test(ip, XFS_ISTALE)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } if (xfs_inode_clean(ip)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } @@ -2256,7 +2256,7 @@ xfs_ifree_cluster( ip_found[found++] = ip; } } - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } @@ -2274,8 +2274,7 @@ xfs_ifree_cluster( xfs_iunlock(ip, XFS_ILOCK_EXCL); } } - - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); } bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, blkno, @@ -2330,6 +2329,7 @@ xfs_ifree_cluster( } kmem_free(ip_found, ninodes * sizeof(xfs_inode_t *)); + xfs_put_perag(mp, pag); } /* Index: 2.6.x-xfs-new/fs/xfs/xfs_rename.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_rename.c 2007-08-01 10:36:25.799320238 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_rename.c 2007-08-01 15:43:34.138947034 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_trans_ail.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_trans_ail.c 2007-08-01 10:36:25.915305171 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_trans_ail.c 2007-08-01 15:43:34.146945997 +1000 @@ -22,6 +22,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_trans_extfree.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_trans_extfree.c 2007-08-01 10:36:25.915305171 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_trans_extfree.c 2007-08-01 15:43:34.150945479 +1000 @@ -22,6 +22,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-08-01 15:43:30.383433897 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-08-01 15:43:34.150945479 +1000 @@ -246,7 +246,6 @@ xfs_start_flags( ap->logbufsize); return XFS_ERROR(EINVAL); } - mp->m_ihsize = ap->ihashsize; mp->m_logbsize = ap->logbufsize; mp->m_fsname_len = strlen(ap->fsname) + 1; mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP); @@ -293,8 +292,6 @@ xfs_start_flags( mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; } - if (ap->flags & XFSMNT_IHASHSIZE) - mp->m_flags |= XFS_MOUNT_IHASHSIZE; if (ap->flags & XFSMNT_IDELETE) mp->m_flags |= XFS_MOUNT_IDELETE; if (ap->flags & XFSMNT_DIRSYNC) @@ -1693,7 +1690,6 @@ xfs_vget( #define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ #define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ #define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ -#define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and * unwritten extent conversion */ @@ -1819,15 +1815,6 @@ xfs_parseargs( iosize = suffix_strtoul(value, &eov, 10); args->flags |= XFSMNT_IOSIZE; args->iosizelog = ffs(iosize) - 1; - } else if (!strcmp(this_char, MNTOPT_IHASHSIZE)) { - if (!value || !*value) { - cmn_err(CE_WARN, - "XFS: %s option requires an argument", - this_char); - return EINVAL; - } - args->flags |= XFSMNT_IHASHSIZE; - args->ihashsize = simple_strtoul(value, &eov, 10); } else if (!strcmp(this_char, MNTOPT_GRPID) || !strcmp(this_char, MNTOPT_BSDGROUPS)) { vfsp->vfs_flag |= VFS_GRPID; @@ -1986,9 +1973,6 @@ xfs_showargs( seq_puts(m, xfs_infop->str); } - if (mp->m_flags & XFS_MOUNT_IHASHSIZE) - seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", (int)mp->m_ihsize); - if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", (int)(1 << mp->m_writeio_log) >> 10); Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c 2007-08-01 15:06:51.049608565 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c 2007-08-01 15:43:34.166943405 +1000 @@ -3859,7 +3859,7 @@ xfs_finish_reclaim( int locked, int sync_mode) { - xfs_ihash_t *ih = ip->i_hash; + xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); bhv_vnode_t *vp = XFS_ITOV_NULL(ip); int error; @@ -3871,12 +3871,12 @@ xfs_finish_reclaim( * Once we have the XFS_IRECLAIM flag set it will not touch * us. */ - write_lock(&ih->ih_lock); + 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)) { spin_unlock(&ip->i_flags_lock); - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); if (locked) { xfs_ifunlock(ip); xfs_iunlock(ip, XFS_ILOCK_EXCL); @@ -3885,7 +3885,8 @@ xfs_finish_reclaim( } __xfs_iflags_set(ip, XFS_IRECLAIM); spin_unlock(&ip->i_flags_lock); - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); + xfs_put_perag(ip->i_mount, pag); /* * If the inode is still dirty, then flush it out. If the inode Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2007-08-01 15:43:30.387433378 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2007-08-01 15:43:34.170942886 +1000 @@ -147,7 +147,6 @@ static void xfsidbg_xhelp(void); static void xfsidbg_xiclog(xlog_in_core_t *); static void xfsidbg_xiclogall(xlog_in_core_t *); static void xfsidbg_xiclogcb(xlog_in_core_t *); -static void xfsidbg_xihash(xfs_mount_t *mp); static void xfsidbg_xinodes(xfs_mount_t *); static void xfsidbg_delayed_blocks(xfs_mount_t *); static void xfsidbg_xinodes_quiesce(xfs_mount_t *); @@ -1238,25 +1237,6 @@ static int kdbm_xfs_xiclogcb( return 0; } -static int kdbm_xfs_xihash( - 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_xihash((xfs_mount_t *) addr); - return 0; -} - static int kdbm_xfs_xinodes( int argc, const char **argv) @@ -2131,15 +2111,11 @@ static void printinode(struct inode *ip) " i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n", ip->i_mode, ip->i_nlink, kdev_t_to_nr(ip->i_rdev), ip->i_state); - kdb_printf(" i_hash.nxt = 0x%p i_hash.pprv = 0x%p\n", - ip->i_hash.next, ip->i_hash.prev); #else kdb_printf( " i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n", ip->i_mode, ip->i_nlink, ip->i_rdev, ip->i_state); - kdb_printf(" i_hash.nxt = 0x%p i_hash.pprv = 0x%p\n", - ip->i_hash.next, ip->i_hash.pprev); #endif kdb_printf(" i_list.nxt = 0x%p i_list.prv = 0x%p\n", ip->i_list.next, ip->i_list.prev); @@ -2681,8 +2657,6 @@ static struct xif xfsidbg_funcs[] = { { "xictrc", kdbm_xfs_xiclogtrace, "", "Dump XFS in-core log trace" }, #endif - { "xihash", kdbm_xfs_xihash, "", - "Dump XFS inode hash statistics"}, #ifdef XFS_ILOCK_TRACE { "xilocktrc",kdbm_xfs_xilock_trace, "", "Dump XFS ilock trace" }, @@ -6610,7 +6584,7 @@ xfsidbg_xmount(xfs_mount_t *mp) "BARRIER", /* 0x20000 */ "IDELETE", /* 0x40000 */ "SWALLOC", /* 0x80000 */ - "IHASHSIZE", /* 0x100000 */ + "UNUSED_100000", /* 0x100000 */ "DIRSYNC", /* 0x200000 */ "COMPAT_IOSIZE",/* 0x400000 */ NULL @@ -6642,8 +6616,6 @@ 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("ihash 0x%p ihsize %zu\n", - mp->m_ihash, mp->m_ihsize); kdb_printf("inodes 0x%p ilock 0x%p ireclaims 0x%x\n", mp->m_inodes, &mp->m_ilock, mp->m_ireclaims); kdb_printf("readio_log 0x%x readio_blocks 0x%x ", @@ -6717,73 +6689,6 @@ xfsidbg_xmount(xfs_mount_t *mp) } -static void -xfsidbg_xihash(xfs_mount_t *mp) -{ -#if 0 - xfs_ihash_t *ih; - int i; - int j; - int total; - int numzeros; - xfs_inode_t *ip; - int *hist; - int hist_bytes = mp->m_ihsize * sizeof(int); - int hist2[21]; - - hist = (int *) kmalloc(hist_bytes, GFP_KERNEL); - - if (hist == NULL) { - kdb_printf("xfsidbg_xihash: kmalloc(%d) failed!\n", - hist_bytes); - return; - } - - for (i = 0; i < mp->m_ihsize; i++) { - ih = mp->m_ihash + i; - j = 0; - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) - j++; - hist[i] = j; - } - - numzeros = total = 0; - - for (i = 0; i < 21; i++) - hist2[i] = 0; - - for (i = 0; i < mp->m_ihsize; i++) { - kdb_printf("%d ", hist[i]); - total += hist[i]; - numzeros += hist[i] == 0 ? 1 : 0; - if (hist[i] > 20) - j = 20; - else - j = hist[i]; - - if (! (j <= 20)) { - kdb_printf("xfsidbg_xihash: (j > 20)/%d @ line # %d\n", - j, __LINE__); - return; - } - - hist2[j]++; - } - - kdb_printf("\n"); - - kdb_printf("total inodes = %d, average length = %zu, adjusted average = %zu\n", - total, total / mp->m_ihsize, - total / (mp->m_ihsize - numzeros)); - - for (i = 0; i < 21; i++) { - kdb_printf("%d - %d , ", i, hist2[i]); - } - kdb_printf("\n"); - kfree(hist); -#endif -} - /* * Command to print xfs inodes: kp xnode */ @@ -6799,10 +6704,8 @@ xfsidbg_xnode(xfs_inode_t *ip) NULL }; - kdb_printf("hash 0x%p mount 0x%p\n", - ip->i_hash, - ip->i_mount); - kdb_printf("mnext 0x%p mprev 0x%p vnode 0x%p \n", + 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)); Index: 2.6.x-xfs-new/fs/xfs/xfs_clnt.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_clnt.h 2007-08-01 10:36:25.915305171 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_clnt.h 2007-08-01 15:43:34.174942368 +1000 @@ -89,7 +89,6 @@ struct xfs_mount_args { #define XFSMNT_IDELETE 0x08000000 /* inode cluster delete */ #define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width * allocation */ -#define XFSMNT_IHASHSIZE 0x20000000 /* inode hash table size */ #define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename * symlink,mkdir,rmdir,mknod */ #define XFSMNT_FLAGS2 0x80000000 /* more flags set in flags2 */ From owner-xfs@oss.sgi.com Wed Aug 8 16:40:52 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:40:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78Nekbm025082 for ; Wed, 8 Aug 2007 16:40:49 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA28901; Thu, 9 Aug 2007 09:40:45 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78NeieW54421824; Thu, 9 Aug 2007 09:40:45 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78Neiec55639575; Thu, 9 Aug 2007 09:40:44 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:40:44 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: Review: Factor some common freelist checks Message-ID: <20070808234043.GT12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12532 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Suggested by Tim - don't duplicate the code used to check the longest available extent on the freelist. [we've got to clean up this header include mess.] Signed-off-by: Dave Chinner --- fs/xfs/dmapi/xfs_dm.c | 2 +- fs/xfs/dmapi/xfs_dm_bhv.c | 2 +- fs/xfs/dmapi/xfs_dm_fsops.c | 2 +- fs/xfs/linux-2.6/xfs_ioctl.c | 2 +- fs/xfs/linux-2.6/xfs_iops.c | 2 +- fs/xfs/linux-2.6/xfs_ksyms.c | 2 +- fs/xfs/linux-2.6/xfs_lrw.c | 2 +- fs/xfs/linux-2.6/xfs_super.c | 2 +- fs/xfs/linux-2.6/xfs_vfs.c | 2 +- fs/xfs/quota/xfs_dquot.c | 2 +- fs/xfs/quota/xfs_dquot_item.c | 2 +- fs/xfs/quota/xfs_qm.c | 2 +- fs/xfs/quota/xfs_qm_bhv.c | 2 +- fs/xfs/quota/xfs_qm_ksyms.c | 2 +- fs/xfs/quota/xfs_qm_stats.c | 2 +- fs/xfs/quota/xfs_qm_syscalls.c | 2 +- fs/xfs/quota/xfs_trans_dquot.c | 2 +- fs/xfs/xfs_alloc.c | 7 ++----- fs/xfs/xfs_alloc.h | 19 +++++++++++++++++-- fs/xfs/xfs_bmap.c | 12 ++---------- fs/xfs/xfs_filestream.c | 9 ++------- fs/xfs/xfs_iomap.c | 2 +- 22 files changed, 41 insertions(+), 42 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_alloc.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_alloc.c 2007-06-25 13:56:20.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_alloc.c 2007-06-25 14:06:05.123181552 +1000 @@ -1858,15 +1858,12 @@ xfs_alloc_fix_freelist( } if (!(flags & XFS_ALLOC_FLAG_FREEING)) { - need = XFS_MIN_FREELIST_PAG(pag, mp); - delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; /* * If it looks like there isn't a long enough extent, or enough * total blocks, reject it. */ - longest = (pag->pagf_longest > delta) ? - (pag->pagf_longest - delta) : - (pag->pagf_flcount > 0 || pag->pagf_longest > 0); + need = XFS_MIN_FREELIST_PAG(pag, mp); + xfs_alloc_min_freelist(mp, pag, &longest); if ((args->minlen + args->alignment + args->minalignslop - 1) > longest || ((int)(pag->pagf_freeblks + pag->pagf_flcount - Index: 2.6.x-xfs-new/fs/xfs/xfs_alloc.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_alloc.h 2007-05-22 19:04:51.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_alloc.h 2007-06-25 14:14:13.627226544 +1000 @@ -19,8 +19,6 @@ #define __XFS_ALLOC_H__ struct xfs_buf; -struct xfs_mount; -struct xfs_perag; struct xfs_trans; /* @@ -207,6 +205,23 @@ xfs_alloc_clear_busy(xfs_trans_t *tp, xfs_agnumber_t ag, int idx); +/* + * Determine the longest free extent available in the AG supplied + */ +STATIC_INLINE void +xfs_alloc_min_freelist( + xfs_mount_t *mp, + xfs_perag_t *pag, + xfs_extlen_t *longest) +{ + xfs_extlen_t need, delta; + + need = XFS_MIN_FREELIST_PAG(pag, mp); + delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; + *longest = (pag->pagf_longest > delta) ? + (pag->pagf_longest - delta) : + (pag->pagf_flcount > 0 || pag->pagf_longest > 0); +} #endif /* __KERNEL__ */ Index: 2.6.x-xfs-new/fs/xfs/xfs_bmap.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_bmap.c 2007-06-25 13:56:11.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_bmap.c 2007-06-25 14:11:19.905965882 +1000 @@ -2703,9 +2703,6 @@ xfs_bmap_btalloc( xfs_agnumber_t startag; xfs_alloc_arg_t args; xfs_extlen_t blen; - xfs_extlen_t delta; - xfs_extlen_t longest; - xfs_extlen_t need; xfs_extlen_t nextminlen = 0; xfs_perag_t *pag; int nullfb; /* true if ap->firstblock isn't set */ @@ -2787,13 +2784,8 @@ xfs_bmap_btalloc( * See xfs_alloc_fix_freelist... */ if (pag->pagf_init) { - need = XFS_MIN_FREELIST_PAG(pag, mp); - delta = need > pag->pagf_flcount ? - need - pag->pagf_flcount : 0; - longest = (pag->pagf_longest > delta) ? - (pag->pagf_longest - delta) : - (pag->pagf_flcount > 0 || - pag->pagf_longest > 0); + xfs_extlen_t longest; + xfs_alloc_min_freelist(mp, pag, &longest); if (blen < longest) blen = longest; } else Index: 2.6.x-xfs-new/fs/xfs/xfs_filestream.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_filestream.c 2007-06-22 18:07:15.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_filestream.c 2007-06-25 14:11:11.355085273 +1000 @@ -140,7 +140,7 @@ _xfs_filestream_pick_ag( xfs_extlen_t minlen) { int err, trylock, nscan; - xfs_extlen_t delta, longest, need, free, minfree, maxfree = 0; + xfs_extlen_t longest, free, minfree, maxfree = 0; xfs_agnumber_t ag, max_ag = NULLAGNUMBER; struct xfs_perag *pag; @@ -186,12 +186,7 @@ _xfs_filestream_pick_ag( goto next_ag; } - need = XFS_MIN_FREELIST_PAG(pag, mp); - delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; - longest = (pag->pagf_longest > delta) ? - (pag->pagf_longest - delta) : - (pag->pagf_flcount > 0 || pag->pagf_longest > 0); - + xfs_alloc_min_freelist(mp, pag, &longest); if (((minlen && longest >= minlen) || (!minlen && pag->pagf_freeblks >= minfree)) && (!pag->pagf_metadata || !(flags & XFS_PICK_USERDATA) || Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2007-06-20 17:59:36.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ioctl.c 2007-06-25 14:13:21.298075718 +1000 @@ -24,9 +24,9 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_iops.c 2007-05-29 16:18:03.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_iops.c 2007-06-25 14:13:02.976473863 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-06-20 17:53:36.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_lrw.c 2007-06-25 14:14:30.457023840 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_super.c 2007-06-20 17:53:35.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c 2007-06-25 14:14:43.087370791 +1000 @@ -25,10 +25,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vfs.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_vfs.c 2007-01-16 10:54:16.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vfs.c 2007-06-25 14:14:56.941557595 +1000 @@ -25,9 +25,9 @@ #include "xfs_ag.h" #include "xfs_dir2.h" #include "xfs_imap.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_quota.h" int Index: 2.6.x-xfs-new/fs/xfs/xfs_iomap.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iomap.c 2007-06-08 21:36:26.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iomap.c 2007-06-25 14:12:09.347493741 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm.c 2007-06-08 21:36:26.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm.c 2007-06-25 14:19:43.936003898 +1000 @@ -26,9 +26,9 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_bhv.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm_bhv.c 2007-01-16 10:54:14.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_bhv.c 2007-06-25 14:16:45.923295350 +1000 @@ -26,9 +26,9 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_fsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm_fsops.c 2007-01-16 10:54:14.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_fsops.c 2007-06-25 14:18:12.523963285 +1000 @@ -26,9 +26,9 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2007-06-25 13:56:20.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c 2007-06-25 14:15:49.646659958 +1000 @@ -27,10 +27,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_da_btree.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_dquot.c 2007-06-25 13:56:20.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot.c 2007-06-25 14:19:04.513160782 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot_item.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_dquot_item.c 2007-06-25 13:56:20.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot_item.c 2007-06-25 14:19:21.906884992 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm.c 2007-06-25 13:56:20.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm.c 2007-06-25 14:21:29.450325544 +1000 @@ -25,10 +25,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_bhv.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_bhv.c 2007-02-07 13:24:32.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_bhv.c 2007-06-25 14:20:21.775098823 +1000 @@ -25,10 +25,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_ksyms.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_ksyms.c 2007-01-16 10:54:16.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_ksyms.c 2007-06-25 14:21:01.018011537 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_stats.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_stats.c 2007-02-07 13:24:32.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_stats.c 2007-06-25 14:21:14.844219110 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_syscalls.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_syscalls.c 2007-03-29 19:03:30.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_syscalls.c 2007-06-25 14:18:28.637854830 +1000 @@ -27,10 +27,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_trans_dquot.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_trans_dquot.c 2007-03-29 19:03:30.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_trans_dquot.c 2007-06-25 14:18:48.239290090 +1000 @@ -24,10 +24,10 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" -#include "xfs_alloc.h" #include "xfs_dmapi.h" #include "xfs_quota.h" #include "xfs_mount.h" +#include "xfs_alloc.h" #include "xfs_bmap_btree.h" #include "xfs_alloc_btree.h" #include "xfs_ialloc_btree.h" From owner-xfs@oss.sgi.com Wed Aug 8 16:59:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 16:59:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l78Nx9bm030573 for ; Wed, 8 Aug 2007 16:59:11 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA29301; Thu, 9 Aug 2007 09:59:08 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l78Nx6eW55611925; Thu, 9 Aug 2007 09:59:07 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l78Nx4uo55658847; Thu, 9 Aug 2007 09:59:04 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 09:59:04 +1000 From: David Chinner To: Martin Steigerwald Cc: xfs@oss.sgi.com Subject: Re: Impact of atime updates on XFS Message-ID: <20070808235904.GS52011508@sgi.com> References: <200708081408.01817.ms@teamix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708081408.01817.ms@teamix.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12533 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Aug 08, 2007 at 02:07:51PM +0200, Martin Steigerwald wrote: > > Hello! > > Today, I read about the impact of atime updates on ext3 and possible > approaches on how to reduce that impact by using relatime, a modified version > of relatime - Ingo Molnar posted a patch - or two different states of dirty > inodes, atime dirty inodes which do not need to be flushed soon and dirty > inodes with other changes which should be flushed soon[1]. Oh, that thread. Wake me when it's over, please? > What would be the impact of atime versus noatime on XFS? What is the > recommended setting for XFS? Are there any plans to implement relatime > logic - maybe even the improved one by Ingo Molnar - into XFS? relatime is a VFS layer construct - it should work with XFS right now. > I just remounted my partitions on the notebook and my workstation with noatime > for testing and I have the feeling that it indeed does help. It might feel that way, but if you can't quantify it, it doesn't exist. Joern Engel is the only person to present hard numbers in that thread, and they showed pretty much no difference to performance.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Aug 8 17:14:27 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 17:14:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from postoffice.aconex.com (mail.app.aconex.com [203.89.192.138]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l790ENbm003032 for ; Wed, 8 Aug 2007 17:14:27 -0700 Received: from mail.aconex.com (castle.yarra.acx [192.168.3.3]) by postoffice.aconex.com (Postfix) with ESMTP id 75AFA127C55F; Thu, 9 Aug 2007 10:14:25 +1000 (EST) Received: from 192.168.3.1 (proxying for 211.28.181.43) (SquirrelMail authenticated user nscott) by mail.aconex.com with HTTP; Thu, 9 Aug 2007 10:14:40 +1000 (EST) Message-ID: <38891.192.168.3.1.1186618480.squirrel@mail.aconex.com> In-Reply-To: <20070808231310.GS12413810@sgi.com> References: <20070808231310.GS12413810@sgi.com> Date: Thu, 9 Aug 2007 10:14:40 +1000 (EST) Subject: Re: [PATCH 4 of 4] Per Allocation Group inode radix trees From: nscott@aconex.com To: "David Chinner" Cc: "xfs-dev" , "xfs-oss" User-Agent: SquirrelMail/1.4.8-4.el4.centos MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12534 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 > ... > operations by keeping structures and operations within AGs. This > removes the need for the ihashsize mount parameter altogether > as the inode caches should never need size hints anymore. >... > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-08-01 15:43:30.383433897 > +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-08-01 15:43:34.150945479 +1000 > ... > -#define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ You probably want to keep this string & parsing for awhile (forever?), but move it to the end of the list with the other deprecated options - just so as to not fail mounts on kernel upgrades... and surprise/annoy sysadmins the world over. cheers. -- Nathan From owner-xfs@oss.sgi.com Wed Aug 8 18:14:02 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 18:14:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_26 autolearn=no version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l791Dvbm018645 for ; Wed, 8 Aug 2007 18:14:01 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IIwHe-0002xF-NK; Thu, 09 Aug 2007 01:53:50 +0100 Date: Thu, 9 Aug 2007 01:53:50 +0100 From: Christoph Hellwig To: David Chinner Cc: xfs-dev , xfs-oss Subject: Re: Review: Factor some common freelist checks Message-ID: <20070809005350.GA11164@infradead.org> References: <20070808234043.GT12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070808234043.GT12413810@sgi.com> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12535 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 09, 2007 at 09:40:44AM +1000, David Chinner wrote: > Suggested by Tim - don't duplicate the code used to check > the longest available extent on the freelist. > > [we've got to clean up this header include mess.] Just move it out of line, it'squite large anyway if you look at all the branches (and there's two more hidden behing XFS_MIN_FREELIST_PAG). Also I'd suggest returning longest from the function instead of using a pointer to return the value. in the end we'd have something like: xfs_extlen_t xfs_alloc_min_freelist( xfs_mount_t *mp, xfs_perag_t *pag) { xfs_extlen_t need, delta; need = XFS_MIN_FREELIST_PAG(pag, mp); if (need > pag->pagf_flcount) delta = need - pag->pagf_flcount; else delta = 0; if (pag->pagf_longest > delta) return pag->pagf_longest - delta; return pag->pagf_flcount > 0 || pag->pagf_longest > 0; } > > Signed-off-by: Dave Chinner > > --- > fs/xfs/dmapi/xfs_dm.c | 2 +- > fs/xfs/dmapi/xfs_dm_bhv.c | 2 +- > fs/xfs/dmapi/xfs_dm_fsops.c | 2 +- > fs/xfs/linux-2.6/xfs_ioctl.c | 2 +- > fs/xfs/linux-2.6/xfs_iops.c | 2 +- > fs/xfs/linux-2.6/xfs_ksyms.c | 2 +- > fs/xfs/linux-2.6/xfs_lrw.c | 2 +- > fs/xfs/linux-2.6/xfs_super.c | 2 +- > fs/xfs/linux-2.6/xfs_vfs.c | 2 +- > fs/xfs/quota/xfs_dquot.c | 2 +- > fs/xfs/quota/xfs_dquot_item.c | 2 +- > fs/xfs/quota/xfs_qm.c | 2 +- > fs/xfs/quota/xfs_qm_bhv.c | 2 +- > fs/xfs/quota/xfs_qm_ksyms.c | 2 +- > fs/xfs/quota/xfs_qm_stats.c | 2 +- > fs/xfs/quota/xfs_qm_syscalls.c | 2 +- > fs/xfs/quota/xfs_trans_dquot.c | 2 +- > fs/xfs/xfs_alloc.c | 7 ++----- > fs/xfs/xfs_alloc.h | 19 +++++++++++++++++-- > fs/xfs/xfs_bmap.c | 12 ++---------- > fs/xfs/xfs_filestream.c | 9 ++------- > fs/xfs/xfs_iomap.c | 2 +- > 22 files changed, 41 insertions(+), 42 deletions(-) > > Index: 2.6.x-xfs-new/fs/xfs/xfs_alloc.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_alloc.c 2007-06-25 13:56:20.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_alloc.c 2007-06-25 14:06:05.123181552 +1000 > @@ -1858,15 +1858,12 @@ xfs_alloc_fix_freelist( > } > > if (!(flags & XFS_ALLOC_FLAG_FREEING)) { > - need = XFS_MIN_FREELIST_PAG(pag, mp); > - delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; > /* > * If it looks like there isn't a long enough extent, or enough > * total blocks, reject it. > */ > - longest = (pag->pagf_longest > delta) ? > - (pag->pagf_longest - delta) : > - (pag->pagf_flcount > 0 || pag->pagf_longest > 0); > + need = XFS_MIN_FREELIST_PAG(pag, mp); > + xfs_alloc_min_freelist(mp, pag, &longest); > if ((args->minlen + args->alignment + args->minalignslop - 1) > > longest || > ((int)(pag->pagf_freeblks + pag->pagf_flcount - > Index: 2.6.x-xfs-new/fs/xfs/xfs_alloc.h > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_alloc.h 2007-05-22 19:04:51.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_alloc.h 2007-06-25 14:14:13.627226544 +1000 > @@ -19,8 +19,6 @@ > #define __XFS_ALLOC_H__ > > struct xfs_buf; > -struct xfs_mount; > -struct xfs_perag; > struct xfs_trans; > > /* > @@ -207,6 +205,23 @@ xfs_alloc_clear_busy(xfs_trans_t *tp, > xfs_agnumber_t ag, > int idx); > > +/* > + * Determine the longest free extent available in the AG supplied > + */ > +STATIC_INLINE void > +xfs_alloc_min_freelist( > + xfs_mount_t *mp, > + xfs_perag_t *pag, > + xfs_extlen_t *longest) > +{ > + xfs_extlen_t need, delta; > + > + need = XFS_MIN_FREELIST_PAG(pag, mp); > + delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; > + *longest = (pag->pagf_longest > delta) ? > + (pag->pagf_longest - delta) : > + (pag->pagf_flcount > 0 || pag->pagf_longest > 0); > +} > > #endif /* __KERNEL__ */ > > Index: 2.6.x-xfs-new/fs/xfs/xfs_bmap.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_bmap.c 2007-06-25 13:56:11.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_bmap.c 2007-06-25 14:11:19.905965882 +1000 > @@ -2703,9 +2703,6 @@ xfs_bmap_btalloc( > xfs_agnumber_t startag; > xfs_alloc_arg_t args; > xfs_extlen_t blen; > - xfs_extlen_t delta; > - xfs_extlen_t longest; > - xfs_extlen_t need; > xfs_extlen_t nextminlen = 0; > xfs_perag_t *pag; > int nullfb; /* true if ap->firstblock isn't set */ > @@ -2787,13 +2784,8 @@ xfs_bmap_btalloc( > * See xfs_alloc_fix_freelist... > */ > if (pag->pagf_init) { > - need = XFS_MIN_FREELIST_PAG(pag, mp); > - delta = need > pag->pagf_flcount ? > - need - pag->pagf_flcount : 0; > - longest = (pag->pagf_longest > delta) ? > - (pag->pagf_longest - delta) : > - (pag->pagf_flcount > 0 || > - pag->pagf_longest > 0); > + xfs_extlen_t longest; > + xfs_alloc_min_freelist(mp, pag, &longest); > if (blen < longest) > blen = longest; > } else > Index: 2.6.x-xfs-new/fs/xfs/xfs_filestream.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_filestream.c 2007-06-22 18:07:15.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_filestream.c 2007-06-25 14:11:11.355085273 +1000 > @@ -140,7 +140,7 @@ _xfs_filestream_pick_ag( > xfs_extlen_t minlen) > { > int err, trylock, nscan; > - xfs_extlen_t delta, longest, need, free, minfree, maxfree = 0; > + xfs_extlen_t longest, free, minfree, maxfree = 0; > xfs_agnumber_t ag, max_ag = NULLAGNUMBER; > struct xfs_perag *pag; > > @@ -186,12 +186,7 @@ _xfs_filestream_pick_ag( > goto next_ag; > } > > - need = XFS_MIN_FREELIST_PAG(pag, mp); > - delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0; > - longest = (pag->pagf_longest > delta) ? > - (pag->pagf_longest - delta) : > - (pag->pagf_flcount > 0 || pag->pagf_longest > 0); > - > + xfs_alloc_min_freelist(mp, pag, &longest); > if (((minlen && longest >= minlen) || > (!minlen && pag->pagf_freeblks >= minfree)) && > (!pag->pagf_metadata || !(flags & XFS_PICK_USERDATA) || > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ioctl.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2007-06-20 17:59:36.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ioctl.c 2007-06-25 14:13:21.298075718 +1000 > @@ -24,9 +24,9 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_iops.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_iops.c 2007-05-29 16:18:03.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_iops.c 2007-06-25 14:13:02.976473863 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_lrw.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-06-20 17:53:36.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_lrw.c 2007-06-25 14:14:30.457023840 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_super.c 2007-06-20 17:53:35.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c 2007-06-25 14:14:43.087370791 +1000 > @@ -25,10 +25,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vfs.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_vfs.c 2007-01-16 10:54:16.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vfs.c 2007-06-25 14:14:56.941557595 +1000 > @@ -25,9 +25,9 @@ > #include "xfs_ag.h" > #include "xfs_dir2.h" > #include "xfs_imap.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_quota.h" > > int > Index: 2.6.x-xfs-new/fs/xfs/xfs_iomap.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iomap.c 2007-06-08 21:36:26.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/xfs_iomap.c 2007-06-25 14:12:09.347493741 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm.c 2007-06-08 21:36:26.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm.c 2007-06-25 14:19:43.936003898 +1000 > @@ -26,9 +26,9 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_da_btree.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_bhv.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm_bhv.c 2007-01-16 10:54:14.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_bhv.c 2007-06-25 14:16:45.923295350 +1000 > @@ -26,9 +26,9 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_fsops.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/dmapi/xfs_dm_fsops.c 2007-01-16 10:54:14.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/dmapi/xfs_dm_fsops.c 2007-06-25 14:18:12.523963285 +1000 > @@ -26,9 +26,9 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2007-06-25 13:56:20.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c 2007-06-25 14:15:49.646659958 +1000 > @@ -27,10 +27,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_da_btree.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_dquot.c 2007-06-25 13:56:20.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot.c 2007-06-25 14:19:04.513160782 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot_item.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_dquot_item.c 2007-06-25 13:56:20.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_dquot_item.c 2007-06-25 14:19:21.906884992 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm.c 2007-06-25 13:56:20.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm.c 2007-06-25 14:21:29.450325544 +1000 > @@ -25,10 +25,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_bhv.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_bhv.c 2007-02-07 13:24:32.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_bhv.c 2007-06-25 14:20:21.775098823 +1000 > @@ -25,10 +25,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_ksyms.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_ksyms.c 2007-01-16 10:54:16.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_ksyms.c 2007-06-25 14:21:01.018011537 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_stats.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_stats.c 2007-02-07 13:24:32.000000000 +1100 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_stats.c 2007-06-25 14:21:14.844219110 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_syscalls.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_qm_syscalls.c 2007-03-29 19:03:30.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_qm_syscalls.c 2007-06-25 14:18:28.637854830 +1000 > @@ -27,10 +27,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > Index: 2.6.x-xfs-new/fs/xfs/quota/xfs_trans_dquot.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/quota/xfs_trans_dquot.c 2007-03-29 19:03:30.000000000 +1000 > +++ 2.6.x-xfs-new/fs/xfs/quota/xfs_trans_dquot.c 2007-06-25 14:18:48.239290090 +1000 > @@ -24,10 +24,10 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > -#include "xfs_alloc.h" > #include "xfs_dmapi.h" > #include "xfs_quota.h" > #include "xfs_mount.h" > +#include "xfs_alloc.h" > #include "xfs_bmap_btree.h" > #include "xfs_alloc_btree.h" > #include "xfs_ialloc_btree.h" > > ---end quoted text--- From owner-xfs@oss.sgi.com Wed Aug 8 18:54:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 18:54:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l791sJbm029348 for ; Wed, 8 Aug 2007 18:54:49 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA02467; Thu, 9 Aug 2007 11:54:19 +1000 Message-ID: <46BA7446.6060604@sgi.com> Date: Thu, 09 Aug 2007 11:56:22 +1000 From: Vlad Apostolov User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev Subject: Re: REVIEW: xfs_repair doesn't handle fsblock != dirblock sizes properly References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12536 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs It is looking good Barry, Regards, Vlad Barry Naujok wrote: > Part of the improved xfs_repair performance speedups, the > prefetch/dir block handling code made sure the I/Os are the > same size between phases. Unfortunately, the blocks are > too small - directories were broken up into fsblock sizes > instead of dirblock sizes. > > The attached patch fixes this regression up. From owner-xfs@oss.sgi.com Wed Aug 8 23:20:58 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 08 Aug 2007 23:21:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l796Krbm031869 for ; Wed, 8 Aug 2007 23:20:58 -0700 Received: from localhost (dslb-084-056-096-011.pools.arcor-ip.net [84.56.96.11]) by mail.lichtvoll.de (Postfix) with ESMTP id 696EE5ADED for ; Thu, 9 Aug 2007 08:25:12 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Re: Impact of atime updates on XFS Date: Thu, 9 Aug 2007 08:20:55 +0200 User-Agent: KMail/1.9.7 References: <200708081408.01817.ms@teamix.de> <20070808235904.GS52011508@sgi.com> (sfid-20070809_081046_217631_CE3DEB23) In-Reply-To: <20070808235904.GS52011508@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708090820.55509.Martin@Lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12537 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 09 August 2007 schrieb David Chinner: > > What would be the impact of atime versus noatime on XFS? What is the > > recommended setting for XFS? Are there any plans to implement > > relatime logic - maybe even the improved one by Ingo Molnar - into > > XFS? > > relatime is a VFS layer construct - it should work with XFS right now. Thanks for your answer. XFS says: XFS: unknown mount option [relatime]. here with Linux shambala 2.6.21.6-tp42-cfs-v19-sws2-2.2.10 #1 PREEMPT Sun Jul 8 21:14:29 CEST 2007 i686 GNU/Linux > > I just remounted my partitions on the notebook and my workstation > > with noatime for testing and I have the feeling that it indeed does > > help. > > It might feel that way, but if you can't quantify it, it doesn't exist. > Joern Engel is the only person to present hard numbers in that thread, > and they showed pretty much no difference to performance.... Ok. I think I will try his benchmark and see whether it makes a difference here. Me just wonders why Ingo says it has the biggest performance impact ever when it doesn't. And he didn' t provide numbers. I think I will contact him directly about that. Regards, -- 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 9 03:15:53 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 03:15:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79AFnbm010755 for ; Thu, 9 Aug 2007 03:15:52 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id UAA16143; Thu, 9 Aug 2007 20:15:48 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79AFkeW56020375; Thu, 9 Aug 2007 20:15:47 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79AFi8656006257; Thu, 9 Aug 2007 20:15:44 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 20:15:44 +1000 From: David Chinner To: Martin Steigerwald Cc: linux-xfs@oss.sgi.com Subject: Re: Impact of atime updates on XFS Message-ID: <20070809101544.GZ12413810@sgi.com> References: <200708081408.01817.ms@teamix.de> <20070808235904.GS52011508@sgi.com> <200708090820.55509.Martin@Lichtvoll.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708090820.55509.Martin@Lichtvoll.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12538 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Aug 09, 2007 at 08:20:55AM +0200, Martin Steigerwald wrote: > Am Donnerstag 09 August 2007 schrieb David Chinner: > > > > What would be the impact of atime versus noatime on XFS? What is the > > > recommended setting for XFS? Are there any plans to implement > > > relatime logic - maybe even the improved one by Ingo Molnar - into > > > XFS? > > > > relatime is a VFS layer construct - it should work with XFS right now. > > Thanks for your answer. > > XFS says: > > XFS: unknown mount option [relatime]. That's because it's supposed to be encoded in the mount flags (i.e. intercepted by the mount binary and not passed to the kernel directly). I think you need a more recent mount binary.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Aug 9 04:03:39 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:03:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79B3Zbm023074 for ; Thu, 9 Aug 2007 04:03:38 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA17223; Thu, 9 Aug 2007 21:03:26 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79B3PeW56004868; Thu, 9 Aug 2007 21:03:25 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79B3MiK55919262; Thu, 9 Aug 2007 21:03:22 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:03:22 +1000 From: David Chinner To: Andi Kleen Cc: David Chinner , xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc Message-ID: <20070809110322.GA12413810@sgi.com> References: <200708081240.21548.ak@suse.de> <200708081422.10373.ak@suse.de> <20070808131404.GQ52011508@sgi.com> <200708081526.06860.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708081526.06860.ak@suse.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12539 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Aug 08, 2007 at 03:26:06PM +0200, Andi Kleen wrote: > On Wednesday 08 August 2007 15:14:04 David Chinner wrote: > > > Memory allocation failure + dirty transaction == filesystem shutdown. > > You mean if the workqueue creation would fail? Yeah. > Surely not having the MRU cache is not a catastrophe and would > allow the transaction to commit anyways? Right now the only errors that come from filestream association are fatal errors. i.e. they should force a shutdown if the transaction is dirty. One of these errors is already an ENOMEM. Now we'd have a case where we'd had a "error that is not an error" and handle that in some way. It gets complex and that's something I try to avoid if at all possible. > The other alternative would be to start it when a directory with > the flag is first seen. That should be before any transactions. On lookup? No thanks. On first create? Possible, but it's still painful and it introduces overhead into every single create operation. > > > > Besides, what's the point of having nice constructs like dedicated > > > > workqueues > > > It's a resource that shouldn't be overused. > > A workqueue + thread uses, what, 10-15k of memory? That's the cost of about > > 10 cached inodes. It is insignificant... > > A little bloat here and a little bloat there and soon we're talking > about serious memory. > > e.g. on a dual core box in a standard configuration we're going towards > ~50 kernel threads out of the box now and that's just too much IMNSHO. My idle desktop machine has 180 processes running on it, 60 of them kernel threads. It doesn't concern me one bit. Andi, you are complaining to the wrong person about thread counts. I live in the world of excessive parallelism and multithreaded I/O. I regularly see 4-8p boxes running hundreds to thousands of I/O threads on a single filesystem. These are the workloads XFS is designed for and we optimise for. A single extra thread is noise.... > > Hmmm. I guess you are really not going to like the patch I > > have that moves the AIL pushing to a new thread to solve > > some of scalability issues in the transaction subsystem...... > > Per CPU or single? Single. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Aug 9 04:06:13 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:06:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l79B6Abm024093 for ; Thu, 9 Aug 2007 04:06:12 -0700 Received: from localhost (dslb-084-056-114-039.pools.arcor-ip.net [84.56.114.39]) by mail.lichtvoll.de (Postfix) with ESMTP id 73BC95ADED; Thu, 9 Aug 2007 13:10:32 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Re: Impact of atime updates on XFS Date: Thu, 9 Aug 2007 13:06:12 +0200 User-Agent: KMail/1.9.7 Cc: David Chinner References: <200708081408.01817.ms@teamix.de> <200708090820.55509.Martin@Lichtvoll.de> <20070809101544.GZ12413810@sgi.com> (sfid-20070809_125925_922049_8B1C4B50) In-Reply-To: <20070809101544.GZ12413810@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708091306.13011.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12540 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 09 August 2007 schrieb David Chinner: > On Thu, Aug 09, 2007 at 08:20:55AM +0200, Martin Steigerwald wrote: > > Am Donnerstag 09 August 2007 schrieb David Chinner: > > > > What would be the impact of atime versus noatime on XFS? What is > > > > the recommended setting for XFS? Are there any plans to implement > > > > relatime logic - maybe even the improved one by Ingo Molnar - > > > > into XFS? > > > > > > relatime is a VFS layer construct - it should work with XFS right > > > now. > > > > Thanks for your answer. > > > > XFS says: > > > > XFS: unknown mount option [relatime]. > > That's because it's supposed to be encoded in the mount flags (i.e. > intercepted by the mount binary and not passed to the kernel > directly). I think you need a more recent mount binary.... Exactly. After I upgraded mount debian package 2.12r-19 to 2.13~rc3-1 mount -o remount,relatime works. Thanks. I got a response back from Ingo and he said, that on ext3 atime updates are very visible while XFS does some journalling tricks to mitigate it. He doubts that I will see much difference on XFS as it has less strict synchronisation rules than ext3. -- 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 9 04:34:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:34:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79BY6bm003760 for ; Thu, 9 Aug 2007 04:34:10 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA17947; Thu, 9 Aug 2007 21:34:06 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79BY5eW55916593; Thu, 9 Aug 2007 21:34:06 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79BY4Ei56059747; Thu, 9 Aug 2007 21:34:04 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:34:04 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 0 of 4] Radix tree based inode caching V2 Message-ID: <20070809113404.GC12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12541 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs One of the perpetual scaling problems XFS has is indexing it's incore inodes. We currently uses hashes and the default hash sizes chosen can only ever be a tradeoff between memory consumption and the maximum realistic size of the cache. As a result, anyone who has millions of inodes cached on a filesystem needs to tunes the size of the cache via the ihashsize mount option to allow decent scalability with inode cache operations. A further problem is the separate inode cluster hash, whose size is based on the ihashsize but is smaller, and so under certain conditions (sparse cluster cache population) this can become a limitation long before the inode hash is causing issues. The following patchset removes the inode hash and cluster hash and replaces them with radix trees to avoid the scalability limitations of the hashes. It also reduces the size of the inodes by 3 pointers.... Version 2: o collapse the original 4 patches into one o factor per-ag radix tree intialisation o convert the xfs_icluster list to use list.h constructs o make ihashsize mount option output: "XFS: ihashsize no longer used, option is deprecated." o update ihashsize docco Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Aug 9 04:38:16 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:38:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_54, J_CHICKENPOX_66,J_CHICKENPOX_75 autolearn=no version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79BcAbm004953 for ; Thu, 9 Aug 2007 04:38:12 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA18001; Thu, 9 Aug 2007 21:38:09 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79Bc8eW56036977; Thu, 9 Aug 2007 21:38:09 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79Bc75c56074502; Thu, 9 Aug 2007 21:38:07 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:38:07 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 1 of 4] Convert inode hash caches to radix trees Message-ID: <20070809113807.GD12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12542 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Convert the inode cache hash to a radix tree. A radix tree has been chosen to replace the hash because of a neat alignment of XFS inode structures and the kernel radix tree fanout. XFS allocates inodes in clusters of 64 inodes and the radix tree keeps 64 sequential entries per node. That means all fo the inodes in a cluster will always sit in the same node of the radix tree. A single radix tree with a read/write lock does not provide enough parallelism to prevent performance regressions on multi-processor machines, so we provide a radix tree per AG. By moving to a radix tree per AG, we can use the agino number as the index rather than the inode number, thereby reducing the radix tree key to 32 bits enabling this to be used for 64 bit inodes on 32 bit machines. In doing so, we also greatly reduce the sparseness of the radix trees because the agino is a more compact representation of the inode location than the inode number. It also provides inherent parallelism in the same manner as the rest of XFS without the need for heuristics. i.e. we parallelise operations by keeping structures and operations within AGs. This removes the need for the ihashsize mount parameter altogether as the inode caches should never need size hints anymore. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_export.c | 4 fs/xfs/linux-2.6/xfs_ksyms.c | 2 fs/xfs/xfs_ag.h | 4 fs/xfs/xfs_buf_item.c | 1 fs/xfs/xfs_clnt.h | 1 fs/xfs/xfs_dir2_block.c | 1 fs/xfs/xfs_dir2_data.c | 1 fs/xfs/xfs_dir2_node.c | 1 fs/xfs/xfs_dir2_sf.c | 1 fs/xfs/xfs_error.c | 1 fs/xfs/xfs_extfree_item.c | 1 fs/xfs/xfs_iget.c | 606 +++++++++++++++--------------------------- fs/xfs/xfs_inode.c | 36 -- fs/xfs/xfs_inode.h | 59 ---- fs/xfs/xfs_mount.c | 24 - fs/xfs/xfs_mount.h | 22 + fs/xfs/xfs_rename.c | 1 fs/xfs/xfs_trans_ail.c | 1 fs/xfs/xfs_trans_extfree.c | 1 fs/xfs/xfs_vfsops.c | 24 - fs/xfs/xfs_vnodeops.c | 9 fs/xfs/xfsidbg.c | 199 ------------- 22 files changed, 307 insertions(+), 693 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2007-08-09 13:03:13.934083931 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2007-08-09 13:03:53.157036650 +1000 @@ -40,131 +40,13 @@ #include "xfs_utils.h" /* - * Initialize the inode hash table for the newly mounted file system. - * Choose an initial table size based on user specified value, else - * use a simple algorithm using the maximum number of inodes as an - * indicator for table size, and clamp it between one and some large - * number of pages. - */ -void -xfs_ihash_init(xfs_mount_t *mp) -{ - __uint64_t icount; - uint i; - - if (!mp->m_ihsize) { - icount = mp->m_maxicount ? mp->m_maxicount : - (mp->m_sb.sb_dblocks << mp->m_sb.sb_inopblog); - mp->m_ihsize = 1 << max_t(uint, 8, - (xfs_highbit64(icount) + 1) / 2); - mp->m_ihsize = min_t(uint, mp->m_ihsize, - (64 * NBPP) / sizeof(xfs_ihash_t)); - } - - mp->m_ihash = kmem_zalloc_greedy(&mp->m_ihsize, - NBPC * sizeof(xfs_ihash_t), - mp->m_ihsize * sizeof(xfs_ihash_t), - KM_SLEEP | KM_MAYFAIL | KM_LARGE); - mp->m_ihsize /= sizeof(xfs_ihash_t); - for (i = 0; i < mp->m_ihsize; i++) - rwlock_init(&(mp->m_ihash[i].ih_lock)); -} - -/* - * Free up structures allocated by xfs_ihash_init, at unmount time. - */ -void -xfs_ihash_free(xfs_mount_t *mp) -{ - kmem_free(mp->m_ihash, mp->m_ihsize * sizeof(xfs_ihash_t)); - mp->m_ihash = NULL; -} - -/* - * Initialize the inode cluster hash table for the newly mounted file system. - * Its size is derived from the ihash table size. - */ -void -xfs_chash_init(xfs_mount_t *mp) -{ - uint i; - - mp->m_chsize = max_t(uint, 1, mp->m_ihsize / - (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)); - mp->m_chsize = min_t(uint, mp->m_chsize, mp->m_ihsize); - mp->m_chash = (xfs_chash_t *)kmem_zalloc(mp->m_chsize - * sizeof(xfs_chash_t), - KM_SLEEP | KM_LARGE); - for (i = 0; i < mp->m_chsize; i++) { - spinlock_init(&mp->m_chash[i].ch_lock,"xfshash"); - } -} - -/* - * Free up structures allocated by xfs_chash_init, at unmount time. - */ -void -xfs_chash_free(xfs_mount_t *mp) -{ - int i; - - for (i = 0; i < mp->m_chsize; i++) { - spinlock_destroy(&mp->m_chash[i].ch_lock); - } - - kmem_free(mp->m_chash, mp->m_chsize*sizeof(xfs_chash_t)); - mp->m_chash = NULL; -} - -/* - * Try to move an inode to the front of its hash list if possible - * (and if its not there already). Called right after obtaining - * the list version number and then dropping the read_lock on the - * hash list in question (which is done right after looking up the - * inode in question...). - */ -STATIC void -xfs_ihash_promote( - xfs_ihash_t *ih, - xfs_inode_t *ip, - ulong version) -{ - xfs_inode_t *iq; - - if ((ip->i_prevp != &ih->ih_next) && write_trylock(&ih->ih_lock)) { - if (likely(version == ih->ih_version)) { - /* remove from list */ - if ((iq = ip->i_next)) { - iq->i_prevp = ip->i_prevp; - } - *ip->i_prevp = iq; - - /* insert at list head */ - iq = ih->ih_next; - iq->i_prevp = &ip->i_next; - ip->i_next = iq; - ip->i_prevp = &ih->ih_next; - ih->ih_next = ip; - } - write_unlock(&ih->ih_lock); - } -} - -/* * Look up an inode by number in the given file system. - * The inode is looked up in the hash table for the file system - * represented by the mount point parameter mp. Each bucket of - * the hash table is guarded by an individual semaphore. - * - * If the inode is found in the hash table, its corresponding vnode - * is obtained with a call to vn_get(). This call takes care of - * coordination with the reclamation of the inode and vnode. Note - * that the vmap structure is filled in while holding the hash lock. - * This gives us the state of the inode/vnode when we found it and - * is used for coordination in vn_get(). + * 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 and - * add the inode into the hash table. + * 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 @@ -192,274 +74,251 @@ xfs_iget_core( xfs_inode_t **ipp, xfs_daddr_t bno) { - xfs_ihash_t *ih; xfs_inode_t *ip; xfs_inode_t *iq; bhv_vnode_t *inode_vp; - ulong version; int error; - /* REFERENCED */ - xfs_chash_t *ch; - xfs_chashlist_t *chl, *chlnew; - SPLDECL(s); + xfs_icluster_t *icl, *new_icl = NULL; + 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); +again: + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, agino); - ih = XFS_IHASH(mp, ino); + if (ip != NULL) { + /* + * If INEW is set this inode is being set up + * we need to pause and try again. + */ + if (xfs_iflags_test(ip, XFS_INEW)) { + read_unlock(&pag->pag_ici_lock); + delay(1); + XFS_STATS_INC(xs_ig_frecycle); -again: - read_lock(&ih->ih_lock); + goto again; + } - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == ino) { + inode_vp = XFS_ITOV_NULL(ip); + if (inode_vp == 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(&ih->ih_lock); + 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)); - inode_vp = XFS_ITOV_NULL(ip); - if (inode_vp == 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(&ih->ih_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(&ih->ih_lock); - return ENOENT; - } - - /* - * There may be transactions sitting in the - * incore log buffers or being flushed to disk - * at this time. We can't clear the - * XFS_IRECLAIMABLE flag until these - * transactions have hit the disk, otherwise we - * will void the guarantee the flag provides - * xfs_iunpin() - */ - if (xfs_ipincount(ip)) { - read_unlock(&ih->ih_lock); - xfs_log_force(mp, 0, - XFS_LOG_FORCE|XFS_LOG_SYNC); - XFS_STATS_INC(xs_ig_frecycle); - 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)) { + read_unlock(&pag->pag_ici_lock); + xfs_put_perag(mp, pag); + return ENOENT; + } - vn_trace_exit(vp, "xfs_iget.alloc", - (inst_t *)__return_address); + /* + * There may be transactions sitting in the + * incore log buffers or being flushed to disk + * at this time. We can't clear the + * XFS_IRECLAIMABLE flag until these + * transactions have hit the disk, otherwise we + * will void the guarantee the flag provides + * xfs_iunpin() + */ + if (xfs_ipincount(ip)) { + read_unlock(&pag->pag_ici_lock); + xfs_log_force(mp, 0, + XFS_LOG_FORCE|XFS_LOG_SYNC); + XFS_STATS_INC(xs_ig_frecycle); + goto again; + } - XFS_STATS_INC(xs_ig_found); + vn_trace_exit(vp, "xfs_iget.alloc", + (inst_t *)__return_address); - xfs_iflags_clear(ip, XFS_IRECLAIMABLE); - version = ih->ih_version; - read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - - XFS_MOUNT_ILOCK(mp); - list_del_init(&ip->i_reclaim); - XFS_MOUNT_IUNLOCK(mp); - - goto finish_inode; - - } else if (vp != inode_vp) { - struct inode *inode = vn_to_inode(inode_vp); - - /* The inode is being torn down, pause and - * try again. - */ - if (inode->i_state & (I_FREEING | I_CLEAR)) { - read_unlock(&ih->ih_lock); - delay(1); - XFS_STATS_INC(xs_ig_frecycle); + XFS_STATS_INC(xs_ig_found); - goto again; - } -/* 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", - inode_vp, vp); - } + xfs_iflags_clear(ip, XFS_IRECLAIMABLE); + read_unlock(&pag->pag_ici_lock); - /* - * Inode cache hit: if ip is not at the front of - * its hash chain, move it there now. - * Do this with the lock held for update, but - * do statistics after releasing the lock. + XFS_MOUNT_ILOCK(mp); + list_del_init(&ip->i_reclaim); + XFS_MOUNT_IUNLOCK(mp); + + goto finish_inode; + + } else if (vp != inode_vp) { + struct inode *inode = vn_to_inode(inode_vp); + + /* The inode is being torn down, pause and + * try again. */ - version = ih->ih_version; - read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - XFS_STATS_INC(xs_ig_found); + if (inode->i_state & (I_FREEING | I_CLEAR)) { + read_unlock(&pag->pag_ici_lock); + delay(1); + XFS_STATS_INC(xs_ig_frecycle); -finish_inode: - if (ip->i_d.di_mode == 0) { - if (!(flags & XFS_IGET_CREATE)) - return ENOENT; - xfs_iocore_inode_reinit(ip); + goto again; } +/* 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", + inode_vp, vp); + } - if (lock_flags != 0) - xfs_ilock(ip, lock_flags); + /* + * Inode cache hit + */ + read_unlock(&pag->pag_ici_lock); + XFS_STATS_INC(xs_ig_found); - xfs_iflags_clear(ip, XFS_ISTALE); - vn_trace_exit(vp, "xfs_iget.found", - (inst_t *)__return_address); - goto return_ip; +finish_inode: + if (ip->i_d.di_mode == 0) { + if (!(flags & XFS_IGET_CREATE)) { + xfs_put_perag(mp, pag); + return ENOENT; + } + xfs_iocore_inode_reinit(ip); } + + if (lock_flags != 0) + xfs_ilock(ip, lock_flags); + + xfs_iflags_clear(ip, XFS_ISTALE); + vn_trace_exit(vp, "xfs_iget.found", + (inst_t *)__return_address); + goto return_ip; } /* - * Inode cache miss: save the hash chain version stamp and unlock - * the chain, so we don't deadlock in vn_alloc. + * Inode cache miss */ + read_unlock(&pag->pag_ici_lock); XFS_STATS_INC(xs_ig_missed); - version = ih->ih_version; - - read_unlock(&ih->ih_lock); - /* * Read the disk inode attributes into a new inode structure and get * a new vnode for it. This should also initialize i_ino and i_mount. */ error = xfs_iread(mp, tp, ino, &ip, bno, (flags & XFS_IGET_BULKSTAT) ? XFS_IMAP_BULKSTAT : 0); - if (error) + if (error) { + xfs_put_perag(mp, pag); return error; + } vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); xfs_inode_lock_init(ip, vp); xfs_iocore_inode_init(ip); - if (lock_flags) 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; } /* - * Put ip on its hash chain, unless someone else hashed a duplicate - * after we released the hash lock. + * This is a bit messy - we preallocate everything we _might_ + * need before we pick up the ici lock. That way we don't have to + * juggle locks and go all the way back to the start. */ - write_lock(&ih->ih_lock); + new_icl = (xfs_icluster_t *)kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); + if (radix_tree_preload(GFP_KERNEL)) { + delay(1); + goto again; + } + mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); + first_index = agino & mask; + write_lock(&pag->pag_ici_lock); - if (ih->ih_version != version) { - for (iq = ih->ih_next; iq != NULL; iq = iq->i_next) { - if (iq->i_ino == ino) { - write_unlock(&ih->ih_lock); - xfs_idestroy(ip); + /* + * Find the cluster if it exists + */ + icl = NULL; + if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq, + first_index, 1)) { + if ((iq->i_ino & mask) == first_index) + icl = iq->i_cluster; + } - XFS_STATS_INC(xs_ig_dup); - goto again; - } - } + /* + * 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); + XFS_STATS_INC(xs_ig_dup); + goto again; } /* * These values _must_ be set before releasing ihlock! */ - ip->i_hash = ih; - if ((iq = ih->ih_next)) { - iq->i_prevp = &ip->i_next; - } - ip->i_next = iq; - ip->i_prevp = &ih->ih_next; - ih->ih_next = ip; ip->i_udquot = ip->i_gdquot = NULL; - ih->ih_version++; xfs_iflags_set(ip, XFS_INEW); - write_unlock(&ih->ih_lock); - /* - * put ip on its cluster's hash chain - */ - ASSERT(ip->i_chash == NULL && ip->i_cprev == NULL && + ASSERT(ip->i_cluster == NULL && ip->i_cprev == NULL && ip->i_cnext == NULL); - chlnew = NULL; - ch = XFS_CHASH(mp, ip->i_blkno); - chlredo: - s = mutex_spinlock(&ch->ch_lock); - for (chl = ch->ch_list; chl != NULL; chl = chl->chl_next) { - if (chl->chl_blkno == ip->i_blkno) { - - /* insert this inode into the doubly-linked list - * where chl points */ - if ((iq = chl->chl_ip)) { - ip->i_cprev = iq->i_cprev; - iq->i_cprev->i_cnext = ip; - iq->i_cprev = ip; - ip->i_cnext = iq; - } else { - ip->i_cnext = ip; - ip->i_cprev = ip; - } - chl->chl_ip = ip; - ip->i_chash = chl; - break; - } - } - - /* no hash list found for this block; add a new hash list */ - if (chl == NULL) { - if (chlnew == NULL) { - mutex_spinunlock(&ch->ch_lock, s); - ASSERT(xfs_chashlist_zone != NULL); - chlnew = (xfs_chashlist_t *) - kmem_zone_alloc(xfs_chashlist_zone, - KM_SLEEP); - ASSERT(chlnew != NULL); - goto chlredo; - } else { - ip->i_cnext = ip; - ip->i_cprev = ip; - ip->i_chash = chlnew; - chlnew->chl_ip = ip; - chlnew->chl_blkno = ip->i_blkno; - if (ch->ch_list) - ch->ch_list->chl_prev = chlnew; - chlnew->chl_next = ch->ch_list; - chlnew->chl_prev = NULL; - ch->ch_list = chlnew; - chlnew = NULL; - } + if (icl) { + /* insert this inode into the doubly-linked list + * where icl points. lock the icl to protect against + * others traversing the icl list */ + spin_lock(&icl->icl_lock); + ASSERT(icl->icl_ip != NULL); + iq = icl->icl_ip; + ip->i_cprev = iq->i_cprev; + iq->i_cprev->i_cnext = ip; + iq->i_cprev = ip; + ip->i_cnext = iq; + icl->icl_ip = ip; + ip->i_cluster = icl; + spin_unlock(&icl->icl_lock); } else { - if (chlnew != NULL) { - kmem_zone_free(xfs_chashlist_zone, chlnew); - } - } - - mutex_spinunlock(&ch->ch_lock, s); - + ip->i_cnext = ip; + ip->i_cprev = ip; + ip->i_cluster = new_icl; + new_icl->icl_ip = ip; + spin_lock_init(&new_icl->icl_lock); + new_icl = NULL; + } + write_unlock(&pag->pag_ici_lock); + radix_tree_preload_end(); + if (new_icl) + kmem_zone_free(xfs_icluster_zone, new_icl); /* * Link ip to its mount and thread it on the mount's inode list. @@ -478,6 +337,7 @@ finish_inode: mp->m_inodes = ip; XFS_MOUNT_IUNLOCK(mp); + xfs_put_perag(mp, pag); return_ip: ASSERT(ip->i_df.if_ext_max == @@ -587,32 +447,19 @@ xfs_inode_incore(xfs_mount_t *mp, xfs_ino_t ino, xfs_trans_t *tp) { - xfs_ihash_t *ih; xfs_inode_t *ip; - ulong version; + xfs_perag_t *pag; - ih = XFS_IHASH(mp, ino); - read_lock(&ih->ih_lock); - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == ino) { - /* - * If we find it and tp matches, return it. - * Also move it to the front of the hash list - * if we find it and it is not already there. - * Otherwise break from the loop and return - * NULL. - */ - if (ip->i_transp == tp) { - version = ih->ih_version; - read_unlock(&ih->ih_lock); - xfs_ihash_promote(ih, ip, version); - return (ip); - } - break; - } - } - read_unlock(&ih->ih_lock); - return (NULL); + pag = xfs_get_perag(mp, ino); + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ino)); + read_unlock(&pag->pag_ici_lock); + xfs_put_perag(mp, pag); + + /* the returned inode must match the transaction */ + if (ip && (ip->i_transp != tp)) + return NULL; + return ip; } /* @@ -718,58 +565,47 @@ void xfs_iextract( xfs_inode_t *ip) { - xfs_ihash_t *ih; + xfs_mount_t *mp = ip->i_mount; + xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); xfs_inode_t *iq; - xfs_mount_t *mp; - xfs_chash_t *ch; - xfs_chashlist_t *chl, *chm; - SPLDECL(s); - - ih = ip->i_hash; - write_lock(&ih->ih_lock); - if ((iq = ip->i_next)) { - iq->i_prevp = ip->i_prevp; - } - *ip->i_prevp = iq; - ih->ih_version++; - write_unlock(&ih->ih_lock); - - /* - * Remove from cluster hash list - * 1) delete the chashlist if this is the last inode on the chashlist - * 2) unchain from list of inodes - * 3) point chashlist->chl_ip to 'chl_next' if to this inode. + + 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 cluster list */ mp = ip->i_mount; - ch = XFS_CHASH(mp, ip->i_blkno); - s = mutex_spinlock(&ch->ch_lock); - - if (ip->i_cnext == ip) { - /* Last inode on chashlist */ + spin_lock(&ip->i_cluster->icl_lock); + if (unlikely(ip->i_cnext == ip)) { + /* + * Last inode in cluster object. + * + * We've been removed from the inode radix tree, and + * we are the last inode to reference the cluster. + * We can simply drop our loks and free it at this point + * because nothing can find us or the cluster. + */ ASSERT(ip->i_cnext == ip && ip->i_cprev == ip); - ASSERT(ip->i_chash != NULL); - chm=NULL; - chl = ip->i_chash; - if (chl->chl_prev) - chl->chl_prev->chl_next = chl->chl_next; - else - ch->ch_list = chl->chl_next; - if (chl->chl_next) - chl->chl_next->chl_prev = chl->chl_prev; - kmem_zone_free(xfs_chashlist_zone, chl); + ASSERT(ip->i_cluster != NULL); + + spin_unlock(&ip->i_cluster->icl_lock); + kmem_zone_free(xfs_icluster_zone, ip->i_cluster); } else { /* delete one inode from a non-empty list */ iq = ip->i_cnext; iq->i_cprev = ip->i_cprev; ip->i_cprev->i_cnext = iq; - if (ip->i_chash->chl_ip == ip) { - ip->i_chash->chl_ip = iq; + if (ip->i_cluster->icl_ip == ip) { + ip->i_cluster->icl_ip = iq; } - ip->i_chash = __return_address; + spin_unlock(&ip->i_cluster->icl_lock); + ip->i_cluster = __return_address; ip->i_cprev = __return_address; ip->i_cnext = __return_address; } - mutex_spinunlock(&ch->ch_lock, s); /* * Remove from mount's inode list. Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2007-08-09 13:03:13.934083931 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2007-08-09 13:03:53.181033562 +1000 @@ -52,7 +52,7 @@ kmem_zone_t *xfs_ifork_zone; kmem_zone_t *xfs_inode_zone; -kmem_zone_t *xfs_chashlist_zone; +kmem_zone_t *xfs_icluster_zone; /* * Used in xfs_itruncate(). This is the maximum number of extents @@ -2182,10 +2182,10 @@ xfs_ifree_cluster( int i, j, found, pre_flushed; xfs_daddr_t blkno; xfs_buf_t *bp; - xfs_ihash_t *ih; xfs_inode_t *ip, **ip_found; xfs_inode_log_item_t *iip; xfs_log_item_t *lip; + xfs_perag_t *pag = xfs_get_perag(mp, inum); SPLDECL(s); if (mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) { @@ -2220,23 +2220,20 @@ xfs_ifree_cluster( */ found = 0; for (i = 0; i < ninodes; i++) { - ih = XFS_IHASH(mp, inum + i); - read_lock(&ih->ih_lock); - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) { - if (ip->i_ino == inum + i) - break; - } + read_lock(&pag->pag_ici_lock); + ip = radix_tree_lookup(&pag->pag_ici_root, + XFS_INO_TO_AGINO(mp, (inum + i))); /* Inode not in memory or we found it already, * nothing to do */ if (!ip || xfs_iflags_test(ip, XFS_ISTALE)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } if (xfs_inode_clean(ip)) { - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } @@ -2259,7 +2256,7 @@ xfs_ifree_cluster( ip_found[found++] = ip; } } - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); continue; } @@ -2277,8 +2274,7 @@ xfs_ifree_cluster( xfs_iunlock(ip, XFS_ILOCK_EXCL); } } - - read_unlock(&ih->ih_lock); + read_unlock(&pag->pag_ici_lock); } bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, blkno, @@ -2333,6 +2329,7 @@ xfs_ifree_cluster( } kmem_free(ip_found, ninodes * sizeof(xfs_inode_t *)); + xfs_put_perag(mp, pag); } /* @@ -3050,12 +3047,10 @@ xfs_iflush( xfs_mount_t *mp; int error; /* REFERENCED */ - xfs_chash_t *ch; xfs_inode_t *iq; int clcount; /* count of inodes clustered */ int bufwasdelwri; enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; - SPLDECL(s); XFS_STATS_INC(xs_iflush_count); @@ -3169,11 +3164,8 @@ xfs_iflush( * inode clustering: * see if other inodes can be gathered into this write */ - - ip->i_chash->chl_buf = bp; - - ch = XFS_CHASH(mp, ip->i_blkno); - s = mutex_spinlock(&ch->ch_lock); + spin_lock(&ip->i_cluster->icl_lock); + ip->i_cluster->icl_buf = bp; clcount = 0; for (iq = ip->i_cnext; iq != ip; iq = iq->i_cnext) { @@ -3227,7 +3219,7 @@ xfs_iflush( xfs_iunlock(iq, XFS_ILOCK_SHARED); } } - mutex_spinunlock(&ch->ch_lock, s); + spin_unlock(&ip->i_cluster->icl_lock); if (clcount) { XFS_STATS_INC(xs_icluster_flushcnt); @@ -3264,7 +3256,7 @@ cluster_corrupt_out: /* Corruption detected in the clustering loop. Invalidate the * inode buffer and shut down the filesystem. */ - mutex_spinunlock(&ch->ch_lock, s); + spin_unlock(&ip->i_cluster->icl_lock); /* * Clean up the buffer. If it was B_DELWRI, just release it -- Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2007-08-09 13:03:13.934083931 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2007-08-09 13:03:53.157036650 +1000 @@ -172,41 +172,18 @@ typedef struct xfs_iocore { extern void xfs_iocore_inode_init(struct xfs_inode *); extern void xfs_iocore_inode_reinit(struct xfs_inode *); - /* - * This is the type used in the xfs inode hash table. - * An array of these is allocated for each mounted - * file system to hash the inodes for that file system. - */ -typedef struct xfs_ihash { - struct xfs_inode *ih_next; - rwlock_t ih_lock; - uint ih_version; -} xfs_ihash_t; - -#define XFS_IHASH(mp,ino) ((mp)->m_ihash + (((uint)(ino)) % (mp)->m_ihsize)) - -/* - * This is the xfs inode cluster hash. This hash is used by xfs_iflush to - * find inodes that share a cluster and can be flushed to disk at the same - * time. - */ -typedef struct xfs_chashlist { - struct xfs_chashlist *chl_next; - struct xfs_chashlist *chl_prev; - struct xfs_inode *chl_ip; - xfs_daddr_t chl_blkno; /* starting block number of + * This is the xfs inode cluster structure. This structure is used by + * xfs_iflush to find inodes that share a cluster and can be flushed to disk at + * the same time. + */ +typedef struct xfs_icluster { + struct xfs_inode *icl_ip; + xfs_daddr_t icl_blkno; /* starting block number of * the cluster */ - struct xfs_buf *chl_buf; /* the inode buffer */ -} xfs_chashlist_t; - -typedef struct xfs_chash { - xfs_chashlist_t *ch_list; - lock_t ch_lock; -} xfs_chash_t; - -#define XFS_CHASH(mp,blk) ((mp)->m_chash + (((uint)blk) % (mp)->m_chsize)) - + struct xfs_buf *icl_buf; /* the inode buffer */ + lock_t icl_lock; /* inode list lock */ +} xfs_icluster_t; /* * This is the xfs in-core inode structure. @@ -269,21 +246,15 @@ typedef struct xfs_icdinode { } xfs_icdinode_t; typedef struct { - struct xfs_ihash *ip_hash; /* pointer to hash header */ - struct xfs_inode *ip_next; /* inode hash link forw */ struct xfs_inode *ip_mnext; /* next inode in mount list */ struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_inode **ip_prevp; /* ptr to prev i_next */ struct xfs_mount *ip_mount; /* fs mount struct ptr */ } xfs_iptr_t; typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_ihash *i_hash; /* pointer to hash header */ - struct xfs_inode *i_next; /* inode hash link forw */ struct xfs_inode *i_mnext; /* next inode in mount list */ struct xfs_inode *i_mprev; /* ptr to prev inode */ - struct xfs_inode **i_prevp; /* ptr to prev i_next */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ struct bhv_desc i_bhv_desc; /* inode behavior descriptor*/ @@ -324,9 +295,9 @@ typedef struct xfs_inode { unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ - xfs_chashlist_t *i_chash; /* cluster hash list header */ - struct xfs_inode *i_cnext; /* cluster hash link forward */ - struct xfs_inode *i_cprev; /* cluster hash link backward */ + xfs_icluster_t *i_cluster; /* cluster list header */ + struct xfs_inode *i_cnext; /* cluster link forward */ + struct xfs_inode *i_cprev; /* cluster link backward */ xfs_fsize_t i_size; /* in-memory size */ /* Trace buffers per inode. */ @@ -521,8 +492,6 @@ xfs_iflags_test(xfs_inode_t *ip, unsigne */ void xfs_ihash_init(struct xfs_mount *); void xfs_ihash_free(struct xfs_mount *); -void xfs_chash_init(struct xfs_mount *); -void xfs_chash_free(struct xfs_mount *); xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t, struct xfs_trans *); void xfs_inode_lock_init(xfs_inode_t *, struct bhv_vnode *); @@ -633,7 +602,7 @@ void xfs_inobp_check(struct xfs_mount * #define xfs_inobp_check(mp, bp) #endif /* DEBUG */ -extern struct kmem_zone *xfs_chashlist_zone; +extern struct kmem_zone *xfs_icluster_zone; extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2007-08-09 13:03:13.938083417 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2007-08-09 13:03:53.193032018 +1000 @@ -135,8 +135,6 @@ static void xfsidbg_xbuf(xfs_buf_t *); static void xfsidbg_xbuf_real(xfs_buf_t *, int); static void xfsidbg_xarg(int); static void xfsidbg_xchksum(uint *); -static void xfsidbg_xchash(xfs_mount_t *mp); -static void xfsidbg_xchashlist(xfs_chashlist_t *chl); static void xfsidbg_xdaargs(xfs_da_args_t *); static void xfsidbg_xdabuf(xfs_dabuf_t *); static void xfsidbg_xdanode(xfs_da_intnode_t *); @@ -149,7 +147,6 @@ static void xfsidbg_xhelp(void); static void xfsidbg_xiclog(xlog_in_core_t *); static void xfsidbg_xiclogall(xlog_in_core_t *); static void xfsidbg_xiclogcb(xlog_in_core_t *); -static void xfsidbg_xihash(xfs_mount_t *mp); static void xfsidbg_xinodes(xfs_mount_t *); static void xfsidbg_delayed_blocks(xfs_mount_t *); static void xfsidbg_xinodes_quiesce(xfs_mount_t *); @@ -1020,46 +1017,6 @@ static int kdbm_xfs_xchksum( return 0; } - -static int kdbm_xfs_xchash( - 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_xchash((xfs_mount_t *) addr); - return 0; -} - -static int kdbm_xfs_xchashlist( - 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_xchashlist((xfs_chashlist_t *) addr); - return 0; -} - - static int kdbm_xfs_xdaargs( int argc, const char **argv) @@ -1280,25 +1237,6 @@ static int kdbm_xfs_xiclogcb( return 0; } -static int kdbm_xfs_xihash( - 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_xihash((xfs_mount_t *) addr); - return 0; -} - static int kdbm_xfs_xinodes( int argc, const char **argv) @@ -2173,15 +2111,11 @@ static void printinode(struct inode *ip) " i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n", ip->i_mode, ip->i_nlink, kdev_t_to_nr(ip->i_rdev), ip->i_state); - kdb_printf(" i_hash.nxt = 0x%p i_hash.pprv = 0x%p\n", - ip->i_hash.next, ip->i_hash.prev); #else kdb_printf( " i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n", ip->i_mode, ip->i_nlink, ip->i_rdev, ip->i_state); - kdb_printf(" i_hash.nxt = 0x%p i_hash.pprv = 0x%p\n", - ip->i_hash.next, ip->i_hash.pprev); #endif kdb_printf(" i_list.nxt = 0x%p i_list.prv = 0x%p\n", ip->i_list.next, ip->i_list.prev); @@ -2670,10 +2604,6 @@ static struct xif xfsidbg_funcs[] = { { "xbxstrc", kdbm_xfs_xbxstrace, "", "Dump XFS bmap extent inode trace" }, #endif - { "xchash", kdbm_xfs_xchash, "", - "Dump XFS cluster hash"}, - { "xchlist", kdbm_xfs_xchashlist, "", - "Dump XFS cluster hash list"}, { "xchksum", kdbm_xfs_xchksum, "", "Dump chksum" }, #ifdef XFS_DIR2_TRACE { "xd2atrc", kdbm_xfs_xdir2atrace, "", @@ -2727,8 +2657,6 @@ static struct xif xfsidbg_funcs[] = { { "xictrc", kdbm_xfs_xiclogtrace, "", "Dump XFS in-core log trace" }, #endif - { "xihash", kdbm_xfs_xihash, "", - "Dump XFS inode hash statistics"}, #ifdef XFS_ILOCK_TRACE { "xilocktrc",kdbm_xfs_xilock_trace, "", "Dump XFS ilock trace" }, @@ -6656,7 +6584,7 @@ xfsidbg_xmount(xfs_mount_t *mp) "BARRIER", /* 0x20000 */ "IDELETE", /* 0x40000 */ "SWALLOC", /* 0x80000 */ - "IHASHSIZE", /* 0x100000 */ + "UNUSED_100000", /* 0x100000 */ "DIRSYNC", /* 0x200000 */ "COMPAT_IOSIZE",/* 0x400000 */ NULL @@ -6688,8 +6616,6 @@ 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("ihash 0x%p ihsize %zu\n", - mp->m_ihash, mp->m_ihsize); kdb_printf("inodes 0x%p ilock 0x%p ireclaims 0x%x\n", mp->m_inodes, &mp->m_ilock, mp->m_ireclaims); kdb_printf("readio_log 0x%x readio_blocks 0x%x ", @@ -6756,8 +6682,6 @@ xfsidbg_xmount(xfs_mount_t *mp) (xfs_dfiloff_t)mp->m_dirdatablk, (xfs_dfiloff_t)mp->m_dirleafblk, (xfs_dfiloff_t)mp->m_dirfreeblk); - kdb_printf("chsize %d chash 0x%p\n", - mp->m_chsize, mp->m_chash); if (mp->m_fsname != NULL) kdb_printf("mountpoint \"%s\"\n", mp->m_fsname); else @@ -6765,71 +6689,6 @@ xfsidbg_xmount(xfs_mount_t *mp) } -static void -xfsidbg_xihash(xfs_mount_t *mp) -{ - xfs_ihash_t *ih; - int i; - int j; - int total; - int numzeros; - xfs_inode_t *ip; - int *hist; - int hist_bytes = mp->m_ihsize * sizeof(int); - int hist2[21]; - - hist = (int *) kmalloc(hist_bytes, GFP_KERNEL); - - if (hist == NULL) { - kdb_printf("xfsidbg_xihash: kmalloc(%d) failed!\n", - hist_bytes); - return; - } - - for (i = 0; i < mp->m_ihsize; i++) { - ih = mp->m_ihash + i; - j = 0; - for (ip = ih->ih_next; ip != NULL; ip = ip->i_next) - j++; - hist[i] = j; - } - - numzeros = total = 0; - - for (i = 0; i < 21; i++) - hist2[i] = 0; - - for (i = 0; i < mp->m_ihsize; i++) { - kdb_printf("%d ", hist[i]); - total += hist[i]; - numzeros += hist[i] == 0 ? 1 : 0; - if (hist[i] > 20) - j = 20; - else - j = hist[i]; - - if (! (j <= 20)) { - kdb_printf("xfsidbg_xihash: (j > 20)/%d @ line # %d\n", - j, __LINE__); - return; - } - - hist2[j]++; - } - - kdb_printf("\n"); - - kdb_printf("total inodes = %d, average length = %zu, adjusted average = %zu\n", - total, total / mp->m_ihsize, - total / (mp->m_ihsize - numzeros)); - - for (i = 0; i < 21; i++) { - kdb_printf("%d - %d , ", i, hist2[i]); - } - kdb_printf("\n"); - kfree(hist); -} - /* * Command to print xfs inodes: kp xnode */ @@ -6845,12 +6704,8 @@ xfsidbg_xnode(xfs_inode_t *ip) NULL }; - kdb_printf("hash 0x%p next 0x%p prevp 0x%p mount 0x%p\n", - ip->i_hash, - ip->i_next, - ip->i_prevp, - ip->i_mount); - kdb_printf("mnext 0x%p mprev 0x%p vnode 0x%p \n", + 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)); @@ -6898,8 +6753,8 @@ xfsidbg_xnode(xfs_inode_t *ip) qprintf(" dir trace 0x%p\n", ip->i_dir_trace); #endif kdb_printf("\n"); - kdb_printf("chash 0x%p cnext 0x%p cprev 0x%p\n", - ip->i_chash, + kdb_printf("icluster 0x%p cnext 0x%p cprev 0x%p\n", + ip->i_cluster, ip->i_cnext, ip->i_cprev); xfs_xnode_fork("data", &ip->i_df); @@ -6917,50 +6772,6 @@ xfsidbg_xcore(xfs_iocore_t *io) } /* - * Command to print xfs inode cluster hash table: kp xchash - */ -static void -xfsidbg_xchash(xfs_mount_t *mp) -{ - int i; - xfs_chash_t *ch; - - kdb_printf("m_chash 0x%p size %d\n", - mp->m_chash, mp->m_chsize); - for (i = 0; i < mp->m_chsize; i++) { - ch = mp->m_chash + i; - kdb_printf("[%3d] ch 0x%p chashlist 0x%p\n", i, ch, ch->ch_list); - xfsidbg_xchashlist(ch->ch_list); - } -} - -/* - * Command to print xfs inode cluster hash list: kp xchashlist - */ -static void -xfsidbg_xchashlist(xfs_chashlist_t *chl) -{ - xfs_inode_t *ip; - - while (chl != NULL) { - kdb_printf("hashlist inode 0x%p blkno %lld buf 0x%p", - chl->chl_ip, (long long) chl->chl_blkno, chl->chl_buf); - - kdb_printf("\n"); - - /* print inodes on chashlist */ - ip = chl->chl_ip; - do { - kdb_printf("0x%p ", ip); - ip = ip->i_cnext; - } while (ip != chl->chl_ip); - kdb_printf("\n"); - - chl=chl->chl_next; - } -} - -/* * Print xfs per-ag data structures for filesystem. */ static void Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_export.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_export.c 2007-08-09 13:00:12.373444776 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_export.c 2007-08-09 13:03:53.161036135 +1000 @@ -17,10 +17,12 @@ */ #include "xfs.h" #include "xfs_types.h" -#include "xfs_dmapi.h" +#include "xfs_inum.h" #include "xfs_log.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_export.h" Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2007-08-09 13:01:41.757944512 +1000 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c 2007-08-09 13:03:42.950350085 +1000 @@ -237,7 +237,7 @@ EXPORT_SYMBOL(xfs_bulkstat); EXPORT_SYMBOL(xfs_bunmapi); EXPORT_SYMBOL(xfs_bwrite); EXPORT_SYMBOL(xfs_change_file_space); -EXPORT_SYMBOL(xfs_chashlist_zone); +EXPORT_SYMBOL(xfs_icluster_zone); EXPORT_SYMBOL(xfs_dev_is_read_only); EXPORT_SYMBOL(xfs_dir_ialloc); EXPORT_SYMBOL(xfs_error_report); Index: 2.6.x-xfs-new/fs/xfs/xfs_ag.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_ag.h 2007-08-09 13:00:12.357446834 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_ag.h 2007-08-09 13:03:53.157036650 +1000 @@ -197,6 +197,10 @@ typedef struct xfs_perag #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 */ } xfs_perag_t; #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) Index: 2.6.x-xfs-new/fs/xfs/xfs_buf_item.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_buf_item.c 2007-08-09 13:00:12.373444776 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_buf_item.c 2007-08-09 13:03:53.165035621 +1000 @@ -23,6 +23,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_buf_item.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_clnt.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_clnt.h 2007-08-09 13:00:12.381443746 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_clnt.h 2007-08-09 13:03:53.193032018 +1000 @@ -89,7 +89,6 @@ struct xfs_mount_args { #define XFSMNT_IDELETE 0x08000000 /* inode cluster delete */ #define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width * allocation */ -#define XFSMNT_IHASHSIZE 0x20000000 /* inode hash table size */ #define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename * symlink,mkdir,rmdir,mknod */ #define XFSMNT_FLAGS2 0x80000000 /* more flags set in flags2 */ Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_block.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_block.c 2007-08-09 13:01:41.733947600 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_block.c 2007-08-09 13:03:53.165035621 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_data.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_data.c 2007-08-09 13:00:12.373444776 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_data.c 2007-08-09 13:03:53.173034591 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_node.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_node.c 2007-08-09 13:00:12.373444776 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_node.c 2007-08-09 13:03:53.173034591 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_dir2_sf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_dir2_sf.c 2007-08-09 13:01:41.753945027 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_dir2_sf.c 2007-08-09 13:03:53.177034077 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_error.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_error.c 2007-08-09 13:00:12.377444261 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_error.c 2007-08-09 13:03:53.177034077 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_extfree_item.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_extfree_item.c 2007-08-09 13:00:12.377444261 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_extfree_item.c 2007-08-09 13:03:53.177034077 +1000 @@ -23,6 +23,7 @@ #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.c 2007-08-09 13:01:41.685953775 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.c 2007-08-09 13:03:53.161036135 +1000 @@ -160,11 +160,6 @@ xfs_mount_free( xfs_mount_t *mp, int remove_bhv) { - if (mp->m_ihash) - xfs_ihash_free(mp); - if (mp->m_chash) - xfs_chash_free(mp); - if (mp->m_perag) { int agno; @@ -396,12 +391,22 @@ xfs_initialize_perag( pag->pagi_inodeok = 1; if (index < max_metadata) pag->pagf_metadata = 1; + if (!pag->pag_ici_init) { + rwlock_init(&pag->pag_ici_lock); + INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); + pag->pag_ici_init = 1; + } } } else { /* Setup default behavior for smaller filesystems */ for (index = 0; index < agcount; index++) { pag = &mp->m_perag[index]; pag->pagi_inodeok = 1; + if (!pag->pag_ici_init) { + rwlock_init(&pag->pag_ici_lock); + INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); + pag->pag_ici_init = 1; + } } } return index; @@ -1033,13 +1038,6 @@ xfs_mountfs( xfs_trans_init(mp); /* - * Allocate and initialize the inode hash table for this - * file system. - */ - xfs_ihash_init(mp); - xfs_chash_init(mp); - - /* * Allocate and initialize the per-ag data. */ init_rwsem(&mp->m_peraglock); @@ -1190,8 +1188,6 @@ xfs_mountfs( error3: xfs_log_unmount_dealloc(mp); error2: - xfs_ihash_free(mp); - xfs_chash_free(mp); for (agno = 0; agno < sbp->sb_agcount; agno++) if (mp->m_perag[agno].pagb_list) kmem_free(mp->m_perag[agno].pagb_list, Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.h 2007-08-09 13:01:41.701951716 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.h 2007-08-09 13:03:53.161036135 +1000 @@ -57,10 +57,7 @@ struct log; struct bhv_vfs; struct bhv_vnode; struct xfs_mount_args; -struct xfs_ihash; -struct xfs_chash; struct xfs_inode; -struct xfs_perag; struct xfs_iocore; struct xfs_bmbt_irec; struct xfs_bmap_free; @@ -335,8 +332,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ lock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - size_t m_ihsize; /* size of next field */ - struct xfs_ihash *m_ihash; /* fs private inode hash table*/ struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ @@ -458,7 +453,7 @@ typedef struct xfs_mount { #define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width * allocation */ -#define XFS_MOUNT_IHASHSIZE (1ULL << 20) /* inode hash table size */ + /* (1ULL << 20) -- currently unused */ #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred * I/O size in stat() */ @@ -572,6 +567,21 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, } /* + * perag get/put wrappers for eventual ref counting + */ +static inline xfs_perag_t * +xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino) +{ + return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)]; +} + +static inline void +xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag) +{ + /* nothing to see here, move along */ +} + +/* * Per-cpu superblock locking functions */ #ifdef HAVE_PERCPU_SB Index: 2.6.x-xfs-new/fs/xfs/xfs_rename.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_rename.c 2007-08-09 13:01:03.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_rename.c 2007-08-09 13:03:53.181033562 +1000 @@ -22,6 +22,7 @@ #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" Index: 2.6.x-xfs-new/fs/xfs/xfs_trans_ail.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_trans_ail.c 2007-08-09 13:00:12.381443746 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_trans_ail.c 2007-08-09 13:03:53.181033562 +1000 @@ -22,6 +22,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_trans_extfree.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_trans_extfree.c 2007-08-09 13:00:12.381443746 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_trans_extfree.c 2007-08-09 13:03:53.181033562 +1000 @@ -22,6 +22,7 @@ #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" +#include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-08-09 13:01:10.829923854 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-08-09 13:03:53.185033047 +1000 @@ -117,8 +117,8 @@ xfs_init(void) xfs_ili_zone = kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili", KM_ZONE_SPREAD, NULL); - xfs_chashlist_zone = - kmem_zone_init_flags(sizeof(xfs_chashlist_t), "xfs_chashlist", + xfs_icluster_zone = + kmem_zone_init_flags(sizeof(xfs_icluster_t), "xfs_icluster", KM_ZONE_SPREAD, NULL); /* @@ -163,7 +163,7 @@ xfs_cleanup(void) extern kmem_zone_t *xfs_efd_zone; extern kmem_zone_t *xfs_efi_zone; extern kmem_zone_t *xfs_buf_item_zone; - extern kmem_zone_t *xfs_chashlist_zone; + extern kmem_zone_t *xfs_icluster_zone; xfs_cleanup_procfs(); xfs_sysctl_unregister(); @@ -199,7 +199,7 @@ xfs_cleanup(void) kmem_zone_destroy(xfs_efi_zone); kmem_zone_destroy(xfs_ifork_zone); kmem_zone_destroy(xfs_ili_zone); - kmem_zone_destroy(xfs_chashlist_zone); + kmem_zone_destroy(xfs_icluster_zone); } /* @@ -246,7 +246,6 @@ xfs_start_flags( ap->logbufsize); return XFS_ERROR(EINVAL); } - mp->m_ihsize = ap->ihashsize; mp->m_logbsize = ap->logbufsize; mp->m_fsname_len = strlen(ap->fsname) + 1; mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP); @@ -293,8 +292,6 @@ xfs_start_flags( mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; } - if (ap->flags & XFSMNT_IHASHSIZE) - mp->m_flags |= XFS_MOUNT_IHASHSIZE; if (ap->flags & XFSMNT_IDELETE) mp->m_flags |= XFS_MOUNT_IDELETE; if (ap->flags & XFSMNT_DIRSYNC) @@ -1693,7 +1690,6 @@ xfs_vget( #define MNTOPT_BSDGROUPS "bsdgroups" /* group-ID from parent directory */ #define MNTOPT_SYSVGROUPS "sysvgroups" /* group-ID from current process */ #define MNTOPT_ALLOCSIZE "allocsize" /* preferred allocation size */ -#define MNTOPT_IHASHSIZE "ihashsize" /* size of inode hash table */ #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and * unwritten extent conversion */ @@ -1819,15 +1815,6 @@ xfs_parseargs( iosize = suffix_strtoul(value, &eov, 10); args->flags |= XFSMNT_IOSIZE; args->iosizelog = ffs(iosize) - 1; - } else if (!strcmp(this_char, MNTOPT_IHASHSIZE)) { - if (!value || !*value) { - cmn_err(CE_WARN, - "XFS: %s option requires an argument", - this_char); - return EINVAL; - } - args->flags |= XFSMNT_IHASHSIZE; - args->ihashsize = simple_strtoul(value, &eov, 10); } else if (!strcmp(this_char, MNTOPT_GRPID) || !strcmp(this_char, MNTOPT_BSDGROUPS)) { vfsp->vfs_flag |= VFS_GRPID; @@ -1986,9 +1973,6 @@ xfs_showargs( seq_puts(m, xfs_infop->str); } - if (mp->m_flags & XFS_MOUNT_IHASHSIZE) - seq_printf(m, "," MNTOPT_IHASHSIZE "=%d", (int)mp->m_ihsize); - if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", (int)(1 << mp->m_writeio_log) >> 10); Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c 2007-08-09 13:01:41.781941424 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c 2007-08-09 13:03:53.185033047 +1000 @@ -3876,7 +3876,7 @@ xfs_finish_reclaim( int locked, int sync_mode) { - xfs_ihash_t *ih = ip->i_hash; + xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); bhv_vnode_t *vp = XFS_ITOV_NULL(ip); int error; @@ -3888,12 +3888,12 @@ xfs_finish_reclaim( * Once we have the XFS_IRECLAIM flag set it will not touch * us. */ - write_lock(&ih->ih_lock); + 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)) { spin_unlock(&ip->i_flags_lock); - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); if (locked) { xfs_ifunlock(ip); xfs_iunlock(ip, XFS_ILOCK_EXCL); @@ -3902,7 +3902,8 @@ xfs_finish_reclaim( } __xfs_iflags_set(ip, XFS_IRECLAIM); spin_unlock(&ip->i_flags_lock); - write_unlock(&ih->ih_lock); + write_unlock(&pag->pag_ici_lock); + xfs_put_perag(ip->i_mount, pag); /* * If the inode is still dirty, then flush it out. If the inode From owner-xfs@oss.sgi.com Thu Aug 9 04:39:43 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:39:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79Bdcbm005510 for ; Thu, 9 Aug 2007 04:39:41 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA18033; Thu, 9 Aug 2007 21:39:39 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79BdceW56044017; Thu, 9 Aug 2007 21:39:39 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79Bdbmk54742521; Thu, 9 Aug 2007 21:39:37 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:39:37 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 2 of 4] Factor per-ag radix tree intialisation Message-ID: <20070809113937.GE12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12543 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Factor out common intialisation code. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.c 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_mount.c 2007-08-09 13:07:53.410065825 +1000 @@ -337,6 +337,17 @@ xfs_mount_validate_sb( return 0; } +STATIC void +xfs_initialize_perag_icache( + xfs_perag_t *pag) +{ + if (!pag->pag_ici_init) { + rwlock_init(&pag->pag_ici_lock); + INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); + pag->pag_ici_init = 1; + } +} + xfs_agnumber_t xfs_initialize_perag( bhv_vfs_t *vfs, @@ -391,22 +402,14 @@ xfs_initialize_perag( pag->pagi_inodeok = 1; if (index < max_metadata) pag->pagf_metadata = 1; - if (!pag->pag_ici_init) { - rwlock_init(&pag->pag_ici_lock); - INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); - pag->pag_ici_init = 1; - } + xfs_initialize_perag_icache(pag); } } else { /* Setup default behavior for smaller filesystems */ for (index = 0; index < agcount; index++) { pag = &mp->m_perag[index]; pag->pagi_inodeok = 1; - if (!pag->pag_ici_init) { - rwlock_init(&pag->pag_ici_lock); - INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC); - pag->pag_ici_init = 1; - } + xfs_initialize_perag_icache(pag); } } return index; From owner-xfs@oss.sgi.com Thu Aug 9 04:42:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:42:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79Bg6bm006452 for ; Thu, 9 Aug 2007 04:42:09 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA18095; Thu, 9 Aug 2007 21:42:06 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79Bg5eW55559214; Thu, 9 Aug 2007 21:42:05 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79Bg4S555866904; Thu, 9 Aug 2007 21:42:04 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:42:04 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 3 of 4] Convert xfs_icluster lists to use list.h Message-ID: <20070809114204.GF12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12544 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Convert the xfs_icluster inode list to use hlist constructs. Use a hlist as we only need a single list head pointer and that keeps the memory usage of these structures down. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 61 +++++++++++++---------------------------------------- fs/xfs/xfs_inode.c | 6 ++++- fs/xfs/xfs_inode.h | 5 +--- fs/xfs/xfsidbg.c | 4 +-- 4 files changed, 24 insertions(+), 52 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2007-08-09 18:14:29.650646277 +1000 @@ -178,7 +178,7 @@ extern void xfs_iocore_inode_reinit(stru * the same time. */ typedef struct xfs_icluster { - struct xfs_inode *icl_ip; + struct hlist_head icl_inodes; /* list of inodes on cluster */ xfs_daddr_t icl_blkno; /* starting block number of * the cluster */ struct xfs_buf *icl_buf; /* the inode buffer */ @@ -296,8 +296,7 @@ typedef struct xfs_inode { xfs_icdinode_t i_d; /* most of ondisk inode */ xfs_icluster_t *i_cluster; /* cluster list header */ - struct xfs_inode *i_cnext; /* cluster link forward */ - struct xfs_inode *i_cprev; /* cluster link backward */ + struct hlist_node i_cnode; /* cluster link node */ xfs_fsize_t i_size; /* in-memory size */ /* Trace buffers per inode. */ Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2007-08-09 18:15:16.832572205 +1000 @@ -290,31 +290,21 @@ finish_inode: ip->i_udquot = ip->i_gdquot = NULL; xfs_iflags_set(ip, XFS_INEW); - ASSERT(ip->i_cluster == NULL && ip->i_cprev == NULL && - ip->i_cnext == NULL); + ASSERT(ip->i_cluster == NULL); - if (icl) { - /* insert this inode into the doubly-linked list - * where icl points. lock the icl to protect against - * others traversing the icl list */ - spin_lock(&icl->icl_lock); - ASSERT(icl->icl_ip != NULL); - iq = icl->icl_ip; - ip->i_cprev = iq->i_cprev; - iq->i_cprev->i_cnext = ip; - iq->i_cprev = ip; - ip->i_cnext = iq; - icl->icl_ip = ip; - ip->i_cluster = icl; - spin_unlock(&icl->icl_lock); - } else { - ip->i_cnext = ip; - ip->i_cprev = ip; - ip->i_cluster = new_icl; - new_icl->icl_ip = ip; + if (!icl) { spin_lock_init(&new_icl->icl_lock); + INIT_HLIST_HEAD(&new_icl->icl_inodes); + icl = new_icl; new_icl = NULL; + } else { + ASSERT(!hlist_empty(&icl->icl_inodes)); } + spin_lock(&icl->icl_lock); + hlist_add_head(&ip->i_cnode, &icl->icl_inodes); + ip->i_cluster = icl; + spin_unlock(&icl->icl_lock); + write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); if (new_icl) @@ -579,33 +569,12 @@ xfs_iextract( */ mp = ip->i_mount; spin_lock(&ip->i_cluster->icl_lock); - if (unlikely(ip->i_cnext == ip)) { - /* - * Last inode in cluster object. - * - * We've been removed from the inode radix tree, and - * we are the last inode to reference the cluster. - * We can simply drop our loks and free it at this point - * because nothing can find us or the cluster. - */ - ASSERT(ip->i_cnext == ip && ip->i_cprev == ip); - ASSERT(ip->i_cluster != NULL); + hlist_del(&ip->i_cnode); + spin_unlock(&ip->i_cluster->icl_lock); - spin_unlock(&ip->i_cluster->icl_lock); + /* was last inode in cluster? */ + if (hlist_empty(&ip->i_cluster->icl_inodes)) kmem_zone_free(xfs_icluster_zone, ip->i_cluster); - } else { - /* delete one inode from a non-empty list */ - iq = ip->i_cnext; - iq->i_cprev = ip->i_cprev; - ip->i_cprev->i_cnext = iq; - if (ip->i_cluster->icl_ip == ip) { - ip->i_cluster->icl_ip = iq; - } - spin_unlock(&ip->i_cluster->icl_lock); - ip->i_cluster = __return_address; - ip->i_cprev = __return_address; - ip->i_cnext = __return_address; - } /* * Remove from mount's inode list. Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2007-08-09 18:11:14.059874991 +1000 @@ -3050,6 +3050,7 @@ xfs_iflush( xfs_inode_t *iq; int clcount; /* count of inodes clustered */ int bufwasdelwri; + struct hlist_node *entry; enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; XFS_STATS_INC(xs_iflush_count); @@ -3168,7 +3169,10 @@ xfs_iflush( ip->i_cluster->icl_buf = bp; clcount = 0; - for (iq = ip->i_cnext; iq != ip; iq = iq->i_cnext) { + hlist_for_each_entry(iq, entry, &ip->i_cluster->icl_inodes, i_cnode) { + if (iq == ip) + continue; + /* * Do an un-protected check to see if the inode is dirty and * is a candidate for flushing. These checks will be repeated Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2007-08-09 18:16:46.581017645 +1000 @@ -6755,8 +6755,8 @@ xfsidbg_xnode(xfs_inode_t *ip) kdb_printf("\n"); kdb_printf("icluster 0x%p cnext 0x%p cprev 0x%p\n", ip->i_cluster, - ip->i_cnext, - ip->i_cprev); + ip->i_cnode.next, + ip->i_cnode.pprev); xfs_xnode_fork("data", &ip->i_df); xfs_xnode_fork("attr", ip->i_afp); kdb_printf("\n"); From owner-xfs@oss.sgi.com Thu Aug 9 04:45:58 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:46:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79Bjtbm007742 for ; Thu, 9 Aug 2007 04:45:57 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA18306; Thu, 9 Aug 2007 21:45:52 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l79BjneW56062213; Thu, 9 Aug 2007 21:45:52 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l79BjmP156017062; Thu, 9 Aug 2007 21:45:48 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 9 Aug 2007 21:45:48 +1000 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [PATCH 4 of 4] Restore ihashsize mount option as deprecated Message-ID: <20070809114548.GG12413810@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12545 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs The ihashsize option should remain so that filesystems with this set don't fail to mount. Ignore the mount option value and issue a deprecation warning to syslog. Update the ihashsize mount option documentation to indicate this behaviour. Update the ikeep/noikeep mount option documentation while we are there. Signed-off-by: Dave Chinner --- Documentation/filesystems/xfs.txt | 14 ++++++-------- fs/xfs/xfs_vfsops.c | 3 +++ 2 files changed, 9 insertions(+), 8 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-08-09 13:03:53.000000000 +1000 +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-08-09 18:27:39.740905512 +1000 @@ -1883,6 +1883,9 @@ xfs_parseargs( args->flags &= ~XFSMNT_ATTR2; } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { args->flags2 |= XFSMNT2_FILESTREAMS; + } else if (!strcmp(this_char, "ihashsize")) { + cmn_err(CE_WARN, + "XFS: ihashsize no longer used, option is deprecated."); } else if (!strcmp(this_char, "osyncisdsync")) { /* no-op, this is now the default */ cmn_err(CE_WARN, Index: 2.6.x-xfs-new/Documentation/filesystems/xfs.txt =================================================================== --- 2.6.x-xfs-new.orig/Documentation/filesystems/xfs.txt 2007-08-09 13:00:11.000000000 +1000 +++ 2.6.x-xfs-new/Documentation/filesystems/xfs.txt 2007-08-09 18:35:57.300771335 +1000 @@ -52,16 +52,14 @@ When mounting an XFS filesystem, the fol and also gets the setgid bit set if it is a directory itself. ihashsize=value - Sets the number of hash buckets available for hashing the - in-memory inodes of the specified mount point. If a value - of zero is used, the value selected by the default algorithm - will be displayed in /proc/mounts. + In memory inode hashes have been removed, so this option has + no function as of August 2007. Option is deprecated. ikeep/noikeep - When inode clusters are emptied of inodes, keep them around - on the disk (ikeep) - this is the traditional XFS behaviour - and is still the default for now. Using the noikeep option, - inode clusters are returned to the free space pool. + When ikeep is specified, XFS does not delete empty inode clusters + and keeps them around on disk. ikeep is the traditional XFS + behaviour. When noikeep is specified, empty inode clusters + are returned to the free space pool. The default is noikeep. inode64 Indicates that XFS is allowed to create inodes at any location From owner-xfs@oss.sgi.com Thu Aug 9 04:55:54 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 04:56:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l79Btqbm010404 for ; Thu, 9 Aug 2007 04:55:53 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l79Bt7c2023718; Thu, 9 Aug 2007 07:55:07 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l79Bt68l021755; Thu, 9 Aug 2007 07:55:06 -0400 Received: from tleilax.poochiereds.net (vpn-14-89.rdu.redhat.com [10.11.14.89]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l79Bt3IN012387; Thu, 9 Aug 2007 07:55:03 -0400 Date: Thu, 9 Aug 2007 07:55:02 -0400 From: Jeff Layton To: Jan Engelhardt Cc: Andrew Morton , codalist@TELEMANN.coda.cs.cmu.edu, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, reiserfs-devel@vger.kernel.org, zippel@linux-m68k.org, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, wli@holomorphy.com, joel.becker@oracle.com, dhowells@redhat.com, fuse-devel@lists.sourceforge.net, jffs-dev@axis.com, user-mode-linux-user@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-cifs-client@lists.samba.org, ocfs2-devel@oss.oracle.com, bfennema@falcon.csc.calpoly.edu Subject: Re: [fuse-devel] [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070809075502.b3426ce9.jlayton@redhat.com> In-Reply-To: References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <20070808085435.722f2b10.jlayton@redhat.com> <20070808094853.8c27450c.akpm@linux-foundation.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12546 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Wed, 8 Aug 2007 22:05:13 +0200 (CEST) Jan Engelhardt wrote: > > On Aug 8 2007 09:48, Andrew Morton wrote: > >> > On Mon, 6 Aug 2007 09:54:03 -0400 > >> > Jeff Layton wrote: > >> > > >> > Is there any way in which we can prevent these problems? Say > >> > > >> > - rename something so that unconverted filesystems will reliably fail to > >> > compile? > >> > > >> > >> I suppose we could rename the .setattr inode operation to something > >> else, but then we'll be stuck with it for at least a while. That seems > >> sort of kludgey too... > > > >Sure. We're changing the required behaviour of .setattr. Changing its > >name is a fine and reasonably reliable way to communicate that fact. > > Maybe ->chattr/->chgattr? > > That seems like a good replacement name. :-) Now that I think on this further though, maybe Trond's suggestion to change how the return code works is the best one. That would (hopefully) catch this problem at runtime, so if someone is using a precompiled but unconverted module then that would be detected too. -- Jeff Layton From owner-xfs@oss.sgi.com Thu Aug 9 13:38:23 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 13:38:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_99 autolearn=no version=3.2.0-pre1-r499012 Received: from smtp-out4.libero.it (smtp-out4.libero.it [212.52.84.46]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l79KcKbm014523; Thu, 9 Aug 2007 13:38:22 -0700 Received: from localhost (172.31.0.42) by smtp-out4.libero.it (7.3.120) id 4688F3500382C080; Thu, 9 Aug 2007 22:13:46 +0200 Received: from smtp-out4.libero.it ([172.31.0.40]) by localhost (asav-out2.libero.it [192.168.32.30]) (amavisd-new, port 10024) with ESMTP id Gzg-pVF5krfp; Thu, 9 Aug 2007 22:13:46 +0200 (CEST) Received: from MailRelay10.libero.it (192.168.32.119) by smtp-out4.libero.it (7.3.120) id 4611FEBC0A302E91; Thu, 9 Aug 2007 22:13:46 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AswMAHYRu0bAqBEL/2dsb2JhbAANigKgbw Received: from unknown (HELO libero.it) ([192.168.17.11]) by outrelay10.libero.it with ESMTP; 09 Aug 2007 22:13:46 +0200 Date: Thu, 9 Aug 2007 22:13:46 +0200 Message-Id: Subject: Contact Mrs.Zaa Gourk MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=iso-8859-1 From: "infoswisss" X-XaM3-API-Version: 4.3 (R1) (B3pl19) X-SenderIP: 194.178.109.250 To: undisclosed-recipients:; X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 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 l79KcNbm014535 X-archive-position: 12547 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: infoswisss@libero.it Precedence: bulk X-list: xfs Contact Mrs.Zaa Gourk Award Notice!!!Ref No(871),Ticket number 7766,serial number9900,luckynumbers 7622, batch number BL 7701 Do Clarification and Claim of US$ 400.000.00 won in Email Lottery.Contact Ms.Zaa Gourk Email:incorpuration@aim.com Tel:+31-642-658-452 Regards, Ms.Sodic Lasy From owner-xfs@oss.sgi.com Thu Aug 9 14:12:27 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 14:12:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l79LCQbm021601 for ; Thu, 9 Aug 2007 14:12:27 -0700 Received: by wa-out-1112.google.com with SMTP id k22so726550waf for ; Thu, 09 Aug 2007 14:12:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=FiSgtiJb0Sgzhv5q3vK60/Ac7fug2nFu2cagjVWyseEXoY1oZw/5EkWwrGa0GH7q2uYanylbsAl2sA7HGqevBz/LM4pT+zSHqpACnqE/zlhWLNXglwNgZoTBGQ0BtHBHcYk+N7YnQE88N27wDt7BtVdysBZjxrD67JcGORHzVDg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=DsQrZcYl0QjnhLbrBCRyVQBn6daRBtJpwC79lT4EzPi3gXyoUqkXeZTF2gFDrL6nxfnbAfoURg5XGqKjvBrcY4lzTWJ9aN9wpwTjvMnEyVJexCKodksWeVsBSqG4y8lugRsTHPBMQa7jX7Vk9UQQe8nyRQZWevlHiJbHvJAtq0w= Received: by 10.115.14.1 with SMTP id r1mr1831407wai.1186693950844; Thu, 09 Aug 2007 14:12:30 -0700 (PDT) Received: by 10.114.13.15 with HTTP; Thu, 9 Aug 2007 14:12:30 -0700 (PDT) Message-ID: <5d96567b0708091412y2ea0df38x9a73da6dcac3e962@mail.gmail.com> Date: Fri, 10 Aug 2007 00:12:30 +0300 From: Raz To: linux-xfs@oss.sgi.com Subject: corruption of xfs over sw raid5 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12548 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: raziebe@gmail.com Precedence: bulk X-list: xfs We are getting xfs corruption ( see bellow ) when deleting from a file system. deletion is done while the file system is filling other files and deleting other files. the bellow is the block device configuration and xfs_info conf. Question: I am using 2.6.17.7 , should I upgrade to 2.6.2x.x ? # cat /proc/mdstat Personalities : [raid5] [raid4] [raid1] [raid0] md1 : active raid5 sda3[0] sdd3[3] sdc3[2] sdb3[1] 1462380288 blocks level 5, 256k chunk, algorithm 2 [4/4] [UUUU] md0 : active raid5 sda2[0] sdd2[3] sdc2[2] sdb2[1] 1589760 blocks level 5, 256k chunk, algorithm 2 [4/4] [UUUU] # xfs_info /d1 meta-data=/dev/md1 isize=256 agcount=349, agsize=1048572 blks = sectsz=512 attr=0 data = bsize=4096 blocks=365595072, imaxpct=25 = sunit=4 swidth=32 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks realtime =none extsz=786432 blocks=0, rtextents=0 [4305465.579000] XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1590 of file fs/xfs/xfs_alloc.c. Caller 0xc10c3eba [4305465.601000] xfs_free_ag_extent+0x372/0x73d xfs_free_extent+0x10d/0x111 [4305465.618000] xfs_free_extent+0x10d/0x111 kmem_zone_alloc+0x57/0xc5 [4305465.636000] xfs_trans_get_efd+0x38/0x46 xfs_bmap_finish+0x146/0x1e5 [4305465.653000] xfs_itruncate_finish+0x22a/0x453 xfs_inactive+0x559/0x5c0 [4305465.671000] xfs_fs_clear_inode+0x8a/0x98 clear_inode+0xa8/0xeb [4305465.687000] generic_delete_inode+0x106/0x115 iput+0x62/0x7c [4305465.703000] do_unlinkat+0xf7/0x121 sys_socketcall+0x163/0x280 [4305465.720000] sys_unlink+0x17/0x1b syscall_call+0x7/0xb [4305465.735000] xfs_force_shutdown(md1,0x8) called from line 4091 of file fs/xfs/xfs_bmap.c. Return address = 0xc1131b5c [4305465.763000] Filesystem "md1": Corruption of in-memory data detected. Shutting down filesystem: md1 [4305465.782000] Please umount the filesystem, and rectify the problem(s) [4305529.751000] xfs_force_shutdown(md1,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc1131b5c [4305535.773000] xfs_force_shutdown(md1,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc1131b5c -- Raz From owner-xfs@oss.sgi.com Thu Aug 9 23:08:48 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 23:08:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7A68ibm014782 for ; Thu, 9 Aug 2007 23:08:47 -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 QAA22658; Fri, 10 Aug 2007 16:08:45 +1000 Message-ID: <46BC00ED.1010201@sgi.com> Date: Fri, 10 Aug 2007 16:08:45 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.5 (Macintosh/20070716) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev Subject: Re: REVIEW: fix xfs_repair phase 4 ag_stride with prefetch References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12549 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 Barry Naujok wrote: > > AG stride testing was performed on a system with ample amounts > of memory, so prefetching with AG stride during Phase 4 was > missed. The attached patch fixes this. > > 32 AGs, ag_stride = 4: > > Phase 3 - for each AG... > - scan and clear agi unlinked lists... > - process known inodes and perform inode discovery... > - agno = 0 > - agno = 4 > - agno = 8 > - agno = 12 > - agno = 16 > - agno = 20 > - agno = 24 > - agno = 28 > > which is correct... but in Phase 4: > > Phase 4 - check for duplicate blocks... > - setting up duplicate extent list... > - check for inodes claiming duplicate blocks... > - agno = 0 > - agno = 1 > - agno = 2 > - agno = 5 > - agno = 6 > - agno = 4 > - agno = 7 > - agno = 3 Okay I replied to this in the bug but forgot about the review email request so I will reply here too:) ========================== ADDITIONAL INFORMATION (ADD) From: timothy shimmin Date: Aug 09 2007 10:59:01PM [BugWorks mailnews processor v1.7.1] ========================== bnaujok@sgi.com via BugWorks wrote: > > [ EXCESSIVE QUOTED TEXT DELETED ] > > - 12:00:16: setting up duplicate extent list - 32 of 32 allocation groups done > - check for inodes claiming duplicate blocks... > - agno = 0 > - agno = 1 > - agno = 2 > - agno = 5 > - agno = 6 > - agno = 4 > - agno = 7 > - agno = 3 So you need to replicate the logic/code you used in phase 3 and put it into phase4 I presume. And the changes are in phase4.c/process_ags() (like in phase3.c/process_ags). So previously it would iterate thru the thread-count and then prefetch and queue up to the ag-count stepping by the ag-stride. And now we go thru each AG but only do an ag-stride worth at a time for a thread. So each thread will get an ag-stride worth of ags to deal with: Fixed code: Thread 0 - gets ag 0-3 (go thru a loop doing a fetch & queue work on ag 0-3) Thread 1 - gets ag 4-7 Thread 2 - gets ag 8-11 etc... Okay, starting to get it now :) So previously (broken code) it would do: Thread 0 - gets ag 0,4,8,12,16,... Thread 1 - gets ag 1,5,9,13,17,... Thread 2 - gets ag 2,6,10,14,18,... I presume the bad phase 4 msgs above are coming out in a different order than what I said above just because of the threading. Or did I make a mistake in my reading of the code. Pity we couldn't share some code there between the phases but I haven't looked to see the difficulties with that are - do tell me. Would be nice to guarantee handling the striding/threading the same in both phases by both using the same iterator code - particularly if it needs to be changed in the future etc. But whatever. And I presume the fix is so that the prefetching for a thread is done in ag-order (and they are just given a chunks worth) instead of the old bad way where the prefetching would be done with a jump over AGs by the stride instead of in order. So it looks fine if my understanding is correct. Cheers, Tim. From owner-xfs@oss.sgi.com Thu Aug 9 23:24:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 09 Aug 2007 23:24:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7A6O5bm022068 for ; Thu, 9 Aug 2007 23:24:08 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA23182; Fri, 10 Aug 2007 16:24:05 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l7A6O4eW53458112; Fri, 10 Aug 2007 16:24:04 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l7A6O2AZ57231723; Fri, 10 Aug 2007 16:24:02 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 10 Aug 2007 16:24:02 +1000 From: David Chinner To: Martin Steigerwald Cc: linux-xfs@oss.sgi.com, David Chinner Subject: Re: Impact of atime updates on XFS Message-ID: <20070810062402.GU52011508@sgi.com> References: <200708081408.01817.ms@teamix.de> <200708090820.55509.Martin@Lichtvoll.de> <20070809101544.GZ12413810@sgi.com> <200708091306.13011.Martin@lichtvoll.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708091306.13011.Martin@lichtvoll.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12550 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Aug 09, 2007 at 01:06:12PM +0200, Martin Steigerwald wrote: > Am Donnerstag 09 August 2007 schrieb David Chinner: > > On Thu, Aug 09, 2007 at 08:20:55AM +0200, Martin Steigerwald wrote: > > > Am Donnerstag 09 August 2007 schrieb David Chinner: > > > > > What would be the impact of atime versus noatime on XFS? What is > > > > > the recommended setting for XFS? Are there any plans to implement > > > > > relatime logic - maybe even the improved one by Ingo Molnar - > > > > > into XFS? > > > > > > > > relatime is a VFS layer construct - it should work with XFS right > > > > now. > > > > > > Thanks for your answer. > > > > > > XFS says: > > > > > > XFS: unknown mount option [relatime]. > > > > That's because it's supposed to be encoded in the mount flags (i.e. > > intercepted by the mount binary and not passed to the kernel > > directly). I think you need a more recent mount binary.... > > Exactly. After I upgraded mount debian package 2.12r-19 to 2.13~rc3-1 > mount -o remount,relatime works. Cool. > I got a response back from Ingo and he said, that on ext3 atime updates > are very visible while XFS does some journalling tricks to mitigate it. Sure. If we can do it with XFS, why can't ext3? Doesn't this point out to you that Ingo is really complaining aout a design deficiency with ext3, not a generic "atime is bad" problem? > He doubts that I will see much difference on XFS as it has less strict > synchronisation rules than ext3. Ah, yes. That would be a reference to ext3 ordered mode where data and metadata I/O is strictly ordered. XFS uses the equivalent of ext3 writeback mode and so doesn't provide this strict ordering. This has long been XFS's main weakness e.g. data I/Os vs file size updates resulting in files full of NULLs. However, we've fixed that particular problem without requiring strict ordering across the entire filesystem and without introducing new performance regressions or quirks. We're solving these issues on a case by case basis via a different mechanisms to provide efficient data/metadata ordering where it is needed rather than enforcing it globally through the journal. I think that we are starting to see the problems with the global ordered mode model that is implemented in ext3 - fsync, flush latency, atime updates, etc. I don't see how they can be easily fixed without compromising the model and its guarantees. IOWs, XFS's less strict synchronisation rules can be seen as a distinct advantage over ext3 ordered mode due to the flexibility they allow us in solving I/O ordering issues without needing to compromise performance. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Fri Aug 10 12:34:09 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 10 Aug 2007 12:34:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7AJY6bm012960 for ; Fri, 10 Aug 2007 12:34:08 -0700 Received: from [192.168.254.4] (dsl-dynamic-209-50-31-245.inebraska.com [209.50.31.245]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 878681807E35C; Fri, 10 Aug 2007 14:34:09 -0500 (CDT) Message-ID: <46BCBDB2.6070703@sandeen.net> Date: Fri, 10 Aug 2007 14:34:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: Andi Kleen , xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc References: <200708081240.21548.ak@suse.de> <200708081422.10373.ak@suse.de> <20070808131404.GQ52011508@sgi.com> <200708081526.06860.ak@suse.de> <20070809110322.GA12413810@sgi.com> In-Reply-To: <20070809110322.GA12413810@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12551 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 David Chinner wrote: > Andi, you are complaining to the wrong person about thread counts. I > live in the world of excessive parallelism and multithreaded I/O. I > regularly see 4-8p boxes running hundreds to thousands of I/O > threads on a single filesystem. These are the workloads XFS is > designed for and we optimise for. A single extra thread is noise.... The other thing this is doing, though, is having an impact on power usage, I think. Fedora is trying to identify things which wake the CPU in an effort to reduce power usage if possible. See for example: http://article.gmane.org/gmane.linux.redhat.fedora.testers/50480 quoting: "One of the biggest power problems is apps that wake up the CPU unnecessarily. With the tickless kernel for x86 (and soon x86_64), every time this happens it's a chance for power savings lost. HOW YOU CAN HELP ---------------- We'd like to get as many reports of misbehaving apps as possible. 1) Install the 'powertop' package 2) Run it in a terminal window on a reasonably idle system with your normal combination of apps. (If you run it when you're actively compiling a kernel, watching a movie, or doing other CPU-intensive things, the results aren't as useful.) 3) Note the results..." and here are the results w/ xfs mounted: < Detailed C-state information is only available on Mobile CPUs (laptops) > P-states (frequencies) 2.21 Ghz 0.0% 2.00 Ghz 0.0% 1.80 Ghz 100.0% Wakeups-from-idle per second : 31.7 no ACPI power usage estimate available Top causes for wakeups: 37.0% ( 20.0) mount : xfs_mru_cache_create ... looks like having this running (note: i'm not using filestreams on this mounted filesystem) may be impacting the power usage of the CPU? Or maybe SGI doesn' care about that, if the goal is 100% utilization of these machines on altixes etc... but still - something to consider I think. Thanks, -Eric From owner-xfs@oss.sgi.com Fri Aug 10 13:49:54 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 10 Aug 2007 13:50:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7AKnpbm002847 for ; Fri, 10 Aug 2007 13:49:54 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7AKm0Q3030064; Fri, 10 Aug 2007 16:48:01 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7AKlwev018483; Fri, 10 Aug 2007 16:47:58 -0400 Received: from tleilax.poochiereds.net (vpn-14-55.rdu.redhat.com [10.11.14.55]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l7AKlq9u028806; Fri, 10 Aug 2007 16:47:53 -0400 Date: Fri, 10 Aug 2007 16:47:52 -0400 From: Jeff Layton To: Trond Myklebust Cc: Andrew Morton , Jeff Layton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070810164752.23117e0e.jlayton@redhat.com> In-Reply-To: <1186533934.6625.91.camel@heimdal.trondhjem.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <1186533934.6625.91.camel@heimdal.trondhjem.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12552 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 07 Aug 2007 20:45:34 -0400 Trond Myklebust wrote: > > - rename something so that unconverted filesystems will reliably fail to > > compile? > > > > - leave existing filesystems alone, but add a new > > inode_operations.setattr_jeff, which the networked filesytems can > > implement, and teach core vfs to call setattr_jeff in preference to > > setattr? > > If you really need to know that the filesystem is handling the flags, > then how about instead having ->setattr() return something which > indicates which flags it actually handled? That is likely to be a far > more intrusive change, but it is one which is future-proof. > One thing that we could do here is have notify_change check attr->ia_valid after the setattr operation returns. If either ATTR_KILL_* bit is set then BUG(). The helper function already clears those bits so anything using it should automatically be ok. We'd have to fix up NFS and a few others that don't implement suid/sgid. This is not as certain as changing the name of the inode operation. It would only pop when someone is attempting to change a setuid/setgid file on these filesystems. Still, it should conceivably catch most if not all offenders. Would that be sufficient to take care of everyone's concerns? -- Jeff Layton From owner-xfs@oss.sgi.com Fri Aug 10 16:49:47 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 10 Aug 2007 16:49:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7ANnhbm017980 for ; Fri, 10 Aug 2007 16:49:46 -0700 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA23552; Sat, 11 Aug 2007 09:49:44 +1000 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id l7ANnheW58516141; Sat, 11 Aug 2007 09:49:43 +1000 (AEST) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id l7ANnfbq58441594; Sat, 11 Aug 2007 09:49:41 +1000 (AEST) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Sat, 11 Aug 2007 09:49:41 +1000 From: David Chinner To: Eric Sandeen Cc: David Chinner , Andi Kleen , xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc Message-ID: <20070810234940.GO12413810@sgi.com> References: <200708081240.21548.ak@suse.de> <200708081422.10373.ak@suse.de> <20070808131404.GQ52011508@sgi.com> <200708081526.06860.ak@suse.de> <20070809110322.GA12413810@sgi.com> <46BCBDB2.6070703@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46BCBDB2.6070703@sandeen.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12553 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Fri, Aug 10, 2007 at 02:34:10PM -0500, Eric Sandeen wrote: > David Chinner wrote: > > > Andi, you are complaining to the wrong person about thread counts. I > > live in the world of excessive parallelism and multithreaded I/O. I > > regularly see 4-8p boxes running hundreds to thousands of I/O > > threads on a single filesystem. These are the workloads XFS is > > designed for and we optimise for. A single extra thread is noise.... > > > The other thing this is doing, though, is having an impact on power > usage, I think. Fedora is trying to identify things which wake the CPU > in an effort to reduce power usage if possible. Sure, but an idle thread doesn't use any power, and the workqueue is now only used when there are streams active. > and here are the results w/ xfs mounted: > > < Detailed C-state information is only available on Mobile CPUs (laptops) > > P-states (frequencies) > 2.21 Ghz 0.0% > 2.00 Ghz 0.0% > 1.80 Ghz 100.0% > Wakeups-from-idle per second : 31.7 > no ACPI power usage estimate available > Top causes for wakeups: > 37.0% ( 20.0) mount : xfs_mru_cache_create http://oss.sgi.com/archives/xfs/2007-08/msg00009.html "On-demand reaping of the MRU cache Instead of running the mru cache reaper all the time based on a timeout, we should only run it when the cache has active objects. This allows CPUs to sleep when there is no activity rather than be woken repeatedly just to check if there is anything to do." Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Fri Aug 10 18:21:49 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 10 Aug 2007 18:21:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7B1Llbm006615 for ; Fri, 10 Aug 2007 18:21:49 -0700 Received: from [192.168.254.4] (dsl-dynamic-209-50-31-245.inebraska.com [209.50.31.245]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 0EEB91807DF04; Fri, 10 Aug 2007 20:21:51 -0500 (CDT) Message-ID: <46BD0F30.6080306@sandeen.net> Date: Fri, 10 Aug 2007 20:21:52 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: David Chinner CC: Andi Kleen , xfs@oss.sgi.com Subject: Re: XFS thread inflation in 2.6.23rc References: <200708081240.21548.ak@suse.de> <200708081422.10373.ak@suse.de> <20070808131404.GQ52011508@sgi.com> <200708081526.06860.ak@suse.de> <20070809110322.GA12413810@sgi.com> <46BCBDB2.6070703@sandeen.net> <20070810234940.GO12413810@sgi.com> In-Reply-To: <20070810234940.GO12413810@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12554 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 David Chinner wrote: > http://oss.sgi.com/archives/xfs/2007-08/msg00009.html > > "On-demand reaping of the MRU cache > > Instead of running the mru cache reaper all the time based on a > timeout, we should only run it when the cache has active objects. > This allows CPUs to sleep when there is no activity rather than > be woken repeatedly just to check if there is anything to do." Ah, cool. Missed that, sorry. Will re-run powertop with that just to keep you on your toes. ;-) -Eric From owner-xfs@oss.sgi.com Fri Aug 10 20:29:00 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 10 Aug 2007 20:29:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7B3Swbm005468 for ; Fri, 10 Aug 2007 20:29:00 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IJhAa-0005XS-26; Sat, 11 Aug 2007 03:57:40 +0100 Date: Sat, 11 Aug 2007 03:57:39 +0100 From: Christoph Hellwig To: Jeff Layton Cc: Trond Myklebust , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-ID: <20070811025739.GA21244@infradead.org> Mail-Followup-To: Christoph Hellwig , Jeff Layton , Trond Myklebust , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <1186533934.6625.91.camel@heimdal.trondhjem.org> <20070810164752.23117e0e.jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070810164752.23117e0e.jlayton@redhat.com> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12555 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 10, 2007 at 04:47:52PM -0400, Jeff Layton wrote: > attr->ia_valid after the setattr operation returns. If either ATTR_KILL_* > bit is set then BUG(). The helper function already clears those bits > so anything using it should automatically be ok. We'd have to fix > up NFS and a few others that don't implement suid/sgid. > > This is not as certain as changing the name of the inode operation. It > would only pop when someone is attempting to change a setuid/setgid > file on these filesystems. Still, it should conceivably catch most if > not all offenders. Would that be sufficient to take care of everyone's > concerns? I like the idea of checking ia_valid after return a lot. But instead of going BUG() it should just do the default action, that we can avoid touching all the filesystem and only need to change those that need special care. I also have plans to add some new AT_ flags for implementing some filesystem ioctl in generic code that would benefit greatly from the ia_valid checkin after return to return ENOTTY fr filesystems not implementing those ioctls. From owner-xfs@oss.sgi.com Sun Aug 12 13:29:39 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 12 Aug 2007 13:29:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_20,J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7CKTabm001462 for ; Sun, 12 Aug 2007 13:29:39 -0700 Received: from localhost (dslb-084-056-127-119.pools.arcor-ip.net [84.56.127.119]) by mail.lichtvoll.de (Postfix) with ESMTP id F002F5ADEE; Sun, 12 Aug 2007 22:34:50 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Re: xfs_fsr and null byte areas in files Date: Sun, 12 Aug 2007 22:29:40 +0200 User-Agent: KMail/1.9.7 Cc: David Chinner , Timothy Shimmin , ck@vds.kolivas.org References: <200707092313.48876.Martin@lichtvoll.de> <20070710005030.GQ31489@sgi.com> <200707262309.24012.Martin@lichtvoll.de> (sfid-20070726_234346_745054_05940549) In-Reply-To: <200707262309.24012.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708122229.40400.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12556 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 26 Juli 2007 schrieb Martin Steigerwald: > Am Dienstag 10 Juli 2007 schrieb David Chinner: > > > 1) Is there an XFS qa test available for xfs_fsr? If so I could use > > > that one. Are there some hints on how to get started on XFS qa? > > > > Yes, test 042. Download it from CVS, build it (installing all the > > bits it asks for ;), edit common.config to add your test and scratch > > partitions (both volatile) and the 'check -l 042' to run test 042. > > Hi! > > I ran test 42 and it completes successfully. Hello, I now read a post from someone who faced null byte areas in files after xfs_fsr as well[1]. And he writes that this problem is related to the ck patchset: http://bhhdoa.org.au/pipermail/ck/2007-August/008433.html It may well be that it is related to the ck patchset in my case as well. I did not know the exact kernel version anymore when I was using xfs_fsr, since it took me 2 weeks to actually find about this corruption. Well and when I ran xfsqa test I had a slighly newer kernel was using the CFS scheduler instead of the ck patchset. Actually I thought the other was using the CFS scheduler as well I didn't think of it as having any relevance so I didn't look into that direction. But now it seems that the problem actually is related ck patchset and that I was using a kernel with ck patchset as well. I try to find the time to run xfsqa test 42 for my latest ck patchset kernel to know for sure. I just wanted you to know. It seems to me that this may well not been a problem with XFS at all. [1] http://oss.sgi.com/archives/xfs/2007-07/msg00038.html Regards, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Mon Aug 13 05:02:34 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 13 Aug 2007 05:02:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_46, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7DC2Ubm026311 for ; Mon, 13 Aug 2007 05:02:34 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7DC1cSc000427; Mon, 13 Aug 2007 08:01:38 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7DC1b3i021055; Mon, 13 Aug 2007 08:01:37 -0400 Received: from tleilax.poochiereds.net (vpn-14-148.rdu.redhat.com [10.11.14.148]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l7DC1ZLp030642; Mon, 13 Aug 2007 08:01:35 -0400 Date: Mon, 13 Aug 2007 08:01:34 -0400 From: Jeff Layton To: Christoph Hellwig Cc: Trond Myklebust , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070813080134.f770814b.jlayton@redhat.com> In-Reply-To: <20070811025739.GA21244@infradead.org> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <1186533934.6625.91.camel@heimdal.trondhjem.org> <20070810164752.23117e0e.jlayton@redhat.com> <20070811025739.GA21244@infradead.org> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12557 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Sat, 11 Aug 2007 03:57:39 +0100 Christoph Hellwig wrote: > > I like the idea of checking ia_valid after return a lot. But instead of > going BUG() it should just do the default action, that we can avoid > touching all the filesystem and only need to change those that need > special care. I also have plans to add some new AT_ flags for implementing > some filesystem ioctl in generic code that would benefit greatly from > the ia_valid checkin after return to return ENOTTY fr filesystems not > implementing those ioctls. That sounds good (if I follow your meaning correctly). How about something like the patch below? If either ATTR_KILL bit is set after the setattr, try to handle them in the "standard" way with a second setattr call. It also does a printk in this situation to alert filesystem developers that they should convert to the "new" scheme, so they can avoid this second setattr call. If this idea seems sound then I'll start the grunt work to fix up the in-tree filesystems so that they don't need the second setattr call. Signed-off-by: Jeff Layton commit 521ada37ab165d9d0a12dfb59a631a2ec58a8f84 Author: Jeff Layton Date: Mon Aug 13 07:43:56 2007 -0400 VFS: move ATTR_KILL handling from notify_change into helper function Separate the handling of the local ia_valid bitmask from the one in attr->ia_valid. This allows us to hand off the actual handling of the ATTR_KILL_* flags to the .setattr i_op when one is defined. notify_change still needs to process those flags for the local ia_valid variable, since it uses that to decide whether to return early, and to pass a (hopefully) appropriate bitmask to fsnotify_change. Also, check the ia_valid after the setattr op returns and see if either ATTR_KILL_* bit is set. If so, then throw a warning and try to clear the bits in the "standard" way. This should help us to catch filesystems that don't handle these bits correctly without breaking them outright. diff --git a/fs/attr.c b/fs/attr.c index f8dfc22..7cbb883 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -100,15 +100,53 @@ int inode_setattr(struct inode * inode, struct iattr * attr) } EXPORT_SYMBOL(inode_setattr); +/** + * generic_attrkill - helper to convert ATTR_KILL_* bits into mode change + * @mode: current mode of inode + * @attr: inode attribute changes requested by VFS + * Context: anywhere + * + * This is a helper function to convert ATTR_KILL_SUID and ATTR_KILL_SGID + * into a mode change. Filesystems should call this from their setattr + * inode op when they want "conventional" setuid-clearing behavior. + * + * Filesystems that declare a setattr inode operation are now expected to + * handle the ATTR_KILL_SUID and ATTR_KILL_SGID bits appropriately. The VFS + * no longer automatically converts these bits to a mode change for + * inodes that have their own setattr operation. + **/ +void generic_attrkill(mode_t mode, struct iattr *attr) +{ + if (attr->ia_valid & ATTR_KILL_SUID) { + attr->ia_valid &= ~ATTR_KILL_SUID; + if (mode & S_ISUID) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISUID; + } + } + if (attr->ia_valid & ATTR_KILL_SGID) { + attr->ia_valid &= ~ATTR_KILL_SGID; + if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISGID; + } + } +} +EXPORT_SYMBOL(generic_attrkill); + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; - mode_t mode; - int error; + int error, once = 0; struct timespec now; unsigned int ia_valid = attr->ia_valid; - mode = inode->i_mode; now = current_fs_time(inode->i_sb); attr->ia_ctime = now; @@ -117,36 +155,48 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!(ia_valid & ATTR_MTIME_SET)) attr->ia_mtime = now; if (ia_valid & ATTR_KILL_SUID) { - attr->ia_valid &= ~ATTR_KILL_SUID; - if (mode & S_ISUID) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISUID; - } + ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) + ia_valid |= ATTR_MODE; } if (ia_valid & ATTR_KILL_SGID) { - attr->ia_valid &= ~ ATTR_KILL_SGID; - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISGID; - } + ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) + ia_valid |= ATTR_MODE; } - if (!attr->ia_valid) + if (!ia_valid) return 0; if (ia_valid & ATTR_SIZE) down_write(&dentry->d_inode->i_alloc_sem); if (inode->i_op && inode->i_op->setattr) { +try_again: error = security_inode_setattr(dentry, attr); if (!error) error = inode->i_op->setattr(dentry, attr); + /* + * if ATTR_KILL_SUID or ATTR_KILL_SGID is still set, then + * assume that the setattr inode op didn't handle them + * correctly. Try to clear these bits the standard way + * and throw a warning. + */ + if (!error && !once && unlikely(attr->ia_valid & + (ATTR_KILL_SUID|ATTR_KILL_SGID))) { + attr->ia_valid &= + (ATTR_MODE|ATTR_KILL_SUID|ATTR_KILL_SGID); + generic_attrkill(inode->i_mode, attr); + once = 1; + if (printk_ratelimit()) + printk(KERN_ERR "%s: %s doesn't seem to " + "handle setuid/setgid bit clearing " + "correctly.\n" + __func__, inode->i_sb->s_type->name); + goto try_again; + } } else { + generic_attrkill(inode->i_mode, attr); error = inode_change_ok(inode, attr); if (!error) error = security_inode_setattr(dentry, attr); diff --git a/include/linux/fs.h b/include/linux/fs.h index 6bf1395..daac0e5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1561,6 +1561,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif +extern void generic_attrkill(mode_t mode, struct iattr *attr); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, From owner-xfs@oss.sgi.com Mon Aug 13 05:37:07 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 13 Aug 2007 05:37:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_46, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7DCb6bm001844 for ; Mon, 13 Aug 2007 05:37:06 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7DCaJ7n021638; Mon, 13 Aug 2007 08:36:19 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7DCaIL8001567; Mon, 13 Aug 2007 08:36:18 -0400 Received: from tleilax.poochiereds.net (vpn-14-148.rdu.redhat.com [10.11.14.148]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l7DCaHif005013; Mon, 13 Aug 2007 08:36:17 -0400 Date: Mon, 13 Aug 2007 08:36:16 -0400 From: Jeff Layton To: Jeff Layton Cc: Christoph Hellwig , Trond Myklebust , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com Subject: Re: [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND) Message-Id: <20070813083616.642c7f27.jlayton@redhat.com> In-Reply-To: <20070813080134.f770814b.jlayton@redhat.com> References: <200708061354.l76Ds3mU002255@dantu.rdu.redhat.com> <20070807171501.e31c4a97.akpm@linux-foundation.org> <1186533934.6625.91.camel@heimdal.trondhjem.org> <20070810164752.23117e0e.jlayton@redhat.com> <20070811025739.GA21244@infradead.org> <20070813080134.f770814b.jlayton@redhat.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12558 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Mon, 13 Aug 2007 08:01:34 -0400 Jeff Layton wrote: > On Sat, 11 Aug 2007 03:57:39 +0100 > Christoph Hellwig wrote: > > > > I like the idea of checking ia_valid after return a lot. But instead of > > going BUG() it should just do the default action, that we can avoid > > touching all the filesystem and only need to change those that need > > special care. I also have plans to add some new AT_ flags for implementing > > some filesystem ioctl in generic code that would benefit greatly from > > the ia_valid checkin after return to return ENOTTY fr filesystems not > > implementing those ioctls. > > That sounds good (if I follow your meaning correctly). How about > something like the patch below? If either ATTR_KILL bit is set after > the setattr, try to handle them in the "standard" way with a second > setattr call. It also does a printk in this situation to alert > filesystem developers that they should convert to the "new" scheme, > so they can avoid this second setattr call. > > If this idea seems sound then I'll start the grunt work to fix up the > in-tree filesystems so that they don't need the second setattr call. > The earlier patch has a misplaced comma and won't build. This one builds. This should be considered an RFC, as I've not yet done any real testing of this patch: Signed-off-by: Jeff Layton commit ad00450c4532da32718efe39e27d99060f04e396 Author: Jeff Layton Date: Mon Aug 13 08:33:10 2007 -0400 VFS: move ATTR_KILL handling from notify_change into helper function Separate the handling of the local ia_valid bitmask from the one in attr->ia_valid. This allows us to hand off the actual handling of the ATTR_KILL_* flags to the .setattr i_op when one is defined. notify_change still needs to process those flags for the local ia_valid variable, since it uses that to decide whether to return early, and to pass a (hopefully) appropriate bitmask to fsnotify_change. Also, check the ia_valid after the setattr op returns and see if either ATTR_KILL_* bit is set. If so, then throw a warning and try to clear the bits in the "standard" way. This should help us to catch filesystems that don't handle these bits correctly without breaking them outright. diff --git a/fs/attr.c b/fs/attr.c index f8dfc22..9585e45 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -100,15 +100,53 @@ int inode_setattr(struct inode * inode, struct iattr * attr) } EXPORT_SYMBOL(inode_setattr); +/** + * generic_attrkill - helper to convert ATTR_KILL_* bits into mode change + * @mode: current mode of inode + * @attr: inode attribute changes requested by VFS + * Context: anywhere + * + * This is a helper function to convert ATTR_KILL_SUID and ATTR_KILL_SGID + * into a mode change. Filesystems should call this from their setattr + * inode op when they want "conventional" setuid-clearing behavior. + * + * Filesystems that declare a setattr inode operation are now expected to + * handle the ATTR_KILL_SUID and ATTR_KILL_SGID bits appropriately. The VFS + * no longer automatically converts these bits to a mode change for + * inodes that have their own setattr operation. + **/ +void generic_attrkill(mode_t mode, struct iattr *attr) +{ + if (attr->ia_valid & ATTR_KILL_SUID) { + attr->ia_valid &= ~ATTR_KILL_SUID; + if (mode & S_ISUID) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISUID; + } + } + if (attr->ia_valid & ATTR_KILL_SGID) { + attr->ia_valid &= ~ATTR_KILL_SGID; + if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISGID; + } + } +} +EXPORT_SYMBOL(generic_attrkill); + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; - mode_t mode; - int error; + int error, once = 0; struct timespec now; unsigned int ia_valid = attr->ia_valid; - mode = inode->i_mode; now = current_fs_time(inode->i_sb); attr->ia_ctime = now; @@ -117,36 +155,48 @@ int notify_change(struct dentry * dentry, struct iattr * attr) if (!(ia_valid & ATTR_MTIME_SET)) attr->ia_mtime = now; if (ia_valid & ATTR_KILL_SUID) { - attr->ia_valid &= ~ATTR_KILL_SUID; - if (mode & S_ISUID) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISUID; - } + ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) + ia_valid |= ATTR_MODE; } if (ia_valid & ATTR_KILL_SGID) { - attr->ia_valid &= ~ ATTR_KILL_SGID; - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISGID; - } + ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) + ia_valid |= ATTR_MODE; } - if (!attr->ia_valid) + if (!ia_valid) return 0; if (ia_valid & ATTR_SIZE) down_write(&dentry->d_inode->i_alloc_sem); if (inode->i_op && inode->i_op->setattr) { +try_again: error = security_inode_setattr(dentry, attr); if (!error) error = inode->i_op->setattr(dentry, attr); + /* + * if ATTR_KILL_SUID or ATTR_KILL_SGID is still set, then + * assume that the setattr inode op didn't handle them + * correctly. Try to clear these bits the standard way + * and throw a warning. + */ + if (!error && !once && unlikely(attr->ia_valid & + (ATTR_KILL_SUID|ATTR_KILL_SGID))) { + attr->ia_valid &= + (ATTR_MODE|ATTR_KILL_SUID|ATTR_KILL_SGID); + generic_attrkill(inode->i_mode, attr); + once = 1; + if (printk_ratelimit()) + printk(KERN_ERR "%s: %s doesn't seem to " + "handle setuid/setgid bit clearing " + "correctly.\n", __func__, + inode->i_sb->s_type->name); + goto try_again; + } } else { + generic_attrkill(inode->i_mode, attr); error = inode_change_ok(inode, attr); if (!error) error = security_inode_setattr(dentry, attr); diff --git a/include/linux/fs.h b/include/linux/fs.h index 6bf1395..daac0e5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1561,6 +1561,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif +extern void generic_attrkill(mode_t mode, struct iattr *attr); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, From owner-xfs@oss.sgi.com Mon Aug 13 10:25:35 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 13 Aug 2007 10:25:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7DHPWbm031654 for ; Mon, 13 Aug 2007 10:25:35 -0700 Received: from localhost (dslb-084-056-067-250.pools.arcor-ip.net [84.56.67.250]) by mail.lichtvoll.de (Postfix) with ESMTP id CC89C5ADF2; Mon, 13 Aug 2007 19:30:59 +0200 (CEST) From: Martin Steigerwald To: linux-xfs@oss.sgi.com Subject: Re: xfs_fsr and null byte areas in files Date: Mon, 13 Aug 2007 19:25:35 +0200 User-Agent: KMail/1.9.7 Cc: ck@vds.kolivas.org References: <200707092313.48876.Martin@lichtvoll.de> <200707262309.24012.Martin@lichtvoll.de> <200708122229.40400.Martin@lichtvoll.de> (sfid-20070812_231250_500144_C3F8EC69) In-Reply-To: <200708122229.40400.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708131925.35824.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12559 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 Sonntag 12 August 2007 schrieb Martin Steigerwald: > > Hi! > > > > I ran test 42 and it completes successfully. > > Hello, > > I now read a post from someone who faced null byte areas in files after > xfs_fsr as well[1]. And he writes that this problem is related to the > ck patchset: > > http://bhhdoa.org.au/pipermail/ck/2007-August/008433.html > > It may well be that it is related to the ck patchset in my case as > well. I did not know the exact kernel version anymore when I was using > xfs_fsr, since it took me 2 weeks to actually find about this > corruption. Well and when I ran xfsqa test I had a slighly newer kernel > was using the CFS scheduler instead of the ck patchset. Actually I > thought the other was using the CFS scheduler as well I didn't think > of it as having any relevance so I didn't look into that direction. > > But now it seems that the problem actually is related ck patchset and > that I was using a kernel with ck patchset as well. I try to find the > time to run xfsqa test 42 for my latest ck patchset kernel to know for > sure. I ran test 42 on my last kernel with ck patchset - 2.6.21.3-tp42-ck2-sws2-2.2.10 - about 20 times, but it did not show any problem. Maybe I have to run it about a 1000 times, since about 0,1-0.5% of my files were affected when it failed and as it seems to me the tests only generates one fragmented file. Could it generate and check more fragmented files in one ago without to much work? 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 Mon Aug 13 11:10:01 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 13 Aug 2007 11:10:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FROM_STARTS_WITH_NUMS autolearn=no version=3.2.0-pre1-r499012 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7DI9xbm012269 for ; Mon, 13 Aug 2007 11:10:01 -0700 Received: by rv-out-0910.google.com with SMTP id k20so973581rvb for ; Mon, 13 Aug 2007 11:10:04 -0700 (PDT) Received: by 10.140.207.2 with SMTP id e2mr2623391rvg.1187027131918; Mon, 13 Aug 2007 10:45:31 -0700 (PDT) Received: by 10.141.128.16 with HTTP; Mon, 13 Aug 2007 10:45:31 -0700 (PDT) Message-ID: Date: Mon, 13 Aug 2007 17:45:31 +0000 From: "Felix X" <01001101@femail.mine.nu> To: "Martin Steigerwald" Subject: Re: [ck] Re: xfs_fsr and null byte areas in files Cc: linux-xfs@oss.sgi.com, ck@vds.kolivas.org In-Reply-To: <200708131925.35824.Martin@lichtvoll.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200707092313.48876.Martin@lichtvoll.de> <200707262309.24012.Martin@lichtvoll.de> <200708122229.40400.Martin@lichtvoll.de> <200708131925.35824.Martin@lichtvoll.de> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12560 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: 01001101@femail.mine.nu Precedence: bulk X-list: xfs Try my test procedure described at http://bugs.archlinux.org/task/7778 ; see if you can get it to happen with that. Running that procedure on a virtual machine with the -ck kernel version 2.6.22.1.ck1-2 got it to happen every time. ~Felix. On 8/13/07, Martin Steigerwald wrote: > Am Sonntag 12 August 2007 schrieb Martin Steigerwald: > > > > Hi! > > > > > > I ran test 42 and it completes successfully. > > > > Hello, > > > > I now read a post from someone who faced null byte areas in files after > > xfs_fsr as well[1]. And he writes that this problem is related to the > > ck patchset: > > > > http://bhhdoa.org.au/pipermail/ck/2007-August/008433.html > > > > It may well be that it is related to the ck patchset in my case as > > well. I did not know the exact kernel version anymore when I was using > > xfs_fsr, since it took me 2 weeks to actually find about this > > corruption. Well and when I ran xfsqa test I had a slighly newer kernel > > was using the CFS scheduler instead of the ck patchset. Actually I > > thought the other was using the CFS scheduler as well I didn't think > > of it as having any relevance so I didn't look into that direction. > > > > But now it seems that the problem actually is related ck patchset and > > that I was using a kernel with ck patchset as well. I try to find the > > time to run xfsqa test 42 for my latest ck patchset kernel to know for > > sure. > > I ran test 42 on my last kernel with ck patchset - > 2.6.21.3-tp42-ck2-sws2-2.2.10 - about 20 times, but it did not show any > problem. Maybe I have to run it about a 1000 times, since about 0,1-0.5% > of my files were affected when it failed and as it seems to me the tests > only generates one fragmented file. Could it generate and check more > fragmented files in one ago without to much work? > > Ciao, > -- > Martin 'Helios' Steigerwald - http://www.Lichtvoll.de > GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 > _______________________________________________ > http://ck.kolivas.org/faqs/replying-to-mailing-list.txt > ck mailing list - mailto: ck@vds.kolivas.org > http://vds.kolivas.org/mailman/listinfo/ck > From owner-xfs@oss.sgi.com Mon Aug 13 18:05:41 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 13 Aug 2007 18:05:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ANY_BOUNCE_MESSAGE,BAYES_50, CRBOUNCE_MESSAGE,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.0-pre1-r499012 Received: from atlas.jabber.org (atlas.jabber.org [208.245.212.69]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7E15cbm026161 for ; Mon, 13 Aug 2007 18:05:40 -0700 Received: by atlas.jabber.org (Postfix, from userid 1005) id 3936921B1AC; Mon, 13 Aug 2007 19:48:29 -0500 (CDT) From: "Peter Saint-Andre" To: xfs@oss.sgi.com Subject: Please confirm (conf#317f31c5d92da0ad31f3e9fa6c2ef386) Date: Mon, 13 Aug 2007 19:48:29 CDT X-AskVersion: 2.5.2 (http://www.paganini.net/ask) X-ASK-Auth: 1187052509-bbc31fc9a7ded0e90ea0f25e1f4063b1 Precedence: bulk Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit In-Reply-To: <20070814004822.12DB421AA2A@atlas.jabber.org> Message-Id: <20070814004829.3936921B1AC@atlas.jabber.org> X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12561 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: stpeter@jabber.org Precedence: bulk X-list: xfs << IMPORTANT INFORMATION! >> This is an automated message. The message you sent (attached below) requires confirmation before it can be delivered. To confirm that you sent the message below, just hit the "R"eply button and send this message back (you don't need to edit anything). Once this is done, no more confirmations will be necessary. This email account is protected by: Active Spam Killer (ASK) V2.5.2 - (C) 2001-2004 by Marco Paganini For more information visit http://www.paganini.net/ask --- Original Message Follows --- From: xfs@oss.sgi.com To: stpeter@jabber.org Subject: Returned mail: Data format error (Original message truncated) From owner-xfs@oss.sgi.com Tue Aug 14 00:53:55 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 00:53:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_99 autolearn=no version=3.2.0-pre1-r499012 Received: from siliconindia.org (mail.siliconindia.org [72.52.77.20]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7E7rsbm001640 for ; Tue, 14 Aug 2007 00:53:55 -0700 Received: from siliconindia.org (localhost.localdomain [127.0.0.1]) by siliconindia.org (Postfix) with ESMTP id 8FDF7C45B for ; Mon, 13 Aug 2007 23:41:17 -0700 (PDT) Received: (from suresh@localhost) by siliconindia.org (8.13.1/8.13.1/Submit) id l7E6fHdW032270; Mon, 13 Aug 2007 23:41:17 -0700 X-Authentication-Warning: siliconindia.org: suresh set sender to sinet@siliconindia.net using -f To: linux-xfs@oss.sgi.com Subject: Invitation to join my SI network Date: Mon, 13 Aug 2007 23:41:17 -0700 From: Shruti Das Reply-to: sinet@siliconindia.org Message-ID: X-Priority: 3 X-Mailer: PHPMailer [version 1.73] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12562 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sinet@siliconindia.net Precedence: bulk X-list: xfs Hi , I'd like to add you to my network on SiliconIndia. Once you join, you can see all my connections online and can contact them directly. It is a business network for your carrier, if you are thinking about your future and opportunities just pay a look, it’s easy to register and it can give you an edge that other don't have. Regards, Shruti Click on the link below to join the network of Shruti Das and start your own network: http://www.siliconindia.com/register.php?id=QlrCSUgo (Please note: Membership is through invitation only) Your Invitation ID: QlrCSUgo Note: If you encounter any problem while registration, please send an email to sinet@siliconindia.com. To subscribe to SI Dailydose e-newsletter click here http://www.siliconindia.com/newsletter/shownews.php ----------------------------------------------------------------------------------------- To unsubscribe from future mailing from SI, click here http://www.siliconindia.com/invitation/remove.php From owner-xfs@oss.sgi.com Tue Aug 14 18:48:36 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 18:48:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7F1mWbm008772 for ; Tue, 14 Aug 2007 18:48:35 -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 LAA01102; Wed, 15 Aug 2007 11:48:30 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 73E3C58C1767; Wed, 15 Aug 2007 11:48:30 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 968615 - xfs_repair - ag_stride not working as designed in Phase 4 Message-Id: <20070815014830.73E3C58C1767@chook.melbourne.sgi.com> Date: Wed, 15 Aug 2007 11:48:30 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12563 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 Fix up AG queuing order in phase 4 Date: Wed Aug 15 11:47:56 AEST 2007 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: tes@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29388a xfsprogs/repair/phase4.c - 1.24 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/phase4.c.diff?r1=text&tr1=1.24&r2=text&tr2=1.23&f=h - Fix up AG queuing order for prefetch in phase 4 From owner-xfs@oss.sgi.com Tue Aug 14 19:04:06 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 19:04:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7F240bm013217 for ; Tue, 14 Aug 2007 19:04:04 -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 MAA01484; Wed, 15 Aug 2007 12:04:00 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 90ED858C1767; Wed, 15 Aug 2007 12:04:00 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 968090 - xfs_repair fails when fsblock size is different do dir block size Message-Id: <20070815020400.90ED858C1767@chook.melbourne.sgi.com> Date: Wed, 15 Aug 2007 12:04:00 +1000 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12564 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 Fixed up I/O size when doing da_reads for directories Date: Wed Aug 15 12:03:26 AEST 2007 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: vapo@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29390a xfsprogs/repair/dir2.c - 1.24 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/dir2.c.diff?r1=text&tr1=1.24&r2=text&tr2=1.23&f=h xfsprogs/repair/prefetch.c - 1.5 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/prefetch.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.4&f=h - Fixed up I/O size for directory blocks. From owner-xfs@oss.sgi.com Tue Aug 14 21:20:03 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 21:20:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_05,J_CHICKENPOX_65, SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7F4K0bm016532 for ; Tue, 14 Aug 2007 21:20:03 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4EE1B1806FDB9 for ; Tue, 14 Aug 2007 23:20:03 -0500 (CDT) Message-ID: <46C27EF8.2020004@sandeen.net> Date: Tue, 14 Aug 2007 23:20:08 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH] remove unused BULKSTAT_FG_INLINE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12565 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 I was looking at xfs_bulkstat with an eye towards stack reduction, and came across this... doesn't help stack, but it doesn't appear that the BULKSTAT_FG_INLINE bulkstat is ever used... Is it there for a reason? If not here's a patch. Thanks, -Eric xfs_itable.c | 31 ++++++------------------------- xfs_itable.h | 1 - 2 files changed, 6 insertions(+), 26 deletions(-) ---- Remove unused BULKSTAT_FG_INLINE flag & associated code. Signed-off-by: Eric Sandeen di_core.di_version, ARCH_CONVERT))) return 0; - if (flags & BULKSTAT_FG_QUICK) { - *dipp = dip; - return 1; - } - /* BULKSTAT_FG_INLINE: if attr fork is local, or not there, use it */ - aformat = INT_GET(dip->di_core.di_aformat, ARCH_CONVERT); - if ((XFS_CFORK_Q(&dip->di_core) == 0) || - (aformat == XFS_DINODE_FMT_LOCAL) || - (aformat == XFS_DINODE_FMT_EXTENTS && !dip->di_core.di_anextents)) { - *dipp = dip; - return 1; - } + + /* BULKSTAT_FG_QUICK */ + *dipp = dip; return 1; } @@ -566,8 +559,7 @@ xfs_bulkstat( ((chunkidx & nimask) >> mp->m_sb.sb_inopblog); - if (flags & (BULKSTAT_FG_QUICK | - BULKSTAT_FG_INLINE)) { + if (flags & BULKSTAT_FG_QUICK) { ino = XFS_AGINO_TO_INO(mp, agno, agino); bno = XFS_AGB_TO_DADDR(mp, agno, @@ -615,22 +607,11 @@ xfs_bulkstat( if (!xfs_bulkstat_use_dinode(mp, flags, bp, clustidx, &dip)) continue; - /* - * If we need to do an iget, cannot hold bp. - * Drop it, until starting the next cluster. - */ - if ((flags & BULKSTAT_FG_INLINE) && !dip) { - if (bp) - xfs_buf_relse(bp); - bp = NULL; - } /* * Get the inode and fill in a single buffer. * BULKSTAT_FG_QUICK uses dip to fill it in. * BULKSTAT_FG_IGET uses igets. - * BULKSTAT_FG_INLINE uses dip if we have an - * inline attr fork, else igets. * See: xfs_bulkstat_one & xfs_dm_bulkstat_one. * This is also used to count inodes/blks, etc * in xfs_qm_quotacheck. Index: linux-2.6.22-rc4/fs/xfs/xfs_itable.h =================================================================== --- linux-2.6.22-rc4.orig/fs/xfs/xfs_itable.h +++ linux-2.6.22-rc4/fs/xfs/xfs_itable.h @@ -45,7 +45,6 @@ typedef int (*bulkstat_one_pf)(struct xf */ #define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */ #define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */ -#define BULKSTAT_FG_INLINE 0x4 /* No iget if inline attrs */ /* * Return stat information in bulk (by-inode) for the filesystem. From owner-xfs@oss.sgi.com Tue Aug 14 21:47:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 21:47:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_05,J_CHICKENPOX_65, SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7F4labm023136 for ; Tue, 14 Aug 2007 21:47:51 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 2DDB61806FDB9 for ; Tue, 14 Aug 2007 23:47:41 -0500 (CDT) Message-ID: <46C28571.2060206@sandeen.net> Date: Tue, 14 Aug 2007 23:47:45 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH V2] remove unused BULKSTAT_FG_INLINE References: <46C27EF8.2020004@sandeen.net> In-Reply-To: <46C27EF8.2020004@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12566 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 Eric Sandeen wrote: > I was looking at xfs_bulkstat with an eye towards stack reduction, > and came across this... doesn't help stack, but it doesn't appear > that the BULKSTAT_FG_INLINE bulkstat is ever used... > > Is it there for a reason? If not here's a patch. > > Thanks, > -Eric > > xfs_itable.c | 31 ++++++------------------------- > xfs_itable.h | 1 - > 2 files changed, 6 insertions(+), 26 deletions(-) > Oops, missed a now-unused var. --- Remove unused BULKSTAT_FG_INLINE flag & associated code. Signed-off-by: Eric Sandeen Index: linux-2.6.22-rc4/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6.22-rc4.orig/fs/xfs/xfs_itable.c +++ linux-2.6.22-rc4/fs/xfs/xfs_itable.c @@ -271,7 +271,8 @@ xfs_bulkstat_use_dinode( xfs_dinode_t **dipp) { xfs_dinode_t *dip; - unsigned int aformat; + + ASSERT(flags & (BULKSTAT_FG_QUICK|BULKSTAT_FG_IGET)); *dipp = NULL; if (!bp || (flags & BULKSTAT_FG_IGET)) @@ -282,18 +283,9 @@ xfs_bulkstat_use_dinode( !XFS_DINODE_GOOD_VERSION( INT_GET(dip->di_core.di_version, ARCH_CONVERT))) return 0; - if (flags & BULKSTAT_FG_QUICK) { - *dipp = dip; - return 1; - } - /* BULKSTAT_FG_INLINE: if attr fork is local, or not there, use it */ - aformat = INT_GET(dip->di_core.di_aformat, ARCH_CONVERT); - if ((XFS_CFORK_Q(&dip->di_core) == 0) || - (aformat == XFS_DINODE_FMT_LOCAL) || - (aformat == XFS_DINODE_FMT_EXTENTS && !dip->di_core.di_anextents)) { - *dipp = dip; - return 1; - } + + /* BULKSTAT_FG_QUICK */ + *dipp = dip; return 1; } @@ -566,8 +558,7 @@ xfs_bulkstat( ((chunkidx & nimask) >> mp->m_sb.sb_inopblog); - if (flags & (BULKSTAT_FG_QUICK | - BULKSTAT_FG_INLINE)) { + if (flags & BULKSTAT_FG_QUICK) { ino = XFS_AGINO_TO_INO(mp, agno, agino); bno = XFS_AGB_TO_DADDR(mp, agno, @@ -615,22 +606,11 @@ xfs_bulkstat( if (!xfs_bulkstat_use_dinode(mp, flags, bp, clustidx, &dip)) continue; - /* - * If we need to do an iget, cannot hold bp. - * Drop it, until starting the next cluster. - */ - if ((flags & BULKSTAT_FG_INLINE) && !dip) { - if (bp) - xfs_buf_relse(bp); - bp = NULL; - } /* * Get the inode and fill in a single buffer. * BULKSTAT_FG_QUICK uses dip to fill it in. * BULKSTAT_FG_IGET uses igets. - * BULKSTAT_FG_INLINE uses dip if we have an - * inline attr fork, else igets. * See: xfs_bulkstat_one & xfs_dm_bulkstat_one. * This is also used to count inodes/blks, etc * in xfs_qm_quotacheck. Index: linux-2.6.22-rc4/fs/xfs/xfs_itable.h =================================================================== --- linux-2.6.22-rc4.orig/fs/xfs/xfs_itable.h +++ linux-2.6.22-rc4/fs/xfs/xfs_itable.h @@ -45,7 +45,6 @@ typedef int (*bulkstat_one_pf)(struct xf */ #define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */ #define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */ -#define BULKSTAT_FG_INLINE 0x4 /* No iget if inline attrs */ /* * Return stat information in bulk (by-inode) for the filesystem. From owner-xfs@oss.sgi.com Tue Aug 14 22:06:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 14 Aug 2007 22:06:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7F56nbm027580 for ; Tue, 14 Aug 2007 22:06:51 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id D24481806FDAE for ; Wed, 15 Aug 2007 00:06:54 -0500 (CDT) Message-ID: <46C289F4.1070502@sandeen.net> Date: Wed, 15 Aug 2007 00:07:00 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: Re: [PATCH V2] remove unused BULKSTAT_FG_INLINE References: <46C27EF8.2020004@sandeen.net> <46C28571.2060206@sandeen.net> In-Reply-To: <46C28571.2060206@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12567 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 Eric Sandeen wrote: > Eric Sandeen wrote: > >> I was looking at xfs_bulkstat with an eye towards stack reduction, >> and came across this... doesn't help stack, but it doesn't appear >> that the BULKSTAT_FG_INLINE bulkstat is ever used... >> >> Is it there for a reason? If not here's a patch. Ah hell. dmapi uses it in cvs... drat, foiled again. (there's also some stack savings to be had by removing the private_data bulkstat field... but dmapi uses that too) -Eric From owner-xfs@oss.sgi.com Wed Aug 15 00:25:06 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 15 Aug 2007 00:25:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7F7Oxbm004071 for ; Wed, 15 Aug 2007 00:25:05 -0700 Received: from linuxbuild.melbourne.sgi.com (linuxbuild.melbourne.sgi.com [134.14.54.115]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07778; Wed, 15 Aug 2007 17:24:59 +1000 From: donaldd@sgi.com Received: by linuxbuild.melbourne.sgi.com (Postfix, from userid 16365) id 061C52759E21; Wed, 15 Aug 2007 17:24:58 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 969187 - Fix xfs_quota disable, enable, off and remove commands Message-Id: <20070815072459.061C52759E21@linuxbuild.melbourne.sgi.com> Date: Wed, 15 Aug 2007 17:24:58 +1000 (EST) X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12568 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 Fix xfs_quota disable, enable, off and remove commands. Fix provided by Utako Kusaka. Date: Wed Aug 15 17:23:44 AEST 2007 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/xfs-cmds Inspected by: utako@tnes.nec.co.jp The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:29395a xfsprogs/doc/CHANGES - 1.245 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/doc/CHANGES.diff?r1=text&tr1=1.245&r2=text&tr2=1.244&f=h xfsprogs/quota/state.c - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/quota/state.c.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h From owner-xfs@oss.sgi.com Wed Aug 15 16:33:53 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 15 Aug 2007 16:33:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.5 required=5.0 tests=BAYES_99,J_CHICKENPOX_21, J_CHICKENPOX_47,J_CHICKENPOX_64,J_CHICKENPOX_82,RDNS_DYNAMIC autolearn=no version=3.2.0-pre1-r499012 Received: from jupiter.dnsdc9.com (62.72.232.72.static.reverse.ltdomains.com [72.232.72.62] (may be forged)) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7FNXpbm027895 for ; Wed, 15 Aug 2007 16:33:53 -0700 Received: from frozen89 by jupiter.dnsdc9.com with local (Exim 4.63) (envelope-from ) id 1ILTeU-00073Z-TN; Wed, 15 Aug 2007 20:55:54 -0400 Received: from 216.93.169.31 ([216.93.169.31]) (SquirrelMail authenticated user frozen89) by myspacetop5.com with HTTP; Wed, 15 Aug 2007 20:55:54 -0400 (EDT) Message-ID: <45394.216.93.169.31.1187225754.squirrel@myspacetop5.com> Date: Wed, 15 Aug 2007 20:55:54 -0400 (EDT) Subject: Job Proposal From: "Daniel Gerrad" Reply-To: danielgerrad@aol.com User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - jupiter.dnsdc9.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [32300 32002] / [47 12] X-AntiAbuse: Sender Address Domain - gmail.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: :/base/3rdparty/squirrelmail/src To: undisclosed-recipients:; X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12569 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: danielgerrad1@gmail.com Precedence: bulk X-list: xfs Good day, I'm Mr Daniel Gerrad and I own a company Based on Chinese and African textile and fabric material in the UK,I'm in search for a trustworthy representative in Canada that can help as a link between me and my clients over there.I just reviewed your email through my email search I would like to know if your are interested to work from home for us DL ARTS COMPANY LIMITED . I Urgently need a representative in Canada,work online from home and get paid weekly without leaving or affecting your present job? My Company produces various clothing materials, batiks,assorted fabrics and traditional costumes.We have clients we supply weekly in the UK and my clients make payments for our supplies every week in form of online transfer which will take 45days to be credited here if it is transferred here directly,so I need a honest and sincere individual in the UK to work as my representative and assist me in processing the payments from our clients and I will pay him/her 10% per each payment recieved on my behalf,your likely to recieve 6 payments per week,minimum of 4. HAVE AN IDEA OF WHAT YOUR EXPECTED TO TAKE CARE OFF ----------------------------------------------------- Receive payments from my patronizing customers in Canada on my behalf i, then deduct 10% from the total funds received as your workmanship and forward the balance to me Via Western Union Money Transfer.(the transfer charges should also be deducted from the total amount your sending to me). Sheryl Shavers (my former representative has moved to Germany with her family) Our payments will be issued out in your name and sent to your address. So all I need is to forward your information to my numerous customers in Canada and I will contact you before they issue payment to you. Hope to get a favourable reply, if accepted to be my rep and get back to me with the following informations in this format. Full: Name : full Address : Tel number : Sex : Age : <> I will need this informations from you for my record,also if you require more information, do not hesitate to contact me,i will give you a call asap. Thanks. MR. Daniel Gerrad Managing Director DL ARTS LIMITED. From owner-xfs@oss.sgi.com Wed Aug 15 16:45:50 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 15 Aug 2007 16:45:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.5 required=5.0 tests=BAYES_99,J_CHICKENPOX_21, J_CHICKENPOX_47,J_CHICKENPOX_64,J_CHICKENPOX_82,RDNS_DYNAMIC autolearn=no version=3.2.0-pre1-r499012 Received: from jupiter.dnsdc9.com (62.72.232.72.static.reverse.ltdomains.com [72.232.72.62] (may be forged)) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7FNjmbm031402 for ; Wed, 15 Aug 2007 16:45:49 -0700 Received: from frozen89 by jupiter.dnsdc9.com with local (Exim 4.63) (envelope-from ) id 1ILT5e-0003Th-0b; Wed, 15 Aug 2007 20:19:54 -0400 Received: from 216.93.169.31 ([216.93.169.31]) (SquirrelMail authenticated user frozen89) by myspacetop5.com with HTTP; Wed, 15 Aug 2007 20:19:54 -0400 (EDT) Message-ID: <33638.216.93.169.31.1187223594.squirrel@myspacetop5.com> Date: Wed, 15 Aug 2007 20:19:54 -0400 (EDT) Subject: Job Proposal From: "Daniel Gerrad" Reply-To: danielgerrad@aol.com User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - jupiter.dnsdc9.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [32300 32002] / [47 12] X-AntiAbuse: Sender Address Domain - gmail.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: :/base/3rdparty/squirrelmail/src To: undisclosed-recipients:; X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12570 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: danielgerrad1@gmail.com Precedence: bulk X-list: xfs Good day, I'm Mr Daniel Gerrad and I own a company Based on Chinese and African textile and fabric material in the UK,I'm in search for a trustworthy representative in Canada that can help as a link between me and my clients over there.I just reviewed your email through my email search I would like to know if your are interested to work from home for us DL ARTS COMPANY LIMITED . I Urgently need a representative in Canada,work online from home and get paid weekly without leaving or affecting your present job? My Company produces various clothing materials, batiks,assorted fabrics and traditional costumes.We have clients we supply weekly in the UK and my clients make payments for our supplies every week in form of online transfer which will take 45days to be credited here if it is transferred here directly,so I need a honest and sincere individual in the UK to work as my representative and assist me in processing the payments from our clients and I will pay him/her 10% per each payment recieved on my behalf,your likely to recieve 6 payments per week,minimum of 4. HAVE AN IDEA OF WHAT YOUR EXPECTED TO TAKE CARE OFF ----------------------------------------------------- Receive payments from my patronizing customers in Canada on my behalf i, then deduct 10% from the total funds received as your workmanship and forward the balance to me Via Western Union Money Transfer.(the transfer charges should also be deducted from the total amount your sending to me). Sheryl Shavers (my former representative has moved to Germany with her family) Our payments will be issued out in your name and sent to your address. So all I need is to forward your information to my numerous customers in Canada and I will contact you before they issue payment to you. Hope to get a favourable reply, if accepted to be my rep and get back to me with the following informations in this format. Full: Name : full Address : Tel number : Sex : Age : <> I will need this informations from you for my record,also if you require more information, do not hesitate to contact me,i will give you a call asap. Thanks. MR. Daniel Gerrad Managing Director DL ARTS LIMITED. From owner-xfs@oss.sgi.com Wed Aug 15 21:31:22 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 15 Aug 2007 21:31:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED, SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7G4VJbm004337 for ; Wed, 15 Aug 2007 21:31:22 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7G428X1030225 for ; Thu, 16 Aug 2007 00:02:08 -0400 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7G428rQ027228 for ; Thu, 16 Aug 2007 00:02:08 -0400 Received: from Liberator.local (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7G427us016409 for ; Thu, 16 Aug 2007 00:02:08 -0400 Message-ID: <46C3CC46.8030005@redhat.com> Date: Wed, 15 Aug 2007 23:02:14 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: xfsprogs/xfsdump: what flavor of GPL...? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12571 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@redhat.com Precedence: bulk X-list: xfs Fedora is making a push to clarify licensing on all packages - GPL+, GPLv2, GPLv2+, GPLv3, GPLv3+, LGPLv2, LGPLv2+, LGPLv3, LGPLv3+ are the acceptable license tags for rpm packaging at this point. ("+" means "or later"). Looking, for example, at mkfs/xfs_mkfs.c: * 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. it makes no mention of GPL _version_. With all the ruckus lately over GPLv3, could sgi please clarify? Since the included COPYING file says LGPL 2.1 and GPL2, I assume that LGPLv2 and GPLv2 are appropriate for the package. It'd be tedious, but you may wish to specify exactly which version of the license in the actual source files... Thanks, -Eric From owner-xfs@oss.sgi.com Thu Aug 16 13:04:18 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 16 Aug 2007 13:04:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_50,J_BACKHAIR_13, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7GK4Gbm005200 for ; Thu, 16 Aug 2007 13:04:17 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7GJM6pm009528; Thu, 16 Aug 2007 15:22:06 -0400 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7GJM6xU005654; Thu, 16 Aug 2007 15:22:06 -0400 Received: from [10.15.80.10] (neon.msp.redhat.com [10.15.80.10]) by lacrosse.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id l7GJM3r9008752; Thu, 16 Aug 2007 15:22:06 -0400 Message-ID: <46C4A33C.9000701@sandeen.net> Date: Thu, 16 Aug 2007 14:19:24 -0500 From: Eric Sandeen User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: xfs mailing list CC: Vlad Apostolov Subject: [PATCH] (fill-in-the-blank) : missing modes on O_CREAT opens Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12572 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 F8 now refuses to build anything that does an open("foo", O_CREAT); with no mode specified... Vlad, could you please fill in the /* mode */ blanks below? :) I think I caught them all... Thanks, -Eric Index: xfsdump-2.2.45/inventory/inv_fstab.c =================================================================== --- xfsdump-2.2.45.orig/inventory/inv_fstab.c +++ xfsdump-2.2.45/inventory/inv_fstab.c @@ -96,7 +96,7 @@ fstab_put_entry( uuid_t *fsidp, char *mn if ( errno != ENOENT ) { return -1; } - if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT )) + if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, /* mode */ )) < 0 ) { INV_PERROR ( INV_FSTAB ); return -1; Index: xfsdump-2.2.45/inventory/inv_idx.c =================================================================== --- xfsdump-2.2.45.orig/inventory/inv_idx.c +++ xfsdump-2.2.45/inventory/inv_idx.c @@ -257,7 +257,7 @@ idx_create( char *fname, inv_oflag_t for the db for SEARCH_ONLY. */ ASSERT( forwhat != INV_SEARCH_ONLY ); - if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT ) ) < 0 ) { + if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, /* mode */ ) ) < 0 ) { INV_PERROR ( fname ); return INV_TOKEN_NULL; } Index: xfsdump-2.2.45/inventory/inv_mgr.c =================================================================== --- xfsdump-2.2.45.orig/inventory/inv_mgr.c +++ xfsdump-2.2.45/inventory/inv_mgr.c @@ -692,7 +692,7 @@ invmgr_lockinit( void ) { if ( invlock_fd == -1 ) { if (( invlock_fd = open( INV_LOCKFILE, - O_RDONLY | O_CREAT )) < 0 ) { + O_RDONLY | O_CREAT, /* mode */ )) < 0 ) { INV_PERROR( INV_LOCKFILE ); return BOOL_FALSE; } Index: xfsdump-2.2.45/inventory/inv_oref.c =================================================================== --- xfsdump-2.2.45.orig/inventory/inv_oref.c +++ xfsdump-2.2.45/inventory/inv_oref.c @@ -429,7 +429,7 @@ oref_resolve_new_invidx( int stobjfd, fd; inv_idbtoken_t tok; - if ((fd = open ( fname , O_RDWR | O_CREAT ) ) < 0 ) { + if ((fd = open ( fname , O_RDWR | O_CREAT, /* mode */ ) ) < 0 ) { INV_PERROR ( fname ); return INV_ERR; } Index: xfsdump-2.2.45/inventory/inv_stobj.c =================================================================== --- xfsdump-2.2.45.orig/inventory/inv_stobj.c +++ xfsdump-2.2.45/inventory/inv_stobj.c @@ -527,7 +527,7 @@ stobj_create( char *fname ) #endif /* create the new storage object */ - if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT )) < 0 ) { + if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT, /* mode */ )) < 0 ) { INV_PERROR ( fname ); memset( fname, 0, INV_STRLEN ); return -1; @@ -1083,7 +1083,7 @@ stobj_unpack_sessinfo( #ifdef INVT_DELETION { - int tmpfd = open( "moids", O_RDWR | O_CREAT ); + int tmpfd = open( "moids", O_RDWR | O_CREAT, /* mode */ ); u_int j; invt_mediafile_t *mmf = s->mfiles; for (i=0; i< s->ses->s_cur_nstreams; i++ ) { Index: xfsdump-2.2.45/invutil/invidx.c =================================================================== --- xfsdump-2.2.45.orig/invutil/invidx.c +++ xfsdump-2.2.45/invutil/invidx.c @@ -275,7 +275,7 @@ invidx_commit(WINDOW *win, node_t *curre return 0; } - new_fd = open(dst_idxfile, O_CREAT|O_RDWR); + new_fd = open(dst_idxfile, O_CREAT|O_RDWR, /* mode */); if(new_fd < 0) { put_error("Error: unable to open inventory index file"); return 0; @@ -616,7 +616,7 @@ stobj_create( char *fname ) invt_sescounter_t sescnt; /* create the new storage object */ - if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT )) < 0 ) { + if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT, /* mode */ )) < 0 ) { return -1; } From owner-xfs@oss.sgi.com Fri Aug 17 06:44:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 17 Aug 2007 06:44:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7HDiJbm021242 for ; Fri, 17 Aug 2007 06:44:20 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 0A3221806FDB9; Fri, 17 Aug 2007 08:44:24 -0500 (CDT) Message-ID: <46C5A63E.5070906@sandeen.net> Date: Fri, 17 Aug 2007 08:44:30 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: xfsprogs/xfsdump: what flavor of GPL...? References: <46C3CC46.8030005@redhat.com> In-Reply-To: <46C3CC46.8030005@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12573 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 Eric Sandeen wrote: > Fedora is making a push to clarify licensing on all packages - > > GPL+, GPLv2, GPLv2+, GPLv3, GPLv3+, LGPLv2, LGPLv2+, LGPLv3, LGPLv3+ > > are the acceptable license tags for rpm packaging at this point. ("+" > means "or later"). Of course, the tag I put on the package is in no way binding for sgi - it's just supposed to reflect the license inside. But it does point out a bit of confusion now that gplv3 is on the scene. I'll follow fedora guidelines & put GPL+ and LGPLv2+ in the field for now; when I get clarification from SGI I'll fix up if needed. Thanks, -Eric > Looking, for example, at mkfs/xfs_mkfs.c: > > * 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. > > it makes no mention of GPL _version_. > > With all the ruckus lately over GPLv3, could sgi please clarify? Since > the included COPYING file says LGPL 2.1 and GPL2, I assume that LGPLv2 > and GPLv2 are appropriate for the package. > > It'd be tedious, but you may wish to specify exactly which version of > the license in the actual source files... > > Thanks, > > -Eric > > From owner-xfs@oss.sgi.com Sat Aug 18 13:04:15 2007 Received: with ECARTIS (v1.0.0; list xfs); Sat, 18 Aug 2007 13:04:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7IK4Ebm027875 for ; Sat, 18 Aug 2007 13:04:15 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 18D1618DF93B1 for ; Sat, 18 Aug 2007 15:04:19 -0500 (CDT) Message-ID: <46C750C9.8040604@sandeen.net> Date: Sat, 18 Aug 2007 15:04:25 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH] make xfs stats Kconfigurable Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12574 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 guys, what do you think, is it worth doing this for when space is tight: xfs stats are already optional based on CONFIG_PROC_FS, and there is already a (never-set) macro XFS_STATS_OFF which can turn them off. Making it a configurable option, if I turn them off I can get a little stack savings on x86, gcc 4.1: xfs_attr_list -8 xfs_bmap_rtalloc -16 xfs_bmap_search_extents -8 xfs_buf_find +8 (not sure why) xfs_iflush -4 xfs_imap -12 xfs_log_reserve -4 xfs_log_sync -8 It'd reduce the size of the binary a bit too. Signed-off-by: Eric Sandeen Index: linux-2.6.22.i386/fs/xfs/Kconfig =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/Kconfig +++ linux-2.6.22.i386/fs/xfs/Kconfig @@ -59,6 +59,17 @@ config XFS_POSIX_ACL If you don't know what Access Control Lists are, say N. + config XFS_STATS + bool "XFS statistics" + depends on XFS_FS && PROC_FS + help + If you say Y here xfs will gather detailed statistics during + its operation, and present them in /proc/fs/xfs/stat and + (CONFIG_XFS_QUOTA is enabled) /proc/fs/xfs/xqmstat. Disabling + this will make the compiled code and stack usage slightly smaller. + + If unsure, say Y. + config XFS_RT bool "XFS Realtime subvolume support" depends on XFS_FS Index: linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6 =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/Makefile-linux-2.6 +++ linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6 @@ -35,12 +35,12 @@ xfs-$(CONFIG_XFS_QUOTA) += $(addprefix xfs_qm.o) ifeq ($(CONFIG_XFS_QUOTA),y) -xfs-$(CONFIG_PROC_FS) += quota/xfs_qm_stats.o +xfs-$(CONFIG_XFS_STAT) += quota/xfs_qm_stats.o endif xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o -xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o +xfs-$(CONFIG_XFS_STATS) += $(XFS_LINUX)/xfs_stats.o xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_stats.h +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h @@ -19,7 +19,7 @@ #define __XFS_STATS_H__ -#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF) +#if defined(CONFIG_XFS_STATS) #include @@ -137,8 +137,7 @@ DECLARE_PER_CPU(struct xfsstats, xfsstat extern void xfs_init_procfs(void); extern void xfs_cleanup_procfs(void); - -#else /* !CONFIG_PROC_FS */ +#else /* !CONFIG_XFS_STATS */ # define XFS_STATS_INC(count) # define XFS_STATS_DEC(count) @@ -147,6 +146,6 @@ extern void xfs_cleanup_procfs(void); static __inline void xfs_init_procfs(void) { }; static __inline void xfs_cleanup_procfs(void) { }; -#endif /* !CONFIG_PROC_FS */ +#endif /* !CONFIG_XFS_STATS */ #endif /* __XFS_STATS_H__ */ Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_sysctl.c +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c @@ -21,7 +21,7 @@ static struct ctl_table_header *xfs_table_header; -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_XFS_STATS STATIC int xfs_stats_clear_proc_handler( ctl_table *ctl, @@ -52,7 +52,7 @@ xfs_stats_clear_proc_handler( return ret; } -#endif /* CONFIG_PROC_FS */ +#endif /* CONFIG_XFS_STATS */ static ctl_table xfs_table[] = { { @@ -222,7 +222,7 @@ static ctl_table xfs_table[] = { .extra2 = &xfs_params.fstrm_timer.max, }, /* please keep this the last entry */ -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_XFS_STATS { .ctl_name = XFS_STATS_CLEAR, .procname = "stats_clear", Index: linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/quota/xfs_qm_stats.h +++ linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h @@ -18,7 +18,7 @@ #ifndef __XFS_QM_STATS_H__ #define __XFS_QM_STATS_H__ -#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF) +#ifdef CONFIG_XFS_STATS /* * XQM global statistics From owner-xfs@oss.sgi.com Sat Aug 18 14:19:43 2007 Received: with ECARTIS (v1.0.0; list xfs); Sat, 18 Aug 2007 14:19:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7ILJebm009572 for ; Sat, 18 Aug 2007 14:19:42 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 184BE18DF93BA for ; Sat, 18 Aug 2007 16:19:46 -0500 (CDT) Message-ID: <46C7627A.60503@sandeen.net> Date: Sat, 18 Aug 2007 16:19:54 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH] optimize XFS_IS_REALTIME_INODE w/o realtime config Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12575 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 Use XFS_IS_REALTIME_INODE in more places, and #define it to 0 if CONFIG_XFS_RT is off. This should be safe because mount checks in xfs_rtmount_init: # define xfs_rtmount_init(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should be encountered after that. Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space, presumeably gcc can optimize around the various "if (0)" type checks: xfs_alloc_file_space -8 xfs_bmap_adjacent -16 xfs_bmapi -8 xfs_bmap_rtalloc -16 xfs_bunmapi -28 xfs_free_file_space -64 xfs_imap +8 <-- ? hmm. xfs_iomap_write_direct -12 xfs_qm_dqusage_adjust -4 xfs_qm_vop_chown_reserve -4 Compile tested only at this point. Signed-off-by: Eric Sandeen Index: linux-2.6.22.i386/fs/xfs/xfs_rtalloc.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_rtalloc.h +++ linux-2.6.22.i386/fs/xfs/xfs_rtalloc.h @@ -21,8 +21,6 @@ struct xfs_mount; struct xfs_trans; -#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) - /* Min and max rt extent sizes, specified in bytes */ #define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */ #define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64KB */ Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_ioctl.c +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_ioctl.c @@ -736,7 +736,7 @@ xfs_ioctl( case XFS_IOC_DIOINFO: { struct dioattr da; xfs_buftarg_t *target = - (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? + XFS_IS_REALTIME_INODE(ip) ? mp->m_rtdev_targp : mp->m_ddev_targp; da.d_mem = da.d_miniosz = 1 << target->bt_sshift; Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_lrw.c +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_lrw.c @@ -220,7 +220,7 @@ xfs_read( if (unlikely(ioflags & IO_ISDIRECT)) { xfs_buftarg_t *target = - (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? + XFS_IS_REALTIME_INODE(ip) ? mp->m_rtdev_targp : mp->m_ddev_targp; if ((*offset & target->bt_smask) || (size & target->bt_smask)) { @@ -694,7 +694,7 @@ start: if (ioflags & IO_ISDIRECT) { xfs_buftarg_t *target = - (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? + XFS_IS_REALTIME_INODE(xip) ? mp->m_rtdev_targp : mp->m_ddev_targp; if ((pos & target->bt_smask) || (count & target->bt_smask)) { Index: linux-2.6.22.i386/fs/xfs/xfs_dfrag.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_dfrag.c +++ linux-2.6.22.i386/fs/xfs/xfs_dfrag.c @@ -184,8 +184,7 @@ xfs_swap_extents( } /* Verify both files are either real-time or non-realtime */ - if ((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != - (tip->i_d.di_flags & XFS_DIFLAG_REALTIME)) { + if (XFS_IS_REALTIME_INODE(ip) != XFS_IS_REALTIME_INODE(tip)) { error = XFS_ERROR(EINVAL); goto error0; } Index: linux-2.6.22.i386/fs/xfs/xfs_iocore.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_iocore.c +++ linux-2.6.22.i386/fs/xfs/xfs_iocore.c @@ -94,7 +94,7 @@ xfs_iocore_inode_reinit( xfs_iocore_t *io = &ip->i_iocore; io->io_flags = 0; - if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) + if (XFS_IS_REALTIME_INODE(ip)) io->io_flags |= XFS_IOCORE_RT; io->io_dmevmask = ip->i_d.di_dmevmask; io->io_dmstate = ip->i_d.di_dmstate; Index: linux-2.6.22.i386/fs/xfs/xfs_rw.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_rw.h +++ linux-2.6.22.i386/fs/xfs/xfs_rw.h @@ -58,7 +58,7 @@ struct xfs_mount; static inline xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb) { - return (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \ + return (XFS_IS_REALTIME_INODE(ip) ? \ (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \ XFS_FSB_TO_DADDR((ip)->i_mount, (fsb))); } @@ -87,7 +87,7 @@ xfs_get_extsz_hint( { xfs_extlen_t extsz; - if (unlikely(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) { + if (unlikely(XFS_IS_REALTIME_INODE(ip))) { extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) ? ip->i_d.di_extsize : ip->i_mount->m_sb.sb_rextsize; Index: linux-2.6.22.i386/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_vnodeops.c +++ linux-2.6.22.i386/fs/xfs/xfs_vnodeops.c @@ -144,7 +144,7 @@ xfs_getattr( default: vap->va_rdev = 0; - if (!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) { + if (!(XFS_IS_REALTIME_INODE(ip))) { vap->va_blocksize = xfs_preferred_iosize(mp); } else { @@ -521,7 +521,7 @@ xfs_setattr( */ if ((ip->i_d.di_nextents || ip->i_delayed_blks) && (mask & XFS_AT_XFLAGS) && - (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != + (XFS_IS_REALTIME_INODE(ip)) != (vap->va_xflags & XFS_XFLAG_REALTIME)) { code = XFS_ERROR(EINVAL); /* EFBIG? */ goto error_return; @@ -533,7 +533,7 @@ xfs_setattr( if ((mask & XFS_AT_EXTSIZE) && vap->va_extsize != 0) { xfs_extlen_t size; - if ((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) || + if (XFS_IS_REALTIME_INODE(ip) || ((mask & XFS_AT_XFLAGS) && (vap->va_xflags & XFS_XFLAG_REALTIME))) { size = mp->m_sb.sb_rextsize << @@ -1188,7 +1188,7 @@ xfs_fsync( * If this inode is on the RT dev we need to flush that * cache as well. */ - if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) + if (XFS_IS_REALTIME_INODE(ip)) xfs_blkdev_issue_flush(ip->i_mount->m_rtdev_targp); } @@ -4263,7 +4263,7 @@ xfs_zero_remaining_bytes( int error = 0; bp = xfs_buf_get_noaddr(mp->m_sb.sb_blocksize, - ip->i_d.di_flags & XFS_DIFLAG_REALTIME ? + XFS_IS_REALTIME_INODE(ip) ? mp->m_rtdev_targp : mp->m_ddev_targp); for (offset = startoff; offset <= endoff; offset = lastoffset + 1) { @@ -4360,7 +4360,7 @@ xfs_free_file_space( error = 0; if (len <= 0) /* if nothing being freed */ return error; - rt = (ip->i_d.di_flags & XFS_DIFLAG_REALTIME); + rt = XFS_IS_REALTIME_INODE(ip); startoffset_fsb = XFS_B_TO_FSB(mp, offset); end_dmi_offset = offset + len; endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); Index: linux-2.6.22.i386/fs/xfs/xfs_dinode.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_dinode.h +++ linux-2.6.22.i386/fs/xfs/xfs_dinode.h @@ -274,6 +274,12 @@ typedef enum xfs_dinode_fmt #define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT) #define XFS_DIFLAG_FILESTREAM (1 << XFS_DIFLAG_FILESTREAM_BIT) +#ifdef CONFIG_XFS_RT +#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) +#else +#define XFS_IS_REALTIME_INODE(ip) (0) +#endif + #define XFS_DIFLAG_ANY \ (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \ XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \ From owner-xfs@oss.sgi.com Sat Aug 18 23:04:58 2007 Received: with ECARTIS (v1.0.0; list xfs); Sat, 18 Aug 2007 23:05:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7J64vbm017531 for ; Sat, 18 Aug 2007 23:04:58 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id D439B18DF93BD for ; Sun, 19 Aug 2007 01:05:01 -0500 (CDT) Message-ID: <46C7DD96.6030001@sandeen.net> Date: Sun, 19 Aug 2007 01:05:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH] optimize dmapi event tests w/o dmapi config Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12576 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 Defining XFS_DM_EVENT* macros to 0 in the absence of CONFIG_XFS_DMAPI allows gcc to optimize away tests that should never be true. Also wrap one hunk of xfs_unmount in #ifdef CONFIG_XFS_DMAPI Stack deltas on x86, gcc 4.1: xfs_create -16 xfs_free_file_space -4 xfs_getbmap +4 xfs_link -8 xfs_mkidr -20 xfs_read -24 xfs_remove -12 xfs_rename -8 xfs_rmdir -16 xfs_setattr -20 xfs_splice_read -20 xfs_splice_write -20 xfs_unmount -48 xfs_write -20 Signed-off-by: Eric Sandeen Index: linux-2.6.22.i386/fs/xfs/xfs_dmapi.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_dmapi.h +++ linux-2.6.22.i386/fs/xfs/xfs_dmapi.h @@ -66,6 +66,7 @@ typedef enum { } dm_right_t; #define HAVE_DM_RIGHT_T +#ifdef CONFIG_XFS_DMAPI /* Defines for determining if an event message should be sent. */ #define DM_EVENT_ENABLED(vfsp, ip, event) ( \ unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ @@ -78,6 +79,11 @@ typedef enum { ( ((io)->io_dmevmask & (1 << event)) || \ ((io)->io_mount->m_dmevmask & (1 << event)) ) \ ) +#else +#define DM_EVENT_ENABLED(vfsp, ip, event) (0) +#define DM_EVENT_ENABLED_IO(vfsp, io, event) (0) +#endif + #define DM_XFS_VALID_FS_EVENTS ( \ (1 << DM_EVENT_PREUNMOUNT) | \ Index: linux-2.6.22.i386/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/xfs_vfsops.c +++ linux-2.6.22.i386/fs/xfs/xfs_vfsops.c @@ -568,6 +568,7 @@ xfs_unmount( rip = mp->m_rootip; rvp = XFS_ITOV(rip); +#ifdef CONFIG_XFS_DMAPI if (vfsp->vfs_flag & VFS_DMI) { error = XFS_SEND_PREUNMOUNT(mp, vfsp, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, @@ -580,7 +581,7 @@ xfs_unmount( unmount_event_flags = (mp->m_dmevmask & (1<; Sun, 19 Aug 2007 10:20:57 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 6F6F218DF93BB for ; Sun, 19 Aug 2007 12:21:00 -0500 (CDT) Message-ID: <46C87C05.5040905@sandeen.net> Date: Sun, 19 Aug 2007 12:21:09 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: [PATCH V2] make xfs stats Kconfigurable References: <46C750C9.8040604@sandeen.net> In-Reply-To: <46C750C9.8040604@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12577 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 Oops, typo in Makefile (CONFIG_XFS_STAT vs _STATS). ---- xfs stats are already optional based on CONFIG_PROC_FS, and there is already a (never-set) macro XFS_STATS_OFF which can turn them off. Making it a configurable option, if I turn them off I can get a little stack savings on x86, gcc 4.1: xfs_attr_list -8 xfs_bmap_rtalloc -16 xfs_bmap_search_extents -8 xfs_buf_find +8 (not sure why) xfs_iflush -4 xfs_imap -12 xfs_log_reserve -4 xfs_log_sync -8 It'd reduce the size of the binary a bit too. Signed-off-by: Eric Sandeen Index: linux-2.6.22.i386/fs/xfs/Kconfig =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/Kconfig +++ linux-2.6.22.i386/fs/xfs/Kconfig @@ -59,6 +59,17 @@ config XFS_POSIX_ACL If you don't know what Access Control Lists are, say N. + config XFS_STATS + bool "XFS statistics" + depends on XFS_FS && PROC_FS + help + If you say Y here xfs will gather detailed statistics during + its operation, and present them in /proc/fs/xfs/stat and + (CONFIG_XFS_QUOTA is enabled) /proc/fs/xfs/xqmstat. Disabling + this will make the compiled code and stack usage slightly smaller. + + If unsure, say Y. + config XFS_RT bool "XFS Realtime subvolume support" depends on XFS_FS Index: linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6 =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/Makefile-linux-2.6 +++ linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6 @@ -35,12 +35,12 @@ xfs-$(CONFIG_XFS_QUOTA) += $(addprefix xfs_qm.o) ifeq ($(CONFIG_XFS_QUOTA),y) -xfs-$(CONFIG_PROC_FS) += quota/xfs_qm_stats.o +xfs-$(CONFIG_XFS_STATS) += quota/xfs_qm_stats.o endif xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o -xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o +xfs-$(CONFIG_XFS_STATS) += $(XFS_LINUX)/xfs_stats.o xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_stats.h +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h @@ -19,7 +19,7 @@ #define __XFS_STATS_H__ -#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF) +#if defined(CONFIG_XFS_STATS) #include @@ -137,8 +137,7 @@ DECLARE_PER_CPU(struct xfsstats, xfsstat extern void xfs_init_procfs(void); extern void xfs_cleanup_procfs(void); - -#else /* !CONFIG_PROC_FS */ +#else /* !CONFIG_XFS_STATS */ # define XFS_STATS_INC(count) # define XFS_STATS_DEC(count) @@ -147,6 +146,6 @@ extern void xfs_cleanup_procfs(void); static __inline void xfs_init_procfs(void) { }; static __inline void xfs_cleanup_procfs(void) { }; -#endif /* !CONFIG_PROC_FS */ +#endif /* !CONFIG_XFS_STATS */ #endif /* __XFS_STATS_H__ */ Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_sysctl.c +++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c @@ -21,7 +21,7 @@ static struct ctl_table_header *xfs_table_header; -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_XFS_STATS STATIC int xfs_stats_clear_proc_handler( ctl_table *ctl, @@ -52,7 +52,7 @@ xfs_stats_clear_proc_handler( return ret; } -#endif /* CONFIG_PROC_FS */ +#endif /* CONFIG_XFS_STATS */ static ctl_table xfs_table[] = { { @@ -222,7 +222,7 @@ static ctl_table xfs_table[] = { .extra2 = &xfs_params.fstrm_timer.max, }, /* please keep this the last entry */ -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_XFS_STATS { .ctl_name = XFS_STATS_CLEAR, .procname = "stats_clear", Index: linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h =================================================================== --- linux-2.6.22.i386.orig/fs/xfs/quota/xfs_qm_stats.h +++ linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h @@ -18,7 +18,7 @@ #ifndef __XFS_QM_STATS_H__ #define __XFS_QM_STATS_H__ -#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF) +#ifdef CONFIG_XFS_STATS /* * XQM global statistics From owner-xfs@oss.sgi.com Sun Aug 19 11:33:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 11:33:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JIXnbm002471 for ; Sun, 19 Aug 2007 11:33:51 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id EEA6D18DF93B1 for ; Sun, 19 Aug 2007 13:33:54 -0500 (CDT) Message-ID: <46C88D1A.1020709@sandeen.net> Date: Sun, 19 Aug 2007 13:34:02 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: Re: [PATCH V2] make xfs stats Kconfigurable References: <46C750C9.8040604@sandeen.net> <46C87C05.5040905@sandeen.net> In-Reply-To: <46C87C05.5040905@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12578 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 Eric Sandeen wrote: > Oops, typo in Makefile (CONFIG_XFS_STAT vs _STATS). > > ---- > > > xfs stats are already optional based on CONFIG_PROC_FS, and there > is already a (never-set) macro XFS_STATS_OFF which can turn them > off. Making it a configurable option, if I turn them off I can > get a little stack savings on x86, gcc 4.1: This causes feature -q in xfsqa to report no quotas, because /proc/fs/xfs/xqm isn't present, but I think that check should just be removed...? -Eric From owner-xfs@oss.sgi.com Sun Aug 19 12:10:39 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:10:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJAbbm007860 for ; Sun, 19 Aug 2007 12:10:39 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 0291C18DF93B1; Sun, 19 Aug 2007 14:10:43 -0500 (CDT) Message-ID: <46C895BB.2000004@sandeen.net> Date: Sun, 19 Aug 2007 14:10:51 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs-oss Subject: Re: [PATCH] optimize XFS_IS_REALTIME_INODE w/o realtime config References: <46C7627A.60503@sandeen.net> <20070819190847.GB2929@infradead.org> In-Reply-To: <20070819190847.GB2929@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12579 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 Sat, Aug 18, 2007 at 04:19:54PM -0500, Eric Sandeen wrote: >> Use XFS_IS_REALTIME_INODE in more places, and #define it to >> 0 if CONFIG_XFS_RT is off. This should be safe because mount >> checks in xfs_rtmount_init: >> >> # define xfs_rtmount_init(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) >> >> so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should >> be encountered after that. >> >> Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space, >> presumeably gcc can optimize around the various "if (0)" type >> checks: > > Looks good to me. > > Not sure if anyone disables the rt volume, but as long as it's a config > option we should try to avoid as much as possible away if it's not enabled. > Fedora does :) -Eric From owner-xfs@oss.sgi.com Sun Aug 19 12:13:39 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:13:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_05,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJDbbm008518 for ; Sun, 19 Aug 2007 12:13:38 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 707BA18DF93BB; Sun, 19 Aug 2007 14:13:43 -0500 (CDT) Message-ID: <46C89670.6050101@sandeen.net> Date: Sun, 19 Aug 2007 14:13:52 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs-oss Subject: Re: [PATCH V2] make xfs stats Kconfigurable References: <46C750C9.8040604@sandeen.net> <46C87C05.5040905@sandeen.net> <20070819191010.GC2929@infradead.org> In-Reply-To: <20070819191010.GC2929@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12580 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 Sun, Aug 19, 2007 at 12:21:09PM -0500, Eric Sandeen wrote: >> Oops, typo in Makefile (CONFIG_XFS_STAT vs _STATS). >> >> ---- >> >> >> xfs stats are already optional based on CONFIG_PROC_FS, and there >> is already a (never-set) macro XFS_STATS_OFF which can turn them >> off. Making it a configurable option, if I turn them off I can >> get a little stack savings on x86, gcc 4.1: > > Why would we want to disable the statistics? To save a little stack space. :) *shrug* This one's not so critical. FWIW, JFS has configurable stats, and I think an upcoming jbd patch adds (config-optional) stats. OTOH when are stats really used outside of sgi? Though I suppose occasionally they'd be useful in field debugging. *shrug* this one may not be worth it; I won't be heartbroken if it doesn't go in... it helps a tiny bit on the stack side. -Eric >> + config XFS_STATS > > Everywhere else the config statement is not indented, so it probably > shouldn't be here either. > From owner-xfs@oss.sgi.com Sun Aug 19 12:29:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:29:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJT9bm014263 for ; Sun, 19 Aug 2007 12:29:10 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IMq7Y-0000m2-7F; Sun, 19 Aug 2007 20:07:32 +0100 Date: Sun, 19 Aug 2007 20:07:32 +0100 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH] optimize dmapi event tests w/o dmapi config Message-ID: <20070819190732.GA2929@infradead.org> References: <46C7DD96.6030001@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C7DD96.6030001@sandeen.net> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12583 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 Sun, Aug 19, 2007 at 01:05:10AM -0500, Eric Sandeen wrote: > Defining XFS_DM_EVENT* macros to 0 in the absence of > CONFIG_XFS_DMAPI allows gcc to optimize away tests that > should never be true. Also wrap one hunk of xfs_unmount > in #ifdef CONFIG_XFS_DMAPI Sounds useful, especially as dmapi is not in mainline at all. From owner-xfs@oss.sgi.com Sun Aug 19 12:29:08 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:29:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJT7bm014256 for ; Sun, 19 Aug 2007 12:29:08 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IMqA6-0000nc-LR; Sun, 19 Aug 2007 20:10:10 +0100 Date: Sun, 19 Aug 2007 20:10:10 +0100 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH V2] make xfs stats Kconfigurable Message-ID: <20070819191010.GC2929@infradead.org> References: <46C750C9.8040604@sandeen.net> <46C87C05.5040905@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C87C05.5040905@sandeen.net> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12582 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 Sun, Aug 19, 2007 at 12:21:09PM -0500, Eric Sandeen wrote: > Oops, typo in Makefile (CONFIG_XFS_STAT vs _STATS). > > ---- > > > xfs stats are already optional based on CONFIG_PROC_FS, and there > is already a (never-set) macro XFS_STATS_OFF which can turn them > off. Making it a configurable option, if I turn them off I can > get a little stack savings on x86, gcc 4.1: Why would we want to disable the statistics? > + config XFS_STATS Everywhere else the config statement is not indented, so it probably shouldn't be here either. From owner-xfs@oss.sgi.com Sun Aug 19 12:29:06 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:29:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJT4bm014235 for ; Sun, 19 Aug 2007 12:29:06 -0700 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1IMq8l-0000mP-Ns; Sun, 19 Aug 2007 20:08:47 +0100 Date: Sun, 19 Aug 2007 20:08:47 +0100 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH] optimize XFS_IS_REALTIME_INODE w/o realtime config Message-ID: <20070819190847.GB2929@infradead.org> References: <46C7627A.60503@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C7627A.60503@sandeen.net> User-Agent: Mutt/1.4.2.3i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12581 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 Sat, Aug 18, 2007 at 04:19:54PM -0500, Eric Sandeen wrote: > Use XFS_IS_REALTIME_INODE in more places, and #define it to > 0 if CONFIG_XFS_RT is off. This should be safe because mount > checks in xfs_rtmount_init: > > # define xfs_rtmount_init(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) > > so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should > be encountered after that. > > Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space, > presumeably gcc can optimize around the various "if (0)" type > checks: Looks good to me. Not sure if anyone disables the rt volume, but as long as it's a config option we should try to avoid as much as possible away if it's not enabled. From owner-xfs@oss.sgi.com Sun Aug 19 12:40:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:40:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJeIbm016778 for ; Sun, 19 Aug 2007 12:40:20 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7JJeNA5002257 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 19 Aug 2007 21:40:23 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7JJeNBl002255 for xfs@oss.sgi.com; Sun, 19 Aug 2007 21:40:23 +0200 Date: Sun, 19 Aug 2007 21:40:23 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] kill unused IOMAP_EOF flag Message-ID: <20070819194023.GB2185@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-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12585 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 Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_iomap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iomap.c 2007-08-13 18:34:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iomap.c 2007-08-13 18:34:49.000000000 +0200 @@ -135,14 +135,10 @@ xfs_imap_to_bmap( int flags) { xfs_mount_t *mp; - xfs_fsize_t nisize; int pbm; xfs_fsblock_t start_block; mp = io->io_mount; - nisize = XFS_SIZE(mp, io); - if (io->io_new_size > nisize) - nisize = io->io_new_size; for (pbm = 0; imaps && pbm < iomaps; imaps--, iomapp++, imap++, pbm++) { iomapp->iomap_offset = XFS_FSB_TO_B(mp, imap->br_startoff); @@ -169,10 +165,6 @@ xfs_imap_to_bmap( iomapp->iomap_flags |= IOMAP_UNWRITTEN; } - if ((iomapp->iomap_offset + iomapp->iomap_bsize) >= nisize) { - iomapp->iomap_flags |= IOMAP_EOF; - } - offset += iomapp->iomap_bsize - iomapp->iomap_delta; } return pbm; /* Return the number filled */ Index: linux-2.6-xfs/fs/xfs/xfs_iomap.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iomap.h 2007-08-13 18:34:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iomap.h 2007-08-13 18:34:29.000000000 +0200 @@ -23,7 +23,6 @@ typedef enum { /* iomap_flags values */ IOMAP_READ = 0, /* mapping for a read */ - IOMAP_EOF = 0x01, /* mapping contains EOF */ IOMAP_HOLE = 0x02, /* mapping covers a hole */ IOMAP_DELAY = 0x04, /* mapping covers delalloc region */ IOMAP_REALTIME = 0x10, /* mapping on the realtime device */ From owner-xfs@oss.sgi.com Sun Aug 19 12:39:42 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 12:39:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7JJdcbm016630 for ; Sun, 19 Aug 2007 12:39:42 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7JJdhA5002236 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 19 Aug 2007 21:39:43 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7JJdhTR002234 for xfs@oss.sgi.com; Sun, 19 Aug 2007 21:39:43 +0200 Date: Sun, 19 Aug 2007 21:39:43 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH] m_growlock should be a mutex Message-ID: <20070819193943.GA2185@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-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12584 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 m_growlock only needs plain binary mutex semantics, so use a struct mutex instead of a semaphore for it. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_fsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_fsops.c 2007-08-13 18:04:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_fsops.c 2007-08-13 18:04:26.000000000 +0200 @@ -433,10 +433,10 @@ xfs_growfs_data( xfs_growfs_data_t *in) { int error; - if (!cpsema(&mp->m_growlock)) + if (!mutex_trylock(&mp->m_growlock)) return XFS_ERROR(EWOULDBLOCK); error = xfs_growfs_data_private(mp, in); - vsema(&mp->m_growlock); + mutex_unlock(&mp->m_growlock); return error; } @@ -446,10 +446,10 @@ xfs_growfs_log( xfs_growfs_log_t *in) { int error; - if (!cpsema(&mp->m_growlock)) + if (!mutex_trylock(&mp->m_growlock)) return XFS_ERROR(EWOULDBLOCK); error = xfs_growfs_log_private(mp, in); - vsema(&mp->m_growlock); + mutex_unlock(&mp->m_growlock); return error; } Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2007-08-13 18:04:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2007-08-13 18:04:26.000000000 +0200 @@ -139,7 +139,7 @@ xfs_mount_init(void) AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail"); spinlock_init(&mp->m_sb_lock, "xfs_sb"); mutex_init(&mp->m_ilock); - initnsema(&mp->m_growlock, 1, "xfs_grow"); + mutex_init(&mp->m_growlock); /* * Initialize the AIL. */ @@ -180,7 +180,7 @@ xfs_mount_free( AIL_LOCK_DESTROY(&mp->m_ail_lock); spinlock_destroy(&mp->m_sb_lock); mutex_destroy(&mp->m_ilock); - freesema(&mp->m_growlock); + mutex_destroy(&mp->m_growlock); if (mp->m_quotainfo) XFS_QM_DONE(mp); Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2007-08-13 18:04:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2007-08-13 18:04:26.000000000 +0200 @@ -377,7 +377,7 @@ typedef struct xfs_mount { uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */ struct xfs_perag *m_perag; /* per-ag accounting info */ struct rw_semaphore m_peraglock; /* lock for m_perag (pointer) */ - sema_t m_growlock; /* growfs mutex */ + struct mutex m_growlock; /* growfs mutex */ int m_fixedfsid[2]; /* unchanged for life of FS */ uint m_dmevmask; /* DMI events for this FS */ __uint64_t m_flags; /* global mount flags */ From owner-xfs@oss.sgi.com Sun Aug 19 16:47:03 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 16:47:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7JNkvbm020526 for ; Sun, 19 Aug 2007 16:47:01 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA22339; Mon, 20 Aug 2007 09:46:57 +1000 Message-ID: <46C8D6E8.2080500@sgi.com> Date: Mon, 20 Aug 2007 09:48:56 +1000 From: Vlad Apostolov User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: [PATCH] optimize dmapi event tests w/o dmapi config References: <46C7DD96.6030001@sandeen.net> In-Reply-To: <46C7DD96.6030001@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12586 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Defining XFS_DM_EVENT* macros to 0 in the absence of > CONFIG_XFS_DMAPI allows gcc to optimize away tests that > should never be true. Also wrap one hunk of xfs_unmount > in #ifdef CONFIG_XFS_DMAPI > Good idea Eric. A few remarks and a question below. > > +#ifdef CONFIG_XFS_DMAPI > CONFIG_XFS_DMAPI is only defined when the DMAPI is statically linked to the kernel. When DMAPI is configured as a module, CONFIG_XFS_DMAPI_MODULE is defined. The HAVE_DMAPI is defined for both, static and module DMAPI configurations. > /* Defines for determining if an event message should be sent. */ > #define DM_EVENT_ENABLED(vfsp, ip, event) ( \ > unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ > @@ -78,6 +79,11 @@ typedef enum { > ( ((io)->io_dmevmask & (1 << event)) || \ > ((io)->io_mount->m_dmevmask & (1 << event)) ) \ > ) > +#else > +#define DM_EVENT_ENABLED(vfsp, ip, event) (0) > The above should use the new two arguments DM_EVENT_ENABLED macro. > +#define DM_EVENT_ENABLED_IO(vfsp, io, event) (0) > What is this DM_EVENT_ENABLE_IO macro for? > > +#ifdef CONFIG_XFS_DMAPI The same, use HAVE_DMAPI instead of CONFIG_XFS_DMAPI. Otherwise it is looking good. Regards, Vlad From owner-xfs@oss.sgi.com Sun Aug 19 20:37:16 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 20:37:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7K3bEbm023586 for ; Sun, 19 Aug 2007 20:37:15 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 152C618DF93BF; Sun, 19 Aug 2007 22:37:19 -0500 (CDT) Message-ID: <46C90C77.5070502@sandeen.net> Date: Sun, 19 Aug 2007 22:37:27 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Vlad Apostolov CC: xfs-oss Subject: Re: [PATCH] optimize dmapi event tests w/o dmapi config References: <46C7DD96.6030001@sandeen.net> <46C8D6E8.2080500@sgi.com> In-Reply-To: <46C8D6E8.2080500@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12587 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 Vlad Apostolov wrote: > Eric Sandeen wrote: > >> Defining XFS_DM_EVENT* macros to 0 in the absence of >> CONFIG_XFS_DMAPI allows gcc to optimize away tests that >> should never be true. Also wrap one hunk of xfs_unmount >> in #ifdef CONFIG_XFS_DMAPI >> >> > Good idea Eric. A few remarks and a question below. > >> >> +#ifdef CONFIG_XFS_DMAPI >> >> > CONFIG_XFS_DMAPI is only defined when the DMAPI is statically linked > to the kernel. When DMAPI is configured as a module, > CONFIG_XFS_DMAPI_MODULE > is defined. The HAVE_DMAPI is defined for both, static and module DMAPI > configurations. > Hmm... ok. kernel.org doesn't have that so you'll need to take care moving this patch to the kernel.org tree I guess. >> /* Defines for determining if an event message should be sent. */ >> #define DM_EVENT_ENABLED(vfsp, ip, event) ( \ >> unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ >> @@ -78,6 +79,11 @@ typedef enum { >> ( ((io)->io_dmevmask & (1 << event)) || \ >> ((io)->io_mount->m_dmevmask & (1 << event)) ) \ >> ) >> +#else >> +#define DM_EVENT_ENABLED(vfsp, ip, event) (0) >> >> > The above should use the new two arguments DM_EVENT_ENABLED macro. > >> +#define DM_EVENT_ENABLED_IO(vfsp, io, event) (0) >> >> > What is this DM_EVENT_ENABLE_IO macro for? > Ah, this is just the differernce between kernel.org & CVS I guess. I'm just re-defining existing macros in 2.6.22.1 to no-ops. DM_EVENT_ENABLE_IO must have been removed from CVS w/o removing from kernel.org (yet) - and I guess same goes for the argument count. Anyway here's a CVS patch, sorry: ------ Defining XFS_DM_EVENT* macros to 0 in the absence of CONFIG_XFS_DMAPI allows gcc to optimize away tests that should never be true. Also wrap one hunk of xfs_unmount in #ifdef CONFIG_XFS_DMAPI Stack deltas on x86, gcc 4.1: xfs_create -16 xfs_free_file_space -4 xfs_getbmap +4 xfs_link -8 xfs_mkidr -20 xfs_read -24 xfs_remove -12 xfs_rename -8 xfs_rmdir -16 xfs_setattr -20 xfs_splice_read -20 xfs_splice_write -20 xfs_unmount -48 xfs_write -20 Signed-off-by: Eric Sandeen Index: linux.orig/fs/xfs/xfs_dmapi.h =================================================================== --- linux.orig/fs/xfs/xfs_dmapi.h +++ linux/fs/xfs/xfs_dmapi.h @@ -67,11 +67,15 @@ typedef enum { #define HAVE_DM_RIGHT_T /* Defines for determining if an event message should be sent. */ +#ifdef HAVE_DMAPI #define DM_EVENT_ENABLED(ip, event) ( \ unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \ ( ((ip)->i_d.di_dmevmask & (1 << event)) || \ ((ip)->i_mount->m_dmevmask & (1 << event)) ) \ ) +#else +#define DM_EVENT_ENABLED(ip, event) (0) +#endif #define DM_XFS_VALID_FS_EVENTS ( \ (1 << DM_EVENT_PREUNMOUNT) | \ Index: linux.orig/fs/xfs/xfs_vfsops.c =================================================================== --- linux.orig/fs/xfs/xfs_vfsops.c +++ linux/fs/xfs/xfs_vfsops.c @@ -572,6 +572,7 @@ xfs_unmount( rip = mp->m_rootip; rvp = XFS_ITOV(rip); +#ifdef HAVE_DMAPI if (vfsp->vfs_flag & VFS_DMI) { error = XFS_SEND_PREUNMOUNT(mp, vfsp, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, @@ -584,7 +585,7 @@ xfs_unmount( unmount_event_flags = (mp->m_dmevmask & (1<; Sun, 19 Aug 2007 22:01:27 -0700 Received: from Liberator.local (unknown [10.0.0.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5FD7118DF93BB for ; Mon, 20 Aug 2007 00:01:32 -0500 (CDT) Message-ID: <46C92035.6040504@sandeen.net> Date: Mon, 20 Aug 2007 00:01:41 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: xfs-oss Subject: upstream changes missing from cvs? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12588 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 Hi sgi folks - Noticed that upstream calls to generic_segment_checks() in xfs_lrw.c seem to be missing from cvs/ptools. Was this on purpose or are changes pushed directly to upstream getting lost in cvs? -Eric From owner-xfs@oss.sgi.com Sun Aug 19 22:20:50 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 22:20:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7K5Kkbm005538 for ; Sun, 19 Aug 2007 22:20:48 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA29017; Mon, 20 Aug 2007 15:20:44 +1000 Message-ID: <46C92524.7000207@sgi.com> Date: Mon, 20 Aug 2007 15:22:44 +1000 From: Vlad Apostolov User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: [PATCH] optimize dmapi event tests w/o dmapi config References: <46C7DD96.6030001@sandeen.net> <46C8D6E8.2080500@sgi.com> <46C90C77.5070502@sandeen.net> In-Reply-To: <46C90C77.5070502@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12589 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs I ran the DMAPI QA with the updated patch and it was working fine. I will push it in the XFS development tree. Thanks Eric. Regards, Vlad Eric Sandeen wrote: > Vlad Apostolov wrote: > > >> Eric Sandeen wrote: >> >> >>> Defining XFS_DM_EVENT* macros to 0 in the absence of >>> CONFIG_XFS_DMAPI allows gcc to optimize away tests that >>> should never be true. Also wrap one hunk of xfs_unmount >>> in #ifdef CONFIG_XFS_DMAPI >>> >>> >>> >> Good idea Eric. A few remarks and a question below. >> >> >>> >>> +#ifdef CONFIG_XFS_DMAPI >>> >>> >>> >> CONFIG_XFS_DMAPI is only defined when the DMAPI is statically linked >> to the kernel. When DMAPI is configured as a module, >> CONFIG_XFS_DMAPI_MODULE >> is defined. The HAVE_DMAPI is defined for both, static and module DMAPI >> configurations. >> >> > Hmm... ok. kernel.org doesn't have that so you'll need to take care moving this > > patch to the kernel.org tree I guess. > > >>> /* Defines for determining if an event message should be sent. */ >>> #define DM_EVENT_ENABLED(vfsp, ip, event) ( \ >>> unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ >>> @@ -78,6 +79,11 @@ typedef enum { >>> ( ((io)->io_dmevmask & (1 << event)) || \ >>> ((io)->io_mount->m_dmevmask & (1 << event)) ) \ >>> ) >>> +#else >>> +#define DM_EVENT_ENABLED(vfsp, ip, event) (0) >>> >>> >>> >> The above should use the new two arguments DM_EVENT_ENABLED macro. >> >> >>> +#define DM_EVENT_ENABLED_IO(vfsp, io, event) (0) >>> >>> >>> >> What is this DM_EVENT_ENABLE_IO macro for? >> >> > Ah, this is just the differernce between kernel.org & CVS I guess. > I'm just re-defining existing macros in 2.6.22.1 to no-ops. > > DM_EVENT_ENABLE_IO must have been removed from CVS w/o removing from > kernel.org (yet) - and I guess same goes for the argument count. > > Anyway here's a CVS patch, sorry: > > ------ > > Defining XFS_DM_EVENT* macros to 0 in the absence of > CONFIG_XFS_DMAPI allows gcc to optimize away tests that > should never be true. Also wrap one hunk of xfs_unmount > in #ifdef CONFIG_XFS_DMAPI > > Stack deltas on x86, gcc 4.1: > > xfs_create -16 > xfs_free_file_space -4 > xfs_getbmap +4 > xfs_link -8 > xfs_mkidr -20 > xfs_read -24 > xfs_remove -12 > xfs_rename -8 > xfs_rmdir -16 > xfs_setattr -20 > xfs_splice_read -20 > xfs_splice_write -20 > xfs_unmount -48 > xfs_write -20 > > Signed-off-by: Eric Sandeen > > Index: linux.orig/fs/xfs/xfs_dmapi.h > =================================================================== > --- linux.orig/fs/xfs/xfs_dmapi.h > +++ linux/fs/xfs/xfs_dmapi.h > @@ -67,11 +67,15 @@ typedef enum { > #define HAVE_DM_RIGHT_T > > /* Defines for determining if an event message should be sent. */ > +#ifdef HAVE_DMAPI > #define DM_EVENT_ENABLED(ip, event) ( \ > unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \ > ( ((ip)->i_d.di_dmevmask & (1 << event)) || \ > ((ip)->i_mount->m_dmevmask & (1 << event)) ) \ > ) > +#else > +#define DM_EVENT_ENABLED(ip, event) (0) > +#endif > > #define DM_XFS_VALID_FS_EVENTS ( \ > (1 << DM_EVENT_PREUNMOUNT) | \ > Index: linux.orig/fs/xfs/xfs_vfsops.c > =================================================================== > --- linux.orig/fs/xfs/xfs_vfsops.c > +++ linux/fs/xfs/xfs_vfsops.c > @@ -572,6 +572,7 @@ xfs_unmount( > rip = mp->m_rootip; > rvp = XFS_ITOV(rip); > > +#ifdef HAVE_DMAPI > if (vfsp->vfs_flag & VFS_DMI) { > error = XFS_SEND_PREUNMOUNT(mp, vfsp, > rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, > @@ -584,7 +585,7 @@ xfs_unmount( > unmount_event_flags = (mp->m_dmevmask & (1< 0 : DM_FLAGS_UNWANTED; > } > - > +#endif > /* > * First blow any referenced inode from this file system > * out of the reference cache, and delete the timer. > > > From owner-xfs@oss.sgi.com Sun Aug 19 22:42:50 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 19 Aug 2007 22:42:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7K5glbm009021 for ; Sun, 19 Aug 2007 22:42:48 -0700 Received: from [134.14.55.89] (soarer.melbourne.sgi.com [134.14.55.89]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA29378; Mon, 20 Aug 2007 15:42:46 +1000 Message-ID: <46C92A4D.6010201@sgi.com> Date: Mon, 20 Aug 2007 15:44:45 +1000 From: Vlad Apostolov User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: sgi.bugs.xfs@engr.sgi.com CC: linux-xfs@oss.sgi.com Subject: TAKE 969372 - [PATCH] optimize dmapi event tests w/o dmapi config Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12590 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vapo@sgi.com Precedence: bulk X-list: xfs optimize dmapi event tests w/o dmapi config Signed-off-by: Eric Sandeen Date: Mon Aug 20 15:39:31 AEST 2007 Workarea: soarer.melbourne.sgi.com:/home/vapo/isms/linux-xfs-patch-reviews Inspected by: vapo The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:29444a fs/xfs/xfs_dmapi.h - 1.60 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dmapi.h.diff?r1=text&tr1=1.60&r2=text&tr2=1.59&f=h - pv 969372, rv vapo - optimize dmapi event tests w/o dmapi config fs/xfs/xfs_vfsops.c - 1.525 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.525&r2=text&tr2=1.524&f=h - pv 969372, rv vapo - optimize dmapi event tests w/o dmapi config From owner-xfs@oss.sgi.com Mon Aug 20 13:53:38 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 20 Aug 2007 13:53:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7KKrbbm006672 for ; Mon, 20 Aug 2007 13:53:38 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrBQI013553; Mon, 20 Aug 2007 16:53:11 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrB7S016724; Mon, 20 Aug 2007 16:53:11 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrAvm027787; Mon, 20 Aug 2007 16:53:10 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l7KKrAv6017754; Mon, 20 Aug 2007 16:53:10 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l7KKr9eE017753; Mon, 20 Aug 2007 16:53:09 -0400 Date: Mon, 20 Aug 2007 16:53:09 -0400 Message-Id: <200708202053.l7KKr9eE017753@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 0/4] move handling of setuid/gid bits from VFS into individual setattr functions (try 2) To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com, nfs@lists.sourceforge.net X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12591 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs When an unprivileged process attempts to modify a file that has the setuid or setgid bits set, the VFS will attempt to clear these bits. The VFS will set the ATTR_KILL_SUID or ATTR_KILL_SGID bits in the ia_valid mask, and then call notify_change to clear these bits and set the mode accordingly. With a networked filesystem (NFS and CIFS in particular but likely others), the client machine may not have credentials that allow for setting the mode. In some situations, this can lead to file corruption, an operation failing outright because the setattr fails, or to races that lead to a mode change being reverted. In this situation, we'd like to just leave the handling of this to the server and ignore these bits. The problem is that by the time the setattr op is called, the VFS has already reinterpreted the ATTR_KILL_* bits into a mode change. We can't fix this in the filesystems where this is a problem, as doing so would leave us having to second-guess what the VFS wants us to do. So we need to change it so that filesystems have more flexibility in how to interpret the ATTR_KILL_* bits. The first patch in the following patchset moves this logic out of notify_change and into a helper function. It then has notify_change call this helper function for inodes that do not have a setattr operation defined. The other patches fix up the individual filesystems for the new scheme, mostly by having them call the new helper. Changing this abruptly could introduce security issues for filesystems that live out-of-tree or if an in-tree filesystem is missed. As a precaution, the patchset has notify_change check the ia_valid in the iattr struct after the setattr call returns. If any ATTR_KILL_* bits are still set, then notify_change assumes that the filesystem didn't handle these bits correctly. It printk's a warning and attempts to clear them the with another setattr call. The upshot of this is that with this change, filesystems that define a setattr inode operation are now responsible for handling the ATTR_KILL bits as well. They can trivially do so by calling the helper, but they should be converted to do so as soon as possible. Some of the follow-on patches may not be strictly necessary, but I decided that it was better to take the conservative approach and call the helper when I wasn't sure. I've tried to CC the maintainers for the individual filesystems where I could find them. Please let me know if there are others who should be informed. This patchset should apply cleanly to the current -mm tree. I've rolled the patches that fix individual filesystems together per Christoph's suggestion, though I can also provide them broken out individually again if needed. Comments and suggestions appreciated. Also, please let me know if I've missed any filesystems that need to be converted... Signed-off-by: Jeff Layton From owner-xfs@oss.sgi.com Mon Aug 20 13:54:24 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 20 Aug 2007 13:54:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7KKsNbm006887 for ; Mon, 20 Aug 2007 13:54:24 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrNuP013702; Mon, 20 Aug 2007 16:53:23 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrNGK016789; Mon, 20 Aug 2007 16:53:23 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrNIW027816; Mon, 20 Aug 2007 16:53:23 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l7KKrMwe017764; Mon, 20 Aug 2007 16:53:22 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l7KKrMYv017763; Mon, 20 Aug 2007 16:53:22 -0400 Date: Mon, 20 Aug 2007 16:53:22 -0400 Message-Id: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 2/4] Fix mainline filesystems to handle ATTR_KILL_ bits correctly To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12593 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs This should fix all of the filesystems in the mainline kernels to handle ATTR_KILL_SUID and ATTR_KILL_SGID correctly. For most of them, this is just a matter of making sure that they call generic_attrkill early in the setattr inode op. Signed-off-by: Jeff Layton --- arch/powerpc/platforms/cell/spufs/inode.c | 1 + fs/9p/vfs_inode.c | 1 + fs/affs/inode.c | 1 + fs/afs/inode.c | 3 +++ fs/coda/inode.c | 1 + fs/configfs/inode.c | 4 +++- fs/ext2/inode.c | 1 + fs/ext3/inode.c | 5 ++++- fs/ext4/inode.c | 5 ++++- fs/fuse/dir.c | 2 ++ fs/gfs2/ops_inode.c | 2 ++ fs/hostfs/hostfs_kern.c | 2 ++ fs/hpfs/inode.c | 1 + fs/hugetlbfs/inode.c | 5 ++++- fs/jffs2/fs.c | 1 + fs/jfs/acl.c | 2 ++ fs/ocfs2/file.c | 2 ++ fs/proc/base.c | 3 +++ fs/proc/generic.c | 3 +++ fs/proc/proc_sysctl.c | 3 +++ fs/ramfs/file-nommu.c | 5 ++++- fs/reiserfs/inode.c | 6 +++++- fs/smbfs/inode.c | 2 ++ fs/sysfs/inode.c | 5 ++++- fs/ufs/truncate.c | 5 ++++- fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- mm/shmem.c | 2 ++ 27 files changed, 69 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index b3d0dd1..66144a1 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -97,6 +97,7 @@ spufs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; + generic_attrkill(inode->i_mode, attr); if ((attr->ia_valid & ATTR_SIZE) && (attr->ia_size != inode->i_size)) return -EINVAL; diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index e5c45ee..a90ebf1 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -756,6 +756,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr) return PTR_ERR(fid); v9fs_blank_wstat(&wstat); + generic_attrkill(dentry->d_inode->i_mode, iattr); if (iattr->ia_valid & ATTR_MODE) wstat.mode = unixmode2p9mode(v9ses, iattr->ia_mode); diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 4609a6c..e8dbedf 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -218,6 +218,7 @@ affs_notify_change(struct dentry *dentry, struct iattr *attr) pr_debug("AFFS: notify_change(%lu,0x%x)\n",inode->i_ino,attr->ia_valid); + generic_attrkill(inode->i_mode, attr); error = inode_change_ok(inode,attr); if (error) goto out; diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 84750c8..8c43c93 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -371,6 +371,9 @@ int afs_setattr(struct dentry *dentry, struct iattr *attr) vnode->fid.vid, vnode->fid.vnode, dentry->d_name.name, attr->ia_valid); + /* FIXME: is this necessary? */ + generic_attrkill(dentry->d_inode->i_mode, attr); + if (!(attr->ia_valid & (ATTR_SIZE | ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_MTIME))) { _leave(" = 0 [unsupported]"); diff --git a/fs/coda/inode.c b/fs/coda/inode.c index 342f4e0..7dec870 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -239,6 +239,7 @@ int coda_setattr(struct dentry *de, struct iattr *iattr) memset(&vattr, 0, sizeof(vattr)); inode->i_ctime = CURRENT_TIME_SEC; + generic_attrkill(inode->i_mode, iattr); coda_iattr_to_vattr(iattr, &vattr); vattr.va_type = C_VNON; /* cannot set type */ diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index dbd257d..d3d6637 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -59,7 +59,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) struct inode * inode = dentry->d_inode; struct configfs_dirent * sd = dentry->d_fsdata; struct iattr * sd_iattr; - unsigned int ia_valid = iattr->ia_valid; + unsigned int ia_valid; int error; if (!sd) @@ -67,6 +67,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) sd_iattr = sd->s_iattr; + generic_attrkill(inode->i_mode, iattr); error = inode_change_ok(inode, iattr); if (error) return error; @@ -90,6 +91,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) /* attributes were changed atleast once in past */ + ia_valid = iattr->ia_valid; if (ia_valid & ATTR_UID) sd_iattr->ia_uid = iattr->ia_uid; if (ia_valid & ATTR_GID) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index c1dcb68..353472c 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1405,6 +1405,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr) struct inode *inode = dentry->d_inode; int error; + generic_attrkill(inode->i_mode, iattr); error = inode_change_ok(inode, iattr); if (error) return error; diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 2d6324a..cabb57b 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -2989,7 +2989,10 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error, rc = 0; - const unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; + + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; error = inode_change_ok(inode, attr); if (error) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index a49bb00..c39f472 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3047,7 +3047,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error, rc = 0; - const unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; + + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; error = inode_change_ok(inode, attr); if (error) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d1acab9..df6a911 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1005,6 +1005,8 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) struct fuse_attr_out outarg; int err; + generic_attrkill(inode->i_mode, attr); + if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { err = inode_change_ok(inode, attr); if (err) diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 5b8b994..f0d8532 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c @@ -994,6 +994,8 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr) if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto out; + generic_attrkill(inode->i_mode, attr); + error = inode_change_ok(inode, attr); if (error) goto out; diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 4880256..370f71e 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -821,6 +821,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr) int fd = HOSTFS_I(dentry->d_inode)->fd; + generic_attrkill(dentry->d_inode->i_mode, attr); + err = inode_change_ok(dentry->d_inode, attr); if (err) return err; diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 85d3e1d..1387839 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -265,6 +265,7 @@ int hpfs_notify_change(struct dentry *dentry, struct iattr *attr) struct inode *inode = dentry->d_inode; int error=0; lock_kernel(); + generic_attrkill(inode->i_mode, attr); if ( ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) || (hpfs_sb(inode->i_sb)->sb_root == inode->i_ino) ) { error = -EINVAL; diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index b35a298..fde0875 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -452,10 +452,13 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; BUG_ON(!inode); + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; + error = inode_change_ok(inode, attr); if (error) goto out; diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 1d3b7a9..597f903 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -37,6 +37,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) uint32_t alloclen; int ret; D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino)); + generic_attrkill(inode->i_mode, iattr); ret = inode_change_ok(inode, iattr); if (ret) return ret; diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 4d84bdc..1630ba0 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -227,6 +227,8 @@ int jfs_setattr(struct dentry *dentry, struct iattr *iattr) struct inode *inode = dentry->d_inode; int rc; + generic_attrkill(inode->i_mode, iattr); + rc = inode_change_ok(inode, iattr); if (rc) return rc; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 0d9f96e..d48c83d 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -989,6 +989,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) mlog_entry("(0x%p, '%.*s')\n", dentry, dentry->d_name.len, dentry->d_name.name); + generic_attrkill(inode->i_mode, attr); + if (attr->ia_valid & ATTR_MODE) mlog(0, "mode change: %d\n", attr->ia_mode); if (attr->ia_valid & ATTR_UID) diff --git a/fs/proc/base.c b/fs/proc/base.c index 614851a..3b0f6c1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -349,6 +349,9 @@ static int proc_setattr(struct dentry *dentry, struct iattr *attr) int error; struct inode *inode = dentry->d_inode; + /* FIXME: is this necessary? */ + generic_attrkill(inode->i_mode, attr); + if (attr->ia_valid & ATTR_MODE) return -EPERM; diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 1bdb624..1e31ae7 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -239,6 +239,9 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) struct proc_dir_entry *de = PDE(inode); int error; + /* FIXME: is this necessary? */ + generic_attrkill(inode->i_mode, iattr); + error = inode_change_ok(inode, iattr); if (error) goto out; diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 680c429..7b50364 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -425,6 +425,9 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr) struct inode *inode = dentry->d_inode; int error; + /* FIXME: is this necessary */ + generic_attrkill(inode->i_mode, attr); + if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) return -EPERM; diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 0989bc2..a3ff4b3 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -192,9 +192,12 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia) { struct inode *inode = dentry->d_inode; - unsigned int old_ia_valid = ia->ia_valid; + unsigned int old_ia_valid; int ret = 0; + generic_attrkill(inode->i_mode, ia); + old_ia_valid = ia->ia_valid; + /* POSIX UID/GID verification for setting inode attributes */ ret = inode_change_ok(inode, ia); if (ret) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 9525f9f..48db0df 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -3062,7 +3062,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; + + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; + reiserfs_write_lock(inode->i_sb); if (attr->ia_valid & ATTR_SIZE) { /* version 2 items will be caught by the s_maxbytes check diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c index ed851e6..98c4158 100644 --- a/fs/smbfs/inode.c +++ b/fs/smbfs/inode.c @@ -682,6 +682,8 @@ smb_notify_change(struct dentry *dentry, struct iattr *attr) if (error) goto out; + generic_attrkill(inode->i_mode, attr); + if ((error = inode_change_ok(inode, attr)) < 0) goto out; diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 782c480..e9a6dfb 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -38,7 +38,7 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) struct inode * inode = dentry->d_inode; struct sysfs_dirent * sd = dentry->d_fsdata; struct iattr * sd_iattr; - unsigned int ia_valid = iattr->ia_valid; + unsigned int ia_valid; int error; if (!sd) @@ -46,6 +46,9 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) sd_iattr = sd->s_iattr; + generic_attrkill(inode->i_mode, iattr); + ia_valid = iattr->ia_valid; + error = inode_change_ok(inode, iattr); if (error) return error; diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index 311ded3..28cb078 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c @@ -510,9 +510,12 @@ out: static int ufs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; int error; + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; + error = inode_change_ok(inode, attr); if (error) return error; diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index e0e06dd..cfbed9e 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -651,12 +651,15 @@ xfs_vn_setattr( struct iattr *attr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; bhv_vnode_t *vp = vn_from_inode(inode); bhv_vattr_t vattr = { 0 }; int flags = 0; int error; + generic_attrkill(inode->i_mode, attr); + ia_valid = attr->ia_valid; + if (ia_valid & ATTR_UID) { vattr.va_mask |= XFS_AT_UID; vattr.va_uid = attr->ia_uid; diff --git a/mm/shmem.c b/mm/shmem.c index 29f8d07..de54808 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -718,6 +718,8 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr) struct page *page = NULL; int error; + generic_attrkill(inode->i_mode, attr); + if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) { if (attr->ia_size < inode->i_size) { /* -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 20 13:53:36 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 20 Aug 2007 13:53:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_46, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7KKrXbm006662 for ; Mon, 20 Aug 2007 13:53:36 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrJw8013648; Mon, 20 Aug 2007 16:53:19 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrI8F016765; Mon, 20 Aug 2007 16:53:18 -0400 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [172.16.57.196]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7KKrHKE027796; Mon, 20 Aug 2007 16:53:17 -0400 Received: from dantu.rdu.redhat.com (localhost.localdomain [127.0.0.1]) by dantu.rdu.redhat.com (8.14.1/8.13.8) with ESMTP id l7KKrHfr017759; Mon, 20 Aug 2007 16:53:17 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.14.1/8.14.1/Submit) id l7KKrFVx017758; Mon, 20 Aug 2007 16:53:15 -0400 Date: Mon, 20 Aug 2007 16:53:15 -0400 Message-Id: <200708202053.l7KKrFVx017758@dantu.rdu.redhat.com> From: Jeff Layton Subject: [PATCH 1/4] VFS: move ATTR_KILL handling from notify_change into helper function To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: v9fs-developer@lists.sourceforge.net, zippel@linux-m68k.org, dhowells@redhat.com, linux-cifs-client@lists.samba.org, codalist@TELEMANN.coda.cs.cmu.edu, joel.becker@oracle.com, linux-ext4@vger.kernel.org, fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com, user-mode-linux-user@lists.sourceforge.net, mikulas@artax.karlin.mff.cuni.cz, wli@holomorphy.com, jffs-dev@axis.com, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, bfennema@falcon.csc.calpoly.edu, xfs@oss.sgi.com, nfs@lists.sourceforge.net X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12592 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs Separate the handling of the local ia_valid bitmask from the one in attr->ia_valid. This allows us to hand off the actual handling of the ATTR_KILL_* flags to the .setattr i_op when one is defined. notify_change still needs to process those flags for the local ia_valid variable, since it uses that to decide whether to return early, and to pass a (hopefully) appropriate bitmask to fsnotify_change. Also, check the ia_valid after the setattr op returns and see if either ATTR_KILL_* bit is set. If so, then throw a warning and try to clear the bits in the "standard" way. This should help us to catch filesystems that don't handle these bits correctly without breaking them outright. Signed-off-by: Jeff Layton --- fs/attr.c | 91 ++++++++++++++++++++++++++++++++++++++++----------- include/linux/fs.h | 1 + 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index ae58bd3..50c8ce4 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -100,15 +100,53 @@ int inode_setattr(struct inode * inode, struct iattr * attr) } EXPORT_SYMBOL(inode_setattr); +/** + * generic_attrkill - helper to convert ATTR_KILL_* bits into mode change + * @mode: current mode of inode + * @attr: inode attribute changes requested by VFS + * Context: anywhere + * + * This is a helper function to convert ATTR_KILL_SUID and ATTR_KILL_SGID + * into a mode change. Filesystems should call this from their setattr + * inode op when they want "conventional" setuid-clearing behavior. + * + * Filesystems that declare a setattr inode operation are now expected to + * handle the ATTR_KILL_SUID and ATTR_KILL_SGID bits appropriately. The VFS + * no longer automatically converts these bits to a mode change for + * inodes that have their own setattr operation. + **/ +void generic_attrkill(mode_t mode, struct iattr *attr) +{ + if (attr->ia_valid & ATTR_KILL_SUID) { + attr->ia_valid &= ~ATTR_KILL_SUID; + if (mode & S_ISUID) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISUID; + } + } + if (attr->ia_valid & ATTR_KILL_SGID) { + attr->ia_valid &= ~ATTR_KILL_SGID; + if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { + if (!(attr->ia_valid & ATTR_MODE)) { + attr->ia_valid |= ATTR_MODE; + attr->ia_mode = mode; + } + attr->ia_mode &= ~S_ISGID; + } + } +} +EXPORT_SYMBOL(generic_attrkill); + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; - mode_t mode; - int error; + int error, once = 0; struct timespec now; unsigned int ia_valid = attr->ia_valid; - mode = inode->i_mode; now = current_fs_time(inode->i_sb); attr->ia_ctime = now; @@ -126,36 +164,49 @@ int notify_change(struct dentry * dentry, struct iattr * attr) return error; } if (ia_valid & ATTR_KILL_SUID) { - attr->ia_valid &= ~ATTR_KILL_SUID; - if (mode & S_ISUID) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISUID; - } + ia_valid &= ~ATTR_KILL_SUID; + if (inode->i_mode & S_ISUID) + ia_valid |= ATTR_MODE; } if (ia_valid & ATTR_KILL_SGID) { - attr->ia_valid &= ~ ATTR_KILL_SGID; - if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { - if (!(ia_valid & ATTR_MODE)) { - ia_valid = attr->ia_valid |= ATTR_MODE; - attr->ia_mode = inode->i_mode; - } - attr->ia_mode &= ~S_ISGID; - } + ia_valid &= ~ATTR_KILL_SGID; + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == + (S_ISGID | S_IXGRP)) + ia_valid |= ATTR_MODE; } - if (!attr->ia_valid) + if (!ia_valid) return 0; if (ia_valid & ATTR_SIZE) down_write(&dentry->d_inode->i_alloc_sem); if (inode->i_op && inode->i_op->setattr) { +retry: error = security_inode_setattr(dentry, attr); if (!error) error = inode->i_op->setattr(dentry, attr); + /* + * if ATTR_KILL_SUID or ATTR_KILL_SGID is still set, then + * assume that the setattr inode op didn't handle them + * correctly. Try to clear these bits the standard way + * with a second setattr call and printk a warning. + */ + if (!error && !once && unlikely(attr->ia_valid & + (ATTR_KILL_SUID|ATTR_KILL_SGID))) { + attr->ia_valid &= + (ATTR_FORCE|ATTR_KILL_SUID|ATTR_KILL_SGID); + generic_attrkill(inode->i_mode, attr); + ++once; + if (printk_ratelimit()) + printk(KERN_ERR "%s: %s doesn't seem to " + "handle setuid/setgid bit killing " + "correctly. Report this to filesystem " + "maintainer.\n", __func__, + inode->i_sb->s_type->name); + goto retry; + } } else { + generic_attrkill(inode->i_mode, attr); error = inode_change_ok(inode, attr); if (!error) error = security_inode_setattr(dentry, attr); diff --git a/include/linux/fs.h b/include/linux/fs.h index 30eb32f..6ba6830 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1679,6 +1679,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif +extern void generic_attrkill(mode_t mode, struct iattr *attr); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int, struct nameidata *); extern int generic_permission(struct inode *, int, -- 1.5.2.2 From owner-xfs@oss.sgi.com Mon Aug 20 22:35:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 20 Aug 2007 22:35:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7L5Z8bm025022 for ; Mon, 20 Aug 2007 22:35:11 -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 PAA02986; Tue, 21 Aug 2007 15:35:09 +1000 Message-ID: <46CA798C.1020101@sgi.com> Date: Tue, 21 Aug 2007 15:35:08 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Jeff Layton CC: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs-oss Subject: Re: [PATCH 2/4] Fix mainline filesystems to handle ATTR_KILL_ bits correctly References: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> In-Reply-To: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12594 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 Jeff Layton wrote: > This should fix all of the filesystems in the mainline kernels to handle > ATTR_KILL_SUID and ATTR_KILL_SGID correctly. For most of them, this is > just a matter of making sure that they call generic_attrkill early in > the setattr inode op. > > Signed-off-by: Jeff Layton > --- > fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- > --- a/fs/xfs/linux-2.6/xfs_iops.c > +++ b/fs/xfs/linux-2.6/xfs_iops.c > @@ -651,12 +651,15 @@ xfs_vn_setattr( > struct iattr *attr) > { > struct inode *inode = dentry->d_inode; > - unsigned int ia_valid = attr->ia_valid; > + unsigned int ia_valid; > bhv_vnode_t *vp = vn_from_inode(inode); > bhv_vattr_t vattr = { 0 }; > int flags = 0; > int error; > > + generic_attrkill(inode->i_mode, attr); > + ia_valid = attr->ia_valid; > + > if (ia_valid & ATTR_UID) { > vattr.va_mask |= XFS_AT_UID; > vattr.va_uid = attr->ia_uid; Looks reasonable to me for XFS. Acked-by: Tim Shimmin So before, this clearing would happen directly in notify_change() and now this won't happen until notify_change() calls i_op->setattr which for a particular fs it can call generic_attrkill() to do it. So I guess for the cases where i_op->setattr is called outside of via notify_change, we don't normally have ATTR_KILL_SUID/SGID set so that nothing will happen there? I guess just wondering the effect with having the code on all setattr's. (I'm not familiar with the code path) --Tim From owner-xfs@oss.sgi.com Tue Aug 21 04:35:49 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 21 Aug 2007 04:35:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7LBZlbm004959 for ; Tue, 21 Aug 2007 04:35:49 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7LBZqsG022064; Tue, 21 Aug 2007 07:35:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7LBZq51032389; Tue, 21 Aug 2007 07:35:52 -0400 Received: from tleilax.poochiereds.net (vpn-14-128.rdu.redhat.com [10.11.14.128]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l7LBZpG3001906; Tue, 21 Aug 2007 07:35:51 -0400 Date: Tue, 21 Aug 2007 07:35:51 -0400 From: Jeff Layton To: Timothy Shimmin Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs-oss Subject: Re: [PATCH 2/4] Fix mainline filesystems to handle ATTR_KILL_ bits correctly Message-Id: <20070821073551.dac4a5dd.jlayton@redhat.com> In-Reply-To: <46CA798C.1020101@sgi.com> References: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> <46CA798C.1020101@sgi.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12595 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 21 Aug 2007 15:35:08 +1000 Timothy Shimmin wrote: > Jeff Layton wrote: > > This should fix all of the filesystems in the mainline kernels to handle > > ATTR_KILL_SUID and ATTR_KILL_SGID correctly. For most of them, this is > > just a matter of making sure that they call generic_attrkill early in > > the setattr inode op. > > > > Signed-off-by: Jeff Layton > > --- > > fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- > > --- a/fs/xfs/linux-2.6/xfs_iops.c > > +++ b/fs/xfs/linux-2.6/xfs_iops.c > > @@ -651,12 +651,15 @@ xfs_vn_setattr( > > struct iattr *attr) > > { > > struct inode *inode = dentry->d_inode; > > - unsigned int ia_valid = attr->ia_valid; > > + unsigned int ia_valid; > > bhv_vnode_t *vp = vn_from_inode(inode); > > bhv_vattr_t vattr = { 0 }; > > int flags = 0; > > int error; > > > > + generic_attrkill(inode->i_mode, attr); > > + ia_valid = attr->ia_valid; > > + > > if (ia_valid & ATTR_UID) { > > vattr.va_mask |= XFS_AT_UID; > > vattr.va_uid = attr->ia_uid; > > Looks reasonable to me for XFS. > Acked-by: Tim Shimmin > > So before, this clearing would happen directly in notify_change() > and now this won't happen until notify_change() calls i_op->setattr > which for a particular fs it can call generic_attrkill() to do it. > So I guess for the cases where i_op->setattr is called outside of > via notify_change, we don't normally have ATTR_KILL_SUID/SGID > set so that nothing will happen there? Right. If neither ATTR_KILL bit is set then generic_attrkill is a noop. > I guess just wondering the effect with having the code on all > setattr's. (I'm not familiar with the code path) > These bits are referenced in very few places in the current kernel tree -- mostly in the VFS layer. The *only* place I see that they actually get interpreted into a mode change is in notify_change. So places that call setattr ops w/o going through notify_change are not likely to have those bits set. But hypothetically, if a fs did set ATTR_KILL_* and call setattr directly, then the setattr would now include a mode change that clears setuid or setgid bits where it may not have before. -- Jeff Layton From owner-xfs@oss.sgi.com Tue Aug 21 09:29:39 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 21 Aug 2007 09:29:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7LGTabm007579 for ; Tue, 21 Aug 2007 09:29:39 -0700 Received: by an-out-0708.google.com with SMTP id c38so174734ana for ; Tue, 21 Aug 2007 09:29:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=pl3hSM9H+Gpv1zSBYQ2Ez+8ickPJapVzgRhlUDyF/ycpHJ65am/+EY7WJyKsuzz9vahh8d0+nrhEx5jhmcjJS3OtaddTA2BKShCtcwrsV1FuUywVhhg1JogSMfbUr6vGNV2MlwQlrrp0YC5dFHEoqizdEjoJeau7Ojn90V7gWnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=HVAK4wZsclkBioyxj4QDW/ylib9sVscRGnBoiZPOOokG72j93p2Df6un1F4v6jBpWY7GdgtVEWy+RihIKm4/oX/oOWnUurq+STapse5ezDtdu7oRhF/R57qjJRzbNIaJ1QmwBELquIaqmpw6VvWWH/aMKRjwOukw+lsrNb6QREo= Received: by 10.90.81.14 with SMTP id e14mr2145095agb.1187710016215; Tue, 21 Aug 2007 08:26:56 -0700 (PDT) Received: by 10.90.34.5 with HTTP; Tue, 21 Aug 2007 08:26:56 -0700 (PDT) Message-ID: <9ee2fe770708210826n5952e727od0df16a5a7b267f0@mail.gmail.com> Date: Tue, 21 Aug 2007 21:11:56 +0545 From: "kanishk rastogi" To: xfs@oss.sgi.com Subject: Need of inode->i_mutex in xfs_write() MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV version 0.90, clamav-milter version devel-120207 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 12596 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: kanishk.85@gmail.com Precedence: bulk X-list: xfs I was looking at the xfs_write code path in kernel 2.6.20 ....... I saw it acquiring inode->i_mutex . Whats the need ? What are we safegaurding inode for. AFAIK its used for protecting the incode inode. (CMIIW) regards kanishk From owner-xfs@oss.sgi.com Wed Aug 22 04:22:25 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 22 Aug 2007 04:22:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7MBMM4p000485 for ; Wed, 22 Aug 2007 04:22:25 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7LMN7TB031775; Tue, 21 Aug 2007 18:23:07 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7LMN6wh020834; Tue, 21 Aug 2007 18:23:06 -0400 Received: from tleilax.poochiereds.net (vpn-14-18.rdu.redhat.com [10.11.14.18]) by pobox.corp.redhat.com (8.13.1/8.13.1) with SMTP id l7LMN5TQ017211; Tue, 21 Aug 2007 18:23:06 -0400 Date: Tue, 21 Aug 2007 18:23:05 -0400 From: Jeff Layton To: Josef Sipek Cc: Timothy Shimmin , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs-oss Subject: Re: [PATCH 2/4] Fix mainline filesystems to handle ATTR_KILL_ bits correctly Message-Id: <20070821182305.7c0cb135.jlayton@redhat.com> In-Reply-To: <20070821212128.GC1741@filer.fsl.cs.sunysb.edu> References: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> <46CA798C.1020101@sgi.com> <20070821073551.dac4a5dd.jlayton@redhat.com> <20070821212128.GC1741@filer.fsl.cs.sunysb.edu> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 12597 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jlayton@redhat.com Precedence: bulk X-list: xfs On Tue, 21 Aug 2007 17:21:28 -0400 Josef Sipek wrote: > On Tue, Aug 21, 2007 at 07:35:51AM -0400, Jeff Layton wrote: > > On Tue, 21 Aug 2007 15:35:08 +1000 > > Timothy Shimmin wrote: > > > > > Jeff Layton wrote: > > > > This should fix all of the filesystems in the mainline kernels to handle > > > > ATTR_KILL_SUID and ATTR_KILL_SGID correctly. For most of them, this is > > > > just a matter of making sure that they call generic_attrkill early in > > > > the setattr inode op. > > > > > > > > Signed-off-by: Jeff Layton > > > > --- > > > > fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- > > > > --- a/fs/xfs/linux-2.6/xfs_iops.c > > > > +++ b/fs/xfs/linux-2.6/xfs_iops.c > > > > @@ -651,12 +651,15 @@ xfs_vn_setattr( > > > > struct iattr *attr) > > > > { > > > > struct inode *inode = dentry->d_inode; > > > > - unsigned int ia_valid = attr->ia_valid; > > > > + unsigned int ia_valid; > > > > bhv_vnode_t *vp = vn_from_inode(inode); > > > > bhv_vattr_t vattr = { 0 }; > > > > int flags = 0; > > > > int error; > > > > > > > > + generic_attrkill(inode->i_mode, attr); > > > > + ia_valid = attr->ia_valid; > > > > + > > > > if (ia_valid & ATTR_UID) { > > > > vattr.va_mask |= XFS_AT_UID; > > > > vattr.va_uid = attr->ia_uid; > > > > > > Looks reasonable to me for XFS. > > > Acked-by: Tim Shimmin > > > > > > So before, this clearing would happen directly in notify_change() > > > and now this won't happen until notify_change() calls i_op->setattr > > > which for a particular fs it can call generic_attrkill() to do it. > > > So I guess for the cases where i_op->setattr is called outside of > > > via notify_change, we don't normally have ATTR_KILL_SUID/SGID > > > set so that nothing will happen there? > > > > Right. If neither ATTR_KILL bit is set then generic_attrkill is a > > noop. > > > > > I guess just wondering the effect with having the code on all > > > setattr's. (I'm not familiar with the code path) > > > > > > > These bits are referenced in very few places in the current kernel > > tree -- mostly in the VFS layer. The *only* place I see that they > > actually get interpreted into a mode change is in notify_change. So > > places that call setattr ops w/o going through notify_change are > > not likely to have those bits set. > > > > But hypothetically, if a fs did set ATTR_KILL_* and call setattr > > directly, then the setattr would now include a mode change that > > clears setuid or setgid bits where it may not have before. > I should probably clarify -- in the hypothetical situation above, the setattr function would have to call generic_attrkill (as most filesystems should do with this change). > It almost sounds like an argument for a new inode op (NULL would use > generic_attr_kill). > That's not a bad idea at all. I suppose that would be easier than modifying every fs like this, and it does seem like it might be cleaner. I need to mull it over, but that might be the best solution. -- Jeff Layton From owner-xfs@oss.sgi.com Wed Aug 22 05:13:04 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 22 Aug 2007 05:13:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from filer.fsl.cs.sunysb.edu (filer.fsl.cs.sunysb.edu [130.245.126.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7MCD14p007647 for ; Wed, 22 Aug 2007 05:13:04 -0700 Received: from filer.fsl.cs.sunysb.edu (localhost.localdomain [127.0.0.1]) by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.1) with ESMTP id l7LLLSps003107; Tue, 21 Aug 2007 17:21:28 -0400 Received: (from jsipek@localhost) by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.1/Submit) id l7LLLSkt003105; Tue, 21 Aug 2007 17:21:28 -0400 X-Authentication-Warning: filer.fsl.cs.sunysb.edu: jsipek set sender to jsipek@fsl.cs.sunysb.edu using -f Date: Tue, 21 Aug 2007 17:21:28 -0400 From: Josef Sipek To: Jeff Layton Cc: Timothy Shimmin , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs-oss Subject: Re: [PATCH 2/4] Fix mainline filesystems to handle ATTR_KILL_ bits correctly Message-ID: <20070821212128.GC1741@filer.fsl.cs.sunysb.edu> References: <200708202053.l7KKrMYv017763@dantu.rdu.redhat.com> <46CA798C.1020101@sgi.com> <20070821073551.dac4a5dd.jlayton@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070821073551.dac4a5dd.jlayton@redhat.com> User-Agent: Mutt/1.5.16 (2007-07-16) X-archive-position: 12598 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jsipek@fsl.cs.sunysb.edu Precedence: bulk X-list: xfs On Tue, Aug 21, 2007 at 07:35:51AM -0400, Jeff Layton wrote: > On Tue, 21 Aug 2007 15:35:08 +1000 > Timothy Shimmin wrote: > > > Jeff Layton wrote: > > > This should fix all of the filesystems in the mainline kernels to handle > > > ATTR_KILL_SUID and ATTR_KILL_SGID correctly. For most of them, this is > > > just a matter of making sure that they call generic_attrkill early in > > > the setattr inode op. > > > > > > Signed-off-by: Jeff Layton > > > --- > > > fs/xfs/linux-2.6/xfs_iops.c | 5 ++++- > > > --- a/fs/xfs/linux-2.6/xfs_iops.c > > > +++ b/fs/xfs/linux-2.6/xfs_iops.c > > > @@ -651,12 +651,15 @@ xfs_vn_setattr( > > > struct iattr *attr) > > > { > > > struct inode *inode = dentry->d_inode; > > > - unsigned int ia_valid = attr->ia_valid; > > > + unsigned int ia_valid; > > > bhv_vnode_t *vp = vn_from_inode(inode); > > > bhv_vattr_t vattr = { 0 }; > > > int flags = 0; > > > int error; > > > > > > + generic_attrkill(inode->i_mode, attr); > > > + ia_valid = attr->ia_valid; > > > + > > > if (ia_valid & ATTR_UID) { > > > vattr.va_mask |= XFS_AT_UID; > > > vattr.va_uid = attr->ia_uid; > > > > Looks reasonable to me for XFS. > > Acked-by: Tim Shimmin > > > > So before, this clearing would happen directly in notify_change() > > and now this won't happen until notify_change() calls i_op->setattr > > which for a particular fs it can call generic_attrkill() to do it. > > So I guess for the cases where i_op->setattr is called outside of > > via notify_change, we don't normally have ATTR_KILL_SUID/SGID > > set so that nothing will happen there? > > Right. If neither ATTR_KILL bit is set then generic_attrkill is a > noop. > > > I guess just wondering the effect with having the code on all > > setattr's. (I'm not familiar with the code path) > > > > These bits are referenced in very few places in the current kernel > tree -- mostly in the VFS layer. The *only* place I see that they > actually get interpreted into a mode change is in notify_change. So > places that call setattr ops w/o going through notify_change are > not likely to have those bits set. > > But hypothetically, if a fs did set ATTR_KILL_* and call setattr > directly, then the setattr would now include a mode change that > clears setuid or setgid bits where it may not have before. It almost sounds like an argument for a new inode op (NULL would use generic_attr_kill). Josef 'Jeff' Sipek. -- A CRAY is the only computer that runs an endless loop in just 4 hours... From owner-xfs@oss.sgi.com Wed Aug 22 15:56:26 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 22 Aug 2007 15:56:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from oth.net (mail.oth.net [209.173.220.26]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7MMuM4p017484 for ; Wed, 22 Aug 2007 15:56:26 -0700 Received: from localhost (r6@localhost) by oth.net (8.9.3/8.9.3) with ESMTP id RAA11768 for ; Wed, 22 Aug 2007 17:17:33 -0500 Date: Wed, 22 Aug 2007 17:17:33 -0500 (CDT) From: Chris Pearson X-Sender: r6@orbis.oth.net To: xfs@oss.sgi.com Subject: sb_ifree and sb_fdblocks are unequal Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 12599 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: kermit4@gmail.com Precedence: bulk X-list: xfs I have the same problem as posted in: http://oss.sgi.com/archives/xfs/2006-02/msg00091.html using xfsprogs-2.9.3 in linux 2.4.29 after running xfs_repair on a read-only mounted root filesystem, xfs_check still shows errors: # ./xfs_check.sh -f /dev/md1 sb_ifree 993009, counted 993008 sb_fdblocks 3119630, counted 3119633 # ./xfs_info.sh / meta-data=/ isize=256 agcount=56, agsize=1048576 blks = sectsz=512 data = bsize=4096 blocks=58587014, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=0 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=2382, version=1 = sectsz=512 sunit=0 blks realtime =none extsz=65536 blocks=0, rtextents=0 It's possible, even likely, I had corruption due to a power outtage and Seagate ATAPI drives that had write caching enabled by default. From owner-xfs@oss.sgi.com Thu Aug 23 04:53:42 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 04:53:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NBrd4p018792 for ; Thu, 23 Aug 2007 04:53: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 VAA24100; Thu, 23 Aug 2007 21:53:34 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 5164858C38F1; Thu, 23 Aug 2007 21:53:34 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - dinode endianess annotations Message-Id: <20070823115334.5164858C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 21:53:34 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12600 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs dinode endianess annotations Biggest bit is duplicating the dinode structure so we have one annoted for native endianess and one for disk endianess. The other significant change is that xfs_xlate_dinode_core is split into one helper per direction to allow for proper annotations, everything else is trivial. As a sidenode splitting out the incore dinode means we can move it into xfs_inode.h in a later patch and severly improving on the include hell in xfs. Signed-off-by: Christoph Hellwig Date: Thu Aug 23 21:53:01 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29476a fs/xfs/xfsidbg.c - 1.321 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.321&r2=text&tr2=1.320&f=h - add endian notations for the dinode. fs/xfs/xfs_ialloc.c - 1.195 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ialloc.c.diff?r1=text&tr1=1.195&r2=text&tr2=1.194&f=h - add endian notations for the dinode. fs/xfs/xfs_itable.c - 1.153 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.153&r2=text&tr2=1.152&f=h - add endian notations for the dinode. fs/xfs/xfs_log_recover.c - 1.321 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.321&r2=text&tr2=1.320&f=h - add endian notations for the dinode. fs/xfs/xfs_inode.c - 1.471 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.471&r2=text&tr2=1.470&f=h - add endian notations for the dinode. fs/xfs/xfs_inode.h - 1.224 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.224&r2=text&tr2=1.223&f=h - add endian notations for the dinode. fs/xfs/xfs_dinode.h - 1.82 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dinode.h.diff?r1=text&tr1=1.82&r2=text&tr2=1.81&f=h - add endian notations for the dinode. fs/xfs/linux-2.6/xfs_ksyms.c - 1.61 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.61&r2=text&tr2=1.60&f=h - add endian notations for the dinode. fs/xfs/dmapi/xfs_dm.c - 1.42 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.42&r2=text&tr2=1.41&f=h - add endian notations for the dinode. From owner-xfs@oss.sgi.com Thu Aug 23 05:03:24 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 05:03:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NC3K4p020901 for ; Thu, 23 Aug 2007 05:03: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 WAA24483; Thu, 23 Aug 2007 22:03:16 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 6FDBD58C38F1; Thu, 23 Aug 2007 22:03:16 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - superblock endianess annotations Message-Id: <20070823120316.6FDBD58C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 22:03:16 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12601 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs superblock endianess annotations Creates a new xfs_dsb_t that is __be annotated and keeps xfs_sb_t for the incore one. xfs_xlatesb is renamed to xfs_sb_to_disk and only handles the incore -> disk conversion. A new helper xfs_sb_from_disk handles the other direction and doesn't need the slightly hacky table-driven approach because we only ever read the full sb from disk. The handling of shared r/o filesystems has been buggy on little endian system and fixing this required shuffling around of some code in that area. Signed-off-by: Christoph Hellwig Date: Thu Aug 23 22:02:37 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29477a fs/xfs/xfsidbg.c - 1.322 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.322&r2=text&tr2=1.321&f=h - Add superblock endian notations. fs/xfs/xfs_sb.h - 1.69 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_sb.h.diff?r1=text&tr1=1.69&r2=text&tr2=1.68&f=h - Add superblock endian notations. fs/xfs/xfs_log_recover.c - 1.322 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.322&r2=text&tr2=1.321&f=h - Add superblock endian notations. fs/xfs/xfs_mount.h - 1.239 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.239&r2=text&tr2=1.238&f=h - Add superblock endian notations. fs/xfs/xfs_mount.c - 1.402 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.402&r2=text&tr2=1.401&f=h - Add superblock endian notations. fs/xfs/xfs_trans.c - 1.182 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.c.diff?r1=text&tr1=1.182&r2=text&tr2=1.181&f=h - Add superblock endian notations. fs/xfs/xfs_fsops.c - 1.128 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_fsops.c.diff?r1=text&tr1=1.128&r2=text&tr2=1.127&f=h - Add superblock endian notations. fs/xfs/linux-2.6/xfs_ksyms.c - 1.62 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.62&r2=text&tr2=1.61&f=h - Add superblock endian notations. From owner-xfs@oss.sgi.com Thu Aug 23 05:22:17 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 05:22:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NCMD4p024232 for ; Thu, 23 Aug 2007 05:22: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 WAA24976; Thu, 23 Aug 2007 22:22:08 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 6416058C38F1; Thu, 23 Aug 2007 22:22:08 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - use filldir internally Message-Id: <20070823122208.6416058C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 22:22:08 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12602 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs use filldir internally Currently xfs has a rather complicated internal scheme to allow for different directory formats in IRIX. This patch rips all code related to this out and pushes useage of the Linux filldir callback into the lowlevel directory code. This does not make the code any less portable because filldir can be used to create dirents of all possible variations (including the IRIX ones as proved by the IRIX binary emulation code under arch/mips/). This patch get rid of an unessecary copy in the readdir path, about 400 lines of code and one of the last two users of the uio structure. This version is updated to deal with dmapi aswell which greatly simplifies the get_dirattrs code. The dmapi part has been tested using the get_dirattrs tools from the xfstest dmapi suite1 with various small and large directories. Signed-off-by: Christoph Hellwig Date: Thu Aug 23 22:21:37 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29478a fs/xfs/xfs_vnodeops.c - 1.706 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.706&r2=text&tr2=1.705&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_block.c - 1.56 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.c.diff?r1=text&tr1=1.56&r2=text&tr2=1.55&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_block.h - 1.19 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.h.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_sf.h - 1.24 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_sf.h.diff?r1=text&tr1=1.24&r2=text&tr2=1.23&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_sf.c - 1.48 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_sf.c.diff?r1=text&tr1=1.48&r2=text&tr2=1.47&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_leaf.c - 1.59 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_leaf.c.diff?r1=text&tr1=1.59&r2=text&tr2=1.58&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2_leaf.h - 1.25 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_leaf.h.diff?r1=text&tr1=1.25&r2=text&tr2=1.24&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_types.h - 1.80 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_types.h.diff?r1=text&tr1=1.80&r2=text&tr2=1.79&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2.h - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/xfs_dir2.c - 1.57 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2.c.diff?r1=text&tr1=1.57&r2=text&tr2=1.56&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/linux-2.6/xfs_file.c - 1.152 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_file.c.diff?r1=text&tr1=1.152&r2=text&tr2=1.151&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/linux-2.6/xfs_vnode.h - 1.129 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.129&r2=text&tr2=1.128&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/linux-2.6/xfs_ksyms.c - 1.63 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.63&r2=text&tr2=1.62&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. fs/xfs/dmapi/xfs_dm.c - 1.43 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.43&r2=text&tr2=1.42&f=h - Use the generic filldir directory formatter callbacks rather than the complex xfs_uio_move based implementation. Removes a copy and simplifies the code greatly. From owner-xfs@oss.sgi.com Thu Aug 23 05:44:33 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 05:44:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NCiS4p027257 for ; Thu, 23 Aug 2007 05:44: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 WAA25540; Thu, 23 Aug 2007 22:44:24 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 99C7858C38F1; Thu, 23 Aug 2007 22:44:24 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - stop using uio in the readlink code Message-Id: <20070823124424.99C7858C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 22:44:24 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12603 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs stop using uio in the readlink code Simplify the readlink code to get rid of the last user of uio. Signed-off-by: Christoph Hellwig Date: Thu Aug 23 22:43:50 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29479a fs/xfs/xfs_vnodeops.c - 1.707 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.707&r2=text&tr2=1.706&f=h - stop using uio in the readlink code. fs/xfs/linux-2.6/xfs_ioctl.c - 1.146 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ioctl.c.diff?r1=text&tr1=1.146&r2=text&tr2=1.145&f=h - stop using uio in the readlink code. fs/xfs/linux-2.6/xfs_vnode.h - 1.130 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.130&r2=text&tr2=1.129&f=h - stop using uio in the readlink code. fs/xfs/linux-2.6/xfs_iops.c - 1.259 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.259&r2=text&tr2=1.258&f=h - stop using uio in the readlink code. From owner-xfs@oss.sgi.com Thu Aug 23 05:49:51 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 05:49:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NCnm4p028316 for ; Thu, 23 Aug 2007 05:49:50 -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 WAA25724; Thu, 23 Aug 2007 22:49:44 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 33A4E58C38F1; Thu, 23 Aug 2007 22:49:44 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 968563 - kill move.[ch] Message-Id: <20070823124944.33A4E58C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 22:49:44 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12604 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs kill move.[ch] Kill uio related functions and defines now that they're unused. Signed-off-by: Christoph Hellwig Date: Thu Aug 23 22:49:17 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29480a fs/xfs/support/move.h - 1.20 - deleted http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/support/move.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - kill move.[ch] now they are unused. fs/xfs/support/move.c - 1.19 - deleted http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/support/move.c.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h - kill move.[ch] now they are unused. fs/xfs/Makefile-linux-2.6 - 1.208 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/Makefile-linux-2.6.diff?r1=text&tr1=1.208&r2=text&tr2=1.207&f=h - kill move.[ch] now they are unused. fs/xfs/linux-2.6/xfs_linux.h - 1.156 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_linux.h.diff?r1=text&tr1=1.156&r2=text&tr2=1.155&f=h - kill move.[ch] now they are unused. From owner-xfs@oss.sgi.com Thu Aug 23 06:02:12 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 06:02:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) 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.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7ND264p030174 for ; Thu, 23 Aug 2007 06:02: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 XAA26077; Thu, 23 Aug 2007 23:02:00 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 7A4CD58C38F1; Thu, 23 Aug 2007 23:02:00 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 969561 - Radix tree based inode caching Message-Id: <20070823130200.7A4CD58C38F1@chook.melbourne.sgi.com> Date: Thu, 23 Aug 2007 23:02:00 +1000 (EST) From: dgc@sgi.com (David Chinner) X-archive-position: 12605 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Radix tree based inode caching One of the perpetual scaling problems XFS has is indexing it's incore inodes. We currently uses hashes and the default hash sizes chosen can only ever be a tradeoff between memory consumption and the maximum realistic size of the cache. As a result, anyone who has millions of inodes cached on a filesystem needs to tunes the size of the cache via the ihashsize mount option to allow decent scalability with inode cache operations. A further problem is the separate inode cluster hash, whose size is based on the ihashsize but is smaller, and so under certain conditions (sparse cluster cache population) this can become a limitation long before the inode hash is causing issues. The following patchset removes the inode hash and cluster hash and replaces them with radix trees to avoid the scalability limitations of the hashes. It also reduces the size of the inodes by 3 pointers.... Date: Thu Aug 23 23:01:35 AEST 2007 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/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:29481a fs/xfs/xfsidbg.c - 1.323 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.323&r2=text&tr2=1.322&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_ag.h - 1.61 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ag.h.diff?r1=text&tr1=1.61&r2=text&tr2=1.60&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_extfree_item.c - 1.67 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_extfree_item.c.diff?r1=text&tr1=1.67&r2=text&tr2=1.66&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_buf_item.c - 1.163 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_buf_item.c.diff?r1=text&tr1=1.163&r2=text&tr2=1.162&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_trans_ail.c - 1.81 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_ail.c.diff?r1=text&tr1=1.81&r2=text&tr2=1.80&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_vnodeops.c - 1.708 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.708&r2=text&tr2=1.707&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_dir2_block.c - 1.57 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.c.diff?r1=text&tr1=1.57&r2=text&tr2=1.56&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_vfsops.c - 1.526 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.526&r2=text&tr2=1.525&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_iget.c - 1.226 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iget.c.diff?r1=text&tr1=1.226&r2=text&tr2=1.225&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_clnt.h - 1.56 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_clnt.h.diff?r1=text&tr1=1.56&r2=text&tr2=1.55&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_dir2_sf.c - 1.49 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_sf.c.diff?r1=text&tr1=1.49&r2=text&tr2=1.48&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_mount.h - 1.240 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.240&r2=text&tr2=1.239&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_mount.c - 1.403 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.403&r2=text&tr2=1.402&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_dir2_data.c - 1.39 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_data.c.diff?r1=text&tr1=1.39&r2=text&tr2=1.38&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_trans_extfree.c - 1.28 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_extfree.c.diff?r1=text&tr1=1.28&r2=text&tr2=1.27&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_inode.c - 1.472 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.472&r2=text&tr2=1.471&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_inode.h - 1.225 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.225&r2=text&tr2=1.224&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_error.c - 1.57 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_error.c.diff?r1=text&tr1=1.57&r2=text&tr2=1.56&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_dir2_node.c - 1.60 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_node.c.diff?r1=text&tr1=1.60&r2=text&tr2=1.59&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/xfs_rename.c - 1.72 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rename.c.diff?r1=text&tr1=1.72&r2=text&tr2=1.71&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/linux-2.6/xfs_ksyms.c - 1.64 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.64&r2=text&tr2=1.63&f=h - Convert xfs inode caches from hashes to radix trees. fs/xfs/linux-2.6/xfs_export.c - 1.13 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_export.c.diff?r1=text&tr1=1.13&r2=text&tr2=1.12&f=h - Convert xfs inode caches from hashes to radix trees. Modid: 2.6.x-xfs-melb:linux:29481b Documentation/filesystems/xfs.txt - 1.19 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/Documentation/filesystems/xfs.txt.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h - Update ihashsize mount option as deprecated. From owner-xfs@oss.sgi.com Thu Aug 23 12:38:11 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 12:38:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7NJc94p003015 for ; Thu, 23 Aug 2007 12:38:10 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7NJc7A5008515 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 23 Aug 2007 21:38:07 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7NJc7Ts008513 for xfs@oss.sgi.com; Thu, 23 Aug 2007 21:38:07 +0200 Date: Thu, 23 Aug 2007 21:38:07 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 4/17] kill the v_flag member in struct bhv_vnode Message-ID: <20070823193807.GE8050@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-archive-position: 12610 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 All flags previous handled at the vnode level are not in the xfs_inode where we already have a flags mechanisms and free bits for flags previously in the vnode. 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 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-08-13 18:00:51.000000000 +0200 @@ -2599,7 +2599,7 @@ xfs_dm_punch_hole( /* Let threads in send_data_event know we punched the file. */ ip->i_iocore.io_dmstate++; xfs_iunlock(ip, XFS_IOLOCK_EXCL); - VMODIFY(vp); + xfs_iflags_set(ip, XFS_IMODIFIED); up_and_out: up_rw_sems(inode, DM_SEM_FLAG_WR); @@ -2988,7 +2988,7 @@ xfs_dm_sync_by_handle( dm_right_t right) { int err, ret; - bhv_vnode_t *vp = vn_from_inode(inode); + xfs_inode_t *ip = XFS_I(inode); /* Returns negative errors to DMAPI */ if (right < DM_RIGHT_EXCL) @@ -2997,7 +2997,7 @@ xfs_dm_sync_by_handle( /* We need to protect against concurrent writers.. */ ret = filemap_fdatawrite(inode->i_mapping); down_rw_sems(inode, DM_FLAGS_IMUX); - err = xfs_fsync(XFS_I(inode), FSYNC_WAIT, 0, -1); + err = xfs_fsync(ip, FSYNC_WAIT, 0, -1); if (!ret) ret = err; up_rw_sems(inode, DM_FLAGS_IMUX); @@ -3005,9 +3005,7 @@ xfs_dm_sync_by_handle( if (!ret) ret = err; - if (VN_TRUNC(vp)) - VUNTRUNCATE(vp); - + xfs_iflags_clear(ip, XFS_ITRUNCATED); if (ret > 0) ret = -ret; /* Return negative errors to DMAPI */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2007-08-13 18:00:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2007-08-13 18:00:51.000000000 +0200 @@ -303,13 +303,13 @@ xfs_map_blocks( xfs_iomap_t *mapp, int flags) { - bhv_vnode_t *vp = vn_from_inode(inode); + xfs_inode_t *ip = XFS_I(inode); int error, nmaps = 1; - error = xfs_bmap(xfs_vtoi(vp), offset, count, + error = xfs_bmap(ip, offset, count, flags, mapp, &nmaps); if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) - VMODIFY(vp); + xfs_iflags_set(ip, XFS_IMODIFIED); return -error; } @@ -1245,10 +1245,7 @@ xfs_vm_writepages( struct address_space *mapping, struct writeback_control *wbc) { - struct bhv_vnode *vp = vn_from_inode(mapping->host); - - if (VN_TRUNC(vp)) - VUNTRUNCATE(vp); + xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED); return generic_writepages(mapping, wbc); } 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 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2007-08-13 18:00:51.000000000 +0200 @@ -217,13 +217,11 @@ xfs_file_fsync( struct dentry *dentry, int datasync) { - bhv_vnode_t *vp = vn_from_inode(dentry->d_inode); int flags = FSYNC_WAIT; if (datasync) flags |= FSYNC_DATA; - if (VN_TRUNC(vp)) - VUNTRUNCATE(vp); + xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED); return -xfs_fsync(XFS_I(dentry->d_inode), flags, (xfs_off_t)0, (xfs_off_t)-1); } @@ -300,10 +298,9 @@ xfs_file_ioctl( { int error; struct inode *inode = filp->f_path.dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); - VMODIFY(vp); + xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); /* NOTE: some of the ioctl's return positive #'s as a * byte count indicating success, such as @@ -322,10 +319,9 @@ xfs_file_ioctl_invis( { int error; struct inode *inode = filp->f_path.dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); - VMODIFY(vp); + xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); /* NOTE: some of the ioctl's return positive #'s as a * byte count indicating success, such as Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_fs_subr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_fs_subr.c 2007-08-13 18:00:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_fs_subr.c 2007-08-13 18:00:51.000000000 +0200 @@ -61,8 +61,7 @@ xfs_flushinval_pages( int ret = 0; if (VN_CACHED(vp)) { - if (VN_TRUNC(vp)) - VUNTRUNCATE(vp); + xfs_iflags_clear(ip, XFS_ITRUNCATED); ret = filemap_write_and_wait(inode->i_mapping); if (!ret) truncate_inode_pages(inode->i_mapping, first); @@ -84,8 +83,7 @@ xfs_flush_pages( int ret2; if (VN_DIRTY(vp)) { - if (VN_TRUNC(vp)) - VUNTRUNCATE(vp); + xfs_iflags_clear(ip, XFS_ITRUNCATED); ret = filemap_fdatawrite(inode->i_mapping); if (flags & XFS_B_ASYNC) return ret; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2007-08-13 18:00:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2007-08-13 18:00:51.000000000 +0200 @@ -371,7 +371,6 @@ xfs_compat_ioctl( unsigned long arg) { struct inode *inode = file->f_path.dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); int error; switch (cmd) { @@ -459,7 +458,7 @@ xfs_compat_ioctl( } error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); - VMODIFY(vp); + xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); return error; } 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 2007-08-13 18:00:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2007-08-13 18:00:51.000000000 +0200 @@ -221,7 +221,7 @@ xfs_init_security( error = xfs_attr_set(XFS_I(ip), name, value, length, ATTR_SECURE); if (!error) - VMODIFY(vp); + xfs_iflags_set(XFS_I(ip), XFS_IMODIFIED); kfree(name); kfree(value); @@ -327,7 +327,7 @@ xfs_vn_mknod( if (!error) { error = _ACL_INHERIT(vp, &vattr, default_acl); if (!error) - VMODIFY(vp); + xfs_iflags_set(XFS_I(&vp->v_inode), XFS_IMODIFIED); else xfs_cleanup_inode(dir, vp, dentry, mode); } @@ -409,7 +409,7 @@ xfs_vn_link( if (unlikely(error)) { VN_RELE(vp); } else { - VMODIFY(vn_from_inode(dir)); + xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); xfs_validate_fields(ip, &vattr); d_instantiate(dentry, ip); } 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 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2007-08-13 18:00:51.000000000 +0200 @@ -197,7 +197,7 @@ xfs_revalidate_inode( inode->i_flags |= S_NOATIME; else inode->i_flags &= ~S_NOATIME; - vp->v_flag &= ~VMODIFIED; + xfs_iflags_clear(ip, XFS_IMODIFIED); } void @@ -448,13 +448,12 @@ xfs_fs_clear_inode( if (XFS_I(inode)) xfs_inactive(XFS_I(inode)); - VN_LOCK(vp); - vp->v_flag &= ~VMODIFIED; - VN_UNLOCK(vp, 0); - if (XFS_I(inode)) + if (XFS_I(inode)) { + xfs_iflags_clear(XFS_I(inode), XFS_IMODIFIED); if (xfs_reclaim(XFS_I(inode))) panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp); + } ASSERT(XFS_I(inode) == NULL); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-13 18:00:51.000000000 +0200 @@ -84,9 +84,6 @@ vn_initialize( XFS_STATS_INC(vn_active); XFS_STATS_INC(vn_alloc); - vp->v_flag = VMODIFIED; - spinlock_init(&vp->v_lock, "v_lock"); - spin_lock(&vnumber_lock); if (!++vn_generation) /* v_number shouldn't be zero */ vn_generation++; @@ -157,7 +154,7 @@ __vn_revalidate( error = xfs_getattr(xfs_vtoi(vp), vattr, 0); if (likely(!error)) { vn_revalidate_core(vp, vattr); - VUNMODIFY(vp); + xfs_iflags_clear(xfs_vtoi(vp), XFS_IMODIFIED); } return -error; } @@ -182,10 +179,8 @@ vn_hold( XFS_STATS_INC(vn_hold); - VN_LOCK(vp); inode = igrab(vn_to_inode(vp)); ASSERT(inode); - VN_UNLOCK(vp, 0); return vp; } @@ -199,7 +194,7 @@ vn_hold( /* 2 */ (void *)(__psint_t) line, \ /* 3 */ (void *)(__psint_t)(vn_count(vp)), \ /* 4 */ (void *)(ra), \ -/* 5 */ (void *)(__psunsigned_t)(vp)->v_flag, \ +/* 5 */ NULL, \ /* 6 */ (void *)(__psint_t)current_cpu(), \ /* 7 */ (void *)(__psint_t)current_pid(), \ /* 8 */ (void *)__return_address, \ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-13 18:00:51.000000000 +0200 @@ -27,20 +27,8 @@ struct attrlist_cursor_kern; typedef struct dentry bhv_vname_t; typedef __u64 bhv_vnumber_t; -typedef enum bhv_vflags { - VMODIFIED = 0x08, /* XFS inode state possibly differs */ - /* to the Linux inode state. */ - VTRUNCATED = 0x40, /* truncated down so flush-on-close */ -} bhv_vflags_t; - -/* - * MP locking protocols: - * v_flag, VN_LOCK/VN_UNLOCK - */ typedef struct bhv_vnode { - bhv_vflags_t v_flag; /* vnode flags (see above) */ bhv_vnumber_t v_number; /* in-core vnode number */ - spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ atomic_t v_iocount; /* outstanding I/O count */ #ifdef XFS_VNODE_TRACE struct ktrace *v_trace; /* trace header structure */ @@ -255,35 +243,6 @@ static inline struct bhv_vnode *vn_grab( #define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode)) /* - * Vnode spinlock manipulation. - */ -#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock) -#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s) - -STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag) -{ - spin_lock(&vp->v_lock); - vp->v_flag |= flag; - spin_unlock(&vp->v_lock); -} - -STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag) -{ - uint cleared; - - spin_lock(&vp->v_lock); - cleared = (vp->v_flag & flag); - vp->v_flag &= ~flag; - spin_unlock(&vp->v_lock); - return cleared; -} - -#define VMODIFY(vp) vn_flagset(vp, VMODIFIED) -#define VUNMODIFY(vp) vn_flagclr(vp, VMODIFIED) -#define VTRUNCATE(vp) vn_flagset(vp, VTRUNCATED) -#define VUNTRUNCATE(vp) vn_flagclr(vp, VTRUNCATED) - -/* * Dealing with bad inodes */ static inline void vn_mark_bad(struct bhv_vnode *vp) @@ -322,7 +281,6 @@ static inline void vn_atime_to_time_t(bh #define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages) #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ PAGECACHE_TAG_DIRTY) -#define VN_TRUNC(vp) ((vp)->v_flag & VTRUNCATED) /* * Flags to vop_setattr/getattr. Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2007-08-13 18:00:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2007-08-13 18:00:51.000000000 +0200 @@ -346,6 +346,7 @@ finish_inode: ASSERT(((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) != 0) == ((ip->i_iocore.io_flags & XFS_IOCORE_RT) != 0)); + xfs_iflags_set(ip, XFS_IMODIFIED); *ipp = ip; /* Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2007-08-13 18:00:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2007-08-13 18:00:51.000000000 +0200 @@ -392,6 +392,9 @@ xfs_iflags_test(xfs_inode_t *ip, unsigne #define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */ #define XFS_INEW 0x0040 #define XFS_IFILESTREAM 0x0080 /* inode is in a filestream directory */ +#define XFS_IMODIFIED 0x0100 /* XFS inode state possibly differs */ + /* to the Linux inode state. */ +#define XFS_ITRUNCATED 0x0200 /* truncated down so flush-on-close */ /* * Flags for inode locking. Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-08-13 18:00:51.000000000 +0200 @@ -660,7 +660,7 @@ xfs_setattr( * vnode and flush it when the file is closed, and * do not wait the usual (long) time for writeout. */ - VTRUNCATE(vp); + xfs_iflags_set(ip, XFS_ITRUNCATED); } /* * Have to do this even if the file's size doesn't change. @@ -1516,6 +1516,8 @@ xfs_release( return 0; if (!XFS_FORCED_SHUTDOWN(mp)) { + int truncated; + /* * If we are using filestreams, and we have an unlinked * file that we are processing the last close on, then nothing @@ -1536,7 +1538,13 @@ xfs_release( * significantly reducing the time window where we'd otherwise * be exposed to that problem. */ - if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0) + spin_lock(&ip->i_flags_lock); + truncated = __xfs_iflags_test(ip, XFS_ITRUNCATED); + if (truncated) + ip->i_flags &= ~XFS_ITRUNCATED; + spin_unlock(&ip->i_flags_lock); + + if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); } Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2007-08-13 18:00:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2007-08-13 18:00:51.000000000 +0200 @@ -1701,47 +1701,6 @@ static int kdbm_xfs_xtrans_res( return 0; } -/* - * Vnode descriptor dump. - * This table is a string version of all the flags defined in vnode.h. - */ -char *tab_vflags[] = { - /* local only flags */ - "VINACT", /* 0x01 */ - "VRECLM", /* 0x02 */ - "VWAIT", /* 0x04 */ - "VMODIFIED", /* 0x08 */ - "INVALID0x10", /* 0x10 */ - "INVALID0x20", /* 0x20 */ - "INVALID0x40", /* 0x40 */ - "INVALID0x80", /* 0x80 */ - "INVALID0x100", /* 0x100 */ - "INVALID0x200", /* 0x200 */ - "INVALID0x400", /* 0x400 */ - "INVALID0x800", /* 0x800 */ - "INVALID0x1000", /* 0x1000 */ - "INVALID0x2000", /* 0x2000 */ - "INVALID0x4000", /* 0x4000 */ - "INVALID0x8000", /* 0x8000 */ - "INVALID0x10000", /* 0x10000 */ - "INVALID0x20000", /* 0x20000 */ - "INVALID0x40000", /* 0x40000 */ - "INVALID0x80000", /* 0x80000 */ - "VROOT", /* 0x100000 */ - "INVALID0x200000", /* 0x200000 */ - "INVALID00x400000", /* 0x400000 */ - "INVALID0x800000", /* 0x800000 */ - "INVALID0x1000000", /* 0x1000000 */ - "INVALID0x2000000", /* 0x2000000 */ - "VSHARE", /* 0x4000000 */ - "INVALID0x8000000", /* 0x8000000 */ - "VENF_LOCKING", /* 0x10000000 */ - "VOPLOCK", /* 0x20000000 */ - "VPURGE", /* 0x40000000 */ - "INVALID0x80000000", /* 0x80000000 */ - NULL -}; - static void printflags(register uint64_t flags, register char **strings, @@ -1797,7 +1756,6 @@ static void printvnode(bhv_vnode_t *vp, { kdb_printf("vnode: 0x%lx\n", addr); - printflags((__psunsigned_t)vp->v_flag, tab_vflags, "flag ="); kdb_printf("\n"); #ifdef XFS_VNODE_TRACE @@ -1986,8 +1944,6 @@ vn_trace_pr_entry(ktrace_entry_t *ktep) kdb_printf(" cpu = %ld pid = %d ", (long)ktep->val[6], (pid_t)ktep->val[7]); - printflags((__psunsigned_t)ktep->val[5], tab_vflags, "flag ="); - if (kdbnearsym((unsigned int)ktep->val[4], &symtab)) { unsigned long offval; @@ -6697,6 +6653,8 @@ xfsidbg_xnode(xfs_inode_t *ip) "quiesce", /* XFS_IQUIESCE */ "reclaim", /* XFS_IRECLAIM */ "stale", /* XFS_ISTALE */ + "modified", /* XFS_IMODIFIED */ + "truncated", /* XFS_ITRUNCATED */ NULL }; From owner-xfs@oss.sgi.com Thu Aug 23 12:38:38 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 12:38:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7NJca4p003408 for ; Thu, 23 Aug 2007 12:38:37 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7NJcYA5008558 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 23 Aug 2007 21:38:34 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7NJcYva008556 for xfs@oss.sgi.com; Thu, 23 Aug 2007 21:38:34 +0200 Date: Thu, 23 Aug 2007 21:38:34 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 6/17] move v_trace from bhv_vnode to xfs_inode Message-ID: <20070823193834.GG8050@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-archive-position: 12612 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 struct bhv_vnode is on it's way out, so move the trace buffer to the XFS inode. Note that this makes the tracing macros rather misnamed, but this kind of fallout will be fixed up incrementally later on. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2007-08-23 14:53:52.000000000 +0200 @@ -1525,7 +1525,7 @@ xfs_vm_bmap( struct inode *inode = (struct inode *)mapping->host; struct xfs_inode *ip = XFS_I(inode); - vn_trace_entry(vn_from_inode(inode), __FUNCTION__, + vn_trace_entry(XFS_I(inode), __FUNCTION__, (inst_t *)__return_address); xfs_rwlock(ip, VRWLOCK_READ); xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); 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 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2007-08-23 14:53:52.000000000 +0200 @@ -733,7 +733,7 @@ xfs_ioctl( xfs_mount_t *mp = ip->i_mount; int error; - vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address); + vn_trace_entry(XFS_I(inode), "xfs_ioctl", (inst_t *)__return_address); switch (cmd) { 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 2007-08-23 14:51:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2007-08-23 14:53:52.000000000 +0200 @@ -412,7 +412,7 @@ xfs_fs_write_inode( { int error = 0, flags = FLUSH_INODE; - vn_trace_entry(vn_from_inode(inode), __FUNCTION__, + vn_trace_entry(XFS_I(inode), __FUNCTION__, (inst_t *)__return_address); if (sync) flags |= FLUSH_SYNC; @@ -432,34 +432,27 @@ STATIC void xfs_fs_clear_inode( struct inode *inode) { - bhv_vnode_t *vp = vn_from_inode(inode); - - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); - - XFS_STATS_INC(vn_rele); - XFS_STATS_INC(vn_remove); - XFS_STATS_INC(vn_reclaim); - XFS_STATS_DEC(vn_active); + xfs_inode_t *ip = XFS_I(inode); /* - * This can happen because xfs_iget_core calls xfs_idestroy if we + * ip can be null when xfs_iget_core calls xfs_idestroy if we * find an inode with di_mode == 0 but without IGET_CREATE set. */ - if (XFS_I(inode)) - xfs_inactive(XFS_I(inode)); - + if (ip) { + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); - if (XFS_I(inode)) { - xfs_iflags_clear(XFS_I(inode), XFS_IMODIFIED); - if (xfs_reclaim(XFS_I(inode))) - panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp); + XFS_STATS_INC(vn_rele); + XFS_STATS_INC(vn_remove); + XFS_STATS_INC(vn_reclaim); + XFS_STATS_DEC(vn_active); + + xfs_inactive(ip); + xfs_iflags_clear(ip, XFS_IMODIFIED); + if (xfs_reclaim(ip)) + panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, inode); } ASSERT(XFS_I(inode) == NULL); - -#ifdef XFS_VNODE_TRACE - ktrace_free(vp->v_trace); -#endif } /* @@ -846,7 +839,8 @@ xfs_fs_fill_super( } if ((error = xfs_fs_start_syncd(vfsp))) goto fail_vnrele; - vn_trace_exit(rootvp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_exit(XFS_I(sb->s_root->d_inode), __FUNCTION__, + (inst_t *)__return_address); kmem_free(args, sizeof(*args)); return 0; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-23 14:53:07.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-23 14:53:56.000000000 +0200 @@ -103,11 +103,6 @@ vn_initialize( ASSERT(VN_CACHED(vp) == 0); -#ifdef XFS_VNODE_TRACE - vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); -#endif /* XFS_VNODE_TRACE */ - - vn_trace_exit(vp, __FUNCTION__, (inst_t *)__return_address); return vp; } @@ -158,7 +153,7 @@ __vn_revalidate( { int error; - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(xfs_vtoi(vp), __FUNCTION__, (inst_t *)__return_address); vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; error = xfs_getattr(xfs_vtoi(vp), vattr, 0); if (likely(!error)) { @@ -197,11 +192,11 @@ vn_hold( #ifdef XFS_VNODE_TRACE #define KTRACE_ENTER(vp, vk, s, line, ra) \ - ktrace_enter( (vp)->v_trace, \ + ktrace_enter( (ip)->i_trace, \ /* 0 */ (void *)(__psint_t)(vk), \ /* 1 */ (void *)(s), \ /* 2 */ (void *)(__psint_t) line, \ -/* 3 */ (void *)(__psint_t)(vn_count(vp)), \ +/* 3 */ NULL, \ /* 4 */ (void *)(ra), \ /* 5 */ NULL, \ /* 6 */ (void *)(__psint_t)current_cpu(), \ @@ -213,32 +208,32 @@ vn_hold( * Vnode tracing code. */ void -vn_trace_entry(bhv_vnode_t *vp, const char *func, inst_t *ra) +vn_trace_entry(xfs_inode_t *ip, const char *func, inst_t *ra) { - KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra); + KTRACE_ENTER(ip, VNODE_KTRACE_ENTRY, func, 0, ra); } void -vn_trace_exit(bhv_vnode_t *vp, const char *func, inst_t *ra) +vn_trace_exit(xfs_inode_t *ip, const char *func, inst_t *ra) { - KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra); + KTRACE_ENTER(ip, VNODE_KTRACE_EXIT, func, 0, ra); } void -vn_trace_hold(bhv_vnode_t *vp, char *file, int line, inst_t *ra) +vn_trace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra) { - KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra); + KTRACE_ENTER(ip, VNODE_KTRACE_HOLD, file, line, ra); } void -vn_trace_ref(bhv_vnode_t *vp, char *file, int line, inst_t *ra) +vn_trace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra) { - KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra); + KTRACE_ENTER(ip, VNODE_KTRACE_REF, file, line, ra); } void -vn_trace_rele(bhv_vnode_t *vp, char *file, int line, inst_t *ra) +vn_trace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra) { - KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra); + KTRACE_ENTER(ip, VNODE_KTRACE_RELE, file, line, ra); } #endif /* XFS_VNODE_TRACE */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-23 14:51:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-23 14:53:56.000000000 +0200 @@ -29,9 +29,6 @@ typedef __u64 bhv_vnumber_t; typedef struct bhv_vnode { bhv_vnumber_t v_number; /* in-core vnode number */ -#ifdef XFS_VNODE_TRACE - struct ktrace *v_trace; /* trace header structure */ -#endif struct inode v_inode; /* Linux inode */ /* inode MUST be last */ } bhv_vnode_t; @@ -222,9 +219,9 @@ extern bhv_vnode_t *vn_hold(struct bhv_v #if defined(XFS_VNODE_TRACE) #define VN_HOLD(vp) \ ((void)vn_hold(vp), \ - vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) + vn_trace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) #define VN_RELE(vp) \ - (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ + (vn_trace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ iput(vn_to_inode(vp))) #else #define VN_HOLD(vp) ((void)vn_hold(vp)) @@ -314,21 +311,17 @@ static inline void vn_atime_to_time_t(bh #define VNODE_KTRACE_REF 4 #define VNODE_KTRACE_RELE 5 -extern void vn_trace_entry(struct bhv_vnode *, const char *, inst_t *); -extern void vn_trace_exit(struct bhv_vnode *, const char *, inst_t *); -extern void vn_trace_hold(struct bhv_vnode *, char *, int, inst_t *); -extern void vn_trace_ref(struct bhv_vnode *, char *, int, inst_t *); -extern void vn_trace_rele(struct bhv_vnode *, char *, int, inst_t *); - -#define VN_TRACE(vp) \ - vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address) +extern void vn_trace_entry(struct xfs_inode *, const char *, inst_t *); +extern void vn_trace_exit(struct xfs_inode *, const char *, inst_t *); +extern void vn_trace_hold(struct xfs_inode *, char *, int, inst_t *); +extern void vn_trace_ref(struct xfs_inode *, char *, int, inst_t *); +extern void vn_trace_rele(struct xfs_inode *, char *, int, inst_t *); #else #define vn_trace_entry(a,b,c) #define vn_trace_exit(a,b,c) #define vn_trace_hold(a,b,c,d) #define vn_trace_ref(a,b,c,d) #define vn_trace_rele(a,b,c,d) -#define VN_TRACE(vp) #endif #endif /* __XFS_VNODE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_dir2.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dir2.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dir2.c 2007-08-23 14:53:52.000000000 +0200 @@ -301,7 +301,7 @@ xfs_readdir( int rval; /* return value */ int v; /* type-checking value */ - vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(dp->i_mount)) return XFS_ERROR(EIO); Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2007-08-23 14:53:56.000000000 +0200 @@ -157,7 +157,7 @@ again: goto again; } - vn_trace_exit(vp, "xfs_iget.alloc", + vn_trace_exit(ip, "xfs_iget.alloc", (inst_t *)__return_address); XFS_STATS_INC(xs_ig_found); @@ -212,7 +212,7 @@ finish_inode: xfs_ilock(ip, lock_flags); xfs_iflags_clear(ip, XFS_ISTALE); - vn_trace_exit(vp, "xfs_iget.found", + vn_trace_exit(ip, "xfs_iget.found", (inst_t *)__return_address); goto return_ip; } @@ -234,7 +234,7 @@ finish_inode: return error; } - vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); + vn_trace_exit(ip, "xfs_iget.alloc", (inst_t *)__return_address); xfs_inode_lock_init(ip, vp); xfs_iocore_inode_init(ip); @@ -477,7 +477,7 @@ xfs_iput(xfs_inode_t *ip, { bhv_vnode_t *vp = XFS_ITOV(ip); - vn_trace_entry(vp, "xfs_iput", (inst_t *)__return_address); + vn_trace_entry(ip, "xfs_iput", (inst_t *)__return_address); xfs_iunlock(ip, lock_flags); VN_RELE(vp); } @@ -492,7 +492,7 @@ xfs_iput_new(xfs_inode_t *ip, bhv_vnode_t *vp = XFS_ITOV(ip); struct inode *inode = vn_to_inode(vp); - vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address); + vn_trace_entry(ip, "xfs_iput_new", (inst_t *)__return_address); if ((ip->i_d.di_mode == 0)) { ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE)); Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2007-08-23 14:53:52.000000000 +0200 @@ -884,6 +884,9 @@ xfs_iread( * Initialize inode's trace buffers. * Do this before xfs_iformat in case it adds entries. */ +#ifdef XFS_VNODE_TRACE + ip->i_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); +#endif #ifdef XFS_BMAP_TRACE ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); #endif @@ -2729,6 +2732,10 @@ xfs_idestroy( mrfree(&ip->i_lock); mrfree(&ip->i_iolock); freesema(&ip->i_flock); + +#ifdef XFS_VNODE_TRACE + ktrace_free(ip->i_trace); +#endif #ifdef XFS_BMAP_TRACE ktrace_free(ip->i_xtrace); #endif Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2007-08-23 14:53:52.000000000 +0200 @@ -302,6 +302,9 @@ typedef struct xfs_inode { xfs_fsize_t i_size; /* in-memory size */ atomic_t i_iocount; /* outstanding I/O count */ /* Trace buffers per inode. */ +#ifdef XFS_VNODE_TRACE + struct ktrace *i_trace; /* general inode trace */ +#endif #ifdef XFS_BMAP_TRACE struct ktrace *i_xtrace; /* inode extent list trace */ #endif Index: linux-2.6-xfs/fs/xfs/xfs_rename.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2007-08-23 14:53:52.000000000 +0200 @@ -247,8 +247,8 @@ xfs_rename( int src_namelen = VNAMELEN(src_vname); int target_namelen = VNAMELEN(target_vname); - vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address); - vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address); + vn_trace_entry(src_dp, "xfs_rename", (inst_t *)__return_address); + vn_trace_entry(xfs_vtoi(target_dir_vp), "xfs_rename", (inst_t *)__return_address); /* * Find the XFS behavior descriptor for the target directory Index: linux-2.6-xfs/fs/xfs/xfs_utils.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_utils.c 2007-08-23 14:53:52.000000000 +0200 @@ -73,7 +73,7 @@ xfs_dir_lookup_int( { int error; - vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); error = xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), inum); if (!error) { Index: linux-2.6-xfs/fs/xfs/xfs_utils.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.h 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_utils.h 2007-08-23 14:53:52.000000000 +0200 @@ -20,7 +20,7 @@ #define IRELE(ip) VN_RELE(XFS_ITOV(ip)) #define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) -#define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \ +#define ITRACE(ip) vn_trace_ref(ip, __FILE__, __LINE__, \ (inst_t *)__return_address) extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-08-23 14:53:52.000000000 +0200 @@ -88,7 +88,7 @@ xfs_getattr( bhv_vnode_t *vp = XFS_ITOV(ip); xfs_mount_t *mp = ip->i_mount; - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); @@ -228,7 +228,7 @@ xfs_setattr( int file_owner; int need_iolock = 1; - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) return XFS_ERROR(EROFS); @@ -915,7 +915,7 @@ xfs_access( { int error; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); xfs_ilock(ip, XFS_ILOCK_SHARED); error = xfs_iaccess(ip, mode, credp); @@ -987,7 +987,7 @@ xfs_readlink( int pathlen; int error = 0; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); @@ -1033,7 +1033,7 @@ xfs_fsync( int error; int log_flushed = 0, changed = 1; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); ASSERT(start >= 0 && stop >= -1); @@ -1594,7 +1594,7 @@ xfs_inactive( int error; int truncate; - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); /* * If the inode is already free, then there can be nothing @@ -1807,7 +1807,7 @@ xfs_lookup( int error; uint lock_mode; - vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(dp->i_mount)) return XFS_ERROR(EIO); @@ -1851,7 +1851,7 @@ xfs_create( int namelen; ASSERT(!*vpp); - vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); dm_di_mode = vap->va_mode; namelen = VNAMELEN(dentry); @@ -2328,7 +2328,7 @@ xfs_remove( uint resblks; int namelen; - vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); @@ -2371,7 +2371,7 @@ xfs_remove( dm_di_mode = ip->i_d.di_mode; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); ITRACE(ip); @@ -2505,7 +2505,7 @@ xfs_remove( if (link_zero && xfs_inode_is_filestream(ip)) xfs_filestream_deassociate(ip); - vn_trace_exit(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_exit(ip, __FUNCTION__, (inst_t *)__return_address); IRELE(ip); @@ -2569,8 +2569,8 @@ xfs_link( char *target_name = VNAME(dentry); int target_namelen; - vn_trace_entry(target_dir_vp, __FUNCTION__, (inst_t *)__return_address); - vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(tdp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(xfs_vtoi(src_vp), __FUNCTION__, (inst_t *)__return_address); target_namelen = VNAMELEN(dentry); ASSERT(!VN_ISDIR(src_vp)); @@ -2753,7 +2753,7 @@ xfs_mkdir( /* Return through std_return after this point. */ - vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); mp = dp->i_mount; udqp = gdqp = NULL; @@ -2947,7 +2947,7 @@ xfs_rmdir( int last_cdp_link; uint resblks; - vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); @@ -3200,7 +3200,7 @@ xfs_symlink( ip = NULL; tp = NULL; - vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) @@ -3492,7 +3492,7 @@ xfs_fid2( { xfs_fid2_t *xfid = (xfs_fid2_t *)fidp; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); ASSERT(sizeof(fid_t) >= sizeof(xfs_fid2_t)); xfid->fid_len = sizeof(xfs_fid2_t) - sizeof(xfid->fid_len); @@ -3674,7 +3674,7 @@ xfs_reclaim( { bhv_vnode_t *vp = XFS_ITOV(ip); - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); ASSERT(!VN_MAPPED(vp)); @@ -3892,7 +3892,7 @@ xfs_alloc_file_space( int committed; int error; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); @@ -4162,7 +4162,7 @@ xfs_free_file_space( vp = XFS_ITOV(ip); mp = ip->i_mount; - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); if ((error = XFS_QM_DQATTACH(mp, ip, 0))) return error; @@ -4368,7 +4368,7 @@ xfs_change_file_space( xfs_trans_t *tp; bhv_vattr_t va; - vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); /* * must be a regular file and have write permission Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2007-08-23 14:51:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2007-08-23 14:53:56.000000000 +0200 @@ -113,6 +113,12 @@ static void xfsidbg_xqm_dqtrace(xfs_dquo #ifdef XFS_FILESTREAMS_TRACE static void xfsidbg_filestreams_trace(int); #endif +#ifdef XFS_VNODE_TRACE +/* + * Print a vnode trace entry. + */ +static int vn_trace_pr_entry(ktrace_entry_t *ktep); +#endif /* @@ -1432,18 +1438,37 @@ static int kdbm_xfs_xnode( int argc, const char **argv) { + xfs_inode_t *ip; unsigned long addr; int nextarg = 1; long offset = 0; int diag; +#ifdef XFS_VNODE_TRACE + ktrace_entry_t *ktep; + ktrace_snap_t kts; +#endif if (argc != 1) return KDB_ARGCOUNT; diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); if (diag) return diag; + ip = (xfs_inode_t *)addr; + + xfsidbg_xnode(ip); - xfsidbg_xnode((xfs_inode_t *) addr); +#ifdef XFS_VNODE_TRACE + kdb_printf("--> itrace @ 0x%lx/0x%p\n", addr, ip->i_trace); + if (ip->i_trace == NULL) + return 0; + ktep = ktrace_first(ip->i_trace, &kts); + while (ktep != NULL) { + if (vn_trace_pr_entry(ktep)) + kdb_printf("\n"); + + ktep = ktrace_next(ip->i_trace, &kts); + } +#endif /* XFS_VNODE_TRACE */ return 0; } @@ -1758,10 +1783,6 @@ static void printvnode(bhv_vnode_t *vp, kdb_printf("\n"); -#ifdef XFS_VNODE_TRACE - kdb_printf(" v_trace 0x%p\n", vp->v_trace); -#endif /* XFS_VNODE_TRACE */ - kdb_printf(" v_number 0x%llx\n", (unsigned long long)vp->v_number); } @@ -1971,7 +1992,7 @@ static int kdbm_vntrace( int nextarg = 1; long offset = 0; unsigned long addr; - bhv_vnode_t *vp; + xfs_inode_t *ip; ktrace_entry_t *ktep; ktrace_snap_t kts; @@ -1984,23 +2005,23 @@ static int kdbm_vntrace( if (diag) return diag; - vp = (bhv_vnode_t *)addr; + ip = (xfs_inode_t *)addr; - if (vp->v_trace == NULL) { + if (ip->i_trace == NULL) { kdb_printf("The vnode trace buffer is not initialized\n"); return 0; } - kdb_printf("vntrace vp 0x%p\n", vp); + kdb_printf("vntrace ip 0x%p\n", ip); - ktep = ktrace_first(vp->v_trace, &kts); + ktep = ktrace_first(ip->i_trace, &kts); while (ktep != NULL) { if (vn_trace_pr_entry(ktep)) kdb_printf("\n"); - ktep = ktrace_next(vp->v_trace, &kts); + ktep = ktrace_next(ip->i_trace, &kts); } return 0; @@ -2096,10 +2117,6 @@ static int kdbm_vn( unsigned long addr; struct inode *ip; bhv_vnode_t vp; -#ifdef XFS_VNODE_TRACE - ktrace_entry_t *ktep; - ktrace_snap_t kts; -#endif if (argc != 1) return KDB_ARGCOUNT; @@ -2117,19 +2134,6 @@ static int kdbm_vn( kdb_printf("--> Vnode @ 0x%lx\n", addr); printvnode(&vp, addr); - -#ifdef XFS_VNODE_TRACE - kdb_printf("--> Vntrace @ 0x%lx/0x%p\n", addr, vp.v_trace); - if (vp.v_trace == NULL) - return 0; - ktep = ktrace_first(vp.v_trace, &kts); - while (ktep != NULL) { - if (vn_trace_pr_entry(ktep)) - kdb_printf("\n"); - - ktep = ktrace_next(vp.v_trace, &kts); - } -#endif /* XFS_VNODE_TRACE */ return 0; } @@ -6691,6 +6695,10 @@ xfsidbg_xnode(xfs_inode_t *ip) ip->i_delayed_blks); kdb_printf("size %lld\n", ip->i_size); + +#ifdef XFS_VNODE_TRACE + qprintf(" trace 0x%p\n", ip->i_trace); +#endif #ifdef XFS_BMAP_TRACE qprintf(" bmap_trace 0x%p\n", ip->i_xtrace); #endif From owner-xfs@oss.sgi.com Thu Aug 23 12:37:55 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 12:37:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, J_CHICKENPOX_66 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7NJbp4p002841 for ; Thu, 23 Aug 2007 12:37:54 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7NJboA5008491 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 23 Aug 2007 21:37:50 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7NJboLG008489 for xfs@oss.sgi.com; Thu, 23 Aug 2007 21:37:50 +0200 Date: Thu, 23 Aug 2007 21:37:50 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 3/17] kill v_vfsp member from struct bhv_vnode Message-ID: <20070823193750.GD8050@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-archive-position: 12609 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 We can easily get at the vfsp through the super_block but it will soon be gone anyway. 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 2007-08-23 19:00:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2007-08-23 19:03:03.000000000 +0200 @@ -236,10 +236,10 @@ xfs_vm_nopage( int *type) { struct inode *inode = area->vm_file->f_path.dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); + bhv_vfs_t *vfsp = vfs_from_sb(inode->i_sb); - ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI); - if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0)) + ASSERT_ALWAYS(vfsp->vfs_flag & VFS_DMI); + if (XFS_SEND_MMAP(XFS_VFSTOM(vfsp), area, 0)) return NULL; return filemap_nopage(area, address, type); } @@ -285,7 +285,7 @@ xfs_file_mmap( vma->vm_ops = &xfs_file_vm_ops; #ifdef HAVE_DMAPI - if (vn_from_inode(filp->f_path.dentry->d_inode)->v_vfsp->vfs_flag & VFS_DMI) + if (vfs_from_sb(filp->f_path.dentry->d_inode->i_sb)->vfs_flag & VFS_DMI) vma->vm_ops = &xfs_dmapi_file_vm_ops; #endif /* HAVE_DMAPI */ @@ -344,16 +344,14 @@ xfs_vm_mprotect( struct vm_area_struct *vma, unsigned int newflags) { - bhv_vnode_t *vp = vn_from_inode(vma->vm_file->f_path.dentry->d_inode); + struct inode *inode = vma->vm_file->f_path.dentry->d_inode; + bhv_vfs_t *vfsp = vfs_from_sb(inode->i_sb); int error = 0; - if (vp->v_vfsp->vfs_flag & VFS_DMI) { + if (vfsp->vfs_flag & VFS_DMI) { if ((vma->vm_flags & VM_MAYSHARE) && - (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE)) { - xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); - - error = XFS_SEND_MMAP(mp, vma, VM_WRITE); - } + (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE)) + error = XFS_SEND_MMAP(XFS_VFSTOM(vfsp), vma, VM_WRITE); } return error; } @@ -370,18 +368,17 @@ STATIC int xfs_file_open_exec( struct inode *inode) { - bhv_vnode_t *vp = vn_from_inode(inode); + bhv_vfs_t *vfsp = vfs_from_sb(inode->i_sb); - if (unlikely(vp->v_vfsp->vfs_flag & VFS_DMI)) { - xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); - xfs_inode_t *ip = xfs_vtoi(vp); - - if (!ip) - return -EINVAL; - if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) - return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, - 0, 0, 0, NULL); + if (unlikely(vfsp->vfs_flag & VFS_DMI)) { + if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) { + bhv_vnode_t *vp = vn_from_inode(inode); + + return -XFS_SEND_DATA(XFS_VFSTOM(vfsp), DM_EVENT_READ, + vp, 0, 0, 0, NULL); + } } + return 0; } #endif /* HAVE_FOP_OPEN_EXEC */ Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2007-08-23 19:03:03.000000000 +0200 @@ -372,6 +372,7 @@ xfs_acl_allow_set( bhv_vnode_t *vp, int kind) { + xfs_inode_t *ip = xfs_vtoi(vp); bhv_vattr_t va; int error; @@ -379,10 +380,10 @@ xfs_acl_allow_set( return EPERM; if (kind == _ACL_TYPE_DEFAULT && !VN_ISDIR(vp)) return ENOTDIR; - if (vp->v_vfsp->vfs_flag & VFS_RDONLY) + if (vp->v_inode.i_sb->s_flags & MS_RDONLY) return EROFS; va.va_mask = XFS_AT_UID; - error = xfs_getattr(xfs_vtoi(vp), &va, 0); + error = xfs_getattr(ip, &va, 0); if (error) return error; if (va.va_uid != current->fsuid && !capable(CAP_FOWNER)) Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2007-08-23 19:03:03.000000000 +0200 @@ -1154,7 +1154,7 @@ xfs_ialloc( if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1)) xfs_bump_ino_vers2(tp, ip); - if (pip && XFS_INHERIT_GID(pip, vp->v_vfsp)) { + if (pip && XFS_INHERIT_GID(pip, XFS_MTOVFS(pip->i_mount))) { ip->i_d.di_gid = pip->i_d.di_gid; if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) { ip->i_d.di_mode |= S_ISGID; Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-08-23 19:03:03.000000000 +0200 @@ -230,7 +230,7 @@ xfs_setattr( vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); - if (vp->v_vfsp->vfs_flag & VFS_RDONLY) + if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) return XFS_ERROR(EROFS); /* @@ -1512,7 +1512,7 @@ xfs_release( return 0; /* If this is a read-only mount, don't do this (would generate I/O) */ - if (vp->v_vfsp->vfs_flag & VFS_RDONLY) + if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) return 0; if (!XFS_FORCED_SHUTDOWN(mp)) { @@ -1618,7 +1618,7 @@ xfs_inactive( error = 0; /* If this is a read-only mount, don't do this (would generate I/O) */ - if (vp->v_vfsp->vfs_flag & VFS_RDONLY) + if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) goto out; if (ip->i_d.di_nlink != 0) { Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2007-08-23 19:03:03.000000000 +0200 @@ -1804,8 +1804,7 @@ static void printvnode(bhv_vnode_t *vp, kdb_printf(" v_trace 0x%p\n", vp->v_trace); #endif /* XFS_VNODE_TRACE */ - kdb_printf(" v_vfsp 0x%p v_number 0x%llx\n", - vp->v_vfsp, (unsigned long long)vp->v_number); + kdb_printf(" v_number 0x%llx\n", (unsigned long long)vp->v_number); } static int kdbm_vnode( Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-08-23 19:06:12.000000000 +0200 @@ -1452,7 +1452,7 @@ xfs_dm_get_bulkall_rvp( int nelems; u_int statstruct_sz; dm_attrloc_t loc; - bhv_vnode_t *vp = vn_from_inode(inode); + xfs_mount_t *mp = XFS_I(inode)->i_mount; dm_attrname_t attrname; dm_bulkstat_one_t dmb; @@ -1501,8 +1501,8 @@ xfs_dm_get_bulkall_rvp( */ dmb.laststruct = NULL; - memcpy(&dmb.fsid, vp->v_vfsp->vfs_altfsid, sizeof(dm_fsid_t)); - error = xfs_bulkstat(xfs_vfstom(vp->v_vfsp), (xfs_ino_t *)&loc, &nelems, + memcpy(&dmb.fsid, XFS_MTOVFS(mp)->vfs_altfsid, sizeof(dm_fsid_t)); + error = xfs_bulkstat(mp, (xfs_ino_t *)&loc, &nelems, xfs_dm_bulkall_one, (void*)&dmb, statstruct_sz, bufp, BULKSTAT_FG_INLINE, &done); if (error) @@ -1566,7 +1566,7 @@ xfs_dm_get_bulkattr_rvp( int nelems; u_int statstruct_sz; dm_attrloc_t loc; - bhv_vnode_t *vp = vn_from_inode(inode); + xfs_mount_t *mp = XFS_I(inode)->i_mount; dm_bulkstat_one_t dmb; /* Returns negative errors to DMAPI */ @@ -1597,8 +1597,8 @@ xfs_dm_get_bulkattr_rvp( } dmb.laststruct = NULL; - memcpy(&dmb.fsid, vp->v_vfsp->vfs_altfsid, sizeof(dm_fsid_t)); - error = xfs_bulkstat(xfs_vfstom(vp->v_vfsp), (xfs_ino_t *)&loc, &nelems, + memcpy(&dmb.fsid, XFS_MTOVFS(mp)->vfs_altfsid, sizeof(dm_fsid_t)); + error = xfs_bulkstat(mp, (xfs_ino_t *)&loc, &nelems, xfs_dm_bulkattr_one, (void*)&dmb, statstruct_sz, bufp, BULKSTAT_FG_INLINE, &done); if (error) @@ -1925,9 +1925,8 @@ xfs_dm_get_dirattrs_rvp( size_t __user *rlenp, int *rvp) { - bhv_vnode_t *vp = vn_from_inode(inode); - xfs_inode_t *dp = xfs_vtoi(vp); - xfs_mount_t *mp = xfs_vfstom(vp->v_vfsp); + xfs_inode_t *dp = XFS_I(inode); + xfs_mount_t *mp = dp->i_mount; dm_readdir_cb_t *cb; dm_attrloc_t loc; int error; @@ -3198,11 +3197,12 @@ xfs_dm_send_mmap_event( if (!vma->vm_file) return 0; + ip = XFS_I(vma->vm_file->f_dentry->d_inode); vp = vn_from_inode(vma->vm_file->f_dentry->d_inode); ASSERT(vp); if (!S_ISREG(vma->vm_file->f_dentry->d_inode->i_mode) || - !(vp->v_vfsp->vfs_flag & VFS_DMI)) + !(XFS_MTOVFS(ip->i_mount)->vfs_flag & VFS_DMI)) return 0; /* If they specifically asked for 'read', then give it to them. @@ -3220,8 +3220,6 @@ xfs_dm_send_mmap_event( return -EACCES; } - ip = xfs_vtoi(vp); - /* Figure out how much of the file is being requested by the user. */ offset = 0; /* beginning of file, for now */ length = 0; /* whole file, for now */ Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm_fsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm_fsops.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm_fsops.c 2007-08-23 19:03:03.000000000 +0200 @@ -89,20 +89,21 @@ xfs_dm_inode_to_fh( dm_fid_t *dmfid, dm_fsid_t *dmfsid) { - bhv_vnode_t *vp = vn_from_inode(inode); - int error; - fid_t fid; + xfs_inode_t *ip = XFS_I(inode); + bhv_vfs_t *vfsp = XFS_MTOVFS(ip->i_mount); + int error; + fid_t fid; /* Returns negative errors to DMAPI */ - if (vp->v_vfsp->vfs_altfsid == NULL) + if (vfsp->vfs_altfsid == NULL) return -EINVAL; - error = xfs_fid2(XFS_I(inode), &fid); + error = xfs_fid2(ip, &fid); if (error) return -error; /* Return negative error to DMAPI */ memcpy(dmfid, &fid, sizeof(*dmfid)); - memcpy(dmfsid, vp->v_vfsp->vfs_altfsid, sizeof(*dmfsid)); + memcpy(dmfsid, vfsp->vfs_altfsid, sizeof(*dmfsid)); return 0; } 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 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2007-08-23 19:03:03.000000000 +0200 @@ -138,7 +138,8 @@ xfs_find_handle( vp = vn_from_inode(inode); /* now we can grab the fsid */ - memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t)); + memcpy(&handle.ha_fsid, XFS_MTOVFS(XFS_I(inode)->i_mount)->vfs_altfsid, + sizeof(xfs_fsid_t)); hsize = sizeof(xfs_fsid_t); if (cmd != XFS_IOC_PATH_TO_FSHANDLE) { Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-23 19:03:03.000000000 +0200 @@ -678,7 +678,7 @@ xfs_write( io = &xip->i_iocore; mp = io->io_mount; - vfs_wait_for_freeze(vp->v_vfsp, SB_FREEZE_WRITE); + vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_WRITE); if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; 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 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2007-08-23 19:03:03.000000000 +0200 @@ -210,7 +210,6 @@ xfs_initialize_vnode( struct inode *inode = vn_to_inode(vp); if (!ip->i_vnode) { - vp->v_vfsp = bhvtovfs(bdp); ip->i_vnode = vp; inode->i_private = ip; } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2007-08-23 19:03:03.000000000 +0200 @@ -69,8 +69,10 @@ vn_ioerror( char *f, int l) { + bhv_vfs_t *vfsp = vfs_from_sb(vp->v_inode.i_sb); + if (unlikely(error == -ENODEV)) - bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l); + bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l); } bhv_vnode_t * Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-23 18:58:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2007-08-23 19:03:03.000000000 +0200 @@ -35,11 +35,10 @@ typedef enum bhv_vflags { /* * MP locking protocols: - * v_flag, v_vfsp VN_LOCK/VN_UNLOCK + * v_flag, VN_LOCK/VN_UNLOCK */ typedef struct bhv_vnode { bhv_vflags_t v_flag; /* vnode flags (see above) */ - bhv_vfs_t *v_vfsp; /* ptr to containing VFS */ bhv_vnumber_t v_number; /* in-core vnode number */ spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ atomic_t v_iocount; /* outstanding I/O count */ From owner-xfs@oss.sgi.com Thu Aug 23 12:37:37 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 23 Aug 2007 12:37:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.0-pre1-r499012 (2007-01-23) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_31, J_CHICKENPOX_32,J_CHICKENPOX_82 autolearn=no version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7NJbW4p002653 for ; Thu, 23 Aug 2007 12:37:35 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l7NJbQA5008460 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 23 Aug 2007 21:37:27 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l7NJbQY8008458 for xfs@oss.sgi.com; Thu, 23 Aug 2007 21:37:26 +0200 Date: Thu, 23 Aug 2007 21:37:26 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Subject: [PATCH 2/17] call common xfs vnode-level helpers directly and remove vnode operations Message-ID: <20070823193726.GC8050@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-archive-position: 12608 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 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 2007-08-23 18:52:50.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2007-08-23 19:00:43.000000000 +0200 @@ -37,6 +37,7 @@ #include "xfs_error.h" #include "xfs_rw.h" #include "xfs_ioctl32.h" +#include "xfs_vnodeops.h" #include #include @@ -55,13 +56,12 @@ __xfs_file_read( loff_t pos) { struct file *file = iocb->ki_filp; - bhv_vnode_t *vp = vn_from_inode(file->f_path.dentry->d_inode); BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) ioflags |= IO_ISDIRECT; - return bhv_vop_read(vp, iocb, iov, nr_segs, &iocb->ki_pos, - ioflags, NULL); + return xfs_read(XFS_I(file->f_path.dentry->d_inode), iocb, iov, + nr_segs, &iocb->ki_pos, ioflags); } STATIC ssize_t @@ -93,14 +93,12 @@ __xfs_file_write( loff_t pos) { struct file *file = iocb->ki_filp; - struct inode *inode = file->f_mapping->host; - bhv_vnode_t *vp = vn_from_inode(inode); BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) ioflags |= IO_ISDIRECT; - return bhv_vop_write(vp, iocb, iov, nr_segs, &iocb->ki_pos, - ioflags, NULL); + return xfs_write(XFS_I(file->f_mapping->host), iocb, iov, nr_segs, + &iocb->ki_pos, ioflags); } STATIC ssize_t @@ -131,8 +129,8 @@ xfs_file_sendfile( read_actor_t actor, void *target) { - return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode), - filp, pos, 0, count, actor, target, NULL); + return xfs_sendfile(XFS_I(filp->f_path.dentry->d_inode), + filp, pos, 0, count, actor, target); } STATIC ssize_t @@ -143,8 +141,8 @@ xfs_file_sendfile_invis( read_actor_t actor, void *target) { - return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode), - filp, pos, IO_INVIS, count, actor, target, NULL); + return xfs_sendfile(XFS_I(filp->f_path.dentry->d_inode), + filp, pos, IO_INVIS, count, actor, target); } STATIC ssize_t @@ -155,8 +153,8 @@ xfs_file_splice_read( size_t len, unsigned int flags) { - return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode), - infilp, ppos, pipe, len, flags, 0, NULL); + return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode), + infilp, ppos, pipe, len, flags, 0); } STATIC ssize_t @@ -167,9 +165,8 @@ xfs_file_splice_read_invis( size_t len, unsigned int flags) { - return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode), - infilp, ppos, pipe, len, flags, IO_INVIS, - NULL); + return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode), + infilp, ppos, pipe, len, flags, IO_INVIS); } STATIC ssize_t @@ -180,8 +177,8 @@ xfs_file_splice_write( size_t len, unsigned int flags) { - return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode), - pipe, outfilp, ppos, len, flags, 0, NULL); + return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode), + pipe, outfilp, ppos, len, flags, 0); } STATIC ssize_t @@ -192,9 +189,8 @@ xfs_file_splice_write_invis( size_t len, unsigned int flags) { - return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode), - pipe, outfilp, ppos, len, flags, IO_INVIS, - NULL); + return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode), + pipe, outfilp, ppos, len, flags, IO_INVIS); } STATIC int @@ -204,7 +200,7 @@ xfs_file_open( { if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) return -EFBIG; - return -bhv_vop_open(vn_from_inode(inode), NULL); + return -xfs_open(XFS_I(inode)); } STATIC int @@ -212,11 +208,7 @@ xfs_file_release( struct inode *inode, struct file *filp) { - bhv_vnode_t *vp = vn_from_inode(inode); - - if (vp) - return -bhv_vop_release(vp); - return 0; + return -xfs_release(XFS_I(inode)); } STATIC int @@ -232,7 +224,8 @@ xfs_file_fsync( flags |= FSYNC_DATA; if (VN_TRUNC(vp)) VUNTRUNCATE(vp); - return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1); + return -xfs_fsync(XFS_I(dentry->d_inode), flags, + (xfs_off_t)0, (xfs_off_t)-1); } #ifdef HAVE_DMAPI @@ -259,7 +252,7 @@ xfs_file_readdir( filldir_t filldir) { struct inode *inode = filp->f_path.dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); + xfs_inode_t *ip = XFS_I(inode); int error; size_t bufsize; @@ -277,7 +270,7 @@ xfs_file_readdir( */ bufsize = (size_t)min_t(loff_t, PAGE_SIZE, inode->i_size); - error = bhv_vop_readdir(vp, dirent, bufsize, + error = xfs_readdir(ip, dirent, bufsize, (xfs_off_t *)&filp->f_pos, filldir); if (error) return -error; @@ -310,7 +303,7 @@ xfs_file_ioctl( struct inode *inode = filp->f_path.dentry->d_inode; bhv_vnode_t *vp = vn_from_inode(inode); - error = bhv_vop_ioctl(vp, inode, filp, 0, cmd, (void __user *)p); + error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); VMODIFY(vp); /* NOTE: some of the ioctl's return positive #'s as a @@ -332,7 +325,7 @@ xfs_file_ioctl_invis( struct inode *inode = filp->f_path.dentry->d_inode; bhv_vnode_t *vp = vn_from_inode(inode); - error = bhv_vop_ioctl(vp, inode, filp, IO_INVIS, cmd, (void __user *)p); + error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); VMODIFY(vp); /* NOTE: some of the ioctl's return positive #'s as a 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 2007-08-23 18:52:50.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2007-08-23 18:58:43.000000000 +0200 @@ -46,6 +46,7 @@ #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_utils.h" +#include "xfs_vnodeops.h" #include #include @@ -53,22 +54,6 @@ #include /* - * Get a XFS inode from a given vnode. - */ -xfs_inode_t * -xfs_vtoi( - bhv_vnode_t *vp) -{ - bhv_desc_t *bdp; - - bdp = bhv_lookup_range(VN_BHV_HEAD(vp), - VNODE_POSITION_XFS, VNODE_POSITION_XFS); - if (unlikely(bdp == NULL)) - return NULL; - return XFS_BHVTOI(bdp); -} - -/* * Bring the atime in the XFS inode uptodate. * Used before logging the inode to disk or when the Linux inode goes away. */ @@ -199,7 +184,7 @@ xfs_validate_fields( bhv_vattr_t *vattr) { vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; - if (!bhv_vop_getattr(vn_from_inode(ip), vattr, ATTR_LAZY, NULL)) { + if (!xfs_getattr(XFS_I(ip), vattr, ATTR_LAZY)) { ip->i_nlink = vattr->va_nlink; ip->i_blocks = vattr->va_nblocks; @@ -233,7 +218,8 @@ xfs_init_security( return -error; } - error = bhv_vop_attr_set(vp, name, value, length, ATTR_SECURE, NULL); + error = xfs_attr_set(XFS_I(ip), name, value, + length, ATTR_SECURE); if (!error) VMODIFY(vp); @@ -256,7 +242,7 @@ xfs_has_fs_struct(struct task_struct *ta STATIC void xfs_cleanup_inode( - bhv_vnode_t *dvp, + struct inode *dir, bhv_vnode_t *vp, struct dentry *dentry, int mode) @@ -272,9 +258,9 @@ xfs_cleanup_inode( teardown.d_name = dentry->d_name; if (S_ISDIR(mode)) - bhv_vop_rmdir(dvp, &teardown, NULL); + xfs_rmdir(XFS_I(dir), &teardown); else - bhv_vop_remove(dvp, &teardown, NULL); + xfs_remove(XFS_I(dir), &teardown); VN_RELE(vp); } @@ -321,10 +307,10 @@ xfs_vn_mknod( vattr.va_mask |= XFS_AT_RDEV; /*FALLTHROUGH*/ case S_IFREG: - error = bhv_vop_create(dvp, dentry, &vattr, &vp, NULL); + error = xfs_create(XFS_I(dir), dentry, &vattr, &vp, NULL); break; case S_IFDIR: - error = bhv_vop_mkdir(dvp, dentry, &vattr, &vp, NULL); + error = xfs_mkdir(XFS_I(dir), dentry, &vattr, &vp, NULL); break; default: error = EINVAL; @@ -334,7 +320,7 @@ xfs_vn_mknod( if (unlikely(!error)) { error = xfs_init_security(vp, dir); if (error) - xfs_cleanup_inode(dvp, vp, dentry, mode); + xfs_cleanup_inode(dir, vp, dentry, mode); } if (unlikely(default_acl)) { @@ -343,7 +329,7 @@ xfs_vn_mknod( if (!error) VMODIFY(vp); else - xfs_cleanup_inode(dvp, vp, dentry, mode); + xfs_cleanup_inode(dir, vp, dentry, mode); } _ACL_FREE(default_acl); } @@ -387,13 +373,13 @@ xfs_vn_lookup( struct dentry *dentry, struct nameidata *nd) { - bhv_vnode_t *vp = vn_from_inode(dir), *cvp; + bhv_vnode_t *cvp; int error; if (dentry->d_name.len >= MAXNAMELEN) return ERR_PTR(-ENAMETOOLONG); - error = bhv_vop_lookup(vp, dentry, &cvp, 0, NULL, NULL); + error = xfs_lookup(XFS_I(dir), dentry, &cvp); if (unlikely(error)) { if (unlikely(error != ENOENT)) return ERR_PTR(-error); @@ -411,21 +397,19 @@ xfs_vn_link( struct dentry *dentry) { struct inode *ip; /* inode of guy being linked to */ - bhv_vnode_t *tdvp; /* target directory for new name/link */ bhv_vnode_t *vp; /* vp of name being linked */ bhv_vattr_t vattr; int error; ip = old_dentry->d_inode; /* inode being linked to */ - tdvp = vn_from_inode(dir); vp = vn_from_inode(ip); VN_HOLD(vp); - error = bhv_vop_link(tdvp, vp, dentry, NULL); + error = xfs_link(XFS_I(dir), vp, dentry); if (unlikely(error)) { VN_RELE(vp); } else { - VMODIFY(tdvp); + VMODIFY(vn_from_inode(dir)); xfs_validate_fields(ip, &vattr); d_instantiate(dentry, ip); } @@ -438,14 +422,12 @@ xfs_vn_unlink( struct dentry *dentry) { struct inode *inode; - bhv_vnode_t *dvp; /* directory containing name to remove */ bhv_vattr_t vattr; int error; inode = dentry->d_inode; - dvp = vn_from_inode(dir); - error = bhv_vop_remove(dvp, dentry, NULL); + error = xfs_remove(XFS_I(dir), dentry); if (likely(!error)) { xfs_validate_fields(dir, &vattr); /* size needs update */ xfs_validate_fields(inode, &vattr); @@ -461,18 +443,17 @@ xfs_vn_symlink( { struct inode *ip; bhv_vattr_t va = { 0 }; - bhv_vnode_t *dvp; /* directory containing name of symlink */ bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */ int error; - dvp = vn_from_inode(dir); cvp = NULL; va.va_mode = S_IFLNK | (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); va.va_mask = XFS_AT_TYPE|XFS_AT_MODE; - error = bhv_vop_symlink(dvp, dentry, &va, (char *)symname, &cvp, NULL); + error = xfs_symlink(XFS_I(dir), dentry, &va, + (char *)symname, &cvp, NULL); if (likely(!error && cvp)) { error = xfs_init_security(cvp, dir); if (likely(!error)) { @@ -481,7 +462,7 @@ xfs_vn_symlink( xfs_validate_fields(dir, &va); xfs_validate_fields(ip, &va); } else { - xfs_cleanup_inode(dvp, cvp, dentry, 0); + xfs_cleanup_inode(dir, cvp, dentry, 0); } } return -error; @@ -493,11 +474,10 @@ xfs_vn_rmdir( struct dentry *dentry) { struct inode *inode = dentry->d_inode; - bhv_vnode_t *dvp = vn_from_inode(dir); bhv_vattr_t vattr; int error; - error = bhv_vop_rmdir(dvp, dentry, NULL); + error = xfs_rmdir(XFS_I(dir), dentry); if (likely(!error)) { xfs_validate_fields(inode, &vattr); xfs_validate_fields(dir, &vattr); @@ -513,15 +493,13 @@ xfs_vn_rename( struct dentry *ndentry) { struct inode *new_inode = ndentry->d_inode; - bhv_vnode_t *fvp; /* from directory */ bhv_vnode_t *tvp; /* target directory */ bhv_vattr_t vattr; int error; - fvp = vn_from_inode(odir); tvp = vn_from_inode(ndir); - error = bhv_vop_rename(fvp, odentry, tvp, ndentry, NULL); + error = xfs_rename(XFS_I(odir), odentry, tvp, ndentry); if (likely(!error)) { if (new_inode) xfs_validate_fields(new_inode, &vattr); @@ -542,7 +520,6 @@ xfs_vn_follow_link( struct dentry *dentry, struct nameidata *nd) { - bhv_vnode_t *vp = vn_from_inode(dentry->d_inode); char *link; int error = -ENOMEM; @@ -550,7 +527,7 @@ xfs_vn_follow_link( if (!link) goto out_err; - error = -bhv_vop_readlink(vp, link); + error = -xfs_readlink(XFS_I(dentry->d_inode), link); if (unlikely(error)) goto out_kfree; @@ -583,7 +560,7 @@ xfs_vn_permission( int mode, struct nameidata *nd) { - return -bhv_vop_access(vn_from_inode(inode), mode << 6, NULL); + return -xfs_access(XFS_I(inode), mode << 6, NULL); } #else #define xfs_vn_permission NULL @@ -596,11 +573,10 @@ xfs_vn_getattr( struct kstat *stat) { struct inode *inode = dentry->d_inode; - bhv_vnode_t *vp = vn_from_inode(inode); bhv_vattr_t vattr = { .va_mask = XFS_AT_STAT }; int error; - error = bhv_vop_getattr(vp, &vattr, ATTR_LAZY, NULL); + error = xfs_getattr(XFS_I(inode), &vattr, ATTR_LAZY); if (likely(!error)) { stat->size = i_size_read(inode); stat->dev = inode->i_sb->s_dev; @@ -628,7 +604,6 @@ xfs_vn_setattr( { struct inode *inode = dentry->d_inode; unsigned int ia_valid = attr->ia_valid; - bhv_vnode_t *vp = vn_from_inode(inode); bhv_vattr_t vattr = { 0 }; int flags = 0; int error; @@ -672,9 +647,9 @@ xfs_vn_setattr( flags |= ATTR_NONBLOCK; #endif - error = bhv_vop_setattr(vp, &vattr, flags, NULL); + error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL); if (likely(!error)) - __vn_revalidate(vp, &vattr); + __vn_revalidate(vn_from_inode(inode), &vattr); return -error; } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2007-08-23 18:58:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2007-08-23 18:58:43.000000000 +0200 @@ -31,4 +31,10 @@ struct xfs_inode; extern void xfs_ichgtime(struct xfs_inode *, int); extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); +#define xfs_vtoi(vp) \ + ((struct xfs_inode *)vn_to_inode(vp)->i_private) + +#define XFS_I(inode) \ + ((struct xfs_inode *)(inode)->i_private) + #endif /* __XFS_IOPS_H__ */ 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 2007-08-23 18:58:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2007-08-23 18:58:43.000000000 +0200 @@ -413,7 +413,7 @@ xfs_readlink_by_handle( if (!link) goto out_iput; - error = -bhv_vop_readlink(vp, link); + error = -xfs_readlink(XFS_I(inode), link); if (error) goto out_kfree; error = do_readlink(hreq.ohandle, olen, link); @@ -497,8 +497,8 @@ xfs_attrlist_by_handle( goto out_vn_rele; cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; - error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags, - cursor, NULL); + error = xfs_attr_list(XFS_I(inode), kbuf, al_hreq.buflen, + al_hreq.flags, cursor); if (error) goto out_kfree; @@ -515,7 +515,7 @@ xfs_attrlist_by_handle( STATIC int xfs_attrmulti_attr_get( - bhv_vnode_t *vp, + struct inode *inode, char *name, char __user *ubuf, __uint32_t *len, @@ -530,7 +530,7 @@ xfs_attrmulti_attr_get( if (!kbuf) return ENOMEM; - error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL); + error = xfs_attr_get(XFS_I(inode), name, kbuf, len, flags, NULL); if (error) goto out_kfree; @@ -544,7 +544,7 @@ xfs_attrmulti_attr_get( STATIC int xfs_attrmulti_attr_set( - bhv_vnode_t *vp, + struct inode *inode, char *name, const char __user *ubuf, __uint32_t len, @@ -553,9 +553,9 @@ xfs_attrmulti_attr_set( char *kbuf; int error = EFAULT; - if (IS_RDONLY(&vp->v_inode)) + if (IS_RDONLY(inode)) return -EROFS; - if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) + if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) return EPERM; if (len > XATTR_SIZE_MAX) return EINVAL; @@ -567,7 +567,7 @@ xfs_attrmulti_attr_set( if (copy_from_user(kbuf, ubuf, len)) goto out_kfree; - error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL); + error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags); out_kfree: kfree(kbuf); @@ -576,15 +576,15 @@ xfs_attrmulti_attr_set( STATIC int xfs_attrmulti_attr_remove( - bhv_vnode_t *vp, + struct inode *inode, char *name, __uint32_t flags) { - if (IS_RDONLY(&vp->v_inode)) + if (IS_RDONLY(inode)) return -EROFS; - if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) + if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) return EPERM; - return bhv_vop_attr_remove(vp, name, flags, NULL); + return xfs_attr_remove(XFS_I(inode), name, flags); } STATIC int @@ -640,17 +640,17 @@ xfs_attrmulti_by_handle( switch (ops[i].am_opcode) { case ATTR_OP_GET: - ops[i].am_error = xfs_attrmulti_attr_get(vp, + ops[i].am_error = xfs_attrmulti_attr_get(inode, attr_name, ops[i].am_attrvalue, &ops[i].am_length, ops[i].am_flags); break; case ATTR_OP_SET: - ops[i].am_error = xfs_attrmulti_attr_set(vp, + ops[i].am_error = xfs_attrmulti_attr_set(inode, attr_name, ops[i].am_attrvalue, ops[i].am_length, ops[i].am_flags); break; case ATTR_OP_REMOVE: - ops[i].am_error = xfs_attrmulti_attr_remove(vp, + ops[i].am_error = xfs_attrmulti_attr_remove(inode, attr_name, ops[i].am_flags); break; default: @@ -1182,7 +1182,7 @@ xfs_ioc_xattr( case XFS_IOC_FSGETXATTR: { vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ XFS_AT_NEXTENTS | XFS_AT_PROJID; - error = bhv_vop_getattr(vp, vattr, 0, NULL); + error = xfs_getattr(ip, vattr, 0); if (unlikely(error)) { error = -error; break; @@ -1215,7 +1215,7 @@ xfs_ioc_xattr( vattr->va_extsize = fa.fsx_extsize; vattr->va_projid = fa.fsx_projid; - error = bhv_vop_setattr(vp, vattr, attr_flags, NULL); + error = xfs_setattr(ip, vattr, attr_flags, NULL); if (likely(!error)) __vn_revalidate(vp, vattr); /* update flags */ error = -error; @@ -1225,7 +1225,7 @@ xfs_ioc_xattr( case XFS_IOC_FSGETXATTRA: { vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ XFS_AT_ANEXTENTS | XFS_AT_PROJID; - error = bhv_vop_getattr(vp, vattr, 0, NULL); + error = xfs_getattr(ip, vattr, 0); if (unlikely(error)) { error = -error; break; @@ -1271,7 +1271,7 @@ xfs_ioc_xattr( vattr->va_xflags = xfs_merge_ioc_xflags(flags, xfs_ip2xflags(ip)); - error = bhv_vop_setattr(vp, vattr, attr_flags, NULL); + error = xfs_setattr(ip, vattr, attr_flags, NULL); if (likely(!error)) __vn_revalidate(vp, vattr); /* update flags */ error = -error; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2007-08-23 16:57:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2007-08-23 18:58:43.000000000 +0200 @@ -37,6 +37,7 @@ #include "xfs_error.h" #include "xfs_rw.h" #include "xfs_iomap.h" +#include "xfs_vnodeops.h" #include #include #include @@ -231,7 +232,8 @@ xfs_end_bio_unwritten( size_t size = ioend->io_size; if (likely(!ioend->io_error)) { - bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL); + xfs_bmap(xfs_vtoi(vp), offset, size, + BMAPI_UNWRITTEN, NULL, NULL); xfs_setfilesize(ioend); } xfs_destroy_ioend(ioend); @@ -304,7 +306,8 @@ xfs_map_blocks( bhv_vnode_t *vp = vn_from_inode(inode); int error, nmaps = 1; - error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps); + error = xfs_bmap(xfs_vtoi(vp), offset, count, + flags, mapp, &nmaps); if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) VMODIFY(vp); return -error; @@ -1322,7 +1325,6 @@ __xfs_get_blocks( int direct, bmapi_flags_t flags) { - bhv_vnode_t *vp = vn_from_inode(inode); xfs_iomap_t iomap; xfs_off_t offset; ssize_t size; @@ -1332,7 +1334,7 @@ __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; - error = bhv_vop_bmap(vp, offset, size, + error = xfs_bmap(XFS_I(inode), offset, size, create ? flags : BMAPI_READ, &iomap, &niomap); if (error) return -error; @@ -1480,13 +1482,13 @@ xfs_vm_direct_IO( { struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; - bhv_vnode_t *vp = vn_from_inode(inode); xfs_iomap_t iomap; int maps = 1; int error; ssize_t ret; - error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps); + error = xfs_bmap(XFS_I(inode), offset, 0, + BMAPI_DEVICE, &iomap, &maps); if (error) return -error; @@ -1527,12 +1529,13 @@ xfs_vm_bmap( sector_t block) { struct inode *inode = (struct inode *)mapping->host; - bhv_vnode_t *vp = vn_from_inode(inode); + struct xfs_inode *ip = XFS_I(inode); - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); - bhv_vop_rwlock(vp, VRWLOCK_READ); - bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF); - bhv_vop_rwunlock(vp, VRWLOCK_READ); + vn_trace_entry(vn_from_inode(inode), __FUNCTION__, + (inst_t *)__return_address); + xfs_rwlock(ip, VRWLOCK_READ); + xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); + xfs_rwunlock(ip, VRWLOCK_READ); return generic_block_bmap(mapping, block, xfs_get_blocks); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_export.c 2007-08-23 18:52:50.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c 2007-08-23 18:58:43.000000000 +0200 @@ -25,6 +25,9 @@ #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_export.h" +#include "xfs_vnodeops.h" +#include "xfs_bmap_btree.h" +#include "xfs_inode.h" static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, }; @@ -161,12 +164,11 @@ xfs_fs_get_parent( struct dentry *child) { int error; - bhv_vnode_t *vp, *cvp; + bhv_vnode_t *cvp; struct dentry *parent; cvp = NULL; - vp = vn_from_inode(child->d_inode); - error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL); + error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp); if (unlikely(error)) return ERR_PTR(-error); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2007-08-23 16:57:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2007-08-23 18:58:43.000000000 +0200 @@ -43,6 +43,7 @@ #include "xfs_itable.h" #include "xfs_error.h" #include "xfs_dfrag.h" +#include "xfs_vnodeops.h" #define _NATIVE_IOC(cmd, type) \ _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type)) @@ -443,7 +444,7 @@ xfs_compat_ioctl( case XFS_IOC_FSBULKSTAT_SINGLE_32: case XFS_IOC_FSINUMBERS_32: cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq); - return xfs_ioc_bulkstat_compat(XFS_BHVTOI(VNHEAD(vp))->i_mount, + return xfs_ioc_bulkstat_compat(XFS_I(inode)->i_mount, cmd, (void*)arg); case XFS_IOC_FD_TO_HANDLE_32: case XFS_IOC_PATH_TO_HANDLE_32: @@ -457,7 +458,7 @@ xfs_compat_ioctl( return -ENOIOCTLCMD; } - error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg); + error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); VMODIFY(vp); return error; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-23 18:58:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2007-08-23 18:58:43.000000000 +0200 @@ -257,8 +257,9 @@ xfs_read( if (unlikely(ioflags & IO_ISDIRECT)) { if (VN_CACHED(vp)) - ret = bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)), - -1, FI_REMAPF_LOCKED); + ret = xfs_flushinval_pages(ip, + ctooff(o