From michael.monnerie@is.it-management.at Tue Sep 1 02:19:48 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n817JSRe159400 for ; Tue, 1 Sep 2009 02:19:38 -0500 X-ASG-Debug-ID: 1251789592-136a02020000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 29DC6159ADB9 for ; Tue, 1 Sep 2009 00:19:55 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id 4ve91BzIwDGKCtyz for ; Tue, 01 Sep 2009 00:19:55 -0700 (PDT) Received: from mailsrv.i.zmi.at (h081217106033.dyn.cm.kabsi.at [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id 7F92D689 for ; Tue, 1 Sep 2009 09:19:18 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id A33C940015E for ; Tue, 1 Sep 2009 09:19:20 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: zero size file after power failure with kernel 2.6.30.5 Subject: Re: zero size file after power failure with kernel 2.6.30.5 Date: Tue, 1 Sep 2009 09:18:30 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: <200908292102.21710@zmi.at> <4A99A80C.9010307@sandeen.net> <19100.22644.149019.555685@tree.ty.sabi.co.uk> In-Reply-To: <19100.22644.149019.555685@tree.ty.sabi.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9961981.iA24zTgTkV"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200909010918.37886@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1251789618 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7799 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --nextPart9961981.iA24zTgTkV Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Dienstag 01 September 2009 Peter Grandi wrote: > Then 'mount' with '-o sync' [snip] Yes. I could also simply switch back to reiserfs, where I never had this=20 kind of issue, despite lots of crashes etc. I'm not here to blame the=20 devs, just wanted to report that this kind of problem still exists, and=20 maybe someone taps into the problem and can improve it. There was a similar problem with the change from ext3 to ext4, with a=20 big discussion. Ext4 has been improved, I don't know how good it is now. And I know lots of discussions whether the app or the kernel is wrong,=20 and whether you should fsync() after rename(). In ext4 they reorganized=20 the way metaupdates are done, maybe that can help xfs too. It seems kmail writes its config every 7 minutes, so it is vulnerable=20 for 3 seconds then. I've set vm.dirty_expire_centisecs =3D 1000 now to improve the situation a bit. mfg zmi =2D-=20 // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 --nextPart9961981.iA24zTgTkV Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAkqcys0ACgkQzhSR9xwSCbR90gCg79ZmRZA9/cM81r8aiofBvnCR gV8AmwXkwcpvitkkmsnBt4bPRh0jOioc =eA5E -----END PGP SIGNATURE----- --nextPart9961981.iA24zTgTkV-- From michael.monnerie@is.it-management.at Tue Sep 1 03:45:35 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n818jF6n163075 for ; Tue, 1 Sep 2009 03:45:25 -0500 X-ASG-Debug-ID: 1251794739-74e503110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A9FF4414FCA for ; Tue, 1 Sep 2009 01:45:40 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id HTYwyfvovIqwbhE6 for ; Tue, 01 Sep 2009 01:45:40 -0700 (PDT) Received: from mailsrv.i.zmi.at (h081217106033.dyn.cm.kabsi.at [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id BF0B96AD for ; Tue, 1 Sep 2009 10:45:30 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id 909F340015E for ; Tue, 1 Sep 2009 10:45:30 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: minor bug in xfsprogs-3.0.3 Subject: minor bug in xfsprogs-3.0.3 Date: Tue, 1 Sep 2009 10:44:44 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909011044.44938@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1251794765 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7803 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean # xfs_info -V Usage: xfs_info [-V] [-t mtab] mountpoint It should print the version, right? mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From pg_mh@sabi.co.UK Tue Sep 1 07:48:39 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81Cm9FY175068 for ; Tue, 1 Sep 2009 07:48:29 -0500 X-ASG-Debug-ID: 1251809340-6e6a00c90000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4F26E415FDF for ; Tue, 1 Sep 2009 05:49:00 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id wacgQQjMk1OfsaZY for ; Tue, 01 Sep 2009 05:49:00 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.63 #1) id 1MiSjY-0003eT-W4 for ; Tue, 01 Sep 2009 12:45:13 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19101.5976.387292.614270@tree.ty.sabi.co.uk> Date: Tue, 1 Sep 2009 12:45:12 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss In-Reply-To: References: <4A975A35.3060809@sandeen.net> <4A981133.6060009@sandeen.net> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta27) XEmacs Lucid (i686-redhat-linux) From: pg_xf2@xf2.to.sabi.co.UK (Peter Grandi) X-Disclaimer: This message contains only personal opinions X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1251809344 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7815 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean > [ ... ] such a harsh way. Harsh? That sounds way too harsh. :-) When you write to a mailing list asking for free help and support, it is rather rude to not have done some preliminary work, such as figuring out the characterisics of RAID5 in case of failure. It is also somewhat rude (but amazingly common) to make confused and partial reports, such as not checking and reporting what has actually failed. > Is this the habit of this mailing list? Depends -- some people here are XFS salesmen, in that their career and employability depend at least in part on widespread adoption of XFS, and on support from other kernel subsystem guys, who may be one day on an interview panel (the guild of Linux kernel hackers is a pretty small and closed world in practice). These are sell-side engineers, and they will be smooth and emollient even in the face of outrageously ridiculous stuff. Sell-side engineers just like sell-side stack analyst never issue anything as harsh as a "sell" recommendation. That's what I do myself when I am on the sell-side, to my coworkers and customers; they pay me to solve their problems, not to tell them they are idiots for creating those problems, and suffering fools gladly is pat of what I get paid for. But here I am on the buy-side; I am buying XFS (and the Linux block layer), not selling it. Not only that, I am providing unpaid opinions. Since I am here buying, and actually paying with my time, I can comment more openly than a someone with a sell-side POV, but still in a relatively soft way, about the merit of the issues I comment upon. > Apart from that, thank you for you help. But a soft but more open assessment of how outrageous some queries are is help too as it makes it easier to assess the gravity of the situation. The smooth, emollient sell-side people will let you dig your own grave. Just consider your statement below about "assume clean" that to me sounds very dangerous (big euphemism), and that did not elicit any warning from the sell-side: > Moreover, when a raid loses 2 devices, and the devices are still > ok, it is possible to reassemble the raid by assuming the > devices clean. Sure you can reassemble the RAID, but what do you mean by "still ok"? Have you read-tested those 2 drives? Have you tested the *other* 18 drives? How do you know none of the other 18 drives got damaged? Have you verified that only the host adapter electronics failed or whatever it was that made those 2 drives drop out? Why do you *need* to assume clean? If the 2 "lost" drives are really ok, you just resync the array. If you *need* to assume clean, it is likely that you have lost something like 5% of data in (every stripe and thus) most files and directories (and internal metadata) and will be replacing it with random bytes. That will very likely cause XFS problems (the least of the problems of course). > I understand that RAID5 is not the ideal solution for that > system, [ ... ] That we don't know for sure; I personaly very much dislike RAID5, but for throw-away mostly read-only data I have to concede that it seems appropriate. It is rather better than RAID6 in almost every reasonable situation. Still a 19+1 array sounds rather bizarre to say the least. Especially in a place where part of the everyday activity is earthquake simulation... > But apart from that, it is not as easy to backup 20 TB, Or to 'fsck' several TB as you also discovered. Anyhow my opinion is that the best way to backup large storage servers is another large storage server (or more than one). When I buy a hard drive I buy 3 backup drives for each "live" drive I use -- at *home*. > so we decided to set it as data storage leaving the > responsibilty of the backup to our users. I do not consider it > completely absurd. Not at all absurd -- if those users *really* accept that. But you are trying to recover the arrays instead of scratching them and restarting. That suggests to me that the users did not actually accept that. If the real agreement with the users is "you have to keep backups, but if something happens you will behave as if you cannot or don't want to restore them" it is quite different. > This is not the case for /Raid/md4, where apparently all devices > are there. That's not so clear. One problem with trying to provide some opinions on your issue and whether the filesystems are recoverable is that you haven't made clear what failed and how you tested each component of each array to make sure that what is still working is known (and talk of "assume clean" is very suspicious). I'd check *everything* because until then you don't know how much has been damaged where, as a major power issue may have affected *everything* even if only partially. When you wrote: > one half (5 TB) of the user directories on /dev/md4 have > disappeared. that seems to indicate some major filesystem metadata and data loss, and the idea of "assume clean" seems to me extremely dangerous. Also '/dev/md5' seems to have reported serious drive issues, so perhaps something bad happened to the '/dev/md4' drives too. That you have tried to run repair tools on a filesystem with an incomplete storage layer may have made things rather worse, so knowing *exactly* what has failed may help you a lot. From pg_mh@sabi.co.UK Tue Sep 1 07:48:48 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81CmI4r175077 for ; Tue, 1 Sep 2009 07:48:38 -0500 X-ASG-Debug-ID: 1251809344-6e6a00ca0000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AB388415FE9 for ; Tue, 1 Sep 2009 05:49:04 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id ZZuDEwsSwuArvu31 for ; Tue, 01 Sep 2009 05:49:04 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.63 #1) id 1MiQfO-000376-N7 for ; Tue, 01 Sep 2009 10:32:46 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19100.63566.98250.185404@tree.ty.sabi.co.uk> Date: Tue, 1 Sep 2009 10:32:46 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> X-ASG-Orig-Subj: Re: zero size file after power failure with kernel 2.6.30.5 Subject: Re: zero size file after power failure with kernel 2.6.30.5 In-Reply-To: <200909010918.37886@zmi.at> References: <200908292102.21710@zmi.at> <4A99A80C.9010307@sandeen.net> <19100.22644.149019.555685@tree.ty.sabi.co.uk> <200909010918.37886@zmi.at> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta27) XEmacs Lucid (i686-redhat-linux) From: pg_xf2@xf2.sabi.co.UK (Peter Grandi) X-Disclaimer: This message contains only personal opinions X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1251809350 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7815 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean [ ... ] >> Then 'mount' with '-o sync' [ ... ] > Yes. I could also simply switch back to reiserfs, where I > never had this kind of issue, despite lots of crashes etc. Other people have a very different impression. Like 'ext3' ReiserFS does ordered writes, but those don't necessarily help because of the colossal amount of buffering that happens anyhow nowadays. > [ ... ] maybe someone taps into the problem and can improve > it. It is foremost an application problem, and then a block layer problem. The first is unsolvable ("user space sucks") in our lifetimes, and the second depends on the goodwill of the proprietors of the relevant kernel subsystem. As to application design, XFS is targeted at heavily parallel workloads on large storage arrays; its design takes advantage of what API semantics permit to improve that use case, and relies on applications making use of those API semantics properly. If that and having good scalable performance at the same time requires having dual power supplies, redundant storage paths, and battery backup, that is the typical platform on which XFS is deployed. > There was a similar problem with the change from ext3 to ext4, > with a big discussion. Ext4 has been improved, Actually it has been made worse, to compensate for bad application and block layer behaviour. Red Hat with 'ext4' have been trying to imply that an in-place upgrade to an 'ext3' compatible filesystem can support every possible point on the spectrum. Well, it turned out that they cannot. So there have been motions towards supporting XFS in 5.4, to have a dual-filesystem strategy, which is what a large number of their important enterprise customers do anyhow. > [ ... ] In ext4 they reorganized the way metaupdates are done, > maybe that can help xfs too. But that makes performance worse in the large/paralell case. > [ ... ] It seems kmail writes its config every 7 minutes, so > it is vulnerable for 3 seconds then. That won't help that much. Apps and the block layer are really designed for older, gentler times. And never mind the clueless, moronic "optimization" of Linux block layer plugging/unplugging. Currently a single disk can write 100MB/s, memory sizes on many _laptops_ are 4GB with potentially 1-2GB or 10-20s of writes cached. On a server one can have RAIDs that can write at/s. If applications and the block layer are misbehaving, and '-o sync' is not used, even if one flushes cache every second, there can still be dozens of MB (on a laptop) to some GB (on a server) that get lost in that one second. The filesystem can try hard to ensure that metadata gets written nearly immediately, ensuring 'fsck'-consistency, but it cannot do that for data in any sensible way unless the application and the block layer do the right thing, so data persistency is at best elusive. > I've set vm.dirty_expire_centisecs = 1000 now to improve the > situation a bit. It does not help that not only the applications and the block layer are misdesigned, but they also misdesigned for a time where data rates were a lot lower, so outstanding updates were bounded a lot lower. There are workarounds and by careful patching and changing default settings one can palliate the worst situations; but for example 10 seconds of 'dirty_expire_centisecs' seems way too long (IIRC you have a fairly large memory and RAID) and other settings matter more. I have written quite a bit in my blog about these issues, and you may find this particular entry rather relevant: http://www.sabi.co.uk/blog/0707jul.html#070701 In general on a fast machine I would use: vm/dirty_ratio =4 vm/dirty_background_ratio =2 vm/dirty_expire_centisecs =400 vm/dirty_writeback_centisecs =200 or half of every one. Short flushing times also ensure more continuous flushing (without huge periodic gulps), which can significantly improve *write* performance for streaming applications (XFS etc. delayed allocation is designed to improve read performance despite the lack of preallocation). This cannot be done on laptops, where short flushing times are bad for power consumption, but at least they are battery backed, and hopefully SSDs will save us anyhow. From eflorac@intellique.com Tue Sep 1 09:20:16 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BRBL autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81EJuKv179894 for ; Tue, 1 Sep 2009 09:20:06 -0500 X-ASG-Debug-ID: 1251814782-322a013a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7E7504164FA for ; Tue, 1 Sep 2009 07:20:01 -0700 (PDT) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by cuda.sgi.com with ESMTP id 9I1GYpknkffHXbmB for ; Tue, 01 Sep 2009 07:20:01 -0700 (PDT) Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 1C8264B01D8 for ; Tue, 1 Sep 2009 16:19:05 +0200 (CEST) Received: from harpe.intellique.com (labo.djinux.com [82.225.196.72]) by smtp2-g21.free.fr (Postfix) with ESMTP id 2C0B24B0143 for ; Tue, 1 Sep 2009 16:19:02 +0200 (CEST) Date: Tue, 1 Sep 2009 16:19:06 +0200 From: Emmanuel Florac To: Linux XFS X-ASG-Orig-Subj: Re: zero size file after power failure with kernel 2.6.30.5 Subject: Re: zero size file after power failure with kernel 2.6.30.5 Message-ID: <20090901161906.0a4ca1d1@harpe.intellique.com> In-Reply-To: <19100.63566.98250.185404@tree.ty.sabi.co.uk> References: <200908292102.21710@zmi.at> <4A99A80C.9010307@sandeen.net> <19100.22644.149019.555685@tree.ty.sabi.co.uk> <200909010918.37886@zmi.at> <19100.63566.98250.185404@tree.ty.sabi.co.uk> Organization: Intellique X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.4; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: smtp2-g21.free.fr[212.27.42.2] X-Barracuda-Start-Time: 1251814852 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7822 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Le Tue, 1 Sep 2009 10:32:46 +0000 pg_xf2@xf2.sabi.co.UK (Peter Grandi) =E9crivait: > If that and having good scalable performance at the same time > requires having dual power supplies, redundant storage paths, > and battery backup, that is the typical platform on which XFS is > deployed. To mitigate this, I used systems with XFS daily for the last 13 years, (including IRIX workstations or PCs with only one drive) and had only once a problem clearly related to XFS (a well known bug, long corrected nowadays). --=20 ---------------------------------------- Emmanuel Florac | Intellique ---------------------------------------- From just.for.lkml@googlemail.com Tue Sep 1 11:59:45 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,HEADER_ESQ autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81GxP2G188445 for ; Tue, 1 Sep 2009 11:59:35 -0500 X-ASG-Debug-ID: 1251824410-4a3703820000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail-bw0-f216.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CC317159CCAE for ; Tue, 1 Sep 2009 10:00:11 -0700 (PDT) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by cuda.sgi.com with ESMTP id nR8z18Vrr54xdQlp for ; Tue, 01 Sep 2009 10:00:11 -0700 (PDT) Received: by bwz12 with SMTP id 12so134975bwz.20 for ; Tue, 01 Sep 2009 10:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=X4iTiJ/9yf/RnmXcsxWuABJK+RG2qQ6uUDeCOt8n98A=; b=VtBQWLYkOQOIauG80pyb/Qs1mARjFnjKPn0W44vXG/oOOOHTMFd4W3Tdf/B0CKwmVG N3mAn6beSQ19wwFPeUd8qXigSDPblxDNu+//Fzl+PcU2oYBFEs0pqp8Yaw0LxnWtv/q9 S2hZACgEu7NvJoZMqGS9eHu6oZaPa8sWBUhYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=KCes2ylM0V6xTWczlkfnnu43yuNhaZPolJE1iazHBZcqqNTDRYA/ByCbag4QfdK7i/ Xn6qADoWjbQYGb28ogkOxPaKuk+GxMfEhPqBmriNMbiYQCnwbLNFjyNPuoAuHxNBtMo/ 8r2BY7jsfs/q3We9FGVn/0vSMWfHJtvDZ9aDc= MIME-Version: 1.0 Received: by 10.223.6.23 with SMTP id 23mr2849976fax.89.1251824406221; Tue, 01 Sep 2009 10:00:06 -0700 (PDT) In-Reply-To: <20090831182754.GA3620@infradead.org> References: <4A9B759B.7020401@msgid.tls.msk.ru> <20090831123010.GA2368@infradead.org> <64bb37e0908311114t4a3cefc3v8ea5092e1558c578@mail.gmail.com> <20090831182754.GA3620@infradead.org> Date: Tue, 1 Sep 2009 19:00:05 +0200 Message-ID: <64bb37e0909011000l78a0aef0wf4c53252c14af75e@mail.gmail.com> X-ASG-Orig-Subj: Re: xfs compat_ioctl? Subject: Re: xfs compat_ioctl? From: Torsten Kaiser To: Christoph Hellwig Cc: Michael Tokarev , Linux-kernel , linux-fsdevel , xfs@oss.sgi.com Content-Type: text/plain; charset=ISO-8859-1 X-Barracuda-Connect: mail-bw0-f216.google.com[209.85.218.216] X-Barracuda-Start-Time: 1251824417 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7831 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Mon, Aug 31, 2009 at 8:27 PM, Christoph Hellwig wrote: > I think you are right, the constant used is incorrect. Does the small > patch below fix it for you? Yes, after adding this patch, xfs_fsr works. > Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c > =================================================================== > --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 > +++ linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 > @@ -619,7 +619,7 @@ xfs_file_compat_ioctl( > case XFS_IOC_GETVERSION_32: > cmd = _NATIVE_IOC(cmd, long); > return xfs_file_ioctl(filp, cmd, p); > - case XFS_IOC_SWAPEXT: { > + case XFS_IOC_SWAPEXT_32: { > struct xfs_swapext sxp; > struct compat_xfs_swapext __user *sxu = arg; > > From sandeen@sandeen.net Tue Sep 1 12:55:30 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81HtAQA197497 for ; Tue, 1 Sep 2009 12:55:20 -0500 X-ASG-Debug-ID: 1251827739-729301110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 317F315A10C5 for ; Tue, 1 Sep 2009 10:55:39 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id lsfdAjSuNmlgl5F0 for ; Tue, 01 Sep 2009 10:55:39 -0700 (PDT) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n81HtPTk003063; Tue, 1 Sep 2009 13:55:26 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n81HtNE2015956; Tue, 1 Sep 2009 13:55:25 -0400 Message-ID: <4A9D600B.4020405@sandeen.net> Date: Tue, 01 Sep 2009 12:55:23 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Torsten Kaiser CC: Christoph Hellwig , linux-fsdevel , Michael Tokarev , Linux-kernel , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs compat_ioctl? Subject: Re: xfs compat_ioctl? References: <4A9B759B.7020401@msgid.tls.msk.ru> <20090831123010.GA2368@infradead.org> <64bb37e0908311114t4a3cefc3v8ea5092e1558c578@mail.gmail.com> <20090831182754.GA3620@infradead.org> <64bb37e0909011000l78a0aef0wf4c53252c14af75e@mail.gmail.com> In-Reply-To: <64bb37e0909011000l78a0aef0wf4c53252c14af75e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1251827763 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7834 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Torsten Kaiser wrote: > On Mon, Aug 31, 2009 at 8:27 PM, Christoph Hellwig wrote: >> I think you are right, the constant used is incorrect. Does the small >> patch below fix it for you? > > Yes, after adding this patch, xfs_fsr works. Crud, sorry about that. I swear I ran 32-bit xfstests under a 64-bit kernel, but I think we were lacking in fsr coverage.... -Eric >> Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c >> =================================================================== >> --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 >> +++ linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 >> @@ -619,7 +619,7 @@ xfs_file_compat_ioctl( >> case XFS_IOC_GETVERSION_32: >> cmd = _NATIVE_IOC(cmd, long); >> return xfs_file_ioctl(filp, cmd, p); >> - case XFS_IOC_SWAPEXT: { >> + case XFS_IOC_SWAPEXT_32: { >> struct xfs_swapext sxp; >> struct compat_xfs_swapext __user *sxu = arg; >> >> > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From BATV+88945cdf03a0dcaa8c4e+2200+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 1 13:05:47 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81I5LsR198025 for ; Tue, 1 Sep 2009 13:05:37 -0500 X-ASG-Debug-ID: 1251828377-7294015e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 252C014EE726 for ; Tue, 1 Sep 2009 11:06:17 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id IJJVSY57Ers7AhbA for ; Tue, 01 Sep 2009 11:06:17 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MiXhE-0007C5-9r for xfs@oss.sgi.com; Tue, 01 Sep 2009 18:03:08 +0000 Date: Tue, 1 Sep 2009 14:03:08 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfs: actually enable the swapext compat handler Subject: [PATCH] xfs: actually enable the swapext compat handler Message-ID: <20090901180308.GA26071@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251828378 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Fix a small typo in the compat ioctl handler that cause the swapext compat handler to never be called. Signed-off-by: Christoph Hellwig Reviewed-by: Torsten Kaiser Tested-by: Torsten Kaiser Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 +++ linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 @@ -619,7 +619,7 @@ xfs_file_compat_ioctl( case XFS_IOC_GETVERSION_32: cmd = _NATIVE_IOC(cmd, long); return xfs_file_ioctl(filp, cmd, p); - case XFS_IOC_SWAPEXT: { + case XFS_IOC_SWAPEXT_32: { struct xfs_swapext sxp; struct compat_xfs_swapext __user *sxu = arg; From BATV+88945cdf03a0dcaa8c4e+2200+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 1 13:07:49 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81I7O9P198127 for ; Tue, 1 Sep 2009 13:07:39 -0500 X-ASG-Debug-ID: 1251828500-726c01770000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0BA1159E3B8 for ; Tue, 1 Sep 2009 11:08:20 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id nenOO104O2S2QQF5 for ; Tue, 01 Sep 2009 11:08:20 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MiXmG-0008DM-L0 for xfs@oss.sgi.com; Tue, 01 Sep 2009 18:08:20 +0000 Date: Tue, 1 Sep 2009 14:08:20 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling Subject: Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling Message-ID: <20090901180820.GB26071@infradead.org> References: <20090827031242.GB6147@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090827031242.GB6147@infradead.org> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251828500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean I managed to trigger the ASSERT in the reclaim path, so it looks both this version and our previous code is buggy. It's back to the drawing board for now until I gifure out what's going on. From BATV+88945cdf03a0dcaa8c4e+2200+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 1 13:13:10 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81ICjVF198483 for ; Tue, 1 Sep 2009 13:13:00 -0500 X-ASG-Debug-ID: 1251828821-721901db0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 101C3417D89 for ; Tue, 1 Sep 2009 11:13:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id QmwgHQfsI8SY7ai6 for ; Tue, 01 Sep 2009 11:13:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MiXrR-0001Cl-EL; Tue, 01 Sep 2009 18:13:41 +0000 Date: Tue, 1 Sep 2009 14:13:41 -0400 From: Christoph Hellwig To: John Quigley Cc: XFS Development X-ASG-Orig-Subj: Re: XFS corruption with power failure Subject: Re: XFS corruption with power failure Message-ID: <20090901181341.GC26071@infradead.org> References: <606994882.2142291250648292843.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> <4A8C1E6E.8020405@jquigley.com> <4A9187C7.9010206@jquigley.com> <4A9576F0.2060304@jquigley.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9576F0.2060304@jquigley.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251828822 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Wed, Aug 26, 2009 at 12:54:56PM -0500, John Quigley wrote: > John Quigley wrote: >> John Quigley wrote: >>> We've distilled this into a reproducible environment with a stack of >>> NFS + XFS to a local disk + automated sysrq 'b' reboots. We're >>> working on getting this bundled up into a nice little package as a >>> VirtualBox vm for your consumption. Please tell me if this is not >>> desirable. >> >> The self-contained and reproducible environment can be downloaded from >> the following location: >> >> http://www.jquigley.com/tmp/xfsVM.tar.bz2 > > Has anyone by chance had an opportunity to utilize this? Any corruption reports? Looked at it, but it turns virtualbox is a real big pile of junk including it's own huge kernel module. Qemu/kvm now has support for the virtualbox disk images and I will give it a try next. From richardc@efilmgroup.com Tue Sep 1 13:27:00 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,HTML_MESSAGE, URIBL_GREY autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81IQdJN199224 for ; Tue, 1 Sep 2009 13:26:49 -0500 X-ASG-Debug-ID: 1251829647-2da900860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from goff1.goffgrafix.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9A9CA15A0EF9 for ; Tue, 1 Sep 2009 11:27:27 -0700 (PDT) Received: from goff1.goffgrafix.com (goff1.goffgrafix.com [208.43.246.232]) by cuda.sgi.com with ESMTP id qdec0hBv116tg1sZ for ; Tue, 01 Sep 2009 11:27:27 -0700 (PDT) Received: from c-76-118-59-6.hsd1.ma.comcast.net ([76.118.59.6] helo=Distrobution) by goff1.goffgrafix.com with esmtpa (Exim 4.69) (envelope-from ) id 1MiXph-0000pp-IK; Tue, 01 Sep 2009 14:11:53 -0400 From: "Richard Cohen" To: X-ASG-Orig-Subj: Active Shooters - Response Training Subject: Active Shooters - Response Training Date: Tue, 1 Sep 2009 14:11:40 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C0_01CA2B0E.27A87B50" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcorFgn3Y82VyBjdQ164b/W5NvEbdgAABijAAADL3cAAADO2gAAEfCkgAABCW1AAAC9+QAAAFOOgAABK8yAAABHZcA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Antivirus: avast! (VPS 090831-0, 08/31/2009), Outbound message X-Antivirus-Status: Clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - goff1.goffgrafix.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - efilmgroup.com X-Barracuda-Connect: goff1.goffgrafix.com[208.43.246.232] X-Barracuda-Start-Time: 1251829649 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA_TO_FROM_DOMAIN_MATCH, HTML_MESSAGE, HTTP_ESCAPED_HOST X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7836 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTTP_ESCAPED_HOST URI: Uses %-escapes inside a URL's hostname 0.00 HTML_MESSAGE BODY: HTML included in message 0.01 BSF_SC0_SA_TO_FROM_DOMAIN_MATCH Sender Domain Matches Recipient Domain X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean This is a multi-part message in MIME format. ------=_NextPart_000_00C0_01CA2B0E.27A87B50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Tactics and strategy for rapid response to an active shooter incident In mass shootings, the usual rules do not apply Waiting for support teams is not an option Mass killings at Columbine High School and Virginia Tech are only two of the many notorious incidents that have been widely reported. The 2008 terrorist attack in Mumbai may represent a new level of sophistication in active shooter incidents. Pre-incident planning and immediate action by response personnel are required to control the outcome of a mass killing and minimize the number of dead and injured. Emergency Film Group has produced "Active Shooter: Rapid Response," a DVD-based training package for law enforcement, emergency management, and other emergency personnel who may respond to a mass shooting. Included with the package is a 35-minute training film, a bonus segment on "Tactics," and an Instructor's CD-Rom with customizable PowerPoint presentation, Post-Seminar Quiz, and other resources helpful in presenting a seminar. Package price is just $425. Volume discounts apply. Please call or write richardc@efilmgroup.com. For a free preview clip, visit http://www.efilmgroup.com/Law-Enforcement/Active-Shooter-Rapid-Response-Vide o.html. This message was sent from: Emergency Film Group, 140 Cooke St., Edgartown, MA 02539. You may unsubscribe by replying with "Unsubscribe" in the subject line. ------=_NextPart_000_00C0_01CA2B0E.27A87B50 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

Tactics and strategy for rapid response to an active shooter incident

 

 

 

In mass shootings, the usual rules do not = apply

Waiting for support teams is not an = option 

 

Mass = killings at Columbine High School and Virginia Tech are only two of the = many notorious incidents that have been widely reported. The 2008 = terrorist attack in Mumbai may represent a new level of sophistication = in active shooter incidents. Pre-incident planning and immediate action by = response personnel are required to control the outcome of a mass killing = and minimize the number of dead and = injured.

 

Emergency = Film Group has produced "Active Shooter: Rapid = Response," a DVD-based training package for law enforcement, emergency = management, and other emergency personnel who may respond to a mass shooting.  Included with the package is a = 35-minute training film, a bonus segment on "Tactics," and an Instructor's CD-Rom with customizable PowerPoint = presentation, Post-Seminar Quiz, and other resources helpful in presenting a seminar.   Package price is just $425. Volume = discounts apply. Please call or write richardc@efilmgroup.com. &n= bsp;

 

 

 

This message was sent from: Emergency Film = Group, 140 Cooke St., Edgartown, MA 02539. You may unsubscribe by replying with “Unsubscribe” in the = subject line.

 

 

 

------=_NextPart_000_00C0_01CA2B0E.27A87B50-- From jquigley@jquigley.com Tue Sep 1 14:16:43 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81JGMS9201750 for ; Tue, 1 Sep 2009 14:16:33 -0500 X-ASG-Debug-ID: 1251832634-470100540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.jquigley.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 45C07418225 for ; Tue, 1 Sep 2009 12:17:14 -0700 (PDT) Received: from mail.jquigley.com (main.jquigley.com [67.23.32.156]) by cuda.sgi.com with ESMTP id bG3IWaspvvqtWdfm for ; Tue, 01 Sep 2009 12:17:14 -0700 (PDT) Received: from [10.1.1.10] (OSH-NAT-213-67.onshore.net [66.146.213.67]) (Authenticated sender: jquigley@mail.jquigley.com) by mail.jquigley.com (Postfix) with ESMTPSA id 6F926204052 for ; Tue, 1 Sep 2009 19:17:11 +0000 (UTC) Message-ID: <4A9D7334.2040500@jquigley.com> Date: Tue, 01 Sep 2009 14:17:08 -0500 From: John Quigley User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: XFS Development X-ASG-Orig-Subj: Re: XFS corruption with power failure Subject: Re: XFS corruption with power failure References: <606994882.2142291250648292843.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> <4A8C1E6E.8020405@jquigley.com> <4A9187C7.9010206@jquigley.com> In-Reply-To: <4A9187C7.9010206@jquigley.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: main.jquigley.com[67.23.32.156] X-Barracuda-Start-Time: 1251832639 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7838 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean John Quigley wrote: > John Quigley wrote: >> We've distilled this into a reproducible environment with a stack of >> NFS + XFS to a local disk + automated sysrq 'b' reboots. We're >> working on getting this bundled up into a nice little package as a >> VirtualBox vm for your consumption. Please tell me if this is not >> desirable. By way of an update, the corruption is definitely specific to Linux nfsd access to XFS at time of power failure. We've be unable to reproduce the problem in any other context except when running IO through NFS to the underlying XFS mount. - John Quigley From sandeen@sandeen.net Tue Sep 1 14:46:00 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81JjebJ203182 for ; Tue, 1 Sep 2009 14:45:50 -0500 X-ASG-Debug-ID: 1251834366-467500f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 201254183FA for ; Tue, 1 Sep 2009 12:46:06 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id wl3WKzDN7YItWKP0 for ; Tue, 01 Sep 2009 12:46:06 -0700 (PDT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n81Jk0qt021149; Tue, 1 Sep 2009 15:46:00 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n81JjxYh007765; Tue, 1 Sep 2009 15:45:59 -0400 Message-ID: <4A9D79F7.9080702@sandeen.net> Date: Tue, 01 Sep 2009 14:45:59 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: actually enable the swapext compat handler Subject: Re: [PATCH] xfs: actually enable the swapext compat handler References: <20090901180308.GA26071@infradead.org> In-Reply-To: <20090901180308.GA26071@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1251834393 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7840 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > Fix a small typo in the compat ioctl handler that cause the swapext > compat handler to never be called. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Torsten Kaiser > Tested-by: Torsten Kaiser Guilty-party: Eric Sandeen Reviewed-by: Eric Sandeen > Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c > =================================================================== > --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 > +++ linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 > @@ -619,7 +619,7 @@ xfs_file_compat_ioctl( > case XFS_IOC_GETVERSION_32: > cmd = _NATIVE_IOC(cmd, long); > return xfs_file_ioctl(filp, cmd, p); > - case XFS_IOC_SWAPEXT: { > + case XFS_IOC_SWAPEXT_32: { > struct xfs_swapext sxp; > struct compat_xfs_swapext __user *sxu = arg; > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From BATV+88945cdf03a0dcaa8c4e+2200+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 1 15:13:18 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81KCrik204599 for ; Tue, 1 Sep 2009 15:13:08 -0500 X-ASG-Debug-ID: 1251836009-575201a90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EC75615A20E3 for ; Tue, 1 Sep 2009 13:13:29 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id POHuqa8KStNqGEv3 for ; Tue, 01 Sep 2009 13:13:29 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MiZjN-0003o2-E3; Tue, 01 Sep 2009 20:13:29 +0000 Date: Tue, 1 Sep 2009 16:13:29 -0400 From: Christoph Hellwig To: Eric Sandeen Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: actually enable the swapext compat handler Subject: Re: [PATCH] xfs: actually enable the swapext compat handler Message-ID: <20090901201329.GA14400@infradead.org> References: <20090901180308.GA26071@infradead.org> <4A9D79F7.9080702@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9D79F7.9080702@sandeen.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251836029 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Tue, Sep 01, 2009 at 02:45:59PM -0500, Eric Sandeen wrote: > Christoph Hellwig wrote: > > Fix a small typo in the compat ioctl handler that cause the swapext > > compat handler to never be called. > > > > Signed-off-by: Christoph Hellwig > > Reviewed-by: Torsten Kaiser > > Tested-by: Torsten Kaiser > > Guilty-party: Eric Sandeen > Reviewed-by: Eric Sandeen Haha, thanks. Felix, can you push this one to Linus for 2.6.31? From felixb@sgi.com Tue Sep 1 16:37:32 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81LbC6p209103 for ; Tue, 1 Sep 2009 16:37:22 -0500 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay2.corp.sgi.com (Postfix) with ESMTP id D89193040C0 for ; Tue, 1 Sep 2009 14:38:08 -0700 (PDT) Received: from eagdhcp-232-185.americas.sgi.com (eagdhcp-232-185.americas.sgi.com [128.162.232.185]) by estes.americas.sgi.com (Postfix) with ESMTP id AA302700074B; Tue, 1 Sep 2009 16:22:54 -0500 (CDT) Cc: Eric Sandeen , xfs@oss.sgi.com Message-Id: From: Felix Blyakher To: Christoph Hellwig In-Reply-To: <20090901201329.GA14400@infradead.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: [PATCH] xfs: actually enable the swapext compat handler Date: Tue, 1 Sep 2009 16:22:54 -0500 References: <20090901180308.GA26071@infradead.org> <4A9D79F7.9080702@sandeen.net> <20090901201329.GA14400@infradead.org> X-Mailer: Apple Mail (2.926) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Sep 1, 2009, at 3:13 PM, Christoph Hellwig wrote: > On Tue, Sep 01, 2009 at 02:45:59PM -0500, Eric Sandeen wrote: >> Christoph Hellwig wrote: >>> Fix a small typo in the compat ioctl handler that cause the swapext >>> compat handler to never be called. >>> >>> Signed-off-by: Christoph Hellwig >>> Reviewed-by: Torsten Kaiser >>> Tested-by: Torsten Kaiser >> >> Guilty-party: Eric Sandeen >> Reviewed-by: Eric Sandeen Yep, trivial fix. Looks good. Reviewed-by: Felix Blyakher >> > > Haha, thanks. Felix, can you push this one to Linus for 2.6.31? Sure, doing it now. Felix > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From felixb@oss.sgi.com Tue Sep 1 16:41:27 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81LfM0x209411 for ; Tue, 1 Sep 2009 16:41:27 -0500 Received: (from felixb@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n81LfMOq209325; Tue, 1 Sep 2009 16:41:22 -0500 Date: Tue, 1 Sep 2009 16:41:22 -0500 Message-Id: <200909012141.n81LfMOq209325@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12474-gaa72a5c X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1da1daed813c534263a87ffc36d5b775e65231ad X-Git-Newrev: aa72a5cf00001d0b952c7c755be404b9118ceb2e This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated aa72a5c xfs: simplify xfs_trans_iget 13e6d5c xfs: merge fsync and O_SYNC handling bd16956 xfs: speed up free inode search 2187550 xfs: rationalize xfs_inobt_lookup* 4254b0b xfs: untangle xfs_dialloc 0b48db8 xfs: factor out debug checks from xfs_dialloc and xfs_difree afabc24 xfs: improve xfs_inobt_update prototype 2e287a7 xfs: improve xfs_inobt_get_rec prototype 85c0b2a xfs: factor out inode initialisation from 1da1daed813c534263a87ffc36d5b775e65231ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit aa72a5cf00001d0b952c7c755be404b9118ceb2e Author: Christoph Hellwig Date: Mon Aug 31 21:51:52 2009 -0300 xfs: simplify xfs_trans_iget xfs_trans_iget is a wrapper for xfs_iget that adds the inode to the transaction after it is read. Except when the inode already is in the inode cache, in which case it returns the existing locked inode with increment lock recursion counts. Now, no one in the tree every decrements these lock recursion counts, so any user of this gets a potential double unlock when both the original owner of the inode and the xfs_trans_iget caller unlock it. When looking back in a git bisect in the historic XFS tree there was only one place that decremented these counts, xfs_trans_iput. Introduced in commit ca25df7a840f426eb566d52667b6950b92bb84b5 by Adam Sweeney in 1993, and removed in commit 19f899a3ab155ff6a49c0c79b06f2f61059afaf3 by Steve Lord in 2003. And as long as it didn't slip through git bisects cracks never actually used in that time frame. A quick audit of the callers of xfs_trans_iget shows that no caller really relies on this behaviour fortunately - xfs_ialloc allows this inode from disk so it must not be there before, and all the RT allocator routines only every add each RT bitmap inode once. In addition to removing lots of code and reducing the size of the inode item this patch also avoids the double inode cache lookup in each create/mkdir/mknod transaction. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 13e6d5cdde0e785aa943810f08b801cadd0935df Author: Christoph Hellwig Date: Mon Aug 31 21:00:31 2009 -0300 xfs: merge fsync and O_SYNC handling The guarantees for O_SYNC are exactly the same as the ones we need to make for an fsync call (and given that Linux O_SYNC is O_DSYNC the equivalent is fdadatasync, but we treat both the same in XFS), except with a range data writeout. Jan Kara has started unifying these two path for filesystems using the generic helpers, and I've started to look at XFS. The actual transaction commited by xfs_fsync and xfs_write_sync_logforce has a different transaction number, but actually is exactly the same. We'll only use the fsync transaction going forward. One major difference is that xfs_write_sync_logforce never issues a cache flush unless we commit a transaction causing that as a side-effect, which is an obvious bug in the O_SYNC handling. Second all the locking and i_update_size vs i_update_core changes from 978b7237123d007b9fa983af6e0e2fa8f97f9934 never made it to xfs_write_sync_logforce, so we add them back. To make xfs_fsync easily usable from the O_SYNC path, the filemap_fdatawait call is moved up to xfs_file_fsync, so that we don't wait on the whole file after we already waited for our portion in xfs_write. We'll also use a plain call to filemap_write_and_wait_range instead of the previous sync_page_rang which did it in two steps including an half-hearted inode write out that doesn't help us. Once we're done with this also remove the now useless i_update_size tracking. Signed-off-by: Christoph Hellwig Reviewed-by: Felix Blyakher Signed-off-by: Felix Blyakher commit bd169565993b39b9b4b102cdac8b13e0a259ce2f Author: Dave Chinner Date: Mon Aug 31 20:58:28 2009 -0300 xfs: speed up free inode search Don't search too far - abort if it is outside a certain radius and simply do a linear search for the first free inode. In AGs with a million inodes this can speed up allocation speed by 3-4x. [hch: ported to the new xfs_ialloc.c world order] Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 2187550525d7bcb8c87689e4eca41b1955bf9ac3 Author: Christoph Hellwig Date: Mon Aug 31 20:58:21 2009 -0300 xfs: rationalize xfs_inobt_lookup* Currenly we have a xfs_inobt_lookup* variant for each comparism direction, and all these get all three fields of the inobt records passed, while the common case is just looking for the inode number and we have only marginally more callers than xfs_inobt_lookup* variants. So opencode a direct call to xfs_btree_lookup for the single case where we need all fields, and replace xfs_inobt_lookup* with a xfs_inobt_looku that just takes the inode number and the direction for all other callers. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 4254b0bbb1c0826b7443ffa593576696bc591aa2 Author: Christoph Hellwig Date: Mon Aug 31 20:57:14 2009 -0300 xfs: untangle xfs_dialloc Clarify the control flow in xfs_dialloc. Factor out a helper to go to the next node from the current one and improve the control flow by expanding composite if statements and using gotos. The xfs_ialloc_next_rec helper is borrowed from Dave Chinners dynamic allocation policy patches. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 0b48db80ba689edfd96ed06c3124d6cf1146de3f Author: Dave Chinner Date: Mon Aug 31 20:57:09 2009 -0300 xfs: factor out debug checks from xfs_dialloc and xfs_difree Factor out a common helper from repeated debug checks in xfs_dialloc and xfs_difree. [hch: split out from Dave's dynamic allocation policy patches] Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit afabc24a73bfee2656724b0a70395f1693eaa62b Author: Christoph Hellwig Date: Mon Aug 31 20:57:03 2009 -0300 xfs: improve xfs_inobt_update prototype Both callers of xfs_inobt_update have the record in form of a xfs_inobt_rec_incore_t, so just pass a pointer to it instead of the individual variables. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 2e287a731e0607e0371dc6165b7dd3ebc67fa8e1 Author: Christoph Hellwig Date: Mon Aug 31 20:56:58 2009 -0300 xfs: improve xfs_inobt_get_rec prototype Most callers of xfs_inobt_get_rec need to fill a xfs_inobt_rec_incore_t, and those who don't yet are fine with a xfs_inobt_rec_incore_t, instead of the three individual variables, too. So just change xfs_inobt_get_rec to write the output into a xfs_inobt_rec_incore_t directly. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher commit 85c0b2ab5e69ca6133380ead1c50e0840d136b39 Author: Dave Chinner Date: Mon Aug 31 20:56:51 2009 -0300 xfs: factor out inode initialisation Factor out code to initialize new inode clusters into a function of it's own. This keeps xfs_ialloc_ag_alloc smaller and better structured and enables a future inode cluster initialization transaction. Also initialize the agno variable earlier in xfs_ialloc_ag_alloc to avoid repeated byte swaps. [hch: The original patch is from Dave from his unpublished inode create transaction patch series, with some modifcations by me to apply stand-alone] Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Felix Blyakher ----------------------------------------------------------------------- Summary of changes: fs/xfs/linux-2.6/xfs_aops.c | 1 - fs/xfs/linux-2.6/xfs_file.c | 19 +- fs/xfs/linux-2.6/xfs_lrw.c | 7 +- fs/xfs/xfs_ag.h | 9 + fs/xfs/xfs_ialloc.c | 805 ++++++++++++++++++++++--------------------- fs/xfs/xfs_ialloc.h | 18 +- fs/xfs/xfs_iget.c | 27 -- fs/xfs/xfs_inode.h | 3 - fs/xfs/xfs_inode_item.c | 10 - fs/xfs/xfs_inode_item.h | 2 - fs/xfs/xfs_itable.c | 96 +++--- fs/xfs/xfs_rw.c | 84 ----- fs/xfs/xfs_rw.h | 1 - fs/xfs/xfs_trans.h | 2 +- fs/xfs/xfs_trans_inode.c | 86 +----- fs/xfs/xfs_vnodeops.c | 11 +- 16 files changed, 499 insertions(+), 682 deletions(-) hooks/post-receive -- XFS development tree From felixb@oss.sgi.com Tue Sep 1 16:56:30 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81LuPiT210267 for ; Tue, 1 Sep 2009 16:56:30 -0500 Received: (from felixb@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n81LuOO5210222; Tue, 1 Sep 2009 16:56:24 -0500 Date: Tue, 1 Sep 2009 16:56:24 -0500 Message-Id: <200909012156.n81LuOO5210222@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12475-gf4378b6 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: aa72a5cf00001d0b952c7c755be404b9118ceb2e X-Git-Newrev: f4378b6eaf63492c0f9a397d52813e0ae6b49e7b This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated f4378b6 xfs: actually enable the swapext compat handler from aa72a5cf00001d0b952c7c755be404b9118ceb2e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f4378b6eaf63492c0f9a397d52813e0ae6b49e7b Author: Christoph Hellwig Date: Tue Sep 1 14:03:08 2009 -0400 xfs: actually enable the swapext compat handler Fix a small typo in the compat ioctl handler that cause the swapext compat handler to never be called. Signed-off-by: Christoph Hellwig Reviewed-by: Torsten Kaiser Tested-by: Torsten Kaiser Reviewed-by: Eric Sandeen Reviewed-by: Felix Blyakher Signed-off-by: Felix Blyakher ----------------------------------------------------------------------- Summary of changes: fs/xfs/linux-2.6/xfs_ioctl32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- XFS development tree From felixb@oss.sgi.com Tue Sep 1 17:00:52 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81M0lhF210619 for ; Tue, 1 Sep 2009 17:00:52 -0500 Received: (from felixb@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n81M0lxe210585; Tue, 1 Sep 2009 17:00:47 -0500 Date: Tue, 1 Sep 2009 17:00:47 -0500 Message-Id: <200909012200.n81M0lxe210585@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, for-linus, updated. v2.6.30-rc4-12442-g3725867 X-Git-Refname: refs/heads/for-linus X-Git-Reftype: branch X-Git-Oldrev: bc990f5cb424cdca9dda866785d088e2c2110ecc X-Git-Newrev: 3725867dccfb83e4b0cff64e916a04258f300591 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, for-linus has been updated 3725867 xfs: actually enable the swapext compat handler from bc990f5cb424cdca9dda866785d088e2c2110ecc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3725867dccfb83e4b0cff64e916a04258f300591 Author: Christoph Hellwig Date: Tue Sep 1 14:03:08 2009 -0400 xfs: actually enable the swapext compat handler Fix a small typo in the compat ioctl handler that cause the swapext compat handler to never be called. Signed-off-by: Christoph Hellwig Reviewed-by: Torsten Kaiser Tested-by: Torsten Kaiser Reviewed-by: Eric Sandeen Reviewed-by: Felix Blyakher Signed-off-by: Felix Blyakher ----------------------------------------------------------------------- Summary of changes: fs/xfs/linux-2.6/xfs_ioctl32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- XFS development tree From felixb@sgi.com Tue Sep 1 17:11:06 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81MAjVH211390 for ; Tue, 1 Sep 2009 17:10:56 -0500 Received: from attica.americas.sgi.com (attica.americas.sgi.com [128.162.236.44]) by relay2.corp.sgi.com (Postfix) with ESMTP id B9A3F3040BC for ; Tue, 1 Sep 2009 15:11:42 -0700 (PDT) Received: by attica.americas.sgi.com (Postfix, from userid 29043) id BED9AA23CA70; Tue, 1 Sep 2009 17:06:12 -0500 (CDT) Date: Tue, 01 Sep 2009 17:06:12 -0500 To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: [GIT PULL] XFS update for 2.6.31 User-Agent: Heirloom mailx 12.2 01/07/07 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090901220612.BED9AA23CA70@attica.americas.sgi.com> From: felixb@sgi.com (Felix Blyakher) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean The following changes since commit 37d0892c5a94e208cf863e3b7bac014edee4346d: Ian Kent (1): autofs4 - fix missed case when changing to use struct path are available in the git repository at: git://oss.sgi.com/xfs/xfs for-linus Christoph Hellwig (1): xfs: actually enable the swapext compat handler fs/xfs/linux-2.6/xfs_ioctl32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) From michael.monnerie@is.it-management.at Tue Sep 1 17:17:08 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81MGmWR211868 for ; Tue, 1 Sep 2009 17:16:58 -0500 X-ASG-Debug-ID: 1251843424-45f601740000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E0D0A418DE6 for ; Tue, 1 Sep 2009 15:17:04 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id QC683xtlAYPewMcj for ; Tue, 01 Sep 2009 15:17:04 -0700 (PDT) Received: from mailsrv.i.zmi.at (unknown [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id 5552069A for ; Wed, 2 Sep 2009 00:16:55 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id 26477400161 for ; Wed, 2 Sep 2009 00:16:58 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss Date: Wed, 2 Sep 2009 00:16:07 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: <19101.5976.387292.614270@tree.ty.sabi.co.uk> In-Reply-To: <19101.5976.387292.614270@tree.ty.sabi.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909020016.07984@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1251843455 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7849 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Dienstag 01 September 2009 Peter Grandi wrote: > knowing *exactly* what has failed may help you a lot. Thank you for your very verbose posting, it was fun to read. And the last line should be answered by the OP. mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From michael.monnerie@is.it-management.at Tue Sep 1 17:53:40 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33, J_CHICKENPOX_53 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81MrK3B213884 for ; Tue, 1 Sep 2009 17:53:30 -0500 X-ASG-Debug-ID: 1251845621-51aa02990000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1D69315A468D for ; Tue, 1 Sep 2009 15:53:41 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id 7iPRul3tJfchNnBb for ; Tue, 01 Sep 2009 15:53:41 -0700 (PDT) Received: from mailsrv.i.zmi.at (unknown [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id 476516C0 for ; Wed, 2 Sep 2009 00:53:30 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id 1DCED400161 for ; Wed, 2 Sep 2009 00:53:33 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: zero size file after power failure with kernel 2.6.30.5 Subject: Re: zero size file after power failure with kernel 2.6.30.5 Date: Wed, 2 Sep 2009 00:52:41 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: <200908292102.21710@zmi.at> <200909010918.37886@zmi.at> <19100.63566.98250.185404@tree.ty.sabi.co.uk> In-Reply-To: <19100.63566.98250.185404@tree.ty.sabi.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909020052.42421@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1251845647 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7853 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Dienstag 01 September 2009 Peter Grandi wrote: > Other people have a very different impression. Like 'ext3' > ReiserFS does ordered writes, but those don't necessarily help > because of the colossal amount of buffering that happens anyhow > nowadays. Maybe. I had reiserfs on this system until two weeks ago, with this quad-core 8GB desktop. Had power failures, crashes, and so on. Can't remember a situation where a KDE app lost its config. But I had a server with the OSS XEN, running a single VM which is my internal mailserver using PostgreSQL as it's store on XFS. My daughter managed to switch the server off (yeah, having redundant power supplies and UPS are still not enough). After reboot, the PostgreSQL database was *damaged*, so much that I had to restore. This should never have happened, and until now I don't know who was guilty for that: XFS? XEN? The RAID Controller with BBU and hard disk cache=off? That's why I'm very sensible to even a small data loss (I had a backup of my kmail config), and I think the filesystem has to do everything to try to keep my data. XFS seems to be optimized more for speed before security, would you mean that? I've often heard "enterprise hardware", which sounds like "if anything crashes, it's your problem" ;-) > http://www.sabi.co.uk/blog/0707jul.html#070701 I like your blog, and http://www.myri.com/scs/READMES/README.myri10ge-linux gave me a good hint to optimize tcp settings a long time ago. > In general on a fast machine I would use: > vm/dirty_ratio =4 > vm/dirty_background_ratio =2 > vm/dirty_expire_centisecs =400 > vm/dirty_writeback_centisecs =200 Since May I use these new settings with kernel 2.6.(29|30): vm.dirty_background_bytes = 16123456 vm.dirty_bytes = 250123456 vm.dirty_expire_centisecs = 1000 vm.dirty_writeback_centisecs = 100 (the expire was on 3000 until the crash). mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From BATV+88945cdf03a0dcaa8c4e+2200+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 1 18:56:28 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n81Nu2A5217223 for ; Tue, 1 Sep 2009 18:56:18 -0500 X-ASG-Debug-ID: 1251849419-3d6c018b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3A36415A5E95 for ; Tue, 1 Sep 2009 16:56:59 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id GPasp8SC58vVDZAv for ; Tue, 01 Sep 2009 16:56:59 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MidDb-00044x-Ju for xfs@oss.sgi.com; Tue, 01 Sep 2009 23:56:55 +0000 Date: Tue, 1 Sep 2009 19:56:55 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfs: un-static xfs_inobt_lookup Subject: [PATCH] xfs: un-static xfs_inobt_lookup Message-ID: <20090901235655.GA15321@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251849419 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean xfs_inobt_lookup is also used in xfs_itable.c, remove the STATIC modifier from it's declaration to fix non-debug builds. This was already fixed in my git tree vs the version last posted to the list. Signed-off-by: Christoph Hellwig Index: xfs/fs/xfs/xfs_ialloc.c =================================================================== --- xfs.orig/fs/xfs/xfs_ialloc.c 2009-09-01 20:47:28.515468366 -0300 +++ xfs/fs/xfs/xfs_ialloc.c 2009-09-01 20:47:33.867913011 -0300 @@ -59,7 +59,7 @@ xfs_ialloc_cluster_alignment( /* * Lookup a record by ino in the btree given by cur. */ -STATIC int /* error */ +int /* error */ xfs_inobt_lookup( struct xfs_btree_cur *cur, /* btree cursor */ xfs_agino_t ino, /* starting inode of chunk */ From edvx1@systemanalysen.net Tue Sep 1 20:19:37 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_45,J_CHICKENPOX_65 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n821JHgJ222472 for ; Tue, 1 Sep 2009 20:19:27 -0500 X-ASG-Debug-ID: 1251854395-045903400000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ngcobalt07.manitu.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 76284419461 for ; Tue, 1 Sep 2009 18:19:55 -0700 (PDT) Received: from ngcobalt07.manitu.net (ngcobalt07.manitu.net [217.11.48.107]) by cuda.sgi.com with ESMTP id r09e6zbC9kuoV71R for ; Tue, 01 Sep 2009 18:19:55 -0700 (PDT) Received: from mobil.systemanalysen.net (localhost [127.0.0.1]) (authenticated as r.mail with PLAIN) by localhost (8.10.2/8.10.2) with ESMTP id n821K1F06106; Wed, 2 Sep 2009 03:20:01 +0200 X-manitu-Original-Sender-IP: 127.0.0.1 X-manitu-Original-Receiver-Name: localhost From: Roland Eggner Reply-To: "Roland Eggner" To: SGI Project XFS mailing list X-ASG-Orig-Subj: free space of root partition decreases unaccountably by some 1024 blocks on every umount+linux shutdown : additional informations Subject: free space of root partition decreases unaccountably by some 1024 blocks on every umount+linux shutdown : additional informations Date: Wed, 2 Sep 2009 03:16:36 +0200 User-Agent: KMail/1.11.2 (Linux/2.6.29.6.roland.0; KDE/4.2.2; i686; ; ) References: <200908121955.07682.edvx1@systemanalysen.net> <4A838598.4000608@sandeen.net> In-Reply-To: <4A838598.4000608@sandeen.net> MIME-Version: 1.0 Message-Id: <200909020316.48300.edvx1@systemanalysen.net> Content-Type: multipart/signed; boundary="nextPart4021922.nUrLzVR9CD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ngcobalt07.manitu.net[217.11.48.107] X-Barracuda-Start-Time: 1251854402 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.01 X-Barracuda-Spam-Status: No, SCORE=-1.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT, SUBJECT_FUZZY_TION X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7863 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.41 SUBJECT_FUZZY_TION Attempt to obfuscate words in Subject: X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --nextPart4021922.nUrLzVR9CD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday August 13th 05:16:40 2009 Eric Sandeen wrote: > Roland Eggner wrote: > > On July 18th I noticed the first time this unaccountable decrease of fr= ee space of my root partition /dev/hda7: > > For at least several boot-shutdown-cycles it has decreased on every cyc= le by some 1020 =E2=80=A6 1030 blocks from originally above 100 MB to 96 MB. > > Expected change at most =C2=B11 block. Neither xfs_check nor xfs_repai= r -dn could detect any flaws. > Maybe I missed it in the email, but how have you ruled out the > possibility that files are simply growing, thereby using the space? Look at the last but one paragraph in my mail from August 12th http://oss.sgi.com/archives/xfs/2009-08/msg00113.html (obviously the find argument =E2=80=9C-mount=E2=80=9D got lost on copy+past= e, sorry). =46acts summarized: =2D--------------- (a) Free space decreases unaccountably even if I circumvent all shutdown s= cripts und shutdown by SysReq R S U B. Note: no SIGTERM, no SIGKILL. (b) Unaccountable free space decrease is triggered EXACTLY, ALWAYS and EXC= LUSIVELY by this =E2=80=9Cremount,ro=E2=80=9D. Note: NOT by any other writ= e activities. (c) Binary comparison of images written with dd exhibited NO unexpected wr= ites to me (I do not have deeper knowledge of xfs internals): in a particu= lar case free space difference reported by df has been 1026 blocks =3D 1050= 624 byte, whereas count of differing bytes reported by =E2=80=9Ccmp -b -l= =E2=80=9D has been only 135189. =E2=80=9Ccmp -b -l=E2=80=9D DID exhibit ex= pected writes e.g. /etc/mtab. (Eric Sandeen got details via private mail a= nd offered kindly to have a look at xfs_metadump extraction from this image= s =E2=80=94 thanks!). (d) Until now I could NOT detect this problem at any other partition, it s= eems that ONLY the root partition is affected. (e) I performed xfsdump | mkfs.xfs | xfsrestore and got back some 200 Mbyt= e free space, but only temporarily =E2=80=94 at subsequent linux shutdowns = free space CONTINUES to decrease, just starting from a new offset. (f) I booted a sidux image and reset the lazy-counter attribute by =E2=80= =9Cxfs_admin -c 0=E2=80=9D =E2=9E=94 Apart from =E2=80=9CXFS: correcting sb= _features alignment problem=E2=80=9D message at next mount, EXACTLY the sam= e result as after measures (e). (WARNING: Never use =E2=80=9Cxfs_admin -c= 0=E2=80=9D unless you have a current backup of your valuable data!!) (g) Kernel 2.6.30.4 shows the problem too. (And introduces some other fla= ws, =E2=80=9Cshow stopping=E2=80=9D for me =E2=80=94 therefore I stay at ke= rnel 2.6.29.6). (h) Apart from following single incident, I got never any error messages f= rom this filesystem, neither from xfs_check nor from xfs_repair: On July 17th a run of xfs_repair yielded following report =E2=80=94 beeing = busy on that day, I ignored the message apart from saving it for later anal= ysis: # xfs_repair -dn /dev/hda7 bad nblocks 1 for free inode 9722 bad nlink 1 for free inode 9722 bad mode 0100644 for free inode 9722 link count mismatch for inode 9722 (name ?), nlink 0, counted 1 Phase 1 - find and verify superblock... Phase 2 - using internal log - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno =3D 0 - agno =3D 1 - agno =3D 2 - agno =3D 3 - process newly discovered inodes... 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 3 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... No modify flag set, skipping filesystem flush and exiting. If I can provide any additional debugging info, let me know. =2D-=20 Roland Eggner --nextPart4021922.nUrLzVR9CD Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkqdx3QACgkQdN/hKfT7G/KnMQCgtfQhfym9YIHDQn1W4UyKK1yw DisAnj+6ZYFKYbygHHePkEl6wxw9zKxR =bNcT -----END PGP SIGNATURE----- --nextPart4021922.nUrLzVR9CD-- From felixb@oss.sgi.com Tue Sep 1 20:44:00 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n821htpS223641 for ; Tue, 1 Sep 2009 20:44:00 -0500 Received: (from felixb@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n821htNu223600; Tue, 1 Sep 2009 20:43:55 -0500 Date: Tue, 1 Sep 2009 20:43:55 -0500 Message-Id: <200909020143.n821htNu223600@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12476-g81e2517 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: f4378b6eaf63492c0f9a397d52813e0ae6b49e7b X-Git-Newrev: 81e251766e8f8c9d7abb5db784e58c5c45f82797 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated 81e2517 xfs: un-static xfs_inobt_lookup from f4378b6eaf63492c0f9a397d52813e0ae6b49e7b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 81e251766e8f8c9d7abb5db784e58c5c45f82797 Author: Christoph Hellwig Date: Tue Sep 1 19:56:55 2009 -0400 xfs: un-static xfs_inobt_lookup xfs_inobt_lookup is also used in xfs_itable.c, remove the STATIC modifier from it's declaration to fix non-debug builds. Signed-off-by: Christoph Hellwig Reviewed-by: Felix Blyakher Signed-off-by: Felix Blyakher ----------------------------------------------------------------------- Summary of changes: fs/xfs/xfs_ialloc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- XFS development tree From felixb@sgi.com Tue Sep 1 21:00:24 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82203FJ224547 for ; Tue, 1 Sep 2009 21:00:13 -0500 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay1.corp.sgi.com (Postfix) with ESMTP id 961438F80D9 for ; Tue, 1 Sep 2009 19:01:00 -0700 (PDT) Received: from [IPv6???1] (sshgate.corp.sgi.com [198.149.20.12]) by estes.americas.sgi.com (Postfix) with ESMTP id 37C98700075C; Tue, 1 Sep 2009 20:37:57 -0500 (CDT) Cc: xfs@oss.sgi.com Message-Id: From: Felix Blyakher To: Christoph Hellwig In-Reply-To: <20090901235655.GA15321@infradead.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [PATCH] xfs: un-static xfs_inobt_lookup Date: Tue, 1 Sep 2009 20:37:56 -0500 References: <20090901235655.GA15321@infradead.org> X-Mailer: Apple Mail (2.930.3) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Sep 1, 2009, at 6:56 PM, Christoph Hellwig wrote: > > xfs_inobt_lookup is also used in xfs_itable.c, remove the STATIC > modifier > from it's declaration to fix non-debug builds. Argh! I think, this or similar thing bit us once in past. > > > This was already fixed in my git tree vs the version last posted to > the > list. Applying it quickly to the oss as well. > Signed-off-by: Christoph Hellwig Reviewed-by: Felix Blyakher > > > Index: xfs/fs/xfs/xfs_ialloc.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_ialloc.c 2009-09-01 20:47:28.515468366 -0300 > +++ xfs/fs/xfs/xfs_ialloc.c 2009-09-01 20:47:33.867913011 -0300 > @@ -59,7 +59,7 @@ xfs_ialloc_cluster_alignment( > /* > * Lookup a record by ino in the btree given by cur. > */ > -STATIC int /* error */ > +int /* error */ > xfs_inobt_lookup( > struct xfs_btree_cur *cur, /* btree cursor */ > xfs_agino_t ino, /* starting inode of chunk */ > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 06:30:42 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82BUERg260070 for ; Wed, 2 Sep 2009 06:30:32 -0500 X-ASG-Debug-ID: 1251891071-2fa102e40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 653801B8760F for ; Wed, 2 Sep 2009 04:31:11 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id oCrFkYvcgjDSTIfI for ; Wed, 02 Sep 2009 04:31:11 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Mio3P-0003p7-M6; Wed, 02 Sep 2009 11:31:07 +0000 Date: Wed, 2 Sep 2009 07:31:07 -0400 From: Christoph Hellwig To: Michael Monnerie Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: minor bug in xfsprogs-3.0.3 Subject: Re: minor bug in xfsprogs-3.0.3 Message-ID: <20090902113107.GA6908@infradead.org> References: <200909011044.44938@zmi.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200909011044.44938@zmi.at> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251891071 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Tue, Sep 01, 2009 at 10:44:44AM +0200, Michael Monnerie wrote: > # xfs_info -V > Usage: xfs_info [-V] [-t mtab] mountpoint > > It should print the version, right? Yes, it should. But from looking at git history it looks like it never did. Same for various other shell scripts (xfs_check/xfs_ncheck/xfs_admin). I'll fix it up. From jpiszcz@lucidpixels.com Wed Sep 2 06:45:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82BinKe260970 for ; Wed, 2 Sep 2009 06:44:59 -0500 X-ASG-Debug-ID: 1251891938-0e7100770000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9208C15A9E1D for ; Wed, 2 Sep 2009 04:45:38 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id nSZfWfV4wA93pamH for ; Wed, 02 Sep 2009 04:45:38 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 1747337EC; Wed, 2 Sep 2009 07:45:36 -0400 (EDT) Date: Wed, 2 Sep 2009 07:45:36 -0400 (EDT) From: Justin Piszcz To: Christoph Hellwig cc: Nikanth Karthikesan , Jens Axboe , linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Kernel 2.6.30.4 loop(..?) regression (& with/2.6.31-rc6) Subject: Re: Kernel 2.6.30.4 loop(..?) regression (& with/2.6.31-rc6) In-Reply-To: Message-ID: References: <20090822201558.GA17955@infradead.org> <20090822205502.GA18904@infradead.org> <20090823224504.GA19942@infradead.org> <20090826180234.GC14019@infradead.org> <20090826212732.GA18124@infradead.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1251891945 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, 28 Aug 2009, Justin Piszcz wrote: > > On Wed, 26 Aug 2009, Justin Piszcz wrote: > >> On Wed, 26 Aug 2009, Christoph Hellwig wrote: >> >>> On Wed, Aug 26, 2009 at 05:19:11PM -0400, Justin Piszcz wrote: Christoph, Now 6 days without any problems using -o nobarrier. $ uptime 07:43:55 up 6 days, 14:12, 1 user, load average: 0.00, 0.00, 0.00 So -o nobarrier is a workaround for the issue. How / what debug settings should be enabled to catch the bug/problem when -o nobarrier is used? Justin. From twalberg@comcast.net Wed Sep 2 06:50:50 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82BoUUx261420 for ; Wed, 2 Sep 2009 06:50:40 -0500 X-ASG-Debug-ID: 1251892285-53ac01690000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from QMTA03.westchester.pa.mail.comcast.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5ABB241AE9B for ; Wed, 2 Sep 2009 04:51:26 -0700 (PDT) Received: from QMTA03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by cuda.sgi.com with ESMTP id s7rpZksdLmc0Dx6n for ; Wed, 02 Sep 2009 04:51:26 -0700 (PDT) Received: from OMTA19.westchester.pa.mail.comcast.net ([76.96.62.98]) by QMTA03.westchester.pa.mail.comcast.net with comcast id bms01c00327AodY53nqZze; Wed, 02 Sep 2009 11:50:33 +0000 Received: from beta.localdomain ([24.14.6.228]) by OMTA19.westchester.pa.mail.comcast.net with comcast id bnva1c00A4vB7EY3fnvaCv; Wed, 02 Sep 2009 11:55:35 +0000 Received: from calvin.localdomain ([10.0.0.8]) by beta.localdomain with esmtp (Exim 4.69) (envelope-from ) id 1MioN1-00051R-Vz; Wed, 02 Sep 2009 06:51:24 -0500 Received: from tew by calvin.localdomain with local (Exim 4.69) (envelope-from ) id 1MioN1-00029V-Ox; Wed, 02 Sep 2009 06:51:23 -0500 Date: Wed, 2 Sep 2009 06:51:23 -0500 From: Tim Walberg To: Tim Walberg , Christoph Hellwig , Linux-kernel , linux-fsdevel , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs compat_ioctl? Subject: Re: xfs compat_ioctl? Message-ID: <20090902115123.GA13355@comcast.net> Reply-To: Tim Walberg Mail-Followup-To: Tim Walberg , Christoph Hellwig , Linux-kernel , linux-fsdevel , xfs@oss.sgi.com References: <4A9B759B.7020401@msgid.tls.msk.ru> <20090831123010.GA2368@infradead.org> <20090831183751.GC19343@comcast.net> <20090831184822.GA10393@infradead.org> <20090831184918.GB10393@infradead.org> <20090831190209.GD19343@comcast.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline In-Reply-To: <20090831190209.GD19343@comcast.net> Errors-To: Tim Walberg User-Agent: Mutt/1.5.16 (2007-06-09) X-Barracuda-Connect: qmta03.westchester.pa.mail.comcast.net[76.96.62.32] X-Barracuda-Start-Time: 1251892286 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA_TO_FROM_ADDR_MATCH X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_SC0_SA_TO_FROM_ADDR_MATCH Sender Address Matches Recipient Address X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ok, that patch has fixed my issues with xfs_fsr. Now I just need to pull a new copy of xfs_progs to get the xfs_db alignment issue fix... Thanks, tw On 08/31/2009 14:02 -0500, Walberg, Tim wrote: >>=09 >>=09 >> On 08/31/2009 14:49 -0400, Christoph Hellwig wrote: >> >> On Mon, Aug 31, 2009 at 02:48:22PM -0400, Christoph Hellwig wrote: >> >> > On Mon, Aug 31, 2009 at 01:37:51PM -0500, Tim Walberg wrote: >> >> > > Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc= 64 GNU/Linux >> >> > > sparcy:~# file $(which xfs_fsr) >> >> > > /usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Re= quired, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Li= nux 2.6.18, stripped >> >> >=20 >> >> > I'll take a look at that, thanks. >> >>=09 >> >> Err, sorry - is that with the patch I posted in this thread or withou= t? >> End of included message >>=09 >>=09 >> No, that's the generic 2.6.30.4... I can attempt with that patch as well= , but >> it might be a day or two... >>=09 >> tw >>=09 End of included message --=20 twalberg@comcast.net --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqeXDsACgkQw+Wcj22rJWaHTgCcDXj5l5OCxgtqjI0yX3/iqjEz I9gAnA1wnOpQh6vGhmNxMMvJOphas5tM =mAQt -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb-- From rumi_ml@rtfm.hu Wed Sep 2 08:17:51 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82DHVJW004099 for ; Wed, 2 Sep 2009 08:17:41 -0500 X-ASG-Debug-ID: 1251897482-6bbc03340000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nexus.dynaweb.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C001041BCA0 for ; Wed, 2 Sep 2009 06:18:02 -0700 (PDT) Received: from nexus.dynaweb.hu (nexus.dynaweb.hu [195.70.37.87]) by cuda.sgi.com with ESMTP id QA0JSOLW3FFoLMK7 for ; Wed, 02 Sep 2009 06:18:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by nexus.dynaweb.hu (Postfix) with ESMTP id 5515243B0E for ; Wed, 2 Sep 2009 15:17:31 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Scanned: by amavisd-new using ClamAV at dynaweb.hu Received: from nexus.dynaweb.hu ([127.0.0.1]) by localhost (nexus.dynaweb.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OQDweFb6RIiU for ; Wed, 2 Sep 2009 15:17:30 +0200 (CEST) Received: from raketa.ipn.dynaweb.hu (catv-80-99-36-176.catv.broadband.hu [80.99.36.176]) by nexus.dynaweb.hu (Postfix) with ESMTPSA id 0FC5440131 for ; Wed, 2 Sep 2009 15:17:30 +0200 (CEST) Date: Wed, 2 Sep 2009 15:17:29 +0200 From: RUMI Szabolcs To: xfs@oss.sgi.com X-ASG-Orig-Subj: Structure needs cleaning? Subject: Structure needs cleaning? Message-Id: <20090902151729.32701dd7.rumi_ml@rtfm.hu> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.5; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: nexus.dynaweb.hu[195.70.37.87] X-Barracuda-Start-Time: 1251897507 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7904 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean Hi! I'm experiencing errors like this: ls: cannot access 11090000.xhp: Structure needs cleaning These files were part of an OpenOffice 3.1.0 source tree, and could not be removed by rm -rf, which was also reporting the above error. In the dmesg there are errors like this, apparently the same one for each access attempt: Pid: 29510, comm: mc Tainted: P 2.6.29-gentoo-r5-PAE #1 Call Trace: [] xfs_da_do_buf+0x8c4/0x900 [] xfs_da_read_buf+0x30/0x40 [] xfs_da_read_buf+0x30/0x40 [] pollwake+0x0/0x50 [] pollwake+0x0/0x50 [] xfs_da_read_buf+0x30/0x40 [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 [] xfs_dir2_leaf_lookup+0x27/0xc0 [] xfs_dir2_isleaf+0x1f/0x60 [] xfs_dir_lookup+0xd8/0x180 [] xfs_lookup+0x6b/0xf0 [] xfs_vn_lookup+0x55/0xa0 [] do_lookup+0x1ba/0x1e0 [] __link_path_walk+0x6cd/0xd60 [] xfs_dir2_leaf_getdents+0x5ff/0xad0 [] path_walk+0x54/0xc0 [] do_path_lookup+0x83/0x170 [] getname+0x9b/0xe0 [] user_path_at+0x5a/0x90 [] vfs_lstat_fd+0x1f/0x50 [] sys_lstat64+0xf/0x30 [] touch_atime+0x14/0x130 [] vfs_readdir+0x78/0xb0 [] sys_getdents64+0xa1/0xd0 [] sysenter_do_call+0x12/0x25 Is this a known one? Thanks, Sab From rumi_ml@rtfm.hu Wed Sep 2 08:23:12 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82DMpYp004377 for ; Wed, 2 Sep 2009 08:23:01 -0500 X-ASG-Debug-ID: 1251897801-0e6f02d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nexus.dynaweb.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7C7151B886C3 for ; Wed, 2 Sep 2009 06:23:21 -0700 (PDT) Received: from nexus.dynaweb.hu (nexus.dynaweb.hu [195.70.37.87]) by cuda.sgi.com with ESMTP id 7iZN6mzd0f2dO8P8 for ; Wed, 02 Sep 2009 06:23:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by nexus.dynaweb.hu (Postfix) with ESMTP id A5B304D454 for ; Wed, 2 Sep 2009 15:22:47 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Scanned: by amavisd-new using ClamAV at dynaweb.hu Received: from nexus.dynaweb.hu ([127.0.0.1]) by localhost (nexus.dynaweb.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5OKfyZODlOD for ; Wed, 2 Sep 2009 15:22:46 +0200 (CEST) Received: from raketa.ipn.dynaweb.hu (catv-80-99-36-176.catv.broadband.hu [80.99.36.176]) by nexus.dynaweb.hu (Postfix) with ESMTPSA id 2A22C43B15 for ; Wed, 2 Sep 2009 15:22:46 +0200 (CEST) Date: Wed, 2 Sep 2009 15:22:45 +0200 From: RUMI Szabolcs To: xfs@oss.sgi.com X-ASG-Orig-Subj: Structure needs cleaning? (take #2) Subject: Structure needs cleaning? (take #2) Message-Id: <20090902152245.b2969883.rumi_ml@rtfm.hu> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.5; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: nexus.dynaweb.hu[195.70.37.87] X-Barracuda-Start-Time: 1251897825 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7906 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean Hi! Sorry but my previous post was missing the important first two lines: d62c8000: 2c 30 78 41 41 41 41 30 30 30 30 2c 36 2c 30 78 ,0xAAAA0000,6,0x Filesystem "sda10": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xc02cc790 Pid: 29510, comm: mc Tainted: P 2.6.29-gentoo-r5-PAE #1 Call Trace: [] xfs_da_do_buf+0x8c4/0x900 [] xfs_da_read_buf+0x30/0x40 [] xfs_da_read_buf+0x30/0x40 [] pollwake+0x0/0x50 [] pollwake+0x0/0x50 [] xfs_da_read_buf+0x30/0x40 [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 [] xfs_dir2_leaf_lookup+0x27/0xc0 [] xfs_dir2_isleaf+0x1f/0x60 [] xfs_dir_lookup+0xd8/0x180 [] xfs_lookup+0x6b/0xf0 [] xfs_vn_lookup+0x55/0xa0 [] do_lookup+0x1ba/0x1e0 [] __link_path_walk+0x6cd/0xd60 [] xfs_dir2_leaf_getdents+0x5ff/0xad0 [] path_walk+0x54/0xc0 [] do_path_lookup+0x83/0x170 [] getname+0x9b/0xe0 [] user_path_at+0x5a/0x90 [] vfs_lstat_fd+0x1f/0x50 [] sys_lstat64+0xf/0x30 [] touch_atime+0x14/0x130 [] vfs_readdir+0x78/0xb0 [] sys_getdents64+0xa1/0xd0 [] sysenter_do_call+0x12/0x25 Thanks, Sab From jack@suse.cz Wed Sep 2 08:58:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82DwbDn006810 for ; Wed, 2 Sep 2009 08:58:48 -0500 X-ASG-Debug-ID: 1251899971-2f1b031a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 825E11B88204 for ; Wed, 2 Sep 2009 06:59:31 -0700 (PDT) Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id EQZPGFnubfYiDz9d for ; Wed, 02 Sep 2009 06:59:31 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id DB7279337C; Wed, 2 Sep 2009 15:59:28 +0200 (CEST) Received: by duck.suse.cz (Postfix, from userid 10005) id D311A6844D; Wed, 2 Sep 2009 15:59:27 +0200 (CEST) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: LKML , hch@lst.de, Jan Kara , ocfs2-devel@oss.oracle.com, Joel Becker , Felix Blyakher , xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 03/16] vfs: Remove syncing from generic_file_direct_write() and generic_file_buffered_write() Subject: [PATCH 03/16] vfs: Remove syncing from generic_file_direct_write() and generic_file_buffered_write() Date: Wed, 2 Sep 2009 15:59:13 +0200 Message-Id: <1251899966-7316-4-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1251899966-7316-1-git-send-email-jack@suse.cz> References: <1251899966-7316-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: cantor.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1251899973 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean generic_file_direct_write() and generic_file_buffered_write() called generic_osync_inode() if it was called on O_SYNC file or IS_SYNC inode. But this is superfluous since generic_file_aio_write() does the syncing as well. Also XFS and OCFS2 which call these functions directly handle syncing themselves. So let's have a single place where syncing happens: generic_file_aio_write(). We slightly change the behavior by syncing only the range of file to which the write happened for buffered writes but that should be all that is required. CC: ocfs2-devel@oss.oracle.com CC: Joel Becker CC: Felix Blyakher CC: xfs@oss.sgi.com Signed-off-by: Jan Kara --- mm/filemap.c | 35 ++++++----------------------------- 1 files changed, 6 insertions(+), 29 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 554a396..f863e1d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2187,20 +2187,7 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov, } *ppos = end; } - - /* - * Sync the fs metadata but not the minor inode changes and - * of course not the data as we did direct DMA for the IO. - * i_mutex is held, which protects generic_osync_inode() from - * livelocking. AIO O_DIRECT ops attempt to sync metadata here. - */ out: - if ((written >= 0 || written == -EIOCBQUEUED) && - ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { - int err = generic_osync_inode(inode, mapping, OSYNC_METADATA); - if (err < 0) - written = err; - } return written; } EXPORT_SYMBOL(generic_file_direct_write); @@ -2332,8 +2319,6 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, { struct file *file = iocb->ki_filp; struct address_space *mapping = file->f_mapping; - const struct address_space_operations *a_ops = mapping->a_ops; - struct inode *inode = mapping->host; ssize_t status; struct iov_iter i; @@ -2343,16 +2328,6 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, if (likely(status >= 0)) { written += status; *ppos = pos + status; - - /* - * For now, when the user asks for O_SYNC, we'll actually give - * O_DSYNC - */ - if (unlikely((file->f_flags & O_SYNC) || IS_SYNC(inode))) { - if (!a_ops->writepage || !is_sync_kiocb(iocb)) - status = generic_osync_inode(inode, mapping, - OSYNC_METADATA|OSYNC_DATA); - } } /* @@ -2514,11 +2489,12 @@ ssize_t generic_file_aio_write_nolock(struct kiocb *iocb, ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); - if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { + if ((ret > 0 || ret == -EIOCBQUEUED) && + ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { ssize_t err; err = sync_page_range_nolock(inode, mapping, pos, ret); - if (err < 0) + if (err < 0 && ret > 0) ret = err; } return ret; @@ -2550,11 +2526,12 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); mutex_unlock(&inode->i_mutex); - if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { + if ((ret > 0 || ret == -EIOCBQUEUED) && + ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { ssize_t err; err = sync_page_range(inode, mapping, pos, ret); - if (err < 0) + if (err < 0 && ret > 0) ret = err; } return ret; -- 1.6.0.2 From jack@suse.cz Wed Sep 2 08:59:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82DxcAj006909 for ; Wed, 2 Sep 2009 08:59:48 -0500 X-ASG-Debug-ID: 1251900032-3e4301c80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 12BD241B8DD for ; Wed, 2 Sep 2009 07:00:32 -0700 (PDT) Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id VZ1hc3ecGvlZJZ36 for ; Wed, 02 Sep 2009 07:00:32 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation 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 E55F993B18; Wed, 2 Sep 2009 15:59:29 +0200 (CEST) Received: by duck.suse.cz (Postfix, from userid 10005) id 5B472168B85; Wed, 2 Sep 2009 15:59:29 +0200 (CEST) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: LKML , hch@lst.de, Jan Kara , Felix Blyakher , xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 13/16] xfs: Convert sync_page_range() to simple filemap_write_and_wait_range() Subject: [PATCH 13/16] xfs: Convert sync_page_range() to simple filemap_write_and_wait_range() Date: Wed, 2 Sep 2009 15:59:23 +0200 Message-Id: <1251899966-7316-14-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1251899966-7316-1-git-send-email-jack@suse.cz> References: <1251899966-7316-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: cantor.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1251900035 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig says that it is enough for XFS to call filemap_write_and_wait_range() instead of sync_page_range() because we do all the metadata syncing when forcing the log. CC: Felix Blyakher CC: xfs@oss.sgi.com CC: Christoph Hellwig Signed-off-by: Jan Kara --- fs/xfs/linux-2.6/xfs_lrw.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 7078974..fde63a3 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c @@ -817,7 +817,8 @@ write_retry: xfs_iunlock(xip, iolock); if (need_i_mutex) mutex_unlock(&inode->i_mutex); - error2 = sync_page_range(inode, mapping, pos, ret); + error2 = filemap_write_and_wait_range(mapping, pos, + pos + ret - 1); if (!error) error = error2; if (need_i_mutex) -- 1.6.0.2 From jack@suse.cz Wed Sep 2 08:59:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82DxcBR006910 for ; Wed, 2 Sep 2009 08:59:48 -0500 X-ASG-Debug-ID: 1251900030-74dc01670000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9558C1B88224 for ; Wed, 2 Sep 2009 07:00:30 -0700 (PDT) Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id rfxc1ZR2JZrwNkCh for ; Wed, 02 Sep 2009 07:00:30 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from relay2.suse.de (relay-ext.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 C220893A00; Wed, 2 Sep 2009 15:59:29 +0200 (CEST) Received: by duck.suse.cz (Postfix, from userid 10005) id 871E42297EC; Wed, 2 Sep 2009 15:59:28 +0200 (CEST) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: LKML , hch@lst.de, Jan Kara , Evgeniy Polyakov , ocfs2-devel@oss.oracle.com, Joel Becker , Felix Blyakher , xfs@oss.sgi.com, Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net, OGAWA Hirofumi , linux-ext4@vger.kernel.org, tytso@mit.edu X-ASG-Orig-Subj: [PATCH 07/16] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode Subject: [PATCH 07/16] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode Date: Wed, 2 Sep 2009 15:59:17 +0200 Message-Id: <1251899966-7316-8-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1251899966-7316-1-git-send-email-jack@suse.cz> References: <1251899966-7316-1-git-send-email-jack@suse.cz> X-Barracuda-Connect: cantor.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1251900035 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Introduce new function for generic inode syncing (vfs_fsync_range) and use it from fsync() path. Introduce also new helper for syncing after a sync write (generic_write_sync) using the generic function. Use these new helpers for syncing from generic VFS functions. This makes O_SYNC writes to block devices acquire i_mutex for syncing. If we really care about this, we can make block_fsync() drop the i_mutex and reacquire it before it returns. CC: Evgeniy Polyakov CC: ocfs2-devel@oss.oracle.com CC: Joel Becker CC: Felix Blyakher CC: xfs@oss.sgi.com CC: Anton Altaparmakov CC: linux-ntfs-dev@lists.sourceforge.net CC: OGAWA Hirofumi CC: linux-ext4@vger.kernel.org CC: tytso@mit.edu Acked-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/splice.c | 22 +++++--------------- fs/sync.c | 55 +++++++++++++++++++++++++++++++++++++++++++++------ include/linux/fs.h | 3 ++ mm/filemap.c | 18 +++++----------- 4 files changed, 63 insertions(+), 35 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index 73766d2..8190237 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -976,25 +976,15 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, if (ret > 0) { unsigned long nr_pages; + int err; - *ppos += ret; nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; - /* - * If file or inode is SYNC and we actually wrote some data, - * sync it. - */ - if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { - int err; - - mutex_lock(&inode->i_mutex); - err = generic_osync_inode(inode, mapping, - OSYNC_METADATA|OSYNC_DATA); - mutex_unlock(&inode->i_mutex); - - if (err) - ret = err; - } + err = generic_write_sync(out, *ppos, ret); + if (err) + ret = err; + else + *ppos += ret; balance_dirty_pages_ratelimited_nr(mapping, nr_pages); } diff --git a/fs/sync.c b/fs/sync.c index 3422ba6..6fe72e6 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -176,19 +176,23 @@ int file_fsync(struct file *filp, struct dentry *dentry, int datasync) } /** - * vfs_fsync - perform a fsync or fdatasync on a file + * vfs_fsync_range - helper to sync a range of data & metadata to disk * @file: file to sync * @dentry: dentry of @file - * @data: only perform a fdatasync operation + * @start: offset in bytes of the beginning of data range to sync + * @end: offset in bytes of the end of data range (inclusive) + * @datasync: perform only datasync * - * Write back data and metadata for @file to disk. If @datasync is - * set only metadata needed to access modified file data is written. + * Write back data in range @start..@end and metadata for @file to disk. If + * @datasync is set only metadata needed to access modified file data is + * written. * * In case this function is called from nfsd @file may be %NULL and * only @dentry is set. This can only happen when the filesystem * implements the export_operations API. */ -int vfs_fsync(struct file *file, struct dentry *dentry, int datasync) +int vfs_fsync_range(struct file *file, struct dentry *dentry, loff_t start, + loff_t end, int datasync) { const struct file_operations *fop; struct address_space *mapping; @@ -212,7 +216,7 @@ int vfs_fsync(struct file *file, struct dentry *dentry, int datasync) goto out; } - ret = filemap_fdatawrite(mapping); + ret = filemap_fdatawrite_range(mapping, start, end); /* * We need to protect against concurrent writers, which could cause @@ -223,12 +227,32 @@ int vfs_fsync(struct file *file, struct dentry *dentry, int datasync) if (!ret) ret = err; mutex_unlock(&mapping->host->i_mutex); - err = filemap_fdatawait(mapping); + + err = filemap_fdatawait_range(mapping, start, end); if (!ret) ret = err; out: return ret; } +EXPORT_SYMBOL(vfs_fsync_range); + +/** + * vfs_fsync - perform a fsync or fdatasync on a file + * @file: file to sync + * @dentry: dentry of @file + * @datasync: only perform a fdatasync operation + * + * Write back data and metadata for @file to disk. If @datasync is + * set only metadata needed to access modified file data is written. + * + * In case this function is called from nfsd @file may be %NULL and + * only @dentry is set. This can only happen when the filesystem + * implements the export_operations API. + */ +int vfs_fsync(struct file *file, struct dentry *dentry, int datasync) +{ + return vfs_fsync_range(file, dentry, 0, LLONG_MAX, datasync); +} EXPORT_SYMBOL(vfs_fsync); static int do_fsync(unsigned int fd, int datasync) @@ -254,6 +278,23 @@ SYSCALL_DEFINE1(fdatasync, unsigned int, fd) return do_fsync(fd, 1); } +/** + * generic_write_sync - perform syncing after a write if file / inode is sync + * @file: file to which the write happened + * @pos: offset where the write started + * @count: length of the write + * + * This is just a simple wrapper about our general syncing function. + */ +int generic_write_sync(struct file *file, loff_t pos, loff_t count) +{ + if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) + return 0; + return vfs_fsync_range(file, file->f_path.dentry, pos, + pos + count - 1, 1); +} +EXPORT_SYMBOL(generic_write_sync); + /* * sys_sync_file_range() permits finely controlled syncing over a segment of * a file in the range offset .. (offset+nbytes-1) inclusive. If nbytes is diff --git a/include/linux/fs.h b/include/linux/fs.h index bc7f0f1..18acaec 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2088,7 +2088,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, extern int filemap_fdatawrite_range(struct address_space *mapping, loff_t start, loff_t end); +extern int vfs_fsync_range(struct file *file, struct dentry *dentry, + loff_t start, loff_t end, int datasync); extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); +extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); extern void sync_supers(void); extern void emergency_sync(void); extern void emergency_remount(void); diff --git a/mm/filemap.c b/mm/filemap.c index 3955f7e..70988a1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -39,11 +39,10 @@ /* * FIXME: remove all knowledge of the buffer layer from the core VM */ -#include /* for generic_osync_inode */ +#include /* for try_to_free_buffers */ #include - /* * Shared mappings implemented 30.11.1994. It's not fully working yet, * though. @@ -2480,19 +2479,16 @@ ssize_t device_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; ssize_t ret; BUG_ON(iocb->ki_pos != pos); ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); - if ((ret > 0 || ret == -EIOCBQUEUED) && - ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { + if (ret > 0 || ret == -EIOCBQUEUED) { ssize_t err; - err = sync_page_range_nolock(inode, mapping, pos, ret); + err = generic_write_sync(file, pos, ret); if (err < 0 && ret > 0) ret = err; } @@ -2515,8 +2511,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; + struct inode *inode = file->f_mapping->host; ssize_t ret; BUG_ON(iocb->ki_pos != pos); @@ -2525,11 +2520,10 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); mutex_unlock(&inode->i_mutex); - if ((ret > 0 || ret == -EIOCBQUEUED) && - ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { + if (ret > 0 || ret == -EIOCBQUEUED) { ssize_t err; - err = sync_page_range(inode, mapping, pos, ret); + err = generic_write_sync(file, pos, ret); if (err < 0 && ret > 0) ret = err; } -- 1.6.0.2 From sandeen@sandeen.net Wed Sep 2 09:30:47 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82EUQB2008658 for ; Wed, 2 Sep 2009 09:30:36 -0500 X-ASG-Debug-ID: 1251901872-74dd02e70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5573C15A250F for ; Wed, 2 Sep 2009 07:31:15 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id a3qYz1Voi2eCIiTT for ; Wed, 02 Sep 2009 07:31:15 -0700 (PDT) Received: from Liberator.local (unknown [10.0.0.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id 430CAAA60C4; Wed, 2 Sep 2009 09:31:10 -0500 (CDT) Message-ID: <4A9E81AD.70003@sandeen.net> Date: Wed, 02 Sep 2009 09:31:09 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: RUMI Szabolcs CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Structure needs cleaning? (take #2) Subject: Re: Structure needs cleaning? (take #2) References: <20090902152245.b2969883.rumi_ml@rtfm.hu> In-Reply-To: <20090902152245.b2969883.rumi_ml@rtfm.hu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1251901880 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7910 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean RUMI Szabolcs wrote: > Hi! > > Sorry but my previous post was missing the important first two lines: Yes, thanks. :) > d62c8000: 2c 30 78 41 41 41 41 30 30 30 30 2c 36 2c 30 78 ,0xAAAA0000,6,0x > Filesystem "sda10": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xc02cc790 This is on-disk corruption, it found bad magic on something it expected to be metadata. You should run xfs_repair. run with -n, or on a restored xfs_metadump image as a dry-run first, if you prefer. -Eric > Pid: 29510, comm: mc Tainted: P 2.6.29-gentoo-r5-PAE #1 > Call Trace: > [] xfs_da_do_buf+0x8c4/0x900 > [] xfs_da_read_buf+0x30/0x40 > [] xfs_da_read_buf+0x30/0x40 > [] pollwake+0x0/0x50 > [] pollwake+0x0/0x50 > [] xfs_da_read_buf+0x30/0x40 > [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 > [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 > [] xfs_dir2_leaf_lookup+0x27/0xc0 > [] xfs_dir2_isleaf+0x1f/0x60 > [] xfs_dir_lookup+0xd8/0x180 > [] xfs_lookup+0x6b/0xf0 > [] xfs_vn_lookup+0x55/0xa0 > [] do_lookup+0x1ba/0x1e0 > [] __link_path_walk+0x6cd/0xd60 > [] xfs_dir2_leaf_getdents+0x5ff/0xad0 > [] path_walk+0x54/0xc0 > [] do_path_lookup+0x83/0x170 > [] getname+0x9b/0xe0 > [] user_path_at+0x5a/0x90 > [] vfs_lstat_fd+0x1f/0x50 > [] sys_lstat64+0xf/0x30 > [] touch_atime+0x14/0x130 > [] vfs_readdir+0x78/0xb0 > [] sys_getdents64+0xa1/0xd0 > [] sysenter_do_call+0x12/0x25 > > Thanks, > Sab > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:43:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HhWAf033626 for ; Wed, 2 Sep 2009 12:43:48 -0500 X-ASG-Debug-ID: 1251913449-4f34024d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4EDDF15B1F79 for ; Wed, 2 Sep 2009 10:44:09 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id gtPnfZPFYPYSFkjM for ; Wed, 02 Sep 2009 10:44:09 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MitsN-0002nG-T1 for xfs@oss.sgi.com; Wed, 02 Sep 2009 17:44:07 +0000 Date: Wed, 2 Sep 2009 13:44:07 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfsprogs: remove unused scripts Subject: xfsprogs: remove unused scripts Message-ID: <20090902174407.GA9759@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251913469 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean xfs_check64.sh and xfs_ncheck64.sh are outdated copies of xfs_check.sh and xfs_ncheck.sh which call a non-existant xfs_db64 binary. They are never installed or otherwise used, so remove them. They are probably a leftover from IRIX Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/db/Makefile =================================================================== --- xfsprogs-dev.orig/db/Makefile 2009-09-02 14:35:19.413268749 -0300 +++ xfsprogs-dev/db/Makefile 2009-09-02 14:35:29.081614935 -0300 @@ -15,7 +15,6 @@ HFILES = addr.h agf.h agfl.h agi.h attr. text.h type.h write.h attrset.h CFILES = $(HFILES:.h=.c) LSRCFILES = xfs_admin.sh xfs_check.sh xfs_ncheck.sh xfs_metadump.sh -LSRCFILES += xfs_check64.sh xfs_ncheck64.sh LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) Index: xfsprogs-dev/db/xfs_check64.sh =================================================================== --- xfsprogs-dev.orig/db/xfs_check64.sh 2009-09-02 14:35:39.477268924 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh -f -# -# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. -# - -OPTS=" " -DBOPTS=" " -USAGE="Usage: xfs_check64 [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" - -while getopts "b:fi:l:stvV" c -do - case $c in - s) OPTS=$OPTS"-s ";; - t) OPTS=$OPTS"-t ";; - v) OPTS=$OPTS"-v ";; - V) OPTS=$OPTS"-V ";; - i) OPTS=$OPTS"-i "$OPTARG" ";; - b) OPTS=$OPTS"-b "$OPTARG" ";; - f) DBOPTS=" -f";; - l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; - \?) echo $USAGE 1>&2 - exit 2 - ;; - esac -done -set -- extra $@ -shift $OPTIND -case $# in - 1) xfs_db64$DBOPTS -F -i -p xfs_check64 -c "check$OPTS" $1 - status=$? - ;; - *) echo $USAGE 1>&2 - exit 2 - ;; -esac -exit $status Index: xfsprogs-dev/db/xfs_ncheck64.sh =================================================================== --- xfsprogs-dev.orig/db/xfs_ncheck64.sh 2009-09-02 14:35:33.717268763 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh -f -# -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# - -OPTS=" " -DBOPTS=" " -USAGE="usage: xfs_ncheck64 [-sfvV] [-l logdev] [-i ino]... special" - -while getopts "b:fi:l:svV" c -do - case $c in - s) OPTS=$OPTS"-s ";; - i) OPTS=$OPTS"-i "$OPTARG" ";; - v) OPTS=$OPTS"-v ";; - V) OPTS=$OPTS"-V ";; - f) DBOPTS=" -f";; - l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; - \?) echo $USAGE 1>&2 - exit 2 - ;; - esac -done -set -- extra $@ -shift $OPTIND -case $# in - 1) xfs_db64$DBOPTS -r -p xfs_ncheck64 -c "blockget -ns" -c "ncheck$OPTS" $1 - status=$? - ;; - *) echo $USAGE 1>&2 - exit 2 - ;; -esac -exit $status From sandeen@sandeen.net Wed Sep 2 12:45:08 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HilJK033685 for ; Wed, 2 Sep 2009 12:44:58 -0500 X-ASG-Debug-ID: 1251913523-70a203220000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5407141E181 for ; Wed, 2 Sep 2009 10:45:23 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 7XDAGu5KGlkSi4ex for ; Wed, 02 Sep 2009 10:45:23 -0700 (PDT) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n82HjCcs003479; Wed, 2 Sep 2009 13:45:12 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n82HjB3Q003113; Wed, 2 Sep 2009 13:45:12 -0400 Message-ID: <4A9EAF27.6090109@sandeen.net> Date: Wed, 02 Sep 2009 12:45:11 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfstests: fix 192 for external logs and enable it by default Subject: Re: [PATCH] xfstests: fix 192 for external logs and enable it by default References: <20090826220836.GA18119@infradead.org> In-Reply-To: <20090826220836.GA18119@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1251913544 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7922 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > Use _test_mount instead of plain mount to make it work with external logs. > > Enable it by default now that it runs everywhere. > > Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen > Index: xfstests-dev/group > =================================================================== > --- xfstests-dev.orig/group 2009-08-26 21:57:59.000000000 +0000 > +++ xfstests-dev/group 2009-08-26 21:58:06.000000000 +0000 > @@ -301,7 +301,7 @@ prealloc > 189 mount auto quick > 190 rw auto quick > 191 nfs4acl auto > -192 atime > +192 atime auto > 193 metadata auto quick > 194 rw auto > 195 ioctl dump auto quick > Index: xfstests-dev/192 > =================================================================== > --- xfstests-dev.orig/192 2009-08-26 21:57:51.000000000 +0000 > +++ xfstests-dev/192 2009-08-26 22:04:16.000000000 +0000 > @@ -67,7 +67,7 @@ time2=`_access_time $testfile | tee -a $ > > cd / > umount $TEST_DIR > -mount $TEST_DIR > +_test_mount > time3=`_access_time $testfile | tee -a $seq.full` > > delta1=`expr $time2 - $time1` > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:47:30 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Hl5fC033823 for ; Wed, 2 Sep 2009 12:47:20 -0500 X-ASG-Debug-ID: 1251913682-4b1d00ca0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BC3F641E203 for ; Wed, 2 Sep 2009 10:48:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id B6Cfn3wiTbClRBks for ; Wed, 02 Sep 2009 10:48:02 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Mitt6-00035M-01; Wed, 02 Sep 2009 17:44:52 +0000 Date: Wed, 2 Sep 2009 13:44:51 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Michael Monnerie X-ASG-Orig-Subj: [PATCH] xfsprogs: fix the -V option for various shell scripts Subject: [PATCH] xfsprogs: fix the -V option for various shell scripts Message-ID: <20090902174451.GB9759@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251913682 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean For most of the shellscripts wrapping xfs_db or xfs_growfs the -V option is not implemented correctly. If we just add -V to the options for the underlying binaries we will never actually call it because the mandatory device / mount point argument is missing. Instead just call the underlying command with -V directly and exit early. This is what xfs_bmap.sh, xfs_mkfile and xfs_metadump.sh are already doing. Signed-off-by: Christoph Hellwig Reported-by: Michael Monnerie Index: xfsprogs-dev/db/xfs_admin.sh =================================================================== --- xfsprogs-dev.orig/db/xfs_admin.sh 2009-09-02 14:36:22.045272960 -0300 +++ xfsprogs-dev/db/xfs_admin.sh 2009-09-02 14:38:28.497305969 -0300 @@ -19,7 +19,10 @@ do L) DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";; u) DB_OPTS=$DB_OPTS" -r -c uuid";; U) DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'";; - V) DB_OPTS=$DB_OPTS" -V";; + V) xfs_db -p xfs_admin -V + status=$? + exit $status + ;; \?) echo $USAGE 1>&2 exit 2 ;; Index: xfsprogs-dev/db/xfs_check.sh =================================================================== --- xfsprogs-dev.orig/db/xfs_check.sh 2009-09-02 14:36:22.069271261 -0300 +++ xfsprogs-dev/db/xfs_check.sh 2009-09-02 14:38:28.501271696 -0300 @@ -13,11 +13,14 @@ do s) OPTS=$OPTS"-s ";; t) OPTS=$OPTS"-t ";; v) OPTS=$OPTS"-v ";; - V) OPTS=$OPTS"-V ";; i) OPTS=$OPTS"-i "$OPTARG" ";; b) OPTS=$OPTS"-b "$OPTARG" ";; f) DBOPTS=$DBOPTS" -f";; l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; + V) xfs_db -p xfs_check -V + status=$? + exit $status + ;; \?) echo $USAGE 1>&2 exit 2 ;; Index: xfsprogs-dev/db/xfs_ncheck.sh =================================================================== --- xfsprogs-dev.orig/db/xfs_ncheck.sh 2009-09-02 14:36:22.089271988 -0300 +++ xfsprogs-dev/db/xfs_ncheck.sh 2009-09-02 14:38:28.501271696 -0300 @@ -14,9 +14,12 @@ do s) OPTS=$OPTS"-s ";; i) OPTS=$OPTS"-i "$OPTARG" ";; v) OPTS=$OPTS"-v ";; - V) OPTS=$OPTS"-V ";; f) DBOPTS=$DBOPTS" -f";; l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; + V) xfs_db -p xfs_ncheck -V + status=$? + exit $status + ;; \?) echo $USAGE 1>&2 exit 2 ;; Index: xfsprogs-dev/growfs/xfs_info.sh =================================================================== --- xfsprogs-dev.orig/growfs/xfs_info.sh 2009-09-02 14:36:22.101270370 -0300 +++ xfsprogs-dev/growfs/xfs_info.sh 2009-09-02 14:38:28.505312364 -0300 @@ -10,7 +10,10 @@ while getopts "t:V" c do case $c in t) OPTS="-t $OPTARG" ;; - V) OPTS="-V $OPTARG" ;; + V) xfs_growfs -p xfs_info -V + status=$? + exit $status + ;; *) echo $USAGE 1>&2 exit 2 ;; From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:08 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Hvhqg034365 for ; Wed, 2 Sep 2009 12:57:58 -0500 X-ASG-Debug-ID: 1251914319-4b1f01250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 30CC841E03E for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id vVvhnHtGq9HZq35q for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6R-0006SB-N3 for xfs@oss.sgi.com; Wed, 02 Sep 2009 17:58:39 +0000 Message-Id: <20090902175531.469184575@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:31 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 00/14] repair memory usage reductions Subject: [PATCH 00/14] repair memory usage reductions X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914320 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean This is a respin of the patches Barry Naujok wrote at SGI for reducing the memory usage in repair. I've split it up, fixed a few small bugs and added two preparatory cleanups - but all the real work is Barry's. There has been lots of heavy testing on large filesystems by Barry on the original patches, and quite a lot of testing on slightly smaller filesystems by me. These were all ad-hoc tests as XFSQA coverage is rather low on repair. My plan is to add various additional testcase for XFSQA both for intentional corruptions as well as reproducing past reported bugs before we'll release these patches in xfsprogs. But I think it would be good if we could get them into the development git tree to get wider coverage already. From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:08 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HvhpT034366 for ; Wed, 2 Sep 2009 12:57:58 -0500 X-ASG-Debug-ID: 1251914320-70f603da0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 698B341E03E for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id yHJhGpswi06gMZKs for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6R-0006Sm-W1 for xfs@oss.sgi.com; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175839.915684396@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:32 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 01/14] repair: merge scanfunc_bno and scanfunc_cnt Subject: [PATCH 01/14] repair: merge scanfunc_bno and scanfunc_cnt References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-unify-scanfunc-bno-cnt X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914320 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Those two functions are almost identical. The big difference is that we only move blocks from XR_E_FREE1 to XR_E_FREE state when processing the cnt btree. Besides that we print bno vs cnt in the messages and obviously validate a slightly different magic number in the header. Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 18:24:26.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 18:40:59.000000000 +0000 @@ -439,15 +439,16 @@ _("out-of-order bmap key (file offset) i } void -scanfunc_bno( +scanfunc_allocbt( struct xfs_btree_block *block, int level, xfs_agblock_t bno, xfs_agnumber_t agno, int suspect, - int isroot - ) + int isroot, + __uint32_t magic) { + const char *name; xfs_agblock_t b, e; int i; xfs_alloc_ptr_t *pp; @@ -456,16 +457,18 @@ scanfunc_bno( int numrecs; int state; - if (be32_to_cpu(block->bb_magic) != XFS_ABTB_MAGIC) { - do_warn(_("bad magic # %#x in btbno block %d/%d\n"), - be32_to_cpu(block->bb_magic), agno, bno); + name = (magic == XFS_ABTB_MAGIC) ? "bno" : "cnt"; + + if (be32_to_cpu(block->bb_magic) != magic) { + do_warn(_("bad magic # %#x in bt%s block %d/%d\n"), + be32_to_cpu(block->bb_magic), name, agno, bno); hdr_errors++; if (suspect) return; } if (be16_to_cpu(block->bb_level) != level) { - do_warn(_("expected level %d got %d in btbno block %d/%d\n"), - level, be16_to_cpu(block->bb_level), agno, bno); + do_warn(_("expected level %d got %d in bt%s block %d/%d\n"), + level, be16_to_cpu(block->bb_level), name, agno, bno); hdr_errors++; if (suspect) return; @@ -483,8 +486,8 @@ scanfunc_bno( default: set_agbno_state(mp, agno, bno, XR_E_MULT); do_warn( -_("bno freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), - state, agno, bno, suspect); +_("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), + name, state, agno, bno, suspect); return; } @@ -520,15 +523,27 @@ _("bno freespace btree block claimed (st continue; for (b = be32_to_cpu(rp[i].ar_startblock); b < e; b++) { - if (get_agbno_state(mp, agno, b) - == XR_E_UNKNOWN) + state = get_agbno_state(mp, agno, b); + switch (state) { + case XR_E_UNKNOWN: set_agbno_state(mp, agno, b, XR_E_FREE1); - else { + break; + case XR_E_FREE1: + /* + * no warning messages -- we'll catch + * FREE1 blocks later + */ + if (magic != XFS_ABTB_MAGIC) { + set_agbno_state(mp, agno, b, + XR_E_FREE); + break; + } + default: do_warn( - _("block (%d,%d) multiply claimed by bno space tree, state - %d\n"), - agno, b, - get_agbno_state(mp, agno, b)); + _("block (%d,%d) multiply claimed by %s space tree, state - %d\n"), + agno, b, name, state); + break; } } } @@ -575,12 +590,26 @@ _("bno freespace btree block claimed (st */ if (be32_to_cpu(pp[i]) != 0 && verify_agbno(mp, agno, be32_to_cpu(pp[i]))) - scan_sbtree(be32_to_cpu(pp[i]), level, agno, - suspect, scanfunc_bno, 0); + scan_sbtree(be32_to_cpu(pp[i]), level, agno, suspect, + (magic == XFS_ABTB_MAGIC) ? + scanfunc_bno : scanfunc_cnt, 0); } } void +scanfunc_bno( + struct xfs_btree_block *block, + int level, + xfs_agblock_t bno, + xfs_agnumber_t agno, + int suspect, + int isroot) +{ + return scanfunc_allocbt(block, level, bno, agno, + suspect, isroot, XFS_ABTB_MAGIC); +} + +void scanfunc_cnt( struct xfs_btree_block *block, int level, @@ -590,136 +619,8 @@ scanfunc_cnt( int isroot ) { - xfs_alloc_ptr_t *pp; - xfs_alloc_rec_t *rp; - xfs_agblock_t b, e; - int i; - int hdr_errors; - int numrecs; - int state; - - hdr_errors = 0; - - if (be32_to_cpu(block->bb_magic) != XFS_ABTC_MAGIC) { - do_warn(_("bad magic # %#x in btcnt block %d/%d\n"), - be32_to_cpu(block->bb_magic), agno, bno); - hdr_errors++; - if (suspect) - return; - } - if (be16_to_cpu(block->bb_level) != level) { - do_warn(_("expected level %d got %d in btcnt block %d/%d\n"), - level, be16_to_cpu(block->bb_level), agno, bno); - hdr_errors++; - if (suspect) - return; - } - - /* - * check for btree blocks multiply claimed - */ - state = get_agbno_state(mp, agno, bno); - - switch (state) { - case XR_E_UNKNOWN: - set_agbno_state(mp, agno, bno, XR_E_FS_MAP); - break; - default: - set_agbno_state(mp, agno, bno, XR_E_MULT); - do_warn( -_("bcnt freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), - state, agno, bno, suspect); - return; - } - - numrecs = be16_to_cpu(block->bb_numrecs); - - if (level == 0) { - if (numrecs > mp->m_alloc_mxr[0]) { - numrecs = mp->m_alloc_mxr[0]; - hdr_errors++; - } - if (isroot == 0 && numrecs < mp->m_alloc_mnr[0]) { - numrecs = mp->m_alloc_mnr[0]; - hdr_errors++; - } - - if (hdr_errors) - suspect++; - - rp = XFS_ALLOC_REC_ADDR(mp, block, 1); - for (i = 0; i < numrecs; i++) { - if (be32_to_cpu(rp[i].ar_blockcount) == 0 || - be32_to_cpu(rp[i].ar_startblock) == 0 || - !verify_agbno(mp, agno, be32_to_cpu( - rp[i].ar_startblock)) || - be32_to_cpu(rp[i].ar_blockcount) > - MAXEXTLEN) - continue; - - e = be32_to_cpu(rp[i].ar_startblock) + - be32_to_cpu(rp[i].ar_blockcount); - if (!verify_agbno(mp, agno, e - 1)) - continue; - for (b = be32_to_cpu(rp[i].ar_startblock); b < e; b++) { - state = get_agbno_state(mp, agno, b); - /* - * no warning messages -- we'll catch - * FREE1 blocks later - */ - switch (state) { - case XR_E_FREE1: - set_agbno_state(mp, agno, b, XR_E_FREE); - break; - case XR_E_UNKNOWN: - set_agbno_state(mp, agno, b, - XR_E_FREE1); - break; - default: - do_warn( - _("block (%d,%d) already used, state %d\n"), - agno, b, state); - break; - } - } - } - return; - } - - /* - * interior record - */ - pp = XFS_ALLOC_PTR_ADDR(mp, block, 1, mp->m_alloc_mxr[1]); - - if (numrecs > mp->m_alloc_mxr[1]) { - numrecs = mp->m_alloc_mxr[1]; - hdr_errors++; - } - if (isroot == 0 && numrecs < mp->m_alloc_mnr[1]) { - numrecs = mp->m_alloc_mnr[1]; - hdr_errors++; - } - - /* - * don't pass bogus tree flag down further if this block - * looked ok. bail out if two levels in a row look bad. - */ - - if (suspect && !hdr_errors) - suspect = 0; - - if (hdr_errors) { - if (suspect) - return; - else suspect++; - } - - for (i = 0; i < numrecs; i++) { - if (be32_to_cpu(pp[i]) != 0 && verify_agbno(mp, agno, - be32_to_cpu(pp[i]))) - scan_sbtree(be32_to_cpu(pp[i]), level, agno, - suspect, scanfunc_cnt, 0); - } + return scanfunc_allocbt(block, level, bno, agno, + suspect, isroot, XFS_ABTC_MAGIC); } /* From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Hvi2s034370 for ; Wed, 2 Sep 2009 12:57:59 -0500 X-ASG-Debug-ID: 1251914320-2afc03bc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D834215B1A29 for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id j5ECizDNz8VHycsP for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6S-0006UK-FV; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175840.403232401@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:35 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 04/14] repair: split up scanfunc_ino Subject: [PATCH 04/14] repair: split up scanfunc_ino References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-split-scanfunc_ino X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914320 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Split out a helper to scan a single inode chunk for suspect inodes from scanfunc_ino to make it more readable. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 19:00:15.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 19:03:26.000000000 +0000 @@ -625,6 +625,167 @@ scanfunc_cnt( suspect, isroot, XFS_ABTC_MAGIC); } +static int +scan_single_ino_chunk( + xfs_agnumber_t agno, + xfs_inobt_rec_t *rp, + int suspect) +{ + xfs_ino_t lino; + xfs_agino_t ino; + xfs_agblock_t agbno; + int j; + int nfree; + int off; + int state; + ino_tree_node_t *ino_rec, *first_rec, *last_rec; + + ino = be32_to_cpu(rp->ir_startino); + off = XFS_AGINO_TO_OFFSET(mp, ino); + agbno = XFS_AGINO_TO_AGBNO(mp, ino); + lino = XFS_AGINO_TO_INO(mp, agno, ino); + + /* + * on multi-block block chunks, all chunks start + * at the beginning of the block. with multi-chunk + * blocks, all chunks must start on 64-inode boundaries + * since each block can hold N complete chunks. if + * fs has aligned inodes, all chunks must start + * at a fs_ino_alignment*N'th agbno. skip recs + * with badly aligned starting inodes. + */ + if (ino == 0 || + (inodes_per_block <= XFS_INODES_PER_CHUNK && off != 0) || + (inodes_per_block > XFS_INODES_PER_CHUNK && + off % XFS_INODES_PER_CHUNK != 0) || + (fs_aligned_inodes && agbno % fs_ino_alignment != 0)) { + do_warn( + _("badly aligned inode rec (starting inode = %llu)\n"), + lino); + suspect++; + } + + /* + * verify numeric validity of inode chunk first + * before inserting into a tree. don't have to + * worry about the overflow case because the + * starting ino number of a chunk can only get + * within 255 inodes of max (NULLAGINO). if it + * gets closer, the agino number will be illegal + * as the agbno will be too large. + */ + if (verify_aginum(mp, agno, ino)) { + do_warn( +_("bad starting inode # (%llu (0x%x 0x%x)) in ino rec, skipping rec\n"), + lino, agno, ino); + return ++suspect; + } + + if (verify_aginum(mp, agno, + ino + XFS_INODES_PER_CHUNK - 1)) { + do_warn( +_("bad ending inode # (%llu (0x%x 0x%x)) in ino rec, skipping rec\n"), + lino + XFS_INODES_PER_CHUNK - 1, + agno, ino + XFS_INODES_PER_CHUNK - 1); + return ++suspect; + } + + /* + * set state of each block containing inodes + */ + if (off == 0 && !suspect) { + for (j = 0; + j < XFS_INODES_PER_CHUNK; + j += mp->m_sb.sb_inopblock) { + agbno = XFS_AGINO_TO_AGBNO(mp, ino + j); + state = get_agbno_state(mp, agno, agbno); + if (state == XR_E_UNKNOWN) { + set_agbno_state(mp, agno, agbno, XR_E_INO); + } else if (state == XR_E_INUSE_FS && agno == 0 && + ino + j >= first_prealloc_ino && + ino + j < last_prealloc_ino) { + set_agbno_state(mp, agno, agbno, XR_E_INO); + } else { + do_warn( +_("inode chunk claims used block, inobt block - agno %d, bno %d, inopb %d\n"), + agno, agbno, + mp->m_sb.sb_inopblock); + /* + * XXX - maybe should mark + * block a duplicate + */ + return ++suspect; + } + } + } + + /* + * ensure only one avl entry per chunk + */ + find_inode_rec_range(agno, ino, ino + XFS_INODES_PER_CHUNK, + &first_rec, &last_rec); + if (first_rec != NULL) { + /* + * this chunk overlaps with one (or more) + * already in the tree + */ + do_warn( +_("inode rec for ino %llu (%d/%d) overlaps existing rec (start %d/%d)\n"), + lino, agno, ino, agno, first_rec->ino_startnum); + suspect++; + + /* + * if the 2 chunks start at the same place, + * then we don't have to put this one + * in the uncertain list. go to the next one. + */ + if (first_rec->ino_startnum == ino) + return suspect; + } + + nfree = 0; + + /* + * now mark all the inodes as existing and free or used. + * if the tree is suspect, put them into the uncertain + * inode tree. + */ + if (!suspect) { + if (XFS_INOBT_IS_FREE_DISK(rp, 0)) { + nfree++; + ino_rec = set_inode_free_alloc(agno, ino); + } else { + ino_rec = set_inode_used_alloc(agno, ino); + } + for (j = 1; j < XFS_INODES_PER_CHUNK; j++) { + if (XFS_INOBT_IS_FREE_DISK(rp, j)) { + nfree++; + set_inode_free(ino_rec, j); + } else { + set_inode_used(ino_rec, j); + } + } + } else { + for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { + if (XFS_INOBT_IS_FREE_DISK(rp, j)) { + nfree++; + add_aginode_uncertain(agno, ino + j, 1); + } else { + add_aginode_uncertain(agno, ino + j, 0); + } + } + } + + if (nfree != be32_to_cpu(rp->ir_freecount)) { + do_warn(_("ir_freecount/free mismatch, inode " + "chunk %d/%d, freecount %d nfree %d\n"), + agno, ino, be32_to_cpu(rp->ir_freecount), nfree); + } + + return suspect; +} + + /* * this one walks the inode btrees sucking the info there into * the incore avl tree. We try and rescue corrupted btree records @@ -651,18 +812,11 @@ scanfunc_ino( int isroot ) { - xfs_ino_t lino; int i; - xfs_agino_t ino; - xfs_agblock_t agbno; - int j; - int nfree; - int off; int numrecs; int state; xfs_inobt_ptr_t *pp; xfs_inobt_rec_t *rp; - ino_tree_node_t *ino_rec, *first_rec, *last_rec; int hdr_errors; hdr_errors = 0; @@ -737,165 +891,8 @@ _("inode btree block claimed (state %d), * of INODES_PER_CHUNK (64) inodes. off is the offset into * the block. skip processing of bogus records. */ - for (i = 0; i < numrecs; i++) { - ino = be32_to_cpu(rp[i].ir_startino); - off = XFS_AGINO_TO_OFFSET(mp, ino); - agbno = XFS_AGINO_TO_AGBNO(mp, ino); - lino = XFS_AGINO_TO_INO(mp, agno, ino); - /* - * on multi-block block chunks, all chunks start - * at the beginning of the block. with multi-chunk - * blocks, all chunks must start on 64-inode boundaries - * since each block can hold N complete chunks. if - * fs has aligned inodes, all chunks must start - * at a fs_ino_alignment*N'th agbno. skip recs - * with badly aligned starting inodes. - */ - if (ino == 0 || - (inodes_per_block <= XFS_INODES_PER_CHUNK && - off != 0) || - (inodes_per_block > XFS_INODES_PER_CHUNK && - off % XFS_INODES_PER_CHUNK != 0) || - (fs_aligned_inodes && - agbno % fs_ino_alignment != 0)) { - do_warn( - _("badly aligned inode rec (starting inode = %llu)\n"), - lino); - suspect++; - } - - /* - * verify numeric validity of inode chunk first - * before inserting into a tree. don't have to - * worry about the overflow case because the - * starting ino number of a chunk can only get - * within 255 inodes of max (NULLAGINO). if it - * gets closer, the agino number will be illegal - * as the agbno will be too large. - */ - if (verify_aginum(mp, agno, ino)) { - do_warn( -_("bad starting inode # (%llu (0x%x 0x%x)) in ino rec, skipping rec\n"), - lino, agno, ino); - suspect++; - continue; - } - - if (verify_aginum(mp, agno, - ino + XFS_INODES_PER_CHUNK - 1)) { - do_warn( -_("bad ending inode # (%llu (0x%x 0x%x)) in ino rec, skipping rec\n"), - lino + XFS_INODES_PER_CHUNK - 1, - agno, ino + XFS_INODES_PER_CHUNK - 1); - suspect++; - continue; - } - - /* - * set state of each block containing inodes - */ - if (off == 0 && !suspect) { - for (j = 0; - j < XFS_INODES_PER_CHUNK; - j += mp->m_sb.sb_inopblock) { - agbno = XFS_AGINO_TO_AGBNO(mp, ino + j); - state = get_agbno_state(mp, - agno, agbno); - - if (state == XR_E_UNKNOWN) { - set_agbno_state(mp, agno, - agbno, XR_E_INO); - } else if (state == XR_E_INUSE_FS && - agno == 0 && - ino + j >= first_prealloc_ino && - ino + j < last_prealloc_ino) { - set_agbno_state(mp, agno, - agbno, XR_E_INO); - } else { - do_warn( -_("inode chunk claims used block, inobt block - agno %d, bno %d, inopb %d\n"), - agno, bno, - mp->m_sb.sb_inopblock); - suspect++; - /* - * XXX - maybe should mark - * block a duplicate - */ - continue; - } - } - } - /* - * ensure only one avl entry per chunk - */ - find_inode_rec_range(agno, ino, - ino + XFS_INODES_PER_CHUNK, - &first_rec, - &last_rec); - if (first_rec != NULL) { - /* - * this chunk overlaps with one (or more) - * already in the tree - */ - do_warn( -_("inode rec for ino %llu (%d/%d) overlaps existing rec (start %d/%d)\n"), - lino, agno, ino, - agno, first_rec->ino_startnum); - suspect++; - - /* - * if the 2 chunks start at the same place, - * then we don't have to put this one - * in the uncertain list. go to the next one. - */ - if (first_rec->ino_startnum == ino) - continue; - } - - nfree = 0; - - /* - * now mark all the inodes as existing and free or used. - * if the tree is suspect, put them into the uncertain - * inode tree. - */ - if (!suspect) { - if (XFS_INOBT_IS_FREE_DISK(&rp[i], 0)) { - nfree++; - ino_rec = set_inode_free_alloc(agno, - ino); - } else { - ino_rec = set_inode_used_alloc(agno, - ino); - } - for (j = 1; j < XFS_INODES_PER_CHUNK; j++) { - if (XFS_INOBT_IS_FREE_DISK(&rp[i], j)) { - nfree++; - set_inode_free(ino_rec, j); - } else { - set_inode_used(ino_rec, j); - } - } - } else { - for (j = 0; j < XFS_INODES_PER_CHUNK; j++) { - if (XFS_INOBT_IS_FREE_DISK(&rp[i], j)) { - nfree++; - add_aginode_uncertain(agno, - ino + j, 1); - } else { - add_aginode_uncertain(agno, - ino + j, 0); - } - } - } - - if (nfree != be32_to_cpu(rp[i].ir_freecount)) { - do_warn(_("ir_freecount/free mismatch, inode " - "chunk %d/%d, freecount %d nfree %d\n"), - agno, ino, - be32_to_cpu(rp[i].ir_freecount), nfree); - } - } + for (i = 0; i < numrecs; i++) + suspect = scan_single_ino_chunk(agno, &rp[i], suspect); if (suspect) bad_ino_btree = 1; From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:10 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HviEZ034373 for ; Wed, 2 Sep 2009 12:58:00 -0500 X-ASG-Debug-ID: 1251914320-2afd03d90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9CCE615B1A26 for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id Wrw9h84qUWDPZ2qY for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6S-0006Tn-9v for xfs@oss.sgi.com; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175840.224768080@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:34 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 03/14] repair: kill B_IS_META flag Subject: [PATCH 03/14] repair: kill B_IS_META flag References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-kill-B_IS_META X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914320 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean B_IS_META is the inverse flag of B_IS_INODE which is not really obvious from it's use. So just use !B_IS_INODE to make it more clear. Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/prefetch.c =================================================================== --- xfsprogs-dev.orig/repair/prefetch.c 2009-08-20 00:02:25.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.c 2009-08-20 00:05:36.000000000 +0000 @@ -64,7 +64,6 @@ * the buffer is for an inode or other metadata. */ #define B_IS_INODE(f) (((f) & 5) == 0) -#define B_IS_META(f) (((f) & 5) != 0) #define DEF_BATCH_BYTES 0x10000 @@ -131,7 +130,7 @@ if (fsbno > args->last_bno_read) { radix_tree_insert(&args->primary_io_queue, fsbno, bp); - if (B_IS_META(flag)) + if (!B_IS_INODE(flag)) radix_tree_tag_set(&args->primary_io_queue, fsbno, 0); else { args->inode_bufs_queued++; @@ -153,7 +152,7 @@ (long long)XFS_BUF_ADDR(bp), args->agno, fsbno, args->last_bno_read); #endif - ASSERT(B_IS_META(flag)); + ASSERT(!B_IS_INODE(flag)); XFS_BUF_SET_PRIORITY(bp, B_DIR_META_2); radix_tree_insert(&args->secondary_io_queue, fsbno, bp); } From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HvixB034371 for ; Wed, 2 Sep 2009 12:57:59 -0500 X-ASG-Debug-ID: 1251914321-4f3902df0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6191715B1A28 for ; Wed, 2 Sep 2009 10:58:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id ByHbuwNH3VaytPYI for ; Wed, 02 Sep 2009 10:58:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006WA-1H; Wed, 02 Sep 2009 17:58:41 +0000 Message-Id: <20090902175840.934778714@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:38 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 07/14] repair: use single prefetch queue Subject: [PATCH 07/14] repair: use single prefetch queue References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-use-single-prefetch-queue X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean We don't need two prefetch queues as we guarantee execution in order anyway. XXX: description could use some more details. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/prefetch.c =================================================================== --- xfsprogs-dev.orig/repair/prefetch.c 2009-08-20 00:14:08.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.c 2009-08-20 00:16:01.000000000 +0000 @@ -128,8 +128,9 @@ pthread_mutex_lock(&args->lock); + btree_insert(args->io_queue, fsbno, bp); + if (fsbno > args->last_bno_read) { - btree_insert(args->primary_io_queue, fsbno, bp); if (B_IS_INODE(flag)) { args->inode_bufs_queued++; if (args->inode_bufs_queued == IO_THRESHOLD) @@ -152,7 +153,6 @@ #endif ASSERT(!B_IS_INODE(flag)); XFS_BUF_SET_PRIORITY(bp, B_DIR_META_2); - btree_insert(args->secondary_io_queue, fsbno, bp); } pf_start_processing(args); @@ -405,7 +405,6 @@ pf_which_t which, void *buf) { - struct btree_root *queue; xfs_buf_t *bplist[MAX_BUFS]; unsigned int num; off64_t first_off, last_off, next_off; @@ -416,19 +415,22 @@ unsigned long max_fsbno; char *pbuf; - queue = (which != PF_SECONDARY) ? args->primary_io_queue - : args->secondary_io_queue; - - while (btree_find(queue, 0, &fsbno) != NULL) { - max_fsbno = fsbno + pf_max_fsbs; + for (;;) { num = 0; - - bplist[0] = btree_lookup(queue, fsbno); + if (which == PF_SECONDARY) { + bplist[0] = btree_find(args->io_queue, 0, &fsbno); + max_fsbno = MIN(fsbno + pf_max_fsbs, + args->last_bno_read); + } else { + bplist[0] = btree_find(args->io_queue, + args->last_bno_read, &fsbno); + max_fsbno = fsbno + pf_max_fsbs; + } while (bplist[num] && num < MAX_BUFS && fsbno < max_fsbno) { if (which != PF_META_ONLY || !B_IS_INODE(XFS_BUF_PRIORITY(bplist[num]))) num++; - bplist[num] = btree_lookup_next(queue, &fsbno); + bplist[num] = btree_lookup_next(args->io_queue, &fsbno); } if (!num) return; @@ -440,21 +442,22 @@ */ first_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR(bplist[0])); last_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR(bplist[num-1])) + - XFS_BUF_SIZE(bplist[num-1]); + XFS_BUF_SIZE(bplist[num-1]); while (last_off - first_off > pf_max_bytes) { num--; - last_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR(bplist[num-1])) + - XFS_BUF_SIZE(bplist[num-1]); + last_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR( + bplist[num-1])) + XFS_BUF_SIZE(bplist[num-1]); } - if (num < ((last_off - first_off) >> (mp->m_sb.sb_blocklog + 3))) { + if (num < ((last_off - first_off) >> + (mp->m_sb.sb_blocklog + 3))) { /* * not enough blocks for one big read, so determine * the number of blocks that are close enough. */ last_off = first_off + XFS_BUF_SIZE(bplist[0]); for (i = 1; i < num; i++) { - next_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR(bplist[i])) + - XFS_BUF_SIZE(bplist[i]); + next_off = LIBXFS_BBTOOFF64(XFS_BUF_ADDR( + bplist[i])) + XFS_BUF_SIZE(bplist[i]); if (next_off - last_off > pf_batch_bytes) break; last_off = next_off; @@ -463,7 +466,7 @@ } for (i = 0; i < num; i++) { - if (btree_delete(queue, XFS_DADDR_TO_FSB(mp, + if (btree_delete(args->io_queue, XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bplist[i]))) == NULL) do_error(_("prefetch corruption\n")); } @@ -566,7 +569,7 @@ return NULL; pthread_mutex_lock(&args->lock); - while (!args->queuing_done || btree_find(args->primary_io_queue, 0, NULL)) { + while (!args->queuing_done || btree_find(args->io_queue, 0, NULL)) { #ifdef XR_PF_TRACE pftrace("waiting to start prefetch I/O for AG %d", args->agno); @@ -692,8 +695,7 @@ #endif pthread_mutex_lock(&args->lock); - ASSERT(btree_find(args->primary_io_queue, 0, NULL) == NULL); - ASSERT(btree_find(args->secondary_io_queue, 0, NULL) == NULL); + ASSERT(btree_find(args->io_queue, 0, NULL) == NULL); args->prefetch_done = 1; if (args->next_args) @@ -751,8 +753,7 @@ args = calloc(1, sizeof(prefetch_args_t)); - btree_init(&args->primary_io_queue); - btree_init(&args->secondary_io_queue); + btree_init(&args->io_queue); if (pthread_mutex_init(&args->lock, NULL) != 0) do_error(_("failed to initialize prefetch mutex\n")); if (pthread_cond_init(&args->start_reading, NULL) != 0) @@ -831,8 +832,7 @@ pthread_cond_destroy(&args->start_reading); pthread_cond_destroy(&args->start_processing); sem_destroy(&args->ra_count); - btree_destroy(args->primary_io_queue); - btree_destroy(args->secondary_io_queue); + btree_destroy(args->io_queue); free(args); } Index: xfsprogs-dev/repair/prefetch.h =================================================================== --- xfsprogs-dev.orig/repair/prefetch.h 2009-08-20 00:06:44.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.h 2009-08-20 00:16:01.000000000 +0000 @@ -13,8 +13,7 @@ pthread_mutex_t lock; pthread_t queuing_thread; pthread_t io_threads[PF_THREAD_COUNT]; - struct btree_root *primary_io_queue; - struct btree_root *secondary_io_queue; + struct btree_root *io_queue; pthread_cond_t start_reading; pthread_cond_t start_processing; int agno; From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66, J_CHICKENPOX_75 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Hvi4k034372 for ; Wed, 2 Sep 2009 12:57:59 -0500 X-ASG-Debug-ID: 1251914321-70ad03b70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A23A141E03E for ; Wed, 2 Sep 2009 10:58:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id bai6ziy09rFjZjzI for ; Wed, 02 Sep 2009 10:58:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006Wp-79; Wed, 02 Sep 2009 17:58:41 +0000 Message-Id: <20090902175841.137658776@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:39 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 08/14] repair: clean up prefetch tracing Subject: [PATCH 08/14] repair: clean up prefetch tracing References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-cleanup-prefetch-tracing X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Define a dummy pftrace macro for the non-tracing case to reduce the ifdef hell, clean up a few trace calls and add proper init/exit handlers for the tracing setup and teardown. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/dino_chunks.c =================================================================== --- xfsprogs-dev.orig/repair/dino_chunks.c 2009-08-19 23:42:32.000000000 +0000 +++ xfsprogs-dev/repair/dino_chunks.c 2009-08-20 00:16:53.000000000 +0000 @@ -629,10 +629,9 @@ cluster_count * sizeof(xfs_buf_t*)); for (bp_index = 0; bp_index < cluster_count; bp_index++) { -#ifdef XR_PF_TRACE pftrace("about to read off %llu in AG %d", (long long)XFS_AGB_TO_DADDR(mp, agno, agbno), agno); -#endif + bplist[bp_index] = libxfs_readbuf(mp->m_dev, XFS_AGB_TO_DADDR(mp, agno, agbno), XFS_FSB_TO_BB(mp, blks_per_cluster), 0); @@ -650,11 +649,9 @@ } agbno += blks_per_cluster; -#ifdef XR_PF_TRACE pftrace("readbuf %p (%llu, %d) in AG %d", bplist[bp_index], (long long)XFS_BUF_ADDR(bplist[bp_index]), XFS_BUF_COUNT(bplist[bp_index]), agno); -#endif } agbno = XFS_AGINO_TO_AGBNO(mp, first_irec->ino_startnum); @@ -906,10 +903,10 @@ * done! - finished up irec and block simultaneously */ for (bp_index = 0; bp_index < cluster_count; bp_index++) { -#ifdef XR_PF_TRACE - pftrace("put/writebuf %p (%llu) in AG %d", bplist[bp_index], - (long long)XFS_BUF_ADDR(bplist[bp_index]), agno); -#endif + pftrace("put/writebuf %p (%llu) in AG %d", + bplist[bp_index], (long long) + XFS_BUF_ADDR(bplist[bp_index]), agno); + if (dirty && !no_modify) libxfs_writebuf(bplist[bp_index], 0); else Index: xfsprogs-dev/repair/dir2.c =================================================================== --- xfsprogs-dev.orig/repair/dir2.c 2009-08-19 23:42:32.000000000 +0000 +++ xfsprogs-dev/repair/dir2.c 2009-08-20 00:16:53.000000000 +0000 @@ -103,21 +103,19 @@ bplist = bparray; } for (i = 0; i < nex; i++) { -#ifdef XR_PF_TRACE pftrace("about to read off %llu (len = %d)", (long long)XFS_FSB_TO_DADDR(mp, bmp[i].startblock), XFS_FSB_TO_BB(mp, bmp[i].blockcount)); -#endif + bplist[i] = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, bmp[i].startblock), XFS_FSB_TO_BB(mp, bmp[i].blockcount), 0); if (!bplist[i]) goto failed; -#ifdef XR_PF_TRACE + pftrace("readbuf %p (%llu, %d)", bplist[i], (long long)XFS_BUF_ADDR(bplist[i]), XFS_BUF_COUNT(bplist[i])); -#endif } dabuf = malloc(XFS_DA_BUF_SIZE(nex)); if (dabuf == NULL) { @@ -248,10 +246,8 @@ } da_buf_done(dabuf); for (i = 0; i < nbuf; i++) { -#ifdef XR_PF_TRACE pftrace("putbuf %p (%llu)", bplist[i], (long long)XFS_BUF_ADDR(bplist[i])); -#endif libxfs_putbuf(bplist[i]); } if (bplist != &bp) @@ -538,7 +534,7 @@ /* * bail out if this is the root block (top of tree) */ - if (this_level >= cursor->active) + if (this_level >= cursor->active) return(0); /* * set hashvalue to correctl reflect the now-validated @@ -1425,7 +1421,7 @@ * numbers. Do NOT touch the name until after we've computed * the hashvalue and done a namecheck() on the name. * - * Conditions must either set clearino to zero or set + * Conditions must either set clearino to zero or set * clearreason why it's being cleared. */ if (!ino_discovery && ent_ino == BADFSINO) { @@ -1456,7 +1452,7 @@ if (ino_discovery) { add_inode_uncertain(mp, ent_ino, 0); clearino = 0; - } else + } else clearreason = _("non-existent"); } else { /* Index: xfsprogs-dev/repair/globals.h =================================================================== --- xfsprogs-dev.orig/repair/globals.h 2009-08-19 23:42:32.000000000 +0000 +++ xfsprogs-dev/repair/globals.h 2009-08-20 00:16:53.000000000 +0000 @@ -199,10 +199,6 @@ EXTERN int report_interval; EXTERN __uint64_t *prog_rpt_done; -#ifdef XR_PF_TRACE -EXTERN FILE *pf_trace_file; -#endif - EXTERN int ag_stride; EXTERN int thread_count; Index: xfsprogs-dev/repair/init.c =================================================================== --- xfsprogs-dev.orig/repair/init.c 2009-08-20 00:06:44.000000000 +0000 +++ xfsprogs-dev/repair/init.c 2009-08-20 00:16:53.000000000 +0000 @@ -150,4 +150,5 @@ ts_create(); ts_init(); increase_rlimit(); + pftrace_init(); } Index: xfsprogs-dev/repair/prefetch.c =================================================================== --- xfsprogs-dev.orig/repair/prefetch.c 2009-08-20 00:16:01.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.c 2009-08-20 00:16:53.000000000 +0000 @@ -83,9 +83,8 @@ prefetch_args_t *args) { if (!args->can_start_processing) { -#ifdef XR_PF_TRACE pftrace("signalling processing for AG %d", args->agno); -#endif + args->can_start_processing = 1; pthread_cond_signal(&args->start_processing); } @@ -96,9 +95,8 @@ prefetch_args_t *args) { if (!args->can_start_reading) { -#ifdef XR_PF_TRACE pftrace("signalling reading for AG %d", args->agno); -#endif + args->can_start_reading = 1; pthread_cond_broadcast(&args->start_reading); } @@ -136,25 +134,16 @@ if (args->inode_bufs_queued == IO_THRESHOLD) pf_start_io_workers(args); } -#ifdef XR_PF_TRACE - pftrace("getbuf %c %p (%llu) in AG %d (fsbno = %lu) added to " - "primary queue (inode_bufs_queued = %d, last_bno = %lu)", - B_IS_INODE(flag) ? 'I' : 'M', bp, - (long long)XFS_BUF_ADDR(bp), args->agno, fsbno, - args->inode_bufs_queued, args->last_bno_read); -#endif } else { -#ifdef XR_PF_TRACE - pftrace("getbuf %c %p (%llu) in AG %d (fsbno = %lu) added to " - "secondary queue (last_bno = %lu)", - B_IS_INODE(flag) ? 'I' : 'M', bp, - (long long)XFS_BUF_ADDR(bp), args->agno, fsbno, - args->last_bno_read); -#endif ASSERT(!B_IS_INODE(flag)); XFS_BUF_SET_PRIORITY(bp, B_DIR_META_2); } + pftrace("getbuf %c %p (%llu) in AG %d (fsbno = %lu) added to queue" + "(inode_bufs_queued = %d, last_bno = %lu)", B_IS_INODE(flag) ? + 'I' : 'M', bp, (long long)XFS_BUF_ADDR(bp), args->agno, fsbno, + args->inode_bufs_queued, args->last_bno_read); + pf_start_processing(args); pthread_mutex_unlock(&args->lock); @@ -192,9 +181,9 @@ while (irec.br_blockcount) { unsigned int len; -#ifdef XR_PF_TRACE + pftrace("queuing dir extent in AG %d", args->agno); -#endif + len = (irec.br_blockcount > mp->m_dirblkfsbs) ? mp->m_dirblkfsbs : irec.br_blockcount; pf_queue_io(args, irec.br_startblock, len, B_DIR_META); @@ -520,20 +509,16 @@ } } for (i = 0; i < num; i++) { -#ifdef XR_PF_TRACE pftrace("putbuf %c %p (%llu) in AG %d", B_IS_INODE(XFS_BUF_PRIORITY(bplist[i])) ? 'I' : 'M', bplist[i], (long long)XFS_BUF_ADDR(bplist[i]), args->agno); -#endif libxfs_putbuf(bplist[i]); } pthread_mutex_lock(&args->lock); if (which != PF_SECONDARY) { -#ifdef XR_PF_TRACE pftrace("inode_bufs_queued for AG %d = %d", args->agno, args->inode_bufs_queued); -#endif /* * if primary inode queue running low, process metadata * in boths queues to avoid I/O starvation as the @@ -542,15 +527,14 @@ */ if (which == PF_PRIMARY && !args->queuing_done && args->inode_bufs_queued < IO_THRESHOLD) { -#ifdef XR_PF_TRACE pftrace("reading metadata bufs from primary queue for AG %d", args->agno); -#endif + pf_batch_read(args, PF_META_ONLY, buf); -#ifdef XR_PF_TRACE + pftrace("reading bufs from secondary queue for AG %d", args->agno); -#endif + pf_batch_read(args, PF_SECONDARY, buf); } } @@ -571,20 +555,18 @@ pthread_mutex_lock(&args->lock); while (!args->queuing_done || btree_find(args->io_queue, 0, NULL)) { -#ifdef XR_PF_TRACE pftrace("waiting to start prefetch I/O for AG %d", args->agno); -#endif + while (!args->can_start_reading && !args->queuing_done) pthread_cond_wait(&args->start_reading, &args->lock); -#ifdef XR_PF_TRACE + pftrace("starting prefetch I/O for AG %d", args->agno); -#endif + pf_batch_read(args, PF_PRIMARY, buf); pf_batch_read(args, PF_SECONDARY, buf); -#ifdef XR_PF_TRACE pftrace("ran out of bufs to prefetch for AG %d", args->agno); -#endif + if (!args->queuing_done) args->can_start_reading = 0; } @@ -592,9 +574,8 @@ free(buf); -#ifdef XR_PF_TRACE pftrace("finished prefetch I/O for AG %d", args->agno); -#endif + return NULL; } @@ -636,10 +617,7 @@ break; } } - -#ifdef XR_PF_TRACE pftrace("starting prefetch for AG %d", args->agno); -#endif for (irec = findfirst_inode_rec(args->agno); irec != NULL; irec = next_ino_rec(irec)) { @@ -676,10 +654,9 @@ pthread_mutex_lock(&args->lock); -#ifdef XR_PF_TRACE pftrace("finished queuing inodes for AG %d (inode_bufs_queued = %d)", args->agno, args->inode_bufs_queued); -#endif + args->queuing_done = 1; pf_start_io_workers(args); pf_start_processing(args); @@ -690,9 +667,8 @@ if (args->io_threads[i]) pthread_join(args->io_threads[i], NULL); -#ifdef XR_PF_TRACE pftrace("prefetch for AG %d finished", args->agno); -#endif + pthread_mutex_lock(&args->lock); ASSERT(btree_find(args->io_queue, 0, NULL) == NULL); @@ -712,9 +688,8 @@ { int err; -#ifdef XR_PF_TRACE pftrace("creating queue thread for AG %d", args->agno); -#endif + err = pthread_create(&args->queuing_thread, NULL, pf_queuing_worker, args); if (err != 0) { @@ -801,14 +776,12 @@ pthread_mutex_lock(&args->lock); while (!args->can_start_processing) { -#ifdef XR_PF_TRACE pftrace("waiting to start processing AG %d", args->agno); -#endif + pthread_cond_wait(&args->start_processing, &args->lock); } -#ifdef XR_PF_TRACE pftrace("can start processing AG %d", args->agno); -#endif + pthread_mutex_unlock(&args->lock); } @@ -819,15 +792,13 @@ if (args == NULL) return; -#ifdef XR_PF_TRACE pftrace("waiting AG %d prefetch to finish", args->agno); -#endif + if (args->queuing_thread) pthread_join(args->queuing_thread, NULL); -#ifdef XR_PF_TRACE pftrace("AG %d prefetch done", args->agno); -#endif + pthread_mutex_destroy(&args->lock); pthread_cond_destroy(&args->start_reading); pthread_cond_destroy(&args->start_processing); @@ -839,6 +810,21 @@ #ifdef XR_PF_TRACE +static FILE *pf_trace_file; + +void +pftrace_init(void) +{ + pf_trace_file = fopen("/tmp/xfs_repair_prefetch.trace", "w"); + setvbuf(pf_trace_file, NULL, _IOLBF, 1024); +} + +void +pftrace_done(void) +{ + fclose(pf_trace_file); +} + void _pftrace(const char *func, const char *msg, ...) { @@ -853,7 +839,8 @@ buf[sizeof(buf)-1] = '\0'; va_end(args); - fprintf(pf_trace_file, "%lu.%06lu %s: %s\n", tv.tv_sec, tv.tv_usec, func, buf); + fprintf(pf_trace_file, "%lu.%06lu %s: %s\n", tv.tv_sec, tv.tv_usec, + func, buf); } #endif Index: xfsprogs-dev/repair/prefetch.h =================================================================== --- xfsprogs-dev.orig/repair/prefetch.h 2009-08-20 00:16:01.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.h 2009-08-20 00:16:53.000000000 +0000 @@ -50,8 +50,15 @@ #ifdef XR_PF_TRACE +void pftrace_init(void); +void pftrace_done(void); + #define pftrace(msg...) _pftrace(__FUNCTION__, ## msg) void _pftrace(const char *, const char *, ...); +#else +static inline void pftrace_init(void) { }; +static inline void pftrace_done(void) { }; +static inline void pftrace(const char *msg, ...) { }; #endif #endif /* _XFS_REPAIR_PREFETCH_H */ Index: xfsprogs-dev/repair/xfs_repair.c =================================================================== --- xfsprogs-dev.orig/repair/xfs_repair.c 2009-08-19 23:42:32.000000000 +0000 +++ xfsprogs-dev/repair/xfs_repair.c 2009-08-20 00:16:53.000000000 +0000 @@ -542,11 +542,6 @@ bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); -#ifdef XR_PF_TRACE - pf_trace_file = fopen("/tmp/xfs_repair_prefetch.trace", "w"); - setvbuf(pf_trace_file, NULL, _IOLBF, 1024); -#endif - temp_mp = &xfs_m; setbuf(stdout, NULL); @@ -850,8 +845,7 @@ if (verbose) summary_report(); do_log(_("done\n")); -#ifdef XR_PF_TRACE - fclose(pf_trace_file); -#endif + pftrace_done(); + return (0); } From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:10 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_14, J_CHICKENPOX_32,J_CHICKENPOX_33,J_CHICKENPOX_61,J_CHICKENPOX_62, J_CHICKENPOX_73 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HvjIm034374 for ; Wed, 2 Sep 2009 12:58:00 -0500 X-ASG-Debug-ID: 1251914321-2afe03e00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D771915B1A28 for ; Wed, 2 Sep 2009 10:58:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id JVchCQzHAjpHurEl for ; Wed, 02 Sep 2009 10:58:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006XL-Ci; Wed, 02 Sep 2009 17:58:41 +0000 Message-Id: <20090902175841.284697389@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:40 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 09/14] repair: track logical to physical block mapping more effeciently Subject: [PATCH 09/14] repair: track logical to physical block mapping more effeciently References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-blkmap-opt X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Currently we track the logical to physical block mapping by a structure which contains an array of physicial blocks. This is extremly efficient and is replaced with the normal starblock storage we use in the kernel and on disk in this patch. In addition also use thread-local storage for the block map, this is possible because repair only processes one inode at a given time per thread, and the block map does not have to outlive the processing of a single inode. The combination of those factors means we can use pthread thread-local storage to store the block map, and we can re-use the allocation over and over again. This should be ported over to xfs_db eventually, or even better we could try to share the code. [hch: added a small fix in blkmap_set_ext to not call memmove unless needed] Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/bmap.c =================================================================== --- xfsprogs-dev.orig/repair/bmap.c 2009-08-20 02:32:34.000000000 +0000 +++ xfsprogs-dev/repair/bmap.c 2009-08-20 02:32:45.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. + * Copyright (c) 2000-2001,2005,2008 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -21,106 +21,46 @@ #include "bmap.h" /* - * Block mapping code taken from xfs_db. - */ - -/* - * Append an extent to the block entry. - */ -void -blkent_append( - blkent_t **entp, - xfs_dfsbno_t b, - xfs_dfilblks_t c) -{ - blkent_t *ent; - size_t size; - int i; - - ent = *entp; - size = BLKENT_SIZE(c + ent->nblks); - if ((*entp = ent = realloc(ent, size)) == NULL) { - do_warn(_("realloc failed in blkent_append (%u bytes)\n"), - size); - return; - } - for (i = 0; i < c; i++) - ent->blks[ent->nblks + i] = b + i; - ent->nblks += c; -} - -/* - * Make a new block entry. - */ -blkent_t * -blkent_new( - xfs_dfiloff_t o, - xfs_dfsbno_t b, - xfs_dfilblks_t c) -{ - blkent_t *ent; - int i; - - if ((ent = malloc(BLKENT_SIZE(c))) == NULL) { - do_warn(_("malloc failed in blkent_new (%u bytes)\n"), - BLKENT_SIZE(c)); - return ent; - } - ent->nblks = c; - ent->startoff = o; - for (i = 0; i < c; i++) - ent->blks[i] = b + i; - return ent; -} - -/* - * Prepend an extent to the block entry. + * Track the logical to physical block mapping for inodes. + * + * Repair only processes one inode at a given time per thread, and the + * block map does not have to outlive the processing of a single inode. + * + * The combination of those factors means we can use pthreads thread-local + * storage to store the block map, and we can re-use the allocation over + * and over again. */ -void -blkent_prepend( - blkent_t **entp, - xfs_dfsbno_t b, - xfs_dfilblks_t c) -{ - int i; - blkent_t *newent; - blkent_t *oldent; - oldent = *entp; - if ((newent = malloc(BLKENT_SIZE(oldent->nblks + c))) == NULL) { - do_warn(_("malloc failed in blkent_prepend (%u bytes)\n"), - BLKENT_SIZE(oldent->nblks + c)); - *entp = newent; - return; - } - newent->nblks = oldent->nblks + c; - newent->startoff = oldent->startoff - c; - for (i = 0; i < c; i++) - newent->blks[i] = b + c; - for (; i < oldent->nblks + c; i++) - newent->blks[i] = oldent->blks[i - c]; - free(oldent); - *entp = newent; -} +pthread_key_t dblkmap_key; +pthread_key_t ablkmap_key; -/* - * Allocate a block map. - */ blkmap_t * blkmap_alloc( - xfs_extnum_t nex) + xfs_extnum_t nex, + int whichfork) { + pthread_key_t key; blkmap_t *blkmap; + ASSERT(whichfork == XFS_DATA_FORK || whichfork == XFS_ATTR_FORK); + if (nex < 1) nex = 1; - if ((blkmap = malloc(BLKMAP_SIZE(nex))) == NULL) { - do_warn(_("malloc failed in blkmap_alloc (%u bytes)\n"), - BLKMAP_SIZE(nex)); - return blkmap; + + key = whichfork ? ablkmap_key : dblkmap_key; + blkmap = pthread_getspecific(key); + if (!blkmap || blkmap->naexts < nex) { + blkmap = realloc(blkmap, BLKMAP_SIZE(nex)); + if (!blkmap) { + do_warn(_("malloc failed in blkmap_alloc (%u bytes)\n"), + BLKMAP_SIZE(nex)); + return NULL; + } + pthread_setspecific(key, blkmap); + blkmap->naexts = nex; } - blkmap->naents = nex; - blkmap->nents = 0; + + blkmap->nexts = 0; return blkmap; } @@ -131,14 +71,7 @@ void blkmap_free( blkmap_t *blkmap) { - blkent_t **entp; - xfs_extnum_t i; - - if (blkmap == NULL) - return; - for (i = 0, entp = blkmap->ents; i < blkmap->nents; i++, entp++) - free(*entp); - free(blkmap); + /* nothing to do! - keep the memory around for the next inode */ } /* @@ -149,20 +82,18 @@ blkmap_get( blkmap_t *blkmap, xfs_dfiloff_t o) { - blkent_t *ent; - blkent_t **entp; + bmap_ext_t *ext = blkmap->exts; int i; - for (i = 0, entp = blkmap->ents; i < blkmap->nents; i++, entp++) { - ent = *entp; - if (o >= ent->startoff && o < ent->startoff + ent->nblks) - return ent->blks[o - ent->startoff]; + for (i = 0; i < blkmap->nexts; i++, ext++) { + if (o >= ext->startoff && o < ext->startoff + ext->blockcount) + return ext->startblock + (o - ext->startoff); } return NULLDFSBNO; } /* - * Get a chunk of entries from a block map. + * Get a chunk of entries from a block map - only used for reading dirv2 blocks */ int blkmap_getn( @@ -172,93 +103,62 @@ blkmap_getn( bmap_ext_t **bmpp, bmap_ext_t *bmpp_single) { - bmap_ext_t *bmp; - blkent_t *ent; - xfs_dfiloff_t ento; - blkent_t **entp; + bmap_ext_t *bmp = NULL; + bmap_ext_t *ext; int i; int nex; if (nb == 1) { - /* + /* * in the common case, when mp->m_dirblkfsbs == 1, * avoid additional malloc/free overhead */ bmpp_single->startblock = blkmap_get(blkmap, o); - bmpp_single->blockcount = 1; - bmpp_single->startoff = 0; - bmpp_single->flag = 0; - *bmpp = bmpp_single; - return (bmpp_single->startblock != NULLDFSBNO) ? 1 : 0; + goto single_ext; } - for (i = nex = 0, bmp = NULL, entp = blkmap->ents; - i < blkmap->nents; - i++, entp++) { - ent = *entp; - if (ent->startoff >= o + nb) + ext = blkmap->exts; + nex = 0; + for (i = 0; i < blkmap->nexts; i++, ext++) { + + if (ext->startoff >= o + nb) break; - if (ent->startoff + ent->nblks <= o) + if (ext->startoff + ext->blockcount <= o) continue; - for (ento = ent->startoff; - ento < ent->startoff + ent->nblks && ento < o + nb; - ento++) { - if (ento < o) - continue; - if (bmp && - bmp[nex - 1].startoff + bmp[nex - 1].blockcount == - ento && - bmp[nex - 1].startblock + bmp[nex - 1].blockcount == - ent->blks[ento - ent->startoff]) - bmp[nex - 1].blockcount++; - else { - bmp = realloc(bmp, ++nex * sizeof(*bmp)); - if (bmp == NULL) { - do_warn(_("blkmap_getn realloc failed" - " (%u bytes)\n"), - nex * sizeof(*bmp)); - continue; - } - bmp[nex - 1].startoff = ento; - bmp[nex - 1].startblock = - ent->blks[ento - ent->startoff]; - bmp[nex - 1].blockcount = 1; - bmp[nex - 1].flag = 0; - } + + /* + * if all the requested blocks are in one extent (also common), + * use the bmpp_single option as well + */ + if (!bmp && o >= ext->startoff && + o + nb <= ext->startoff + ext->blockcount) { + bmpp_single->startblock = + ext->startblock + (o - ext->startoff); + goto single_ext; } + + /* + * rare case - multiple extents for a single dir block + */ + bmp = malloc(nb * sizeof(bmap_ext_t)); + if (!bmp) + do_error(_("blkmap_getn malloc failed (%u bytes)\n"), + nb * sizeof(bmap_ext_t)); + + bmp[nex].startblock = ext->startblock + (o - ext->startoff); + bmp[nex].blockcount = MIN(nb, ext->blockcount - + (bmp[nex].startblock - ext->startblock)); + o += bmp[nex].blockcount; + nb -= bmp[nex].blockcount; + nex++; } *bmpp = bmp; return nex; -} - -/* - * Make a block map larger. - */ -void -blkmap_grow( - blkmap_t **blkmapp, - blkent_t **entp, - blkent_t *newent) -{ - blkmap_t *blkmap; - size_t size; - int i; - int idx; - blkmap = *blkmapp; - idx = (int)(entp - blkmap->ents); - if (blkmap->naents == blkmap->nents) { - size = BLKMAP_SIZE(blkmap->nents + 1); - if ((*blkmapp = blkmap = realloc(blkmap, size)) == NULL) { - do_warn(_("realloc failed in blkmap_grow (%u bytes)\n"), - size); - return; - } - blkmap->naents++; - } - for (i = blkmap->nents; i > idx; i--) - blkmap->ents[i] = blkmap->ents[i - 1]; - blkmap->ents[idx] = newent; - blkmap->nents++; +single_ext: + bmpp_single->blockcount = nb; + bmpp_single->startoff = 0; /* not even used by caller! */ + *bmpp = bmpp_single; + return (bmpp_single->startblock != NULLDFSBNO) ? 1 : 0; } /* @@ -268,12 +168,12 @@ xfs_dfiloff_t blkmap_last_off( blkmap_t *blkmap) { - blkent_t *ent; + bmap_ext_t *ext; - if (!blkmap->nents) + if (!blkmap->nexts) return NULLDFILOFF; - ent = blkmap->ents[blkmap->nents - 1]; - return ent->startoff + ent->nblks; + ext = blkmap->exts + blkmap->nexts - 1; + return ext->startoff + ext->blockcount; } /* @@ -285,73 +185,45 @@ blkmap_next_off( xfs_dfiloff_t o, int *t) { - blkent_t *ent; - blkent_t **entp; + bmap_ext_t *ext; - if (!blkmap->nents) + if (!blkmap->nexts) return NULLDFILOFF; if (o == NULLDFILOFF) { *t = 0; - ent = blkmap->ents[0]; - return ent->startoff; + return blkmap->exts[0].startoff; } - entp = &blkmap->ents[*t]; - ent = *entp; - if (o < ent->startoff + ent->nblks - 1) + ext = blkmap->exts + *t; + if (o < ext->startoff + ext->blockcount - 1) return o + 1; - entp++; - if (entp >= &blkmap->ents[blkmap->nents]) + if (*t >= blkmap->nexts - 1) return NULLDFILOFF; (*t)++; - ent = *entp; - return ent->startoff; + return ext[1].startoff; } /* - * Set a block value in a block map. + * Make a block map larger. */ -void -blkmap_set_blk( - blkmap_t **blkmapp, - xfs_dfiloff_t o, - xfs_dfsbno_t b) +static blkmap_t * +blkmap_grow( + blkmap_t **blkmapp) { - blkmap_t *blkmap; - blkent_t *ent; - blkent_t **entp; - blkent_t *nextent; - - blkmap = *blkmapp; - for (entp = blkmap->ents; entp < &blkmap->ents[blkmap->nents]; entp++) { - ent = *entp; - if (o < ent->startoff - 1) { - ent = blkent_new(o, b, 1); - blkmap_grow(blkmapp, entp, ent); - return; - } - if (o == ent->startoff - 1) { - blkent_prepend(entp, b, 1); - return; - } - if (o >= ent->startoff && o < ent->startoff + ent->nblks) { - ent->blks[o - ent->startoff] = b; - return; - } - if (o > ent->startoff + ent->nblks) - continue; - blkent_append(entp, b, 1); - if (entp == &blkmap->ents[blkmap->nents - 1]) - return; - ent = *entp; - nextent = entp[1]; - if (ent->startoff + ent->nblks < nextent->startoff) - return; - blkent_append(entp, nextent->blks[0], nextent->nblks); - blkmap_shrink(blkmap, &entp[1]); - return; + pthread_key_t key = dblkmap_key; + blkmap_t *blkmap = *blkmapp; + + if (pthread_getspecific(key) != blkmap) { + key = ablkmap_key; + ASSERT(pthread_getspecific(key) == blkmap); } - ent = blkent_new(o, b, 1); - blkmap_grow(blkmapp, entp, ent); + + blkmap->naexts += 4; + blkmap = realloc(blkmap, BLKMAP_SIZE(blkmap->naexts)); + if (blkmap == NULL) + do_error(_("realloc failed in blkmap_grow\n")); + *blkmapp = blkmap; + pthread_setspecific(key, blkmap); + return blkmap; } /* @@ -364,46 +236,23 @@ blkmap_set_ext( xfs_dfsbno_t b, xfs_dfilblks_t c) { - blkmap_t *blkmap; - blkent_t *ent; - blkent_t **entp; + blkmap_t *blkmap = *blkmapp; xfs_extnum_t i; - blkmap = *blkmapp; - if (!blkmap->nents) { - blkmap->ents[0] = blkent_new(o, b, c); - blkmap->nents = 1; - return; - } - entp = &blkmap->ents[blkmap->nents - 1]; - ent = *entp; - if (ent->startoff + ent->nblks == o) { - blkent_append(entp, b, c); - return; - } - if (ent->startoff + ent->nblks < o) { - ent = blkent_new(o, b, c); - blkmap_grow(blkmapp, &blkmap->ents[blkmap->nents], ent); - return; - } - for (i = 0; i < c; i++) - blkmap_set_blk(blkmapp, o + i, b + i); -} + if (blkmap->nexts == blkmap->naexts) + blkmap = blkmap_grow(blkmapp); -/* - * Make a block map smaller. - */ -void -blkmap_shrink( - blkmap_t *blkmap, - blkent_t **entp) -{ - int i; - int idx; + for (i = 0; i < blkmap->nexts; i++) { + if (blkmap->exts[i].startoff > o) { + memmove(blkmap->exts + i + 1, + blkmap->exts + i, + sizeof(bmap_ext_t) * (blkmap->nexts - i)); + break; + } + } - free(*entp); - idx = (int)(entp - blkmap->ents); - for (i = idx + 1; i < blkmap->nents; i++) - blkmap->ents[i] = blkmap->ents[i - 1]; - blkmap->nents--; + blkmap->exts[i].startoff = o; + blkmap->exts[i].startblock = b; + blkmap->exts[i].blockcount = c; + blkmap->nexts++; } Index: xfsprogs-dev/repair/bmap.h =================================================================== --- xfsprogs-dev.orig/repair/bmap.h 2009-08-20 02:32:34.000000000 +0000 +++ xfsprogs-dev/repair/bmap.h 2009-08-20 02:32:45.000000000 +0000 @@ -16,59 +16,41 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * Block mapping code taken from xfs_db. - */ +#ifndef _XFS_REPAIR_BMAP_H +#define _XFS_REPAIR_BMAP_H /* - * Block map entry. + * Extent descriptor. */ -typedef struct blkent { +typedef struct bmap_ext { xfs_dfiloff_t startoff; - xfs_dfilblks_t nblks; - xfs_dfsbno_t blks[1]; -} blkent_t; -#define BLKENT_SIZE(n) \ - (offsetof(blkent_t, blks) + (sizeof(xfs_dfsbno_t) * (n))) + xfs_dfsbno_t startblock; + xfs_dfilblks_t blockcount; +} bmap_ext_t; /* * Block map. */ typedef struct blkmap { - int naents; - int nents; - blkent_t *ents[1]; + int naexts; + int nexts; + bmap_ext_t exts[1]; } blkmap_t; -#define BLKMAP_SIZE(n) \ - (offsetof(blkmap_t, ents) + (sizeof(blkent_t *) * (n))) -/* - * Extent descriptor. - */ -typedef struct bmap_ext { - xfs_dfiloff_t startoff; - xfs_dfsbno_t startblock; - xfs_dfilblks_t blockcount; - int flag; -} bmap_ext_t; +#define BLKMAP_SIZE(n) \ + (offsetof(blkmap_t, exts) + (sizeof(bmap_ext_t) * (n))) -void blkent_append(blkent_t **entp, xfs_dfsbno_t b, - xfs_dfilblks_t c); -blkent_t *blkent_new(xfs_dfiloff_t o, xfs_dfsbno_t b, xfs_dfilblks_t c); -void blkent_prepend(blkent_t **entp, xfs_dfsbno_t b, - xfs_dfilblks_t c); -blkmap_t *blkmap_alloc(xfs_extnum_t); +blkmap_t *blkmap_alloc(xfs_extnum_t nex, int whichfork); void blkmap_free(blkmap_t *blkmap); + +void blkmap_set_ext(blkmap_t **blkmapp, xfs_dfiloff_t o, + xfs_dfsbno_t b, xfs_dfilblks_t c); + xfs_dfsbno_t blkmap_get(blkmap_t *blkmap, xfs_dfiloff_t o); int blkmap_getn(blkmap_t *blkmap, xfs_dfiloff_t o, - xfs_dfilblks_t nb, bmap_ext_t **bmpp, + xfs_dfilblks_t nb, bmap_ext_t **bmpp, bmap_ext_t *bmpp_single); -void blkmap_grow(blkmap_t **blkmapp, blkent_t **entp, - blkent_t *newent); xfs_dfiloff_t blkmap_last_off(blkmap_t *blkmap); xfs_dfiloff_t blkmap_next_off(blkmap_t *blkmap, xfs_dfiloff_t o, int *t); -void blkmap_set_blk(blkmap_t **blkmapp, xfs_dfiloff_t o, - xfs_dfsbno_t b); -void blkmap_set_ext(blkmap_t **blkmapp, xfs_dfiloff_t o, - xfs_dfsbno_t b, xfs_dfilblks_t c); -void blkmap_shrink(blkmap_t *blkmap, blkent_t **entp); + +#endif /* _XFS_REPAIR_BMAP_H */ Index: xfsprogs-dev/repair/dinode.c =================================================================== --- xfsprogs-dev.orig/repair/dinode.c 2009-08-20 02:32:34.000000000 +0000 +++ xfsprogs-dev/repair/dinode.c 2009-08-21 01:23:34.000000000 +0000 @@ -2050,7 +2050,7 @@ process_inode_data_fork( *nextents = 1; if (dinoc->di_format != XFS_DINODE_FMT_LOCAL && type != XR_INO_RTDATA) - *dblkmap = blkmap_alloc(*nextents); + *dblkmap = blkmap_alloc(*nextents, XFS_DATA_FORK); *nextents = 0; switch (dinoc->di_format) { @@ -2172,14 +2172,14 @@ process_inode_attr_fork( err = process_lclinode(mp, agno, ino, dino, XFS_ATTR_FORK); break; case XFS_DINODE_FMT_EXTENTS: - ablkmap = blkmap_alloc(*anextents); + ablkmap = blkmap_alloc(*anextents, XFS_ATTR_FORK); *anextents = 0; err = process_exinode(mp, agno, ino, dino, type, dirty, atotblocks, anextents, &ablkmap, XFS_ATTR_FORK, check_dups); break; case XFS_DINODE_FMT_BTREE: - ablkmap = blkmap_alloc(*anextents); + ablkmap = blkmap_alloc(*anextents, XFS_ATTR_FORK); *anextents = 0; err = process_btinode(mp, agno, ino, dino, type, dirty, atotblocks, anextents, &ablkmap, Index: xfsprogs-dev/repair/init.c =================================================================== --- xfsprogs-dev.orig/repair/init.c 2009-08-20 02:32:34.000000000 +0000 +++ xfsprogs-dev/repair/init.c 2009-08-20 02:32:45.000000000 +0000 @@ -24,19 +24,24 @@ #include "pthread.h" #include "avl.h" #include "dir.h" +#include "bmap.h" #include "incore.h" #include "prefetch.h" #include +/* TODO: dirbuf/freemap key usage is completely b0rked - only used for dirv1 */ static pthread_key_t dirbuf_key; static pthread_key_t dir_freemap_key; static pthread_key_t attr_freemap_key; +extern pthread_key_t dblkmap_key; +extern pthread_key_t ablkmap_key; + static void ts_alloc(pthread_key_t key, unsigned n, size_t size) { void *voidp; - voidp = malloc((n)*(size)); + voidp = calloc(n, size); if (voidp == NULL) { do_error(_("ts_alloc: cannot allocate thread specific storage\n")); /* NO RETURN */ @@ -52,6 +57,9 @@ ts_create(void) pthread_key_create(&dirbuf_key, NULL); pthread_key_create(&dir_freemap_key, NULL); pthread_key_create(&attr_freemap_key, NULL); + + pthread_key_create(&dblkmap_key, NULL); + pthread_key_create(&ablkmap_key, NULL); } void From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HvhXC034367 for ; Wed, 2 Sep 2009 12:57:59 -0500 X-ASG-Debug-ID: 1251914320-4f3402bb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A5A8715B1A28 for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id uC5M8niEd0nyJeAY for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6S-0006TI-4r; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175840.048298899@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:33 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 02/14] repair: reduce byte swap operations in scanfunc_allocbt Subject: [PATCH 02/14] repair: reduce byte swap operations in scanfunc_allocbt References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-scan.c-reduce-byteswaps X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914320 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Store native endian version of the extent startblock and length in local variables instead of converting them over and over again. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 18:48:01.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 18:54:29.000000000 +0000 @@ -449,7 +449,6 @@ scanfunc_allocbt( __uint32_t magic) { const char *name; - xfs_agblock_t b, e; int i; xfs_alloc_ptr_t *pp; xfs_alloc_rec_t *rp; @@ -509,20 +508,21 @@ _("%s freespace btree block claimed (sta rp = XFS_ALLOC_REC_ADDR(mp, block, 1); for (i = 0; i < numrecs; i++) { - if (be32_to_cpu(rp[i].ar_blockcount) == 0 || - be32_to_cpu(rp[i].ar_startblock) == 0 || - !verify_agbno(mp, agno, - be32_to_cpu(rp[i].ar_startblock)) || - be32_to_cpu(rp[i].ar_blockcount) > - MAXEXTLEN) - continue; + xfs_agblock_t b, end; + xfs_extlen_t len; + + b = be32_to_cpu(rp[i].ar_startblock); + len = be32_to_cpu(rp[i].ar_blockcount); + end = b + len; - e = be32_to_cpu(rp[i].ar_startblock) + - be32_to_cpu(rp[i].ar_blockcount); - if (!verify_agbno(mp, agno, e - 1)) + if (b == 0 || !verify_agbno(mp, agno, b)) + continue; + if (len == 0 || len > MAXEXTLEN) continue; - for (b = be32_to_cpu(rp[i].ar_startblock); - b < e; b++) { + if (!verify_agbno(mp, agno, end - 1)) + continue; + + for ( ; b < end; b++) { state = get_agbno_state(mp, agno, b); switch (state) { case XR_E_UNKNOWN: @@ -579,6 +579,8 @@ _("%s freespace btree block claimed (sta } for (i = 0; i < numrecs; i++) { + xfs_agblock_t bno = be32_to_cpu(pp[i]); + /* * XXX - put sibling detection right here. * we know our sibling chain is good. So as we go, @@ -588,11 +590,11 @@ _("%s freespace btree block claimed (sta * pointer mismatch, try and extract as much data * as possible. */ - if (be32_to_cpu(pp[i]) != 0 && verify_agbno(mp, agno, - be32_to_cpu(pp[i]))) - scan_sbtree(be32_to_cpu(pp[i]), level, agno, suspect, + if (bno != 0 && verify_agbno(mp, agno, bno)) { + scan_sbtree(bno, level, agno, suspect, (magic == XFS_ABTB_MAGIC) ? scanfunc_bno : scanfunc_cnt, 0); + } } } From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HvhJF034368 for ; Wed, 2 Sep 2009 12:57:58 -0500 X-ASG-Debug-ID: 1251914320-70a403810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0484341E03E for ; Wed, 2 Sep 2009 10:58:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id eeOl8MIUN6lS91Hr for ; Wed, 02 Sep 2009 10:58:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6S-0006Uq-Lf; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175840.573208011@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:36 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 05/14] repair: reduce byte swapping in scan_freelist Subject: [PATCH 05/14] repair: reduce byte swapping in scan_freelist References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-cleanup-scan_freelist X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Store the ag number in a local native endian variable to avoid byteswapping it over and over again. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 19:03:26.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 19:05:32.000000000 +0000 @@ -943,23 +943,26 @@ scan_freelist( { xfs_agfl_t *agfl; xfs_buf_t *agflbuf; + xfs_agnumber_t agno; xfs_agblock_t bno; int count; int i; + agno = be32_to_cpu(agf->agf_seqno); + if (XFS_SB_BLOCK(mp) != XFS_AGFL_BLOCK(mp) && - XFS_AGF_BLOCK(mp) != XFS_AGFL_BLOCK(mp) && - XFS_AGI_BLOCK(mp) != XFS_AGFL_BLOCK(mp)) - set_agbno_state(mp, be32_to_cpu(agf->agf_seqno), - XFS_AGFL_BLOCK(mp), XR_E_FS_MAP); + XFS_AGF_BLOCK(mp) != XFS_AGFL_BLOCK(mp) && + XFS_AGI_BLOCK(mp) != XFS_AGFL_BLOCK(mp)) + set_agbno_state(mp, agno, XFS_AGFL_BLOCK(mp), XR_E_FS_MAP); + if (be32_to_cpu(agf->agf_flcount) == 0) return; - agflbuf = libxfs_readbuf(mp->m_dev, XFS_AG_DADDR(mp, - be32_to_cpu(agf->agf_seqno), - XFS_AGFL_DADDR(mp)), XFS_FSS_TO_BB(mp, 1), 0); + + agflbuf = libxfs_readbuf(mp->m_dev, + XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)), + XFS_FSS_TO_BB(mp, 1), 0); if (!agflbuf) { - do_abort(_("can't read agfl block for ag %d\n"), - be32_to_cpu(agf->agf_seqno)); + do_abort(_("can't read agfl block for ag %d\n"), agno); return; } agfl = XFS_BUF_TO_AGFL(agflbuf); @@ -967,12 +970,11 @@ scan_freelist( count = 0; for (;;) { bno = be32_to_cpu(agfl->agfl_bno[i]); - if (verify_agbno(mp, be32_to_cpu(agf->agf_seqno), bno)) - set_agbno_state(mp, be32_to_cpu(agf->agf_seqno), - bno, XR_E_FREE); + if (verify_agbno(mp, agno, bno)) + set_agbno_state(mp, agno, bno, XR_E_FREE); else do_warn(_("bad agbno %u in agfl, agno %d\n"), - bno, be32_to_cpu(agf->agf_seqno)); + bno, agno); count++; if (i == be32_to_cpu(agf->agf_fllast)) break; @@ -981,8 +983,7 @@ scan_freelist( } if (count != be32_to_cpu(agf->agf_flcount)) { do_warn(_("freeblk count %d != flcount %d in ag %d\n"), count, - be32_to_cpu(agf->agf_flcount), - be32_to_cpu(agf->agf_seqno)); + be32_to_cpu(agf->agf_flcount), agno); } libxfs_putbuf(agflbuf); } From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_61,J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_65, J_CHICKENPOX_66,J_CHICKENPOX_71 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Hvi8H034369 for ; Wed, 2 Sep 2009 12:57:59 -0500 X-ASG-Debug-ID: 1251914320-4b1e012c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5EBC841E03E for ; Wed, 2 Sep 2009 10:58:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id aPadCMhukC8Dav4Y for ; Wed, 02 Sep 2009 10:58:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6S-0006VV-RL; Wed, 02 Sep 2009 17:58:40 +0000 Message-Id: <20090902175840.740632507@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:37 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 06/14] repair: use a btree instead of a radix tree for the prefetch queue Subject: [PATCH 06/14] repair: use a btree instead of a radix tree for the prefetch queue References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-radix-to-btree X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Currently the prefetch queue in xfs_repair uses a radix tree implementation derived from the Linux kernel one to manage it's prefetch queue. The radix tree implement is not very memory efficient for sparse indices, so replace it with a btree implementation that is much more efficient. This is not that important for the prefetch queue but will be very important for the next memory optimization patches which need a tree to store things like the block map which are very sparse, and we do not want to deal with two tree implementations (or rather three given that we still have avl.c around) Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/Makefile =================================================================== --- xfsprogs-dev.orig/repair/Makefile 2009-08-20 00:01:58.000000000 +0000 +++ xfsprogs-dev/repair/Makefile 2009-08-20 00:06:43.000000000 +0000 @@ -9,15 +9,15 @@ LTCOMMAND = xfs_repair -HFILES = agheader.h attr_repair.h avl.h avl64.h bmap.h dinode.h dir.h \ - dir2.h err_protos.h globals.h incore.h protos.h rt.h \ - progress.h scan.h versions.h prefetch.h radix-tree.h threads.h +HFILES = agheader.h attr_repair.h avl.h avl64.h bmap.h btree.h \ + dinode.h dir.h dir2.h err_protos.h globals.h incore.h protos.h rt.h \ + progress.h scan.h versions.h prefetch.h threads.h -CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c dino_chunks.c \ - dinode.c dir.c dir2.c globals.c incore.c \ +CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \ + dino_chunks.c dinode.c dir.c dir2.c globals.c incore.c \ incore_bmc.c init.c incore_ext.c incore_ino.c phase1.c \ phase2.c phase3.c phase4.c phase5.c phase6.c phase7.c \ - progress.c prefetch.c radix-tree.c rt.c sb.c scan.c threads.c \ + progress.c prefetch.c rt.c sb.c scan.c threads.c \ versions.c xfs_repair.c LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) Index: xfsprogs-dev/repair/btree.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xfsprogs-dev/repair/btree.c 2009-08-20 00:06:44.000000000 +0000 @@ -0,0 +1,1234 @@ +/* + * Copyright (c) 2007, Silicon Graphics, Inc. Barry Naujok + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "btree.h" + + +#define BTREE_KEY_MAX 7 +#define BTREE_KEY_MIN (BTREE_KEY_MAX / 2) + +#define BTREE_PTR_MAX (BTREE_KEY_MAX + 1) + +struct btree_node { + unsigned long num_keys; + unsigned long keys[BTREE_KEY_MAX]; + struct btree_node * ptrs[BTREE_PTR_MAX]; +}; + +struct btree_cursor { + struct btree_node *node; + int index; +}; + +struct btree_root { + struct btree_node *root_node; + struct btree_cursor *cursor; /* track path to end leaf */ + int height; + /* lookup cache */ + int keys_valid; /* set if the cache is valid */ + unsigned long cur_key; + unsigned long next_key; + void *next_value; + unsigned long prev_key; + void *prev_value; +#ifdef BTREE_STATS + struct btree_stats { + unsigned long num_items; + unsigned long max_items; + int alloced; + int cache_hits; + int cache_misses; + int lookup; + int find; + int key_update; + int value_update; + int insert; + int delete; + int inc_height; + int dec_height; + int shift_prev; + int shift_next; + int split; + int merge_prev; + int merge_next; + int balance_prev; + int balance_next; + } stats; +#endif +}; + + +static struct btree_node * +btree_node_alloc(void) +{ + return calloc(1, sizeof(struct btree_node)); +} + +static void +btree_node_free( + struct btree_node *node) +{ + free(node); +} + +static void +btree_free_nodes( + struct btree_node *node, + int level) +{ + int i; + + if (level) + for (i = 0; i <= node->num_keys; i++) + btree_free_nodes(node->ptrs[i], level - 1); + btree_node_free(node); +} + +static void +__btree_init( + struct btree_root *root) +{ + memset(root, 0, sizeof(struct btree_root)); + root->height = 1; + root->cursor = calloc(1, sizeof(struct btree_cursor)); + root->root_node = btree_node_alloc(); + ASSERT(root->root_node); +#ifdef BTREE_STATS + root->stats.max_items = 1; + root->stats.alloced += 1; +#endif +} + +static void +__btree_free( + struct btree_root *root) +{ + btree_free_nodes(root->root_node, root->height - 1); + free(root->cursor); + root->height = 0; + root->cursor = NULL; + root->root_node = NULL; +} + +void +btree_init( + struct btree_root **root) +{ + *root = calloc(1, sizeof(struct btree_root)); + __btree_init(*root); +} + +void +btree_clear( + struct btree_root *root) +{ + __btree_free(root); + __btree_init(root); +} + +void +btree_destroy( + struct btree_root *root) +{ + __btree_free(root); + free(root); +} + +int +btree_is_empty( + struct btree_root *root) +{ + return root->root_node->num_keys == 0; +} + +static inline void +btree_invalidate_cursor( + struct btree_root *root) +{ + root->cursor[0].node = NULL; + root->keys_valid = 0; +} + +static inline unsigned long +btree_key_of_cursor( + struct btree_cursor *cursor, + int height) +{ + while (cursor->node->num_keys == cursor->index && --height > 0) + cursor++; + return cursor->node->keys[cursor->index]; +} + +static void * +btree_get_prev( + struct btree_root *root, + unsigned long *key) +{ + struct btree_cursor *cur = root->cursor; + int level = 0; + struct btree_node *node; + + if (cur->index > 0) { + if (key) + *key = cur->node->keys[cur->index - 1]; + return cur->node->ptrs[cur->index - 1]; + } + + /* else need to go up and back down the tree to find the previous */ + + while (cur->index == 0) { + if (++level == root->height) + return NULL; + cur++; + } + + /* the key is in the current level */ + if (key) + *key = cur->node->keys[cur->index - 1]; + + /* descend back down the right side to get the pointer */ + node = cur->node->ptrs[cur->index - 1]; + while (level--) + node = node->ptrs[node->num_keys]; + return node; +} + +static void * +btree_get_next( + struct btree_root *root, + unsigned long *key) +{ + struct btree_cursor *cur = root->cursor; + int level = 0; + struct btree_node *node; + + while (cur->index == cur->node->num_keys) { + if (++level == root->height) + return NULL; + cur++; + } + if (level == 0) { + if (key) { + cur->index++; + *key = btree_key_of_cursor(cur, root->height); + cur->index--; + } + return cur->node->ptrs[cur->index + 1]; + } + + node = cur->node->ptrs[cur->index + 1]; + while (--level > 0) + node = node->ptrs[0]; + if (key) + *key = node->keys[0]; + return node->ptrs[0]; +} + +/* + * Lookup/Search functions + */ + +static int +btree_do_search( + struct btree_root *root, + unsigned long key) +{ + unsigned long k = 0; + struct btree_cursor *cur = root->cursor + root->height; + struct btree_node *node = root->root_node; + int height = root->height; + int key_found = 0; + int i; + + while (--height >= 0) { + cur--; + for (i = 0; i < node->num_keys; i++) + if (node->keys[i] >= key) { + k = node->keys[i]; + key_found = 1; + break; + } + cur->node = node; + cur->index = i; + node = node->ptrs[i]; + } + root->keys_valid = key_found; + if (!key_found) + return 0; + + root->cur_key = k; + root->next_value = NULL; /* do on-demand next value lookup */ + root->prev_value = btree_get_prev(root, &root->prev_key); + return 1; +} + +static int +btree_search( + struct btree_root *root, + unsigned long key) +{ + if (root->keys_valid && key <= root->cur_key && + (!root->prev_value || key > root->prev_key)) { +#ifdef BTREE_STATS + root->stats.cache_hits++; +#endif + return 1; + } +#ifdef BTREE_STATS + root->stats.cache_misses++; +#endif + return btree_do_search(root, key); +} + +void * +btree_find( + struct btree_root *root, + unsigned long key, + unsigned long *actual_key) +{ +#ifdef BTREE_STATS + root->stats.find += 1; +#endif + if (!btree_search(root, key)) + return NULL; + + if (actual_key) + *actual_key = root->cur_key; + return root->cursor->node->ptrs[root->cursor->index]; +} + +void * +btree_lookup( + struct btree_root *root, + unsigned long key) +{ +#ifdef BTREE_STATS + root->stats.lookup += 1; +#endif + if (!btree_search(root, key) || root->cur_key != key) + return NULL; + return root->cursor->node->ptrs[root->cursor->index]; +} + +void * +btree_peek_prev( + struct btree_root *root, + unsigned long *key) +{ + if (!root->keys_valid) + return NULL; + if (key) + *key = root->prev_key; + return root->prev_value; +} + +void * +btree_peek_next( + struct btree_root *root, + unsigned long *key) +{ + if (!root->keys_valid) + return NULL; + if (!root->next_value) + root->next_value = btree_get_next(root, &root->next_key); + if (key) + *key = root->next_key; + return root->next_value; +} + +static void * +btree_move_cursor_to_next( + struct btree_root *root, + unsigned long *key) +{ + struct btree_cursor *cur = root->cursor; + int level = 0; + + while (cur->index == cur->node->num_keys) { + if (++level == root->height) + return NULL; + cur++; + } + cur->index++; + if (level == 0) { + if (key) + *key = btree_key_of_cursor(cur, root->height); + return cur->node->ptrs[cur->index]; + } + + while (--level >= 0) { + root->cursor[level].node = cur->node->ptrs[cur->index]; + root->cursor[level].index = 0; + cur--; + } + if (key) + *key = cur->node->keys[0]; + return cur->node->ptrs[0]; +} + +void * +btree_lookup_next( + struct btree_root *root, + unsigned long *key) +{ + void *value; + + if (!root->keys_valid) + return NULL; + + root->prev_key = root->cur_key; + root->prev_value = root->cursor->node->ptrs[root->cursor->index]; + + value = btree_move_cursor_to_next(root, &root->cur_key); + if (!value) { + btree_invalidate_cursor(root); + return NULL; + } + root->next_value = NULL; /* on-demand next value fetch */ + if (key) + *key = root->cur_key; + return value; +} + +static void * +btree_move_cursor_to_prev( + struct btree_root *root, + unsigned long *key) +{ + struct btree_cursor *cur = root->cursor; + int level = 0; + + while (cur->index == 0) { + if (++level == root->height) + return NULL; + cur++; + } + cur->index--; + if (key) /* the key is in the current level */ + *key = cur->node->keys[cur->index]; + while (level > 0) { + level--; + root->cursor[level].node = cur->node->ptrs[cur->index]; + root->cursor[level].index = root->cursor[level].node->num_keys; + cur--; + } + return cur->node->ptrs[cur->index]; +} + +void * +btree_lookup_prev( + struct btree_root *root, + unsigned long *key) +{ + void *value; + + if (!root->keys_valid) + return NULL; + + value = btree_move_cursor_to_prev(root, &root->cur_key); + if (!value) + return NULL; + root->prev_value = btree_get_prev(root, &root->prev_key); + root->next_value = NULL; /* on-demand next value fetch */ + if (key) + *key = root->cur_key; + return value; +} + +void * +btree_uncached_lookup( + struct btree_root *root, + unsigned long key) +{ + /* cursor-less (ie. uncached) lookup */ + int height = root->height - 1; + struct btree_node *node = root->root_node; + int i; + int key_found = 0; + + while (height >= 0) { + for (i = 0; i < node->num_keys; i++) + if (node->keys[i] >= key) { + key_found = node->keys[i] == key; + break; + } + node = node->ptrs[i]; + height--; + } + return key_found ? node : NULL; +} + +/* Update functions */ + +static inline void +btree_update_node_key( + struct btree_root *root, + struct btree_cursor *cursor, + int level, + unsigned long new_key) +{ + int i; + +#ifdef BTREE_STATS + root->stats.key_update += 1; +#endif + + cursor += level; + for (i = level; i < root->height; i++) { + if (cursor->index < cursor->node->num_keys) { + cursor->node->keys[cursor->index] = new_key; + break; + } + cursor++; + } +} + +int +btree_update_key( + struct btree_root *root, + unsigned long old_key, + unsigned long new_key) +{ + if (!btree_search(root, old_key) || root->cur_key != old_key) + return ENOENT; + + if (root->next_value && new_key >= root->next_key) + return EINVAL; + + if (root->prev_value && new_key <= root->prev_key) + return EINVAL; + + btree_update_node_key(root, root->cursor, 0, new_key); + + return 0; +} + +int +btree_update_value( + struct btree_root *root, + unsigned long key, + void *new_value) +{ + if (!new_value) + return EINVAL; + + if (!btree_search(root, key) || root->cur_key != key) + return ENOENT; + +#ifdef BTREE_STATS + root->stats.value_update += 1; +#endif + root->cursor->node->ptrs[root->cursor->index] = new_value; + + return 0; +} + +/* + * Cursor modification functions - used for inserting and deleting + */ + +static struct btree_cursor * +btree_copy_cursor_prev( + struct btree_root *root, + struct btree_cursor *dest_cursor, + int level) +{ + struct btree_cursor *src_cur = root->cursor + level; + struct btree_cursor *dst_cur; + int l = level; + int i; + + if (level >= root->height) + return NULL; + + while (src_cur->index == 0) { + if (++l >= root->height) + return NULL; + src_cur++; + } + for (i = l; i < root->height; i++) + dest_cursor[i] = *src_cur++; + + dst_cur = dest_cursor + l; + dst_cur->index--; + while (l-- >= level) { + dest_cursor[l].node = dst_cur->node->ptrs[dst_cur->index]; + dest_cursor[l].index = dest_cursor[l].node->num_keys; + dst_cur--; + } + return dest_cursor; +} + +static struct btree_cursor * +btree_copy_cursor_next( + struct btree_root *root, + struct btree_cursor *dest_cursor, + int level) +{ + struct btree_cursor *src_cur = root->cursor + level; + struct btree_cursor *dst_cur; + int l = level; + int i; + + if (level >= root->height) + return NULL; + + while (src_cur->index == src_cur->node->num_keys) { + if (++l >= root->height) + return NULL; + src_cur++; + } + for (i = l; i < root->height; i++) + dest_cursor[i] = *src_cur++; + + dst_cur = dest_cursor + l; + dst_cur->index++; + while (l-- >= level) { + dest_cursor[l].node = dst_cur->node->ptrs[dst_cur->index]; + dest_cursor[l].index = 0; + dst_cur--; + } + return dest_cursor; +} + +/* + * Shift functions + * + * Tries to move items in the current leaf to its sibling if it has space. + * Used in both insert and delete functions. + * Returns the number of items shifted. + */ + +static int +btree_shift_to_prev( + struct btree_root *root, + int level, + struct btree_cursor *prev_cursor, + int num_children) +{ + struct btree_node *node; + struct btree_node *prev_node; + int num_remain; /* # of keys left in "node" */ + unsigned long key; + int i; + + if (!prev_cursor || !num_children) + return 0; + + prev_node = prev_cursor[level].node; + node = root->cursor[level].node; + + ASSERT(num_children > 0 && num_children <= node->num_keys + 1); + + if ((prev_node->num_keys + num_children) > BTREE_KEY_MAX) + return 0; + +#ifdef BTREE_STATS + root->stats.shift_prev += 1; +#endif + + num_remain = node->num_keys - num_children; + ASSERT(num_remain == -1 || num_remain >= BTREE_KEY_MIN); + + /* shift parent keys around */ + level++; + if (num_remain > 0) + key = node->keys[num_children - 1]; + else + key = btree_key_of_cursor(root->cursor + level, + root->height - level); + while (prev_cursor[level].index == prev_cursor[level].node->num_keys) { + level++; + ASSERT(level < root->height); + } + prev_node->keys[prev_node->num_keys] = + prev_cursor[level].node->keys[prev_cursor[level].index]; + prev_cursor[level].node->keys[prev_cursor[level].index] = key; + + /* copy pointers and keys to the end of the prev node */ + for (i = 0; i < num_children - 1; i++) { + prev_node->keys[prev_node->num_keys + 1 + i] = node->keys[i]; + prev_node->ptrs[prev_node->num_keys + 1 + i] = node->ptrs[i]; + } + prev_node->ptrs[prev_node->num_keys + 1 + i] = node->ptrs[i]; + prev_node->num_keys += num_children; + + /* move remaining pointers/keys to start of node */ + if (num_remain >= 0) { + for (i = 0; i < num_remain; i++) { + node->keys[i] = node->keys[num_children + i]; + node->ptrs[i] = node->ptrs[num_children + i]; + } + node->ptrs[i] = node->ptrs[num_children + i]; + node->num_keys = num_remain; + } else + node->num_keys = 0; + + return num_children; +} + +static int +btree_shift_to_next( + struct btree_root *root, + int level, + struct btree_cursor *next_cursor, + int num_children) +{ + struct btree_node *node; + struct btree_node *next_node; + int num_remain; /* # of children left in node */ + int i; + + if (!next_cursor || !num_children) + return 0; + + node = root->cursor[level].node; + next_node = next_cursor[level].node; + + ASSERT(num_children > 0 && num_children <= node->num_keys + 1); + + if ((next_node->num_keys + num_children) > BTREE_KEY_MAX) + return 0; + + num_remain = node->num_keys + 1 - num_children; + ASSERT(num_remain == 0 || num_remain > BTREE_KEY_MIN); + +#ifdef BTREE_STATS + root->stats.shift_next += 1; +#endif + + /* make space for "num_children" items at beginning of next-leaf */ + i = next_node->num_keys; + next_node->ptrs[num_children + i] = next_node->ptrs[i]; + while (--i >= 0) { + next_node->keys[num_children + i] = next_node->keys[i]; + next_node->ptrs[num_children + i] = next_node->ptrs[i]; + } + + /* update keys in parent and next node from parent */ + do { + level++; + ASSERT(level < root->height); + } while (root->cursor[level].index == root->cursor[level].node->num_keys); + + next_node->keys[num_children - 1] = + root->cursor[level].node->keys[root->cursor[level].index]; + root->cursor[level].node->keys[root->cursor[level].index] = + node->keys[node->num_keys - num_children]; + + /* copy last "num_children" items from node into start of next-node */ + for (i = 0; i < num_children - 1; i++) { + next_node->keys[i] = node->keys[num_remain + i]; + next_node->ptrs[i] = node->ptrs[num_remain + i]; + } + next_node->ptrs[i] = node->ptrs[num_remain + i]; + next_node->num_keys += num_children; + + if (num_remain > 0) + node->num_keys -= num_children; + else + node->num_keys = 0; + + return num_children; +} + +/* + * Insertion functions + */ + +static struct btree_node * +btree_increase_height( + struct btree_root *root) +{ + struct btree_node *new_root; + struct btree_cursor *new_cursor; + + new_cursor = realloc(root->cursor, (root->height + 1) * + sizeof(struct btree_cursor)); + if (!new_cursor) + return NULL; + root->cursor = new_cursor; + + new_root = btree_node_alloc(); + if (!new_root) + return NULL; + +#ifdef BTREE_STATS + root->stats.alloced += 1; + root->stats.inc_height += 1; + root->stats.max_items *= BTREE_PTR_MAX; +#endif + + new_root->ptrs[0] = root->root_node; + root->root_node = new_root; + + root->cursor[root->height].node = new_root; + root->cursor[root->height].index = 0; + + root->height++; + + return new_root; +} + +static int +btree_insert_item( + struct btree_root *root, + int level, + unsigned long key, + void *value); + + +static struct btree_node * +btree_split( + struct btree_root *root, + int level, + unsigned long key, + int *index) +{ + struct btree_node *node = root->cursor[level].node; + struct btree_node *new_node; + int i; + + new_node = btree_node_alloc(); + if (!new_node) + return NULL; + + if (btree_insert_item(root, level + 1, node->keys[BTREE_KEY_MIN], + new_node) != 0) { + btree_node_free(new_node); + return NULL; + } + +#ifdef BTREE_STATS + root->stats.alloced += 1; + root->stats.split += 1; +#endif + + for (i = 0; i < BTREE_KEY_MAX - BTREE_KEY_MIN - 1; i++) { + new_node->keys[i] = node->keys[BTREE_KEY_MIN + 1 + i]; + new_node->ptrs[i] = node->ptrs[BTREE_KEY_MIN + 1 + i]; + } + new_node->ptrs[i] = node->ptrs[BTREE_KEY_MIN + 1 + i]; + new_node->num_keys = BTREE_KEY_MAX - BTREE_KEY_MIN - 1; + + node->num_keys = BTREE_KEY_MIN; + if (key < node->keys[BTREE_KEY_MIN]) + return node; /* index doesn't change */ + + /* insertion point is in new node... */ + *index -= BTREE_KEY_MIN + 1; + return new_node; +} + +static int +btree_insert_shift_to_prev( + struct btree_root *root, + int level, + int *index) +{ + struct btree_cursor tmp_cursor[root->height]; + int n; + + if (*index <= 0) + return -1; + + if (!btree_copy_cursor_prev(root, tmp_cursor, level + 1)) + return -1; + + n = MIN(*index, (BTREE_PTR_MAX - tmp_cursor[level].node->num_keys) / 2); + if (!n || !btree_shift_to_prev(root, level, tmp_cursor, n)) + return -1; + + *index -= n; + return 0; +} + +static int +btree_insert_shift_to_next( + struct btree_root *root, + int level, + int *index) +{ + struct btree_cursor tmp_cursor[root->height]; + int n; + + if (*index >= BTREE_KEY_MAX) + return -1; + + if (!btree_copy_cursor_next(root, tmp_cursor, level + 1)) + return -1; + + n = MIN(BTREE_KEY_MAX - *index, + (BTREE_PTR_MAX - tmp_cursor[level].node->num_keys) / 2); + if (!n || !btree_shift_to_next(root, level, tmp_cursor, n)) + return -1; + return 0; +} + +static int +btree_insert_item( + struct btree_root *root, + int level, + unsigned long key, + void *value) +{ + struct btree_node *node = root->cursor[level].node; + int index = root->cursor[level].index; + int i; + + if (node->num_keys == BTREE_KEY_MAX) { + if (btree_insert_shift_to_prev(root, level, &index) == 0) + goto insert; + if (btree_insert_shift_to_next(root, level, &index) == 0) + goto insert; + if (level == root->height - 1) { + if (!btree_increase_height(root)) + return ENOMEM; + } + node = btree_split(root, level, key, &index); + if (!node) + return ENOMEM; + } +insert: + ASSERT(index <= node->num_keys); + + i = node->num_keys; + node->ptrs[i + 1] = node->ptrs[i]; + while (--i >= index) { + node->keys[i + 1] = node->keys[i]; + node->ptrs[i + 1] = node->ptrs[i]; + } + + node->num_keys++; + node->keys[index] = key; + + if (level == 0) + node->ptrs[index] = value; + else + node->ptrs[index + 1] = value; + + return 0; +} + + + +int +btree_insert( + struct btree_root *root, + unsigned long key, + void *value) +{ + int result; + + if (!value) + return EINVAL; + + if (btree_search(root, key) && root->cur_key == key) + return EEXIST; + +#ifdef BTREE_STATS + root->stats.insert += 1; + root->stats.num_items += 1; +#endif + + result = btree_insert_item(root, 0, key, value); + + btree_invalidate_cursor(root); + + return result; +} + + +/* + * Deletion functions + * + * Rather more complicated as deletions has 4 ways to go once a node + * ends up with less than the minimum number of keys: + * - move remainder to previous node + * - move remainder to next node + * (both will involve a parent deletion which may recurse) + * - balance by moving some items from previous node + * - balance by moving some items from next node + */ + +static void +btree_decrease_height( + struct btree_root *root) +{ + struct btree_node *old_root = root->root_node; + + ASSERT(old_root->num_keys == 0); + +#ifdef BTREE_STATS + root->stats.alloced -= 1; + root->stats.dec_height += 1; + root->stats.max_items /= BTREE_PTR_MAX; +#endif + root->root_node = old_root->ptrs[0]; + btree_node_free(old_root); + root->height--; +} + +static int +btree_merge_with_prev( + struct btree_root *root, + int level, + struct btree_cursor *prev_cursor) +{ + if (!prev_cursor) + return 0; + + if (!btree_shift_to_prev(root, level, prev_cursor, + root->cursor[level].node->num_keys + 1)) + return 0; + +#ifdef BTREE_STATS + root->stats.merge_prev += 1; +#endif + return 1; +} + +static int +btree_merge_with_next( + struct btree_root *root, + int level, + struct btree_cursor *next_cursor) +{ + if (!next_cursor) + return 0; + + if (!btree_shift_to_next(root, level, next_cursor, + root->cursor[level].node->num_keys + 1)) + return 0; + +#ifdef BTREE_STATS + root->stats.merge_next += 1; +#endif + return 1; +} + +static int +btree_balance_with_prev( + struct btree_root *root, + int level, + struct btree_cursor *prev_cursor) +{ + struct btree_cursor *root_cursor = root->cursor; + + if (!prev_cursor) + return 0; + ASSERT(prev_cursor[level].node->num_keys > BTREE_KEY_MIN); + +#ifdef BTREE_STATS + root->stats.balance_prev += 1; +#endif + /* + * Move some nodes from the prev node into the current node. + * As the shift operation is a right shift and is relative to + * the root cursor, make the root cursor the prev cursor and + * pass in the root cursor as the next cursor. + */ + + root->cursor = prev_cursor; + if (!btree_shift_to_next(root, level, root_cursor, + (prev_cursor[level].node->num_keys + 1 - BTREE_KEY_MIN) / 2)) + abort(); + root->cursor = root_cursor; + + return 1; +} + +static int +btree_balance_with_next( + struct btree_root *root, + int level, + struct btree_cursor *next_cursor) +{ + struct btree_cursor *root_cursor = root->cursor; + + if (!next_cursor) + return 0; + assert(next_cursor[level].node->num_keys > BTREE_KEY_MIN); + +#ifdef btree_stats + root->stats.balance_next += 1; +#endif + /* + * move some nodes from the next node into the current node. + * as the shift operation is a left shift and is relative to + * the root cursor, make the root cursor the next cursor and + * pass in the root cursor as the prev cursor. + */ + + root->cursor = next_cursor; + if (!btree_shift_to_prev(root, level, root_cursor, + (next_cursor[level].node->num_keys + 1 - BTREE_KEY_MIN) / 2)) + abort(); + root->cursor = root_cursor; + + return 1; + +} + +static void +btree_delete_key( + struct btree_root *root, + int level); + +/* + * btree_delete_node: + * + * Return 0 if it's done or 1 if the next level needs to be collapsed + */ +static void +btree_delete_node( + struct btree_root *root, + int level) +{ + struct btree_cursor prev_cursor[root->height]; + struct btree_cursor next_cursor[root->height]; + struct btree_cursor *pc; + struct btree_cursor *nc; + + /* + * the node has underflowed, grab or merge keys/items from a + * neighbouring node. + */ + + if (level == root->height - 1) { + if (level > 0 && root->root_node->num_keys == 0) + btree_decrease_height(root); + return; + } + + pc = btree_copy_cursor_prev(root, prev_cursor, level + 1); + if (!btree_merge_with_prev(root, level, pc)) { + nc = btree_copy_cursor_next(root, next_cursor, level + 1); + if (!btree_merge_with_next(root, level, nc)) { + /* merging failed, try redistrubution */ + if (!btree_balance_with_prev(root, level, pc) && + !btree_balance_with_next(root, level, nc)) + abort(); + return; /* when balancing, then the node isn't freed */ + } + } + +#ifdef BTREE_STATS + root->stats.alloced -= 1; +#endif + btree_node_free(root->cursor[level].node); + + btree_delete_key(root, level + 1); +} + +static void +btree_delete_key( + struct btree_root *root, + int level) +{ + struct btree_node *node = root->cursor[level].node; + int index = root->cursor[level].index; + + node->num_keys--; + if (index <= node->num_keys) { + /* + * if not deleting the last item, shift higher items down + * to cover the item being deleted + */ + while (index < node->num_keys) { + node->keys[index] = node->keys[index + 1]; + node->ptrs[index] = node->ptrs[index + 1]; + index++; + } + node->ptrs[index] = node->ptrs[index + 1]; + } else { + /* + * else update the associated parent key as the last key + * in the leaf has changed + */ + btree_update_node_key(root, root->cursor, level + 1, + node->keys[node->num_keys]); + } + /* + * if node underflows, either merge with sibling or rebalance + * with sibling. + */ + if (node->num_keys < BTREE_KEY_MIN) + btree_delete_node(root, level); +} + +void * +btree_delete( + struct btree_root *root, + unsigned long key) +{ + void *value; + + value = btree_lookup(root, key); + if (!value) + return NULL; + +#ifdef BTREE_STATS + root->stats.delete += 1; + root->stats.num_items -= 1; +#endif + + btree_delete_key(root, 0); + + btree_invalidate_cursor(root); + + return value; +} + +#ifdef BTREE_STATS +void +btree_print_stats( + struct btree_root *root, + FILE *f) +{ + unsigned long max_items = root->stats.max_items * + (root->root_node->num_keys + 1); + + fprintf(f, "\tnum_items = %lu, max_items = %lu (%lu%%)\n", + root->stats.num_items, max_items, + root->stats.num_items * 100 / max_items); + fprintf(f, "\talloced = %d nodes, %lu bytes, %lu bytes per item\n", + root->stats.alloced, + root->stats.alloced * sizeof(struct btree_node), + root->stats.alloced * sizeof(struct btree_node) / + root->stats.num_items); + fprintf(f, "\tlookup = %d\n", root->stats.lookup); + fprintf(f, "\tfind = %d\n", root->stats.find); + fprintf(f, "\tcache_hits = %d\n", root->stats.cache_hits); + fprintf(f, "\tcache_misses = %d\n", root->stats.cache_misses); + fprintf(f, "\tkey_update = %d\n", root->stats.key_update); + fprintf(f, "\tvalue_update = %d\n", root->stats.value_update); + fprintf(f, "\tinsert = %d\n", root->stats.insert); + fprintf(f, "\tshift_prev = %d\n", root->stats.shift_prev); + fprintf(f, "\tshift_next = %d\n", root->stats.shift_next); + fprintf(f, "\tsplit = %d\n", root->stats.split); + fprintf(f, "\tinc_height = %d\n", root->stats.inc_height); + fprintf(f, "\tdelete = %d\n", root->stats.delete); + fprintf(f, "\tmerge_prev = %d\n", root->stats.merge_prev); + fprintf(f, "\tmerge_next = %d\n", root->stats.merge_next); + fprintf(f, "\tbalance_prev = %d\n", root->stats.balance_prev); + fprintf(f, "\tbalance_next = %d\n", root->stats.balance_next); + fprintf(f, "\tdec_height = %d\n", root->stats.dec_height); +} +#endif Index: xfsprogs-dev/repair/btree.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xfsprogs-dev/repair/btree.h 2009-08-20 00:06:44.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _BTREE_H +#define _BTREE_H + + +struct btree_root; + +void +btree_init( + struct btree_root **root); + +void +btree_destroy( + struct btree_root *root); + +int +btree_is_empty( + struct btree_root *root); + +void * +btree_lookup( + struct btree_root *root, + unsigned long key); + +void * +btree_find( + struct btree_root *root, + unsigned long key, + unsigned long *actual_key); + +void * +btree_peek_prev( + struct btree_root *root, + unsigned long *key); + +void * +btree_peek_next( + struct btree_root *root, + unsigned long *key); + +void * +btree_lookup_next( + struct btree_root *root, + unsigned long *key); + +void * +btree_lookup_prev( + struct btree_root *root, + unsigned long *key); + +int +btree_insert( + struct btree_root *root, + unsigned long key, + void *value); + +void * +btree_delete( + struct btree_root *root, + unsigned long key); + +int +btree_update_key( + struct btree_root *root, + unsigned long old_key, + unsigned long new_key); + +int +btree_update_value( + struct btree_root *root, + unsigned long key, + void *new_value); + +void +btree_clear( + struct btree_root *root); + +#ifdef BTREE_STATS +void +btree_print_stats( + struct btree_root *root, + FILE *f); +#endif + +#endif /* _BTREE_H */ Index: xfsprogs-dev/repair/init.c =================================================================== --- xfsprogs-dev.orig/repair/init.c 2009-08-20 00:01:58.000000000 +0000 +++ xfsprogs-dev/repair/init.c 2009-08-20 00:06:44.000000000 +0000 @@ -26,7 +26,6 @@ #include "dir.h" #include "incore.h" #include "prefetch.h" -#include "radix-tree.h" #include static pthread_key_t dirbuf_key; @@ -151,5 +150,4 @@ ts_create(); ts_init(); increase_rlimit(); - radix_tree_init(); } Index: xfsprogs-dev/repair/prefetch.c =================================================================== --- xfsprogs-dev.orig/repair/prefetch.c 2009-08-20 00:05:36.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.c 2009-08-20 00:14:08.000000000 +0000 @@ -1,6 +1,7 @@ #include #include #include "avl.h" +#include "btree.h" #include "globals.h" #include "agheader.h" #include "incore.h" @@ -14,7 +15,6 @@ #include "threads.h" #include "prefetch.h" #include "progress.h" -#include "radix-tree.h" int do_prefetch = 1; @@ -129,10 +129,8 @@ pthread_mutex_lock(&args->lock); if (fsbno > args->last_bno_read) { - radix_tree_insert(&args->primary_io_queue, fsbno, bp); - if (!B_IS_INODE(flag)) - radix_tree_tag_set(&args->primary_io_queue, fsbno, 0); - else { + btree_insert(args->primary_io_queue, fsbno, bp); + if (B_IS_INODE(flag)) { args->inode_bufs_queued++; if (args->inode_bufs_queued == IO_THRESHOLD) pf_start_io_workers(args); @@ -154,7 +152,7 @@ #endif ASSERT(!B_IS_INODE(flag)); XFS_BUF_SET_PRIORITY(bp, B_DIR_META_2); - radix_tree_insert(&args->secondary_io_queue, fsbno, bp); + btree_insert(args->secondary_io_queue, fsbno, bp); } pf_start_processing(args); @@ -407,7 +405,7 @@ pf_which_t which, void *buf) { - struct radix_tree_root *queue; + struct btree_root *queue; xfs_buf_t *bplist[MAX_BUFS]; unsigned int num; off64_t first_off, last_off, next_off; @@ -415,27 +413,25 @@ int i; int inode_bufs; unsigned long fsbno; + unsigned long max_fsbno; char *pbuf; - queue = (which != PF_SECONDARY) ? &args->primary_io_queue - : &args->secondary_io_queue; + queue = (which != PF_SECONDARY) ? args->primary_io_queue + : args->secondary_io_queue; - while (radix_tree_lookup_first(queue, &fsbno) != NULL) { - - if (which != PF_META_ONLY) { - num = radix_tree_gang_lookup_ex(queue, - (void**)&bplist[0], fsbno, - fsbno + pf_max_fsbs, MAX_BUFS); - ASSERT(num > 0); - ASSERT(XFS_FSB_TO_DADDR(mp, fsbno) == - XFS_BUF_ADDR(bplist[0])); - } else { - num = radix_tree_gang_lookup_tag(queue, - (void**)&bplist[0], fsbno, - MAX_BUFS / 4, 0); - if (num == 0) - return; + while (btree_find(queue, 0, &fsbno) != NULL) { + max_fsbno = fsbno + pf_max_fsbs; + num = 0; + + bplist[0] = btree_lookup(queue, fsbno); + while (bplist[num] && num < MAX_BUFS && fsbno < max_fsbno) { + if (which != PF_META_ONLY || + !B_IS_INODE(XFS_BUF_PRIORITY(bplist[num]))) + num++; + bplist[num] = btree_lookup_next(queue, &fsbno); } + if (!num) + return; /* * do a big read if 25% of the potential buffer is useful, @@ -467,7 +463,7 @@ } for (i = 0; i < num; i++) { - if (radix_tree_delete(queue, XFS_DADDR_TO_FSB(mp, + if (btree_delete(queue, XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bplist[i]))) == NULL) do_error(_("prefetch corruption\n")); } @@ -570,7 +566,7 @@ return NULL; pthread_mutex_lock(&args->lock); - while (!args->queuing_done || args->primary_io_queue.height) { + while (!args->queuing_done || btree_find(args->primary_io_queue, 0, NULL)) { #ifdef XR_PF_TRACE pftrace("waiting to start prefetch I/O for AG %d", args->agno); @@ -696,8 +692,8 @@ #endif pthread_mutex_lock(&args->lock); - ASSERT(args->primary_io_queue.height == 0); - ASSERT(args->secondary_io_queue.height == 0); + ASSERT(btree_find(args->primary_io_queue, 0, NULL) == NULL); + ASSERT(btree_find(args->secondary_io_queue, 0, NULL) == NULL); args->prefetch_done = 1; if (args->next_args) @@ -755,8 +751,8 @@ args = calloc(1, sizeof(prefetch_args_t)); - INIT_RADIX_TREE(&args->primary_io_queue, 0); - INIT_RADIX_TREE(&args->secondary_io_queue, 0); + btree_init(&args->primary_io_queue); + btree_init(&args->secondary_io_queue); if (pthread_mutex_init(&args->lock, NULL) != 0) do_error(_("failed to initialize prefetch mutex\n")); if (pthread_cond_init(&args->start_reading, NULL) != 0) @@ -835,6 +831,8 @@ pthread_cond_destroy(&args->start_reading); pthread_cond_destroy(&args->start_processing); sem_destroy(&args->ra_count); + btree_destroy(args->primary_io_queue); + btree_destroy(args->secondary_io_queue); free(args); } Index: xfsprogs-dev/repair/prefetch.h =================================================================== --- xfsprogs-dev.orig/repair/prefetch.h 2009-08-20 00:01:58.000000000 +0000 +++ xfsprogs-dev/repair/prefetch.h 2009-08-20 00:06:44.000000000 +0000 @@ -3,7 +3,6 @@ #include #include "incore.h" -#include "radix-tree.h" extern int do_prefetch; @@ -14,8 +13,8 @@ pthread_mutex_t lock; pthread_t queuing_thread; pthread_t io_threads[PF_THREAD_COUNT]; - struct radix_tree_root primary_io_queue; - struct radix_tree_root secondary_io_queue; + struct btree_root *primary_io_queue; + struct btree_root *secondary_io_queue; pthread_cond_t start_reading; pthread_cond_t start_processing; int agno; Index: xfsprogs-dev/repair/radix-tree.c =================================================================== --- xfsprogs-dev.orig/repair/radix-tree.c 2009-08-20 00:01:58.000000000 +0000 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,805 +0,0 @@ -/* - * Copyright (C) 2001 Momchil Velikov - * Portions Copyright (C) 2001 Christoph Hellwig - * Copyright (C) 2005 SGI, Christoph Lameter - * - * 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; either version 2, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include "radix-tree.h" - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - -#define RADIX_TREE_MAP_SHIFT 6 -#define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT) -#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE-1) - -#ifdef RADIX_TREE_TAGS -#define RADIX_TREE_TAG_LONGS \ - ((RADIX_TREE_MAP_SIZE + BITS_PER_LONG - 1) / BITS_PER_LONG) -#endif - -struct radix_tree_node { - unsigned int count; - void *slots[RADIX_TREE_MAP_SIZE]; -#ifdef RADIX_TREE_TAGS - unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; -#endif -}; - -struct radix_tree_path { - struct radix_tree_node *node; - int offset; -}; - -#define RADIX_TREE_INDEX_BITS (8 /* CHAR_BIT */ * sizeof(unsigned long)) -#define RADIX_TREE_MAX_PATH (RADIX_TREE_INDEX_BITS/RADIX_TREE_MAP_SHIFT + 2) - -static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH]; - -/* - * Radix tree node cache. - */ - -#define radix_tree_node_alloc(r) ((struct radix_tree_node *) \ - calloc(1, sizeof(struct radix_tree_node))) -#define radix_tree_node_free(n) free(n) - -#ifdef RADIX_TREE_TAGS - -static inline void tag_set(struct radix_tree_node *node, unsigned int tag, - int offset) -{ - *((__uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31)); -} - -static inline void tag_clear(struct radix_tree_node *node, unsigned int tag, - int offset) -{ - __uint32_t *p = (__uint32_t*)node->tags[tag] + (offset >> 5); - __uint32_t m = 1 << (offset & 31); - *p &= ~m; -} - -static inline int tag_get(struct radix_tree_node *node, unsigned int tag, - int offset) -{ - return 1 & (((const __uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31)); -} - -/* - * Returns 1 if any slot in the node has this tag set. - * Otherwise returns 0. - */ -static inline int any_tag_set(struct radix_tree_node *node, unsigned int tag) -{ - int idx; - for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) { - if (node->tags[tag][idx]) - return 1; - } - return 0; -} - -#endif - -/* - * Return the maximum key which can be store into a - * radix tree with height HEIGHT. - */ -static inline unsigned long radix_tree_maxindex(unsigned int height) -{ - return height_to_maxindex[height]; -} - -/* - * Extend a radix tree so it can store key @index. - */ -static int radix_tree_extend(struct radix_tree_root *root, unsigned long index) -{ - struct radix_tree_node *node; - unsigned int height; -#ifdef RADIX_TREE_TAGS - char tags[RADIX_TREE_MAX_TAGS]; - int tag; -#endif - - /* Figure out what the height should be. */ - height = root->height + 1; - while (index > radix_tree_maxindex(height)) - height++; - - if (root->rnode == NULL) { - root->height = height; - goto out; - } - -#ifdef RADIX_TREE_TAGS - /* - * Prepare the tag status of the top-level node for propagation - * into the newly-pushed top-level node(s) - */ - for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { - tags[tag] = 0; - if (any_tag_set(root->rnode, tag)) - tags[tag] = 1; - } -#endif - do { - if (!(node = radix_tree_node_alloc(root))) - return -ENOMEM; - - /* Increase the height. */ - node->slots[0] = root->rnode; - -#ifdef RADIX_TREE_TAGS - /* Propagate the aggregated tag info into the new root */ - for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { - if (tags[tag]) - tag_set(node, tag, 0); - } -#endif - node->count = 1; - root->rnode = node; - root->height++; - } while (height > root->height); -out: - return 0; -} - -/** - * radix_tree_insert - insert into a radix tree - * @root: radix tree root - * @index: index key - * @item: item to insert - * - * Insert an item into the radix tree at position @index. - */ -int radix_tree_insert(struct radix_tree_root *root, - unsigned long index, void *item) -{ - struct radix_tree_node *node = NULL, *slot; - unsigned int height, shift; - int offset; - int error; - - /* Make sure the tree is high enough. */ - if ((!index && !root->rnode) || - index > radix_tree_maxindex(root->height)) { - error = radix_tree_extend(root, index); - if (error) - return error; - } - - slot = root->rnode; - height = root->height; - shift = (height-1) * RADIX_TREE_MAP_SHIFT; - - offset = 0; /* uninitialised var warning */ - do { - if (slot == NULL) { - /* Have to add a child node. */ - if (!(slot = radix_tree_node_alloc(root))) - return -ENOMEM; - if (node) { - node->slots[offset] = slot; - node->count++; - } else - root->rnode = slot; - } - - /* Go a level down */ - offset = (index >> shift) & RADIX_TREE_MAP_MASK; - node = slot; - slot = node->slots[offset]; - shift -= RADIX_TREE_MAP_SHIFT; - height--; - } while (height > 0); - - if (slot != NULL) - return -EEXIST; - - ASSERT(node); - node->count++; - node->slots[offset] = item; -#ifdef RADIX_TREE_TAGS - ASSERT(!tag_get(node, 0, offset)); - ASSERT(!tag_get(node, 1, offset)); -#endif - return 0; -} - -static inline void **__lookup_slot(struct radix_tree_root *root, - unsigned long index) -{ - unsigned int height, shift; - struct radix_tree_node **slot; - - height = root->height; - if (index > radix_tree_maxindex(height)) - return NULL; - - shift = (height-1) * RADIX_TREE_MAP_SHIFT; - slot = &root->rnode; - - while (height > 0) { - if (*slot == NULL) - return NULL; - - slot = (struct radix_tree_node **) - ((*slot)->slots + - ((index >> shift) & RADIX_TREE_MAP_MASK)); - shift -= RADIX_TREE_MAP_SHIFT; - height--; - } - - return (void **)slot; -} - -/** - * radix_tree_lookup_slot - lookup a slot in a radix tree - * @root: radix tree root - * @index: index key - * - * Lookup the slot corresponding to the position @index in the radix tree - * @root. This is useful for update-if-exists operations. - */ -void **radix_tree_lookup_slot(struct radix_tree_root *root, unsigned long index) -{ - return __lookup_slot(root, index); -} - -/** - * radix_tree_lookup - perform lookup operation on a radix tree - * @root: radix tree root - * @index: index key - * - * Lookup the item at the position @index in the radix tree @root. - */ -void *radix_tree_lookup(struct radix_tree_root *root, unsigned long index) -{ - void **slot; - - slot = __lookup_slot(root, index); - return slot != NULL ? *slot : NULL; -} - -/** - * raid_tree_first_key - find the first index key in the radix tree - * @root: radix tree root - * @index: where the first index will be placed - * - * Returns the first entry and index key in the radix tree @root. - */ -void *radix_tree_lookup_first(struct radix_tree_root *root, unsigned long *index) -{ - unsigned int height, shift; - struct radix_tree_node *slot; - unsigned long i; - - height = root->height; - *index = 0; - if (height == 0) - return NULL; - - shift = (height-1) * RADIX_TREE_MAP_SHIFT; - slot = root->rnode; - - for (; height > 1; height--) { - for (i = 0; i < RADIX_TREE_MAP_SIZE; i++) { - if (slot->slots[i] != NULL) - break; - } - ASSERT(i < RADIX_TREE_MAP_SIZE); - - *index |= (i << shift); - shift -= RADIX_TREE_MAP_SHIFT; - slot = slot->slots[i]; - } - for (i = 0; i < RADIX_TREE_MAP_SIZE; i++) { - if (slot->slots[i] != NULL) { - *index |= i; - return slot->slots[i]; - } - } - return NULL; -} - -#ifdef RADIX_TREE_TAGS - -/** - * radix_tree_tag_set - set a tag on a radix tree node - * @root: radix tree root - * @index: index key - * @tag: tag index - * - * Set the search tag (which must be < RADIX_TREE_MAX_TAGS) - * corresponding to @index in the radix tree. From - * the root all the way down to the leaf node. - * - * Returns the address of the tagged item. Setting a tag on a not-present - * item is a bug. - */ -void *radix_tree_tag_set(struct radix_tree_root *root, - unsigned long index, unsigned int tag) -{ - unsigned int height, shift; - struct radix_tree_node *slot; - - height = root->height; - if (index > radix_tree_maxindex(height)) - return NULL; - - shift = (height - 1) * RADIX_TREE_MAP_SHIFT; - slot = root->rnode; - - while (height > 0) { - int offset; - - offset = (index >> shift) & RADIX_TREE_MAP_MASK; - if (!tag_get(slot, tag, offset)) - tag_set(slot, tag, offset); - slot = slot->slots[offset]; - ASSERT(slot != NULL); - shift -= RADIX_TREE_MAP_SHIFT; - height--; - } - - return slot; -} - -/** - * radix_tree_tag_clear - clear a tag on a radix tree node - * @root: radix tree root - * @index: index key - * @tag: tag index - * - * Clear the search tag (which must be < RADIX_TREE_MAX_TAGS) - * corresponding to @index in the radix tree. If - * this causes the leaf node to have no tags set then clear the tag in the - * next-to-leaf node, etc. - * - * Returns the address of the tagged item on success, else NULL. ie: - * has the same return value and semantics as radix_tree_lookup(). - */ -void *radix_tree_tag_clear(struct radix_tree_root *root, - unsigned long index, unsigned int tag) -{ - struct radix_tree_path path[RADIX_TREE_MAX_PATH], *pathp = path; - struct radix_tree_node *slot; - unsigned int height, shift; - void *ret = NULL; - - height = root->height; - if (index > radix_tree_maxindex(height)) - goto out; - - shift = (height - 1) * RADIX_TREE_MAP_SHIFT; - pathp->node = NULL; - slot = root->rnode; - - while (height > 0) { - int offset; - - if (slot == NULL) - goto out; - - offset = (index >> shift) & RADIX_TREE_MAP_MASK; - pathp[1].offset = offset; - pathp[1].node = slot; - slot = slot->slots[offset]; - pathp++; - shift -= RADIX_TREE_MAP_SHIFT; - height--; - } - - ret = slot; - if (ret == NULL) - goto out; - - do { - if (!tag_get(pathp->node, tag, pathp->offset)) - goto out; - tag_clear(pathp->node, tag, pathp->offset); - if (any_tag_set(pathp->node, tag)) - goto out; - pathp--; - } while (pathp->node); -out: - return ret; -} - -#endif - -static unsigned int -__lookup(struct radix_tree_root *root, void **results, unsigned long index, - unsigned int max_items, unsigned long *next_index) -{ - unsigned int nr_found = 0; - unsigned int shift, height; - struct radix_tree_node *slot; - unsigned long i; - - height = root->height; - if (height == 0) - goto out; - - shift = (height-1) * RADIX_TREE_MAP_SHIFT; - slot = root->rnode; - - for ( ; height > 1; height--) { - - for (i = (index >> shift) & RADIX_TREE_MAP_MASK ; - i < RADIX_TREE_MAP_SIZE; i++) { - if (slot->slots[i] != NULL) - break; - index &= ~((1UL << shift) - 1); - index += 1UL << shift; - if (index == 0) - goto out; /* 32-bit wraparound */ - } - if (i == RADIX_TREE_MAP_SIZE) - goto out; - - shift -= RADIX_TREE_MAP_SHIFT; - slot = slot->slots[i]; - } - - /* Bottom level: grab some items */ - for (i = index & RADIX_TREE_MAP_MASK; i < RADIX_TREE_MAP_SIZE; i++) { - index++; - if (slot->slots[i]) { - results[nr_found++] = slot->slots[i]; - if (nr_found == max_items) - goto out; - } - } -out: - *next_index = index; - return nr_found; -} - -/** - * radix_tree_gang_lookup - perform multiple lookup on a radix tree - * @root: radix tree root - * @results: where the results of the lookup are placed - * @first_index: start the lookup from this key - * @max_items: place up to this many items at *results - * - * Performs an index-ascending scan of the tree for present items. Places - * them at *@results and returns the number of items which were placed at - * *@results. - * - * The implementation is naive. - */ -unsigned int -radix_tree_gang_lookup(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned int max_items) -{ - const unsigned long max_index = radix_tree_maxindex(root->height); - unsigned long cur_index = first_index; - unsigned int ret = 0; - - while (ret < max_items) { - unsigned int nr_found; - unsigned long next_index; /* Index of next search */ - - if (cur_index > max_index) - break; - nr_found = __lookup(root, results + ret, cur_index, - max_items - ret, &next_index); - ret += nr_found; - if (next_index == 0) - break; - cur_index = next_index; - } - return ret; -} - -/** - * radix_tree_gang_lookup_ex - perform multiple lookup on a radix tree - * @root: radix tree root - * @results: where the results of the lookup are placed - * @first_index: start the lookup from this key - * @last_index: don't lookup past this key - * @max_items: place up to this many items at *results - * - * Performs an index-ascending scan of the tree for present items starting - * @first_index until @last_index up to as many as @max_items. Places - * them at *@results and returns the number of items which were placed - * at *@results. - * - * The implementation is naive. - */ -unsigned int -radix_tree_gang_lookup_ex(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned long last_index, - unsigned int max_items) -{ - const unsigned long max_index = radix_tree_maxindex(root->height); - unsigned long cur_index = first_index; - unsigned int ret = 0; - - while (ret < max_items && cur_index < last_index) { - unsigned int nr_found; - unsigned long next_index; /* Index of next search */ - - if (cur_index > max_index) - break; - nr_found = __lookup(root, results + ret, cur_index, - max_items - ret, &next_index); - ret += nr_found; - if (next_index == 0) - break; - cur_index = next_index; - } - return ret; -} - -#ifdef RADIX_TREE_TAGS - -static unsigned int -__lookup_tag(struct radix_tree_root *root, void **results, unsigned long index, - unsigned int max_items, unsigned long *next_index, unsigned int tag) -{ - unsigned int nr_found = 0; - unsigned int shift; - unsigned int height = root->height; - struct radix_tree_node *slot; - - shift = (height - 1) * RADIX_TREE_MAP_SHIFT; - slot = root->rnode; - - while (height > 0) { - unsigned long i = (index >> shift) & RADIX_TREE_MAP_MASK; - - for ( ; i < RADIX_TREE_MAP_SIZE; i++) { - if (tag_get(slot, tag, i)) { - ASSERT(slot->slots[i] != NULL); - break; - } - index &= ~((1UL << shift) - 1); - index += 1UL << shift; - if (index == 0) - goto out; /* 32-bit wraparound */ - } - if (i == RADIX_TREE_MAP_SIZE) - goto out; - height--; - if (height == 0) { /* Bottom level: grab some items */ - unsigned long j = index & RADIX_TREE_MAP_MASK; - - for ( ; j < RADIX_TREE_MAP_SIZE; j++) { - index++; - if (tag_get(slot, tag, j)) { - ASSERT(slot->slots[j] != NULL); - results[nr_found++] = slot->slots[j]; - if (nr_found == max_items) - goto out; - } - } - } - shift -= RADIX_TREE_MAP_SHIFT; - slot = slot->slots[i]; - } -out: - *next_index = index; - return nr_found; -} - -/** - * radix_tree_gang_lookup_tag - perform multiple lookup on a radix tree - * based on a tag - * @root: radix tree root - * @results: where the results of the lookup are placed - * @first_index: start the lookup from this key - * @max_items: place up to this many items at *results - * @tag: the tag index (< RADIX_TREE_MAX_TAGS) - * - * Performs an index-ascending scan of the tree for present items which - * have the tag indexed by @tag set. Places the items at *@results and - * returns the number of items which were placed at *@results. - */ -unsigned int -radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned int max_items, - unsigned int tag) -{ - const unsigned long max_index = radix_tree_maxindex(root->height); - unsigned long cur_index = first_index; - unsigned int ret = 0; - - while (ret < max_items) { - unsigned int nr_found; - unsigned long next_index; /* Index of next search */ - - if (cur_index > max_index) - break; - nr_found = __lookup_tag(root, results + ret, cur_index, - max_items - ret, &next_index, tag); - ret += nr_found; - if (next_index == 0) - break; - cur_index = next_index; - } - return ret; -} - -#endif - -/** - * radix_tree_shrink - shrink height of a radix tree to minimal - * @root radix tree root - */ -static inline void radix_tree_shrink(struct radix_tree_root *root) -{ - /* try to shrink tree height */ - while (root->height > 1 && - root->rnode->count == 1 && - root->rnode->slots[0]) { - struct radix_tree_node *to_free = root->rnode; - - root->rnode = to_free->slots[0]; - root->height--; - /* must only free zeroed nodes into the slab */ -#ifdef RADIX_TREE_TAGS - tag_clear(to_free, 0, 0); - tag_clear(to_free, 1, 0); -#endif - to_free->slots[0] = NULL; - to_free->count = 0; - radix_tree_node_free(to_free); - } -} - -/** - * radix_tree_delete - delete an item from a radix tree - * @root: radix tree root - * @index: index key - * - * Remove the item at @index from the radix tree rooted at @root. - * - * Returns the address of the deleted item, or NULL if it was not present. - */ -void *radix_tree_delete(struct radix_tree_root *root, unsigned long index) -{ - struct radix_tree_path path[RADIX_TREE_MAX_PATH], *pathp = path; - struct radix_tree_path *orig_pathp; - struct radix_tree_node *slot; - unsigned int height, shift; - void *ret = NULL; -#ifdef RADIX_TREE_TAGS - char tags[RADIX_TREE_MAX_TAGS]; - int nr_cleared_tags; - int tag; -#endif - int offset; - - height = root->height; - if (index > radix_tree_maxindex(height)) - goto out; - - shift = (height - 1) * RADIX_TREE_MAP_SHIFT; - pathp->node = NULL; - slot = root->rnode; - - for ( ; height > 0; height--) { - if (slot == NULL) - goto out; - - pathp++; - offset = (index >> shift) & RADIX_TREE_MAP_MASK; - pathp->offset = offset; - pathp->node = slot; - slot = slot->slots[offset]; - shift -= RADIX_TREE_MAP_SHIFT; - } - - ret = slot; - if (ret == NULL) - goto out; - - orig_pathp = pathp; - -#ifdef RADIX_TREE_TAGS - /* - * Clear all tags associated with the just-deleted item - */ - nr_cleared_tags = 0; - for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { - tags[tag] = 1; - if (tag_get(pathp->node, tag, pathp->offset)) { - tag_clear(pathp->node, tag, pathp->offset); - if (!any_tag_set(pathp->node, tag)) { - tags[tag] = 0; - nr_cleared_tags++; - } - } - } - - for (pathp--; nr_cleared_tags && pathp->node; pathp--) { - for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { - if (tags[tag]) - continue; - - tag_clear(pathp->node, tag, pathp->offset); - if (any_tag_set(pathp->node, tag)) { - tags[tag] = 1; - nr_cleared_tags--; - } - } - } -#endif - /* Now free the nodes we do not need anymore */ - for (pathp = orig_pathp; pathp->node; pathp--) { - pathp->node->slots[pathp->offset] = NULL; - pathp->node->count--; - - if (pathp->node->count) { - if (pathp->node == root->rnode) - radix_tree_shrink(root); - goto out; - } - - /* Node with zero slots in use so free it */ - radix_tree_node_free(pathp->node); - } - root->rnode = NULL; - root->height = 0; -out: - return ret; -} - -#ifdef RADIX_TREE_TAGS -/** - * radix_tree_tagged - test whether any items in the tree are tagged - * @root: radix tree root - * @tag: tag to test - */ -int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag) -{ - struct radix_tree_node *rnode; - rnode = root->rnode; - if (!rnode) - return 0; - return any_tag_set(rnode, tag); -} -#endif - -static unsigned long __maxindex(unsigned int height) -{ - unsigned int tmp = height * RADIX_TREE_MAP_SHIFT; - unsigned long index = (~0UL >> (RADIX_TREE_INDEX_BITS - tmp - 1)) >> 1; - - if (tmp >= RADIX_TREE_INDEX_BITS) - index = ~0UL; - return index; -} - -static void radix_tree_init_maxindex(void) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++) - height_to_maxindex[i] = __maxindex(i); -} - -void radix_tree_init(void) -{ - radix_tree_init_maxindex(); -} Index: xfsprogs-dev/repair/radix-tree.h =================================================================== --- xfsprogs-dev.orig/repair/radix-tree.h 2009-08-20 00:01:58.000000000 +0000 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2001 Momchil Velikov - * Portions Copyright (C) 2001 Christoph Hellwig - * - * 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; either version 2, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef __XFS_SUPPORT_RADIX_TREE_H__ -#define __XFS_SUPPORT_RADIX_TREE_H__ - -#define RADIX_TREE_TAGS - -struct radix_tree_root { - unsigned int height; - struct radix_tree_node *rnode; -}; - -#define RADIX_TREE_INIT(mask) { \ - .height = 0, \ - .rnode = NULL, \ -} - -#define RADIX_TREE(name, mask) \ - struct radix_tree_root name = RADIX_TREE_INIT(mask) - -#define INIT_RADIX_TREE(root, mask) \ -do { \ - (root)->height = 0; \ - (root)->rnode = NULL; \ -} while (0) - -#ifdef RADIX_TREE_TAGS -#define RADIX_TREE_MAX_TAGS 2 -#endif - -int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); -void *radix_tree_lookup(struct radix_tree_root *, unsigned long); -void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); -void *radix_tree_lookup_first(struct radix_tree_root *, unsigned long *); -void *radix_tree_delete(struct radix_tree_root *, unsigned long); -unsigned int -radix_tree_gang_lookup(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned int max_items); -unsigned int -radix_tree_gang_lookup_ex(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned long last_index, - unsigned int max_items); - -void radix_tree_init(void); - -#ifdef RADIX_TREE_TAGS -void *radix_tree_tag_set(struct radix_tree_root *root, - unsigned long index, unsigned int tag); -void *radix_tree_tag_clear(struct radix_tree_root *root, - unsigned long index, unsigned int tag); -int radix_tree_tag_get(struct radix_tree_root *root, - unsigned long index, unsigned int tag); -unsigned int -radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, - unsigned long first_index, unsigned int max_items, - unsigned int tag); -int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); -#endif - -#endif /* __XFS_SUPPORT_RADIX_TREE_H__ */ From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:43 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, J_CHICKENPOX_65,J_CHICKENPOX_66 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HwIFf034412 for ; Wed, 2 Sep 2009 12:58:33 -0500 X-ASG-Debug-ID: 1251914322-70a203a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9640441E04A for ; Wed, 2 Sep 2009 10:58:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 3XWEVUcA6owepWaI for ; Wed, 02 Sep 2009 10:58:42 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6U-0006a2-5D; Wed, 02 Sep 2009 17:58:42 +0000 Message-Id: <20090902175842.081792481@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:44 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 13/14] repair: optimize duplicate extent tracking Subject: [PATCH 13/14] repair: optimize duplicate extent tracking References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-dup_extents-btree X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914322 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Switch the duplicate extent tracking from an avl tree to our new btree implementation. Modify search_dup_extent to find overlapping extents with differening start blocks instead of having the caller walk every possible start block. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/dinode.c =================================================================== --- xfsprogs-dev.orig/repair/dinode.c 2009-08-21 15:11:16.000000000 +0000 +++ xfsprogs-dev/repair/dinode.c 2009-08-21 15:11:29.000000000 +0000 @@ -735,18 +735,14 @@ process_bmbt_reclist_int( * checking each entry without setting the * block bitmap */ - for (b = irec.br_startblock; - agbno < ebno; - b++, agbno++) { - if (search_dup_extent(mp, agno, agbno)) { - do_warn(_("%s fork in ino %llu claims " - "dup extent, off - %llu, " - "start - %llu, cnt %llu\n"), - forkname, ino, irec.br_startoff, - irec.br_startblock, - irec.br_blockcount); - goto done; - } + if (search_dup_extent(agno, agbno, ebno)) { + do_warn(_("%s fork in ino %llu claims " + "dup extent, off - %llu, " + "start - %llu, cnt %llu\n"), + forkname, ino, irec.br_startoff, + irec.br_startblock, + irec.br_blockcount); + goto done; } *tot += irec.br_blockcount; continue; Index: xfsprogs-dev/repair/incore.h =================================================================== --- xfsprogs-dev.orig/repair/incore.h 2009-08-21 15:11:16.000000000 +0000 +++ xfsprogs-dev/repair/incore.h 2009-08-21 15:11:29.000000000 +0000 @@ -20,6 +20,8 @@ #define XFS_REPAIR_INCORE_H #include "avl.h" + + /* * contains definition information. implementation (code) * is spread out in separate files. @@ -179,23 +181,11 @@ get_bcnt_extent(xfs_agnumber_t agno, xfs /* * duplicate extent tree functions */ -void add_dup_extent(xfs_agnumber_t agno, - xfs_agblock_t startblock, - xfs_extlen_t blockcount); - -extern avltree_desc_t **extent_tree_ptrs; -/* ARGSUSED */ -static inline int -search_dup_extent(xfs_mount_t *mp, xfs_agnumber_t agno, xfs_agblock_t agbno) -{ - ASSERT(agno < glob_agcount); - - if (avl_findrange(extent_tree_ptrs[agno], agbno) != NULL) - return(1); - - return(0); -} +int add_dup_extent(xfs_agnumber_t agno, xfs_agblock_t startblock, + xfs_extlen_t blockcount); +int search_dup_extent(xfs_agnumber_t agno, + xfs_agblock_t start_agbno, xfs_agblock_t end_agbno); void add_rt_dup_extent(xfs_drtbno_t startblock, xfs_extlen_t blockcount); Index: xfsprogs-dev/repair/incore_ext.c =================================================================== --- xfsprogs-dev.orig/repair/incore_ext.c 2009-08-21 15:11:16.000000000 +0000 +++ xfsprogs-dev/repair/incore_ext.c 2009-08-21 15:24:07.000000000 +0000 @@ -18,6 +18,7 @@ #include #include "avl.h" +#include "btree.h" #include "globals.h" #include "incore.h" #include "agheader.h" @@ -72,8 +73,8 @@ static rt_ext_flist_t rt_ext_flist; static avl64tree_desc_t *rt_ext_tree_ptr; /* dup extent tree for rt */ -avltree_desc_t **extent_tree_ptrs; /* array of extent tree ptrs */ - /* one per ag for dups */ +static struct btree_root **dup_extent_trees; /* per ag dup extent trees */ + static avltree_desc_t **extent_bno_ptrs; /* * array of extent tree ptrs * one per ag for free extents @@ -100,6 +101,48 @@ static pthread_mutex_t rt_ext_tree_lock; static pthread_mutex_t rt_ext_flist_lock; /* + * duplicate extent tree functions + */ + +void +release_dup_extent_tree( + xfs_agnumber_t agno) +{ + btree_clear(dup_extent_trees[agno]); +} + +int +add_dup_extent( + xfs_agnumber_t agno, + xfs_agblock_t startblock, + xfs_extlen_t blockcount) +{ +#ifdef XR_DUP_TRACE + fprintf(stderr, "Adding dup extent - %d/%d %d\n", agno, startblock, + blockcount); +#endif + return btree_insert(dup_extent_trees[agno], startblock, + (void *)(uintptr_t)(startblock + blockcount)); +} + +int +search_dup_extent( + xfs_agnumber_t agno, + xfs_agblock_t start_agbno, + xfs_agblock_t end_agbno) +{ + unsigned long bno; + + if (!btree_find(dup_extent_trees[agno], start_agbno, &bno)) + return 0; /* this really shouldn't happen */ + if (bno < end_agbno) + return 1; + return (uintptr_t)btree_peek_prev(dup_extent_trees[agno], NULL) > + start_agbno; +} + + +/* * extent tree stuff is avl trees of duplicate extents, * sorted in order by block number. there is one tree per ag. */ @@ -211,14 +254,6 @@ release_extent_tree(avltree_desc_t *tree * top-level (visible) routines */ void -release_dup_extent_tree(xfs_agnumber_t agno) -{ - release_extent_tree(extent_tree_ptrs[agno]); - - return; -} - -void release_agbno_extent_tree(xfs_agnumber_t agno) { release_extent_tree(extent_bno_ptrs[agno]); @@ -522,93 +557,6 @@ get_bcnt_extent(xfs_agnumber_t agno, xfs return(ext); } -/* - * the next 2 routines manage the trees of duplicate extents -- 1 tree - * per AG - */ -void -add_dup_extent(xfs_agnumber_t agno, xfs_agblock_t startblock, - xfs_extlen_t blockcount) -{ - extent_tree_node_t *first, *last, *ext, *next_ext; - xfs_agblock_t new_startblock; - xfs_extlen_t new_blockcount; - - ASSERT(agno < glob_agcount); - -#ifdef XR_DUP_TRACE - fprintf(stderr, "Adding dup extent - %d/%d %d\n", agno, startblock, blockcount); -#endif - avl_findranges(extent_tree_ptrs[agno], startblock - 1, - startblock + blockcount + 1, - (avlnode_t **) &first, (avlnode_t **) &last); - /* - * find adjacent and overlapping extent blocks - */ - if (first == NULL && last == NULL) { - /* nothing, just make and insert new extent */ - - ext = mk_extent_tree_nodes(startblock, blockcount, XR_E_MULT); - - if (avl_insert(extent_tree_ptrs[agno], - (avlnode_t *) ext) == NULL) { - do_error(_("duplicate extent range\n")); - } - - return; - } - - ASSERT(first != NULL && last != NULL); - - /* - * find the new composite range, delete old extent nodes - * as we go - */ - new_startblock = startblock; - new_blockcount = blockcount; - - for (ext = first; - ext != (extent_tree_node_t *) last->avl_node.avl_nextino; - ext = next_ext) { - /* - * preserve the next inorder node - */ - next_ext = (extent_tree_node_t *) ext->avl_node.avl_nextino; - /* - * just bail if the new extent is contained within an old one - */ - if (ext->ex_startblock <= startblock && - ext->ex_blockcount >= blockcount) - return; - /* - * now check for overlaps and adjacent extents - */ - if (ext->ex_startblock + ext->ex_blockcount >= startblock - || ext->ex_startblock <= startblock + blockcount) { - - if (ext->ex_startblock < new_startblock) - new_startblock = ext->ex_startblock; - - if (ext->ex_startblock + ext->ex_blockcount > - new_startblock + new_blockcount) - new_blockcount = ext->ex_startblock + - ext->ex_blockcount - - new_startblock; - - avl_delete(extent_tree_ptrs[agno], (avlnode_t *) ext); - continue; - } - } - - ext = mk_extent_tree_nodes(new_startblock, new_blockcount, XR_E_MULT); - - if (avl_insert(extent_tree_ptrs[agno], (avlnode_t *) ext) == NULL) { - do_error(_("duplicate extent range\n")); - } - - return; -} - static __psunsigned_t avl_ext_start(avlnode_t *node) { @@ -901,10 +849,9 @@ incore_ext_init(xfs_mount_t *mp) pthread_mutex_init(&rt_ext_tree_lock, NULL); pthread_mutex_init(&rt_ext_flist_lock, NULL); - if ((extent_tree_ptrs = malloc(agcount * - sizeof(avltree_desc_t *))) == NULL) - do_error( - _("couldn't malloc dup extent tree descriptor table\n")); + dup_extent_trees = calloc(agcount, sizeof(struct btree_root *)); + if (!dup_extent_trees) + do_error(_("couldn't malloc dup extent tree descriptor table\n")); if ((extent_bno_ptrs = malloc(agcount * sizeof(avltree_desc_t *))) == NULL) @@ -917,10 +864,6 @@ incore_ext_init(xfs_mount_t *mp) _("couldn't malloc free by-bcnt extent tree descriptor table\n")); for (i = 0; i < agcount; i++) { - if ((extent_tree_ptrs[i] = - malloc(sizeof(avltree_desc_t))) == NULL) - do_error( - _("couldn't malloc dup extent tree descriptor\n")); if ((extent_bno_ptrs[i] = malloc(sizeof(avltree_desc_t))) == NULL) do_error( @@ -932,7 +875,7 @@ incore_ext_init(xfs_mount_t *mp) } for (i = 0; i < agcount; i++) { - avl_init_tree(extent_tree_ptrs[i], &avl_extent_tree_ops); + btree_init(&dup_extent_trees[i]); avl_init_tree(extent_bno_ptrs[i], &avl_extent_tree_ops); avl_init_tree(extent_bcnt_ptrs[i], &avl_extent_bcnt_tree_ops); } @@ -959,18 +902,18 @@ incore_ext_teardown(xfs_mount_t *mp) free_allocations(ba_list); for (i = 0; i < mp->m_sb.sb_agcount; i++) { - free(extent_tree_ptrs[i]); + btree_destroy(dup_extent_trees[i]); free(extent_bno_ptrs[i]); free(extent_bcnt_ptrs[i]); } + free(dup_extent_trees); free(extent_bcnt_ptrs); free(extent_bno_ptrs); - free(extent_tree_ptrs); - extent_bcnt_ptrs = extent_bno_ptrs = extent_tree_ptrs = NULL; - - return; + dup_extent_trees = NULL; + extent_bcnt_ptrs = NULL; + extent_bno_ptrs = NULL; } int Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 15:11:16.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 15:23:51.000000000 +0000 @@ -286,8 +286,9 @@ _("bad back (left) sibling pointer (saw * filesystem */ if (type != XR_INO_RTDATA || whichfork != XFS_DATA_FORK) { - if (search_dup_extent(mp, XFS_FSB_TO_AGNO(mp, bno), - XFS_FSB_TO_AGBNO(mp, bno))) + if (search_dup_extent(XFS_FSB_TO_AGNO(mp, bno), + XFS_FSB_TO_AGBNO(mp, bno), + XFS_FSB_TO_AGBNO(mp, bno) + 1)) return(1); } else { if (search_rt_dup_extent(mp, bno)) From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:43 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_36, J_CHICKENPOX_66 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HwIhD034411 for ; Wed, 2 Sep 2009 12:58:33 -0500 X-ASG-Debug-ID: 1251914322-70a403820000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7320341E03E for ; Wed, 2 Sep 2009 10:58:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id HlfjgbUQXbxSolHH for ; Wed, 02 Sep 2009 10:58:42 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006ZM-Vq; Wed, 02 Sep 2009 17:58:42 +0000 Message-Id: <20090902175841.875447973@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:43 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 12/14] repair: switch block usage bitmap to a btree Subject: [PATCH 12/14] repair: switch block usage bitmap to a btree References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-bmap_extents-btree X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914322 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Using a btree representing the extents is much more space efficient than using a bitmap tracking every single block. In addition it also allows for more optimal algorithms checking range overlaps instead of walking every block in various places. Also move the RT tracking bitmap into incore.c instead of leaving it a as macros - this keeps the implementation contained. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/dino_chunks.c =================================================================== --- xfsprogs-dev.orig/repair/dino_chunks.c 2009-09-02 14:51:09.449268859 -0300 +++ xfsprogs-dev/repair/dino_chunks.c 2009-09-02 14:51:18.593298964 -0300 @@ -118,6 +118,7 @@ verify_inode_chunk(xfs_mount_t *mp, int i; int j; int state; + xfs_extlen_t blen; agno = XFS_INO_TO_AGNO(mp, ino); agino = XFS_INO_TO_AGINO(mp, ino); @@ -433,9 +434,10 @@ verify_inode_chunk(xfs_mount_t *mp, * entry or an iunlinked pointer */ pthread_mutex_lock(&ag_locks[agno]); - for (j = 0, cur_agbno = chunk_start_agbno; - cur_agbno < chunk_stop_agbno; cur_agbno++) { - state = get_bmap(agno, cur_agbno); + for (cur_agbno = chunk_start_agbno; + cur_agbno < chunk_stop_agbno; + cur_agbno += blen) { + state = get_bmap_ext(agno, cur_agbno, chunk_stop_agbno, &blen); switch (state) { case XR_E_MULT: case XR_E_INUSE: @@ -444,9 +446,9 @@ verify_inode_chunk(xfs_mount_t *mp, do_warn( _("inode block %d/%d multiply claimed, (state %d)\n"), agno, cur_agbno, state); - set_bmap(agno, cur_agbno, XR_E_MULT); - j = 1; - break; + set_bmap_ext(agno, cur_agbno, blen, XR_E_MULT); + pthread_mutex_unlock(&ag_locks[agno]); + return 0; case XR_E_INO: do_error( _("uncertain inode block overlap, agbno = %d, ino = %llu\n"), @@ -455,11 +457,6 @@ verify_inode_chunk(xfs_mount_t *mp, default: break; } - - if (j) { - pthread_mutex_unlock(&ag_locks[agno]); - return(0); - } } pthread_mutex_unlock(&ag_locks[agno]); @@ -487,8 +484,9 @@ verify_inode_chunk(xfs_mount_t *mp, pthread_mutex_lock(&ag_locks[agno]); for (cur_agbno = chunk_start_agbno; - cur_agbno < chunk_stop_agbno; cur_agbno++) { - state = get_bmap(agno, cur_agbno); + cur_agbno < chunk_stop_agbno; + cur_agbno += blen) { + state = get_bmap_ext(agno, cur_agbno, chunk_stop_agbno, &blen); switch (state) { case XR_E_INO: do_error( @@ -498,7 +496,7 @@ verify_inode_chunk(xfs_mount_t *mp, case XR_E_UNKNOWN: case XR_E_FREE1: case XR_E_FREE: - set_bmap(agno, cur_agbno, XR_E_INO); + set_bmap_ext(agno, cur_agbno, blen, XR_E_INO); break; case XR_E_MULT: case XR_E_INUSE: @@ -512,7 +510,7 @@ verify_inode_chunk(xfs_mount_t *mp, do_warn( _("inode block %d/%d bad state, (state %d)\n"), agno, cur_agbno, state); - set_bmap(agno, cur_agbno, XR_E_INO); + set_bmap_ext(agno, cur_agbno, blen, XR_E_INO); break; } } Index: xfsprogs-dev/repair/dinode.c =================================================================== --- xfsprogs-dev.orig/repair/dinode.c 2009-09-02 14:51:09.457268829 -0300 +++ xfsprogs-dev/repair/dinode.c 2009-09-02 14:51:18.593298964 -0300 @@ -524,6 +524,7 @@ process_rt_rec( /* * set the appropriate number of extents + * this iterates block by block, this can be optimised using extents */ for (b = irec->br_startblock; b < irec->br_startblock + irec->br_blockcount; b += mp->m_sb.sb_rextsize) { @@ -614,9 +615,10 @@ process_bmbt_reclist_int( char *forkname; int i; int state; - xfs_dfsbno_t e; xfs_agnumber_t agno; xfs_agblock_t agbno; + xfs_agblock_t ebno; + xfs_extlen_t blen; xfs_agnumber_t locked_agno = -1; int error = 1; @@ -718,7 +720,7 @@ process_bmbt_reclist_int( */ agno = XFS_FSB_TO_AGNO(mp, irec.br_startblock); agbno = XFS_FSB_TO_AGBNO(mp, irec.br_startblock); - e = irec.br_startblock + irec.br_blockcount; + ebno = agbno + irec.br_blockcount; if (agno != locked_agno) { if (locked_agno != -1) pthread_mutex_unlock(&ag_locks[locked_agno]); @@ -733,7 +735,9 @@ process_bmbt_reclist_int( * checking each entry without setting the * block bitmap */ - for (b = irec.br_startblock; b < e; b++, agbno++) { + for (b = irec.br_startblock; + agbno < ebno; + b++, agbno++) { if (search_dup_extent(mp, agno, agbno)) { do_warn(_("%s fork in ino %llu claims " "dup extent, off - %llu, " @@ -748,22 +752,10 @@ process_bmbt_reclist_int( continue; } - for (b = irec.br_startblock; b < e; b++, agbno++) { - /* - * Process in chunks of 16 (XR_BB_UNIT/XR_BB) - * for common XR_E_UNKNOWN to XR_E_INUSE transition - */ - if (((agbno & XR_BB_MASK) == 0) && ((irec.br_startblock + irec.br_blockcount - b) >= (XR_BB_UNIT/XR_BB))) { - if (ba_bmap[agno][agbno>>XR_BB] == XR_E_UNKNOWN_LL) { - ba_bmap[agno][agbno>>XR_BB] = XR_E_INUSE_LL; - agbno += (XR_BB_UNIT/XR_BB) - 1; - b += (XR_BB_UNIT/XR_BB) - 1; - continue; - } - - } - - state = get_bmap(agno, agbno); + for (b = irec.br_startblock; + agbno < ebno; + b += blen, agbno += blen) { + state = get_bmap_ext(agno, agbno, ebno, &blen); switch (state) { case XR_E_FREE: case XR_E_FREE1: @@ -772,7 +764,7 @@ process_bmbt_reclist_int( forkname, ino, (__uint64_t) b); /* fall through ... */ case XR_E_UNKNOWN: - set_bmap(agno, agbno, XR_E_INUSE); + set_bmap_ext(agno, agbno, blen, XR_E_INUSE); break; case XR_E_BAD_STATE: @@ -788,7 +780,7 @@ process_bmbt_reclist_int( case XR_E_INUSE: case XR_E_MULT: - set_bmap(agno, agbno, XR_E_MULT); + set_bmap_ext(agno, agbno, blen, XR_E_MULT); do_warn(_("%s fork in %s inode %llu claims " "used block %llu\n"), forkname, ftype, ino, (__uint64_t) b); Index: xfsprogs-dev/repair/globals.h =================================================================== --- xfsprogs-dev.orig/repair/globals.h 2009-09-02 14:51:09.461268919 -0300 +++ xfsprogs-dev/repair/globals.h 2009-09-02 14:51:18.597292070 -0300 @@ -156,11 +156,6 @@ EXTERN int chunks_pblock; /* # of 64-in EXTERN int max_symlink_blocks; EXTERN __int64_t fs_max_file_offset; -/* block allocation bitmaps */ - -EXTERN __uint64_t **ba_bmap; /* see incore.h */ -EXTERN __uint64_t *rt_ba_bmap; /* see incore.h */ - /* realtime info */ EXTERN xfs_rtword_t *btmcompute; Index: xfsprogs-dev/repair/phase2.c =================================================================== --- xfsprogs-dev.orig/repair/phase2.c 2009-09-02 14:51:09.465298621 -0300 +++ xfsprogs-dev/repair/phase2.c 2009-09-02 14:51:18.605297206 -0300 @@ -109,7 +109,6 @@ void phase2(xfs_mount_t *mp) { xfs_agnumber_t i; - xfs_agblock_t b; int j; ino_tree_node_t *ino_rec; @@ -169,11 +168,8 @@ phase2(xfs_mount_t *mp) /* * also mark blocks */ - for (b = 0; b < mp->m_ialloc_blks; b++) { - set_bmap(0, - b + XFS_INO_TO_AGBNO(mp, mp->m_sb.sb_rootino), - XR_E_INO); - } + set_bmap_ext(0, XFS_INO_TO_AGBNO(mp, mp->m_sb.sb_rootino), + mp->m_ialloc_blks, XR_E_INO); } else { do_log(_(" - found root inode chunk\n")); Index: xfsprogs-dev/repair/phase4.c =================================================================== --- xfsprogs-dev.orig/repair/phase4.c 2009-09-02 14:51:09.533268366 -0300 +++ xfsprogs-dev/repair/phase4.c 2009-09-02 14:51:18.609296598 -0300 @@ -192,8 +192,7 @@ phase4(xfs_mount_t *mp) xfs_agnumber_t i; xfs_agblock_t j; xfs_agblock_t ag_end; - xfs_agblock_t extent_start; - xfs_extlen_t extent_len; + xfs_extlen_t blen; int ag_hdr_len = 4 * mp->m_sb.sb_sectsize; int ag_hdr_block; int bstate; @@ -226,29 +225,13 @@ phase4(xfs_mount_t *mp) ag_end = (i < mp->m_sb.sb_agcount - 1) ? mp->m_sb.sb_agblocks : mp->m_sb.sb_dblocks - (xfs_drfsbno_t) mp->m_sb.sb_agblocks * i; - extent_start = extent_len = 0; + /* * set up duplicate extent list for this ag */ - for (j = ag_hdr_block; j < ag_end; j++) { - - /* Process in chunks of 16 (XR_BB_UNIT/XR_BB) */ - if ((extent_start == 0) && ((j & XR_BB_MASK) == 0)) { - switch(ba_bmap[i][j>>XR_BB]) { - case XR_E_UNKNOWN_LL: - case XR_E_FREE1_LL: - case XR_E_FREE_LL: - case XR_E_INUSE_LL: - case XR_E_INUSE_FS_LL: - case XR_E_INO_LL: - case XR_E_FS_MAP_LL: - j += (XR_BB_UNIT/XR_BB) - 1; - continue; - } - } - - bstate = get_bmap(i, j); - switch (bstate) { + for (j = ag_hdr_block; j < ag_end; j += blen) { + bstate = get_bmap_ext(i, j, ag_end, &blen); + switch (bstate) { case XR_E_BAD_STATE: default: do_warn( @@ -262,37 +245,13 @@ phase4(xfs_mount_t *mp) case XR_E_INUSE_FS: case XR_E_INO: case XR_E_FS_MAP: - if (extent_start == 0) - continue; - else { - /* - * add extent and reset extent state - */ - add_dup_extent(i, extent_start, - extent_len); - extent_start = 0; - extent_len = 0; - } break; case XR_E_MULT: - if (extent_start == 0) { - extent_start = j; - extent_len = 1; - } else if (extent_len == MAXEXTLEN) { - add_dup_extent(i, extent_start, - extent_len); - extent_start = j; - extent_len = 1; - } else - extent_len++; + add_dup_extent(i, j, blen); break; } } - /* - * catch tail-case, extent hitting the end of the ag - */ - if (extent_start != 0) - add_dup_extent(i, extent_start, extent_len); + PROG_RPT_INC(prog_rpt_done[i], 1); } print_final_rpt(); Index: xfsprogs-dev/repair/phase5.c =================================================================== --- xfsprogs-dev.orig/repair/phase5.c 2009-09-02 14:51:09.561269620 -0300 +++ xfsprogs-dev/repair/phase5.c 2009-09-02 14:51:18.613269588 -0300 @@ -88,10 +88,8 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_ag xfs_agblock_t agbno; xfs_agblock_t ag_end; uint free_blocks; -#ifdef XR_BLD_FREE_TRACE - int old_state; - int state = XR_E_BAD_STATE; -#endif + xfs_extlen_t blen; + int bstate; /* * scan the bitmap for the ag looking for continuous @@ -120,30 +118,10 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_ag * ok, now find the number of extents, keep track of the * largest extent. */ - for (agbno = 0; agbno < ag_end; agbno++) { -#if 0 - old_state = state; - state = get_bmap(agno, agbno); - if (state != old_state) { - fprintf(stderr, "agbno %u - new state is %d\n", - agbno, state); - } -#endif - /* Process in chunks of 16 (XR_BB_UNIT/XR_BB) */ - if ((in_extent == 0) && ((agbno & XR_BB_MASK) == 0)) { - /* testing >= XR_E_INUSE */ - switch (ba_bmap[agno][agbno>>XR_BB]) { - case XR_E_INUSE_LL: - case XR_E_INUSE_FS_LL: - case XR_E_INO_LL: - case XR_E_FS_MAP_LL: - agbno += (XR_BB_UNIT/XR_BB) - 1; - continue; - } - - } - if (get_bmap(agno, agbno) < XR_E_INUSE) { - free_blocks++; + for (agbno = 0; agbno < ag_end; agbno += blen) { + bstate = get_bmap_ext(agno, agbno, ag_end, &blen); + if (bstate < XR_E_INUSE) { + free_blocks += blen; if (in_extent == 0) { /* * found the start of a free extent @@ -151,9 +129,9 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_ag in_extent = 1; num_extents++; extent_start = agbno; - extent_len = 1; + extent_len = blen; } else { - extent_len++; + extent_len += blen; } } else { if (in_extent) { Index: xfsprogs-dev/repair/incore.c =================================================================== --- xfsprogs-dev.orig/repair/incore.c 2009-09-02 14:51:09.565269570 -0300 +++ xfsprogs-dev/repair/incore.c 2009-09-02 14:51:29.072772399 -0300 @@ -18,6 +18,7 @@ #include #include "avl.h" +#include "btree.h" #include "globals.h" #include "incore.h" #include "agheader.h" @@ -52,14 +53,192 @@ free_allocations(ba_rec_t *list) return; } +/* + * The following manages the in-core bitmap of the entire filesystem + * using extents in a btree. + * + * The btree items will point to one of the state values below, + * rather than storing the value itself in the pointer. + */ +static int states[16] = + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + +static struct btree_root **ag_bmap; + +static void +update_bmap( + struct btree_root *bmap, + unsigned long offset, + xfs_extlen_t blen, + void *new_state) +{ + unsigned long end = offset + blen; + int *cur_state; + unsigned long cur_key; + int *next_state; + unsigned long next_key; + int *prev_state; + + cur_state = btree_find(bmap, offset, &cur_key); + if (!cur_state) + return; + + if (offset == cur_key) { + /* if the start is the same as the "item" extent */ + if (cur_state == new_state) + return; + + /* + * Note: this may be NULL if we are updating the map for + * the superblock. + */ + prev_state = btree_peek_prev(bmap, NULL); + + next_state = btree_peek_next(bmap, &next_key); + if (next_key > end) { + /* different end */ + if (new_state == prev_state) { + /* #1: prev has same state, move offset up */ + btree_update_key(bmap, offset, end); + return; + } + + /* #4: insert new extent after, update current value */ + btree_update_value(bmap, offset, new_state); + btree_insert(bmap, end, cur_state); + return; + } + + /* same end (and same start) */ + if (new_state == next_state) { + /* next has same state */ + if (new_state == prev_state) { + /* #3: merge prev & next */ + btree_delete(bmap, offset); + btree_delete(bmap, end); + return; + } + + /* #8: merge next */ + btree_update_value(bmap, offset, new_state); + btree_delete(bmap, end); + return; + } + + /* same start, same end, next has different state */ + if (new_state == prev_state) { + /* #5: prev has same state */ + btree_delete(bmap, offset); + return; + } + + /* #6: update value only */ + btree_update_value(bmap, offset, new_state); + return; + } + + /* different start, offset is in the middle of "cur" */ + prev_state = btree_peek_prev(bmap, NULL); + ASSERT(prev_state != NULL); + if (prev_state == new_state) + return; + + if (end == cur_key) { + /* end is at the same point as the current extent */ + if (new_state == cur_state) { + /* #7: move next extent down */ + btree_update_key(bmap, end, offset); + return; + } + + /* #9: different start, same end, add new extent */ + btree_insert(bmap, offset, new_state); + return; + } + + /* #2: insert an extent into the middle of another extent */ + btree_insert(bmap, offset, new_state); + btree_insert(bmap, end, prev_state); +} + +void +set_bmap_ext( + xfs_agnumber_t agno, + xfs_agblock_t agbno, + xfs_extlen_t blen, + int state) +{ + update_bmap(ag_bmap[agno], agbno, blen, &states[state]); +} + +int +get_bmap_ext( + xfs_agnumber_t agno, + xfs_agblock_t agbno, + xfs_agblock_t maxbno, + xfs_extlen_t *blen) +{ + int *statep; + unsigned long key; + + statep = btree_find(ag_bmap[agno], agbno, &key); + if (!statep) + return -1; + + if (key == agbno) { + if (blen) { + if (!btree_peek_next(ag_bmap[agno], &key)) + return -1; + *blen = MIN(maxbno, key) - agbno; + } + return *statep; + } + + statep = btree_peek_prev(ag_bmap[agno], NULL); + if (!statep) + return -1; + if (blen) + *blen = MIN(maxbno, key) - agbno; + + return *statep; +} +static uint64_t *rt_bmap; static size_t rt_bmap_size; +/* block records fit into __uint64_t's units */ +#define XR_BB_UNIT 64 /* number of bits/unit */ +#define XR_BB 4 /* bits per block record */ +#define XR_BB_NUM (XR_BB_UNIT/XR_BB) /* number of records per unit */ +#define XR_BB_MASK 0xF /* block record mask */ + +/* + * these work in real-time extents (e.g. fsbno == rt extent number) + */ +int +get_rtbmap( + xfs_drtbno_t bno) +{ + return (*(rt_bmap + bno / XR_BB_NUM) >> + ((bno % XR_BB_NUM) * XR_BB)) & XR_BB_MASK; +} + +void +set_rtbmap( + xfs_drtbno_t bno, + int state) +{ + *(rt_bmap + bno / XR_BB_NUM) = + ((*(rt_bmap + bno / XR_BB_NUM) & + (~((__uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) | + (((__uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB))); +} + static void reset_rt_bmap(void) { - if (rt_ba_bmap) - memset(rt_ba_bmap, 0x22, rt_bmap_size); /* XR_E_FREE */ + if (rt_bmap) + memset(rt_bmap, 0x22, rt_bmap_size); /* XR_E_FREE */ } static void @@ -72,8 +251,8 @@ init_rt_bmap( rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB), sizeof(__uint64_t)); - rt_ba_bmap = memalign(sizeof(__uint64_t), rt_bmap_size); - if (!rt_ba_bmap) { + rt_bmap = memalign(sizeof(__uint64_t), rt_bmap_size); + if (!rt_bmap) { do_error( _("couldn't allocate realtime block map, size = %llu\n"), mp->m_sb.sb_rextents); @@ -84,8 +263,8 @@ init_rt_bmap( static void free_rt_bmap(xfs_mount_t *mp) { - free(rt_ba_bmap); - rt_ba_bmap = NULL; + free(rt_bmap); + rt_bmap = NULL; } @@ -93,28 +272,41 @@ void reset_bmaps(xfs_mount_t *mp) { xfs_agnumber_t agno; + xfs_agblock_t ag_size; int ag_hdr_block; - int i; ag_hdr_block = howmany(4 * mp->m_sb.sb_sectsize, mp->m_sb.sb_blocksize); + ag_size = mp->m_sb.sb_agblocks; - for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { - memset(ba_bmap[agno], 0, - roundup((mp->m_sb.sb_agblocks + (NBBY / XR_BB) - 1) / - (NBBY / XR_BB), sizeof(__uint64_t))); - for (i = 0; i < ag_hdr_block; i++) - set_bmap(agno, i, XR_E_INUSE_FS); + for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { + if (agno == mp->m_sb.sb_agcount - 1) + ag_size = (xfs_extlen_t)(mp->m_sb.sb_dblocks - + (xfs_drfsbno_t)mp->m_sb.sb_agblocks * agno); +#ifdef BTREE_STATS + if (btree_find(ag_bmap[agno], 0, NULL)) { + printf("ag_bmap[%d] btree stats:\n", i); + btree_print_stats(ag_bmap[agno], stdout); + } +#endif + /* + * We always insert an item for the first block having a + * given state. So the code below means: + * + * block 0..ag_hdr_block-1: XR_E_INUSE_FS + * ag_hdr_block..ag_size: XR_E_UNKNOWN + * ag_size... XR_E_BAD_STATE + */ + btree_clear(ag_bmap[agno]); + btree_insert(ag_bmap[agno], 0, &states[XR_E_INUSE_FS]); + btree_insert(ag_bmap[agno], + ag_hdr_block, &states[XR_E_UNKNOWN]); + btree_insert(ag_bmap[agno], ag_size, &states[XR_E_BAD_STATE]); } if (mp->m_sb.sb_logstart != 0) { - xfs_dfsbno_t logend; - - logend = mp->m_sb.sb_logstart + mp->m_sb.sb_logblocks; - - for (i = mp->m_sb.sb_logstart; i < logend ; i++) { - set_bmap(XFS_FSB_TO_AGNO(mp, i), - XFS_FSB_TO_AGBNO(mp, i), XR_E_INUSE_FS); - } + set_bmap_ext(XFS_FSB_TO_AGNO(mp, mp->m_sb.sb_logstart), + XFS_FSB_TO_AGBNO(mp, mp->m_sb.sb_logstart), + mp->m_sb.sb_logblocks, XR_E_INUSE_FS); } reset_rt_bmap(); @@ -123,30 +315,18 @@ reset_bmaps(xfs_mount_t *mp) void init_bmaps(xfs_mount_t *mp) { - xfs_agblock_t numblocks = mp->m_sb.sb_agblocks; - int agcount = mp->m_sb.sb_agcount; - int i; - size_t size = 0; - - ba_bmap = calloc(agcount, sizeof(__uint64_t *)); - if (!ba_bmap) - do_error(_("couldn't allocate block map pointers\n")); + xfs_agnumber_t i; - ag_locks = calloc(agcount, sizeof(pthread_mutex_t)); + ag_bmap = calloc(mp->m_sb.sb_agcount, sizeof(struct btree_root *)); + if (!ag_bmap) + do_error(_("couldn't allocate block map btree roots\n")); + + ag_locks = calloc(mp->m_sb.sb_agcount, sizeof(pthread_mutex_t)); if (!ag_locks) do_error(_("couldn't allocate block map locks\n")); - for (i = 0; i < agcount; i++) { - size = roundup((numblocks+(NBBY/XR_BB)-1) / (NBBY/XR_BB), - sizeof(__uint64_t)); - - ba_bmap[i] = memalign(sizeof(__uint64_t), size); - if (!ba_bmap[i]) { - do_error(_("couldn't allocate block map, size = %d\n"), - numblocks); - return; - } - memset(ba_bmap[i], 0, size); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + btree_init(&ag_bmap[i]); pthread_mutex_init(&ag_locks[i], NULL); } @@ -160,9 +340,9 @@ free_bmaps(xfs_mount_t *mp) xfs_agnumber_t i; for (i = 0; i < mp->m_sb.sb_agcount; i++) - free(ba_bmap[i]); - free(ba_bmap); - ba_bmap = NULL; + btree_destroy(ag_bmap[i]); + free(ag_bmap); + ag_bmap = NULL; free_rt_bmap(mp); } Index: xfsprogs-dev/repair/incore.h =================================================================== --- xfsprogs-dev.orig/repair/incore.h 2009-09-02 14:51:09.573269190 -0300 +++ xfsprogs-dev/repair/incore.h 2009-09-02 14:51:18.621298890 -0300 @@ -37,59 +37,32 @@ void record_allocation(ba_rec_t *addr, void free_allocations(ba_rec_t *list); /* - * block bit map defs -- track state of each filesystem block. - * ba_bmap is an array of bitstrings declared in the globals.h file. - * the bitstrings are broken up into 64-bit chunks. one bitstring per AG. - */ -#define BA_BMAP_SIZE(x) (howmany(x, 4)) - -void init_bmaps(xfs_mount_t *mp); -void reset_bmaps(xfs_mount_t *mp); -void free_bmaps(xfs_mount_t *mp); - - -/* blocks are numbered from zero */ - -/* block records fit into __uint64_t's units */ - -#define XR_BB_UNIT 64 /* number of bits/unit */ -#define XR_BB 4 /* bits per block record */ -#define XR_BB_NUM (XR_BB_UNIT/XR_BB) /* number of records per unit */ -#define XR_BB_MASK 0xF /* block record mask */ - -/* - * bitstring ops -- set/get block states, either in filesystem - * bno's or in agbno's. turns out that fsbno addressing is - * more convenient when dealing with bmap extracted addresses - * and agbno addressing is more convenient when dealing with - * meta-data extracted addresses. So the fsbno versions use - * mtype (which can be one of the block map types above) to - * set the correct block map while the agbno versions assume - * you want to use the regular block map. - */ - -#define get_bmap(agno, ag_blockno) \ - ((int) (*(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) \ - >> (((ag_blockno)%XR_BB_NUM)*XR_BB)) \ - & XR_BB_MASK) -#define set_bmap(agno, ag_blockno, state) \ - *(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) = \ - ((*(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) & \ - (~((__uint64_t) XR_BB_MASK << (((ag_blockno)%XR_BB_NUM)*XR_BB)))) | \ - (((__uint64_t) (state)) << (((ag_blockno)%XR_BB_NUM)*XR_BB))) - -/* - * these work in real-time extents (e.g. fsbno == rt extent number) - */ -#define get_rtbmap(fsbno) \ - ((*(rt_ba_bmap + (fsbno)/XR_BB_NUM) >> \ - (((fsbno)%XR_BB_NUM)*XR_BB)) & XR_BB_MASK) -#define set_rtbmap(fsbno, state) \ - *(rt_ba_bmap + (fsbno)/XR_BB_NUM) = \ - ((*(rt_ba_bmap + (fsbno)/XR_BB_NUM) & \ - (~((__uint64_t) XR_BB_MASK << (((fsbno)%XR_BB_NUM)*XR_BB)))) | \ - (((__uint64_t) (state)) << (((fsbno)%XR_BB_NUM)*XR_BB))) + * block map -- track state of each filesystem block. + */ + +void init_bmaps(xfs_mount_t *mp); +void reset_bmaps(xfs_mount_t *mp); +void free_bmaps(xfs_mount_t *mp); + +void set_bmap_ext(xfs_agnumber_t agno, xfs_agblock_t agbno, + xfs_extlen_t blen, int state); +int get_bmap_ext(xfs_agnumber_t agno, xfs_agblock_t agbno, + xfs_agblock_t maxbno, xfs_extlen_t *blen); +void set_rtbmap(xfs_drtbno_t bno, int state); +int get_rtbmap(xfs_drtbno_t bno); + +static inline void +set_bmap(xfs_agnumber_t agno, xfs_agblock_t agbno, int state) +{ + set_bmap_ext(agno, agbno, 1, state); +} + +static inline int +get_bmap(xfs_agnumber_t agno, xfs_agblock_t agbno) +{ + return get_bmap_ext(agno, agbno, agbno + 1, NULL); +} /* * extent tree definitions Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-09-02 14:51:09.577269000 -0300 +++ xfsprogs-dev/repair/scan.c 2009-09-02 14:51:18.629269735 -0300 @@ -509,7 +509,7 @@ _("%s freespace btree block claimed (sta rp = XFS_ALLOC_REC_ADDR(mp, block, 1); for (i = 0; i < numrecs; i++) { xfs_agblock_t b, end; - xfs_extlen_t len; + xfs_extlen_t len, blen; b = be32_to_cpu(rp[i].ar_startblock); len = be32_to_cpu(rp[i].ar_blockcount); @@ -522,8 +522,8 @@ _("%s freespace btree block claimed (sta if (!verify_agbno(mp, agno, end - 1)) continue; - for ( ; b < end; b++) { - state = get_bmap(agno, b); + for ( ; b < end; b += blen) { + state = get_bmap_ext(agno, b, end, &blen); switch (state) { case XR_E_UNKNOWN: set_bmap(agno, b, XR_E_FREE1); @@ -534,13 +534,15 @@ _("%s freespace btree block claimed (sta * FREE1 blocks later */ if (magic != XFS_ABTB_MAGIC) { - set_bmap(agno, b, XR_E_FREE); + set_bmap_ext(agno, b, blen, + XR_E_FREE); break; } default: do_warn( - _("block (%d,%d) multiply claimed by %s space tree, state - %d\n"), - agno, b, name, state); + _("block (%d,%d-%d) multiply claimed by %s space tree, state - %d\n"), + agno, b, b + blen - 1, + name, state); break; } } From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:43 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HwIEw034420 for ; Wed, 2 Sep 2009 12:58:33 -0500 X-ASG-Debug-ID: 1251914322-728a03d00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B950A41E03E for ; Wed, 2 Sep 2009 10:58:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 2DwF15ZUUZofuQ8P for ; Wed, 02 Sep 2009 10:58:42 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6U-0006bD-BA; Wed, 02 Sep 2009 17:58:42 +0000 Message-Id: <20090902175842.262611292@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:45 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 14/14] repair: add missing locking in scanfunc_bmap Subject: [PATCH 14/14] repair: add missing locking in scanfunc_bmap References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-scanfunc_bmap-locking X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914322 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Make sure to protect access to the block usage tracking btree with the ag_lock. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-20 03:16:13.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-20 03:18:17.000000000 +0000 @@ -235,6 +235,7 @@ agno = XFS_FSB_TO_AGNO(mp, bno); agbno = XFS_FSB_TO_AGBNO(mp, bno); + pthread_mutex_lock(&ag_locks[agno]); state = get_bmap(agno, agbno); switch (state) { case XR_E_UNKNOWN: @@ -280,6 +281,7 @@ state, ino, (__uint64_t) bno); break; } + pthread_mutex_unlock(&ag_locks[agno]); } else { /* * attribute fork for realtime files is in the regular From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_64,J_CHICKENPOX_73 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HwJlr034430 for ; Wed, 2 Sep 2009 12:58:34 -0500 X-ASG-Debug-ID: 1251914321-4f3802b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 29E6915B1A32 for ; Wed, 2 Sep 2009 10:58:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id wuSfvCMm22hRDUfe for ; Wed, 02 Sep 2009 10:58:42 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006Ym-Po; Wed, 02 Sep 2009 17:58:41 +0000 Message-Id: <20090902175841.711310240@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:42 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usage tracking Subject: [PATCH 11/14] repair: cleanup alloc/free/reset of the block usage tracking References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-cleanup-bmap-helpers-2 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914322 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Currently the code to allocate, free and reset the block usage bitmaps is a complete mess. This patch reorganizes it into logical helpers. Details: - the current incore_init code is called just before phase2 is called, which then marks the log and the AG headers used. - we get rid of incore_init init, and replace it with direct calls to the unchanched incore_ino_init/incore_ext_init functions and our new init_bmaps which does all the allocations for the block usage tracking, aswell as a call to reset_bmaps to initialize it to the default values. - reset_bmaps is also called from early phase4 code to reset all state instead of opencoding it. - there is a new free_bmaps helper which we call to free our block usage bitmaps when we don't need them anymore after phase5. The current code frees some of it a bit early in phase5, but needs to take of it in phase6 in case we didn't call phase5 due to nomodify mode, and leaks it if we don't call phase 6, which might happen in case of a bad inode allocation btree. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/phase4.c =================================================================== --- xfsprogs-dev.orig/repair/phase4.c 2009-08-21 01:59:26.000000000 +0000 +++ xfsprogs-dev/repair/phase4.c 2009-08-21 02:41:44.000000000 +0000 @@ -355,19 +355,7 @@ phase4(xfs_mount_t *mp) /* * initialize bitmaps for all AGs */ - for (i = 0; i < mp->m_sb.sb_agcount; i++) { - /* - * now reset the bitmap for all ags - */ - memset(ba_bmap[i], 0, - roundup((mp->m_sb.sb_agblocks+(NBBY/XR_BB)-1)/(NBBY/XR_BB), - sizeof(__uint64_t))); - for (j = 0; j < ag_hdr_block; j++) - set_bmap(i, j, XR_E_INUSE_FS); - } - set_bmap_rt(mp->m_sb.sb_rextents); - set_bmap_log(mp); - set_bmap_fs(mp); + reset_bmaps(mp); do_log(_(" - check for inodes claiming duplicate blocks...\n")); set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount); Index: xfsprogs-dev/repair/incore.c =================================================================== --- xfsprogs-dev.orig/repair/incore.c 2009-08-21 01:59:26.000000000 +0000 +++ xfsprogs-dev/repair/incore.c 2009-08-21 03:02:28.000000000 +0000 @@ -52,205 +52,117 @@ free_allocations(ba_rec_t *list) return; } -/* ba bmap setupstuff. setting/getting state is in incore.h */ -void -setup_bmap(xfs_agnumber_t agno, xfs_agblock_t numblocks, xfs_drtbno_t rtblocks) -{ - int i; - size_t size = 0; +static size_t rt_bmap_size; - ba_bmap = (__uint64_t**)malloc(agno*sizeof(__uint64_t *)); - if (!ba_bmap) - do_error(_("couldn't allocate block map pointers\n")); - ag_locks = malloc(agno * sizeof(pthread_mutex_t)); - if (!ag_locks) - do_error(_("couldn't allocate block map locks\n")); - - for (i = 0; i < agno; i++) { - size = roundup((numblocks+(NBBY/XR_BB)-1) / (NBBY/XR_BB), - sizeof(__uint64_t)); - - ba_bmap[i] = (__uint64_t*)memalign(sizeof(__uint64_t), size); - if (!ba_bmap[i]) { - do_error(_("couldn't allocate block map, size = %d\n"), - numblocks); - return; - } - memset(ba_bmap[i], 0, size); - pthread_mutex_init(&ag_locks[i], NULL); - } +static void +reset_rt_bmap(void) +{ + if (rt_ba_bmap) + memset(rt_ba_bmap, 0x22, rt_bmap_size); /* XR_E_FREE */ +} - if (rtblocks == 0) { - rt_ba_bmap = NULL; +static void +init_rt_bmap( + xfs_mount_t *mp) +{ + if (mp->m_sb.sb_rextents == 0) return; - } - size = roundup(rtblocks / (NBBY/XR_BB), sizeof(__uint64_t)); + rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB), + sizeof(__uint64_t)); - rt_ba_bmap=(__uint64_t*)memalign(sizeof(__uint64_t), size); + rt_ba_bmap = memalign(sizeof(__uint64_t), rt_bmap_size); if (!rt_ba_bmap) { - do_error( + do_error( _("couldn't allocate realtime block map, size = %llu\n"), - rtblocks); - return; + mp->m_sb.sb_rextents); + return; } - - /* - * start all real-time as free blocks - */ - set_bmap_rt(rtblocks); - - return; } -/* ARGSUSED */ -void -teardown_rt_bmap(xfs_mount_t *mp) +static void +free_rt_bmap(xfs_mount_t *mp) { - if (rt_ba_bmap != NULL) { - free(rt_ba_bmap); - rt_ba_bmap = NULL; - } - - return; + free(rt_ba_bmap); + rt_ba_bmap = NULL; } -/* ARGSUSED */ -void -teardown_ag_bmap(xfs_mount_t *mp, xfs_agnumber_t agno) -{ - ASSERT(ba_bmap[agno] != NULL); - - free(ba_bmap[agno]); - ba_bmap[agno] = NULL; - - return; -} -/* ARGSUSED */ void -teardown_bmap_finish(xfs_mount_t *mp) +reset_bmaps(xfs_mount_t *mp) { - free(ba_bmap); - ba_bmap = NULL; - - return; -} + xfs_agnumber_t agno; + int ag_hdr_block; + int i; -void -teardown_bmap(xfs_mount_t *mp) -{ - xfs_agnumber_t i; + ag_hdr_block = howmany(4 * mp->m_sb.sb_sectsize, mp->m_sb.sb_blocksize); - for (i = 0; i < mp->m_sb.sb_agcount; i++) { - teardown_ag_bmap(mp, i); + for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { + memset(ba_bmap[agno], 0, + roundup((mp->m_sb.sb_agblocks + (NBBY / XR_BB) - 1) / + (NBBY / XR_BB), sizeof(__uint64_t))); + for (i = 0; i < ag_hdr_block; i++) + set_bmap(agno, i, XR_E_INUSE_FS); } - teardown_rt_bmap(mp); - teardown_bmap_finish(mp); + if (mp->m_sb.sb_logstart != 0) { + xfs_dfsbno_t logend; - return; -} + logend = mp->m_sb.sb_logstart + mp->m_sb.sb_logblocks; -/* - * block map initialization routines -- realtime, log, fs - */ -void -set_bmap_rt(xfs_drtbno_t num) -{ - xfs_drtbno_t j; - xfs_drtbno_t size; - - /* - * for now, initialize all realtime blocks to be free - * (state == XR_E_FREE) - */ - size = howmany(num / (NBBY/XR_BB), sizeof(__uint64_t)); - - for (j = 0; j < size; j++) - rt_ba_bmap[j] = 0x2222222222222222LL; - - return; -} - -void -set_bmap_log(xfs_mount_t *mp) -{ - xfs_dfsbno_t logend, i; - - if (mp->m_sb.sb_logstart == 0) - return; - - logend = mp->m_sb.sb_logstart + mp->m_sb.sb_logblocks; - - for (i = mp->m_sb.sb_logstart; i < logend ; i++) { - set_bmap(XFS_FSB_TO_AGNO(mp, i), - XFS_FSB_TO_AGBNO(mp, i), XR_E_INUSE_FS); + for (i = mp->m_sb.sb_logstart; i < logend ; i++) { + set_bmap(XFS_FSB_TO_AGNO(mp, i), + XFS_FSB_TO_AGBNO(mp, i), XR_E_INUSE_FS); + } } - return; + reset_rt_bmap(); } void -set_bmap_fs(xfs_mount_t *mp) +init_bmaps(xfs_mount_t *mp) { - xfs_agnumber_t i; - xfs_agblock_t j; - xfs_agblock_t end; - - /* - * AG header is 4 sectors - */ - end = howmany(4 * mp->m_sb.sb_sectsize, mp->m_sb.sb_blocksize); + xfs_agblock_t numblocks = mp->m_sb.sb_agblocks; + int agcount = mp->m_sb.sb_agcount; + int i; + size_t size = 0; - for (i = 0; i < mp->m_sb.sb_agcount; i++) - for (j = 0; j < end; j++) - set_bmap(i, j, XR_E_INUSE_FS); + ba_bmap = calloc(agcount, sizeof(__uint64_t *)); + if (!ba_bmap) + do_error(_("couldn't allocate block map pointers\n")); - return; -} + ag_locks = calloc(agcount, sizeof(pthread_mutex_t)); + if (!ag_locks) + do_error(_("couldn't allocate block map locks\n")); -#if 0 -void -set_bmap_fs_bt(xfs_mount_t *mp) -{ - xfs_agnumber_t i; - xfs_agblock_t j; - xfs_agblock_t begin; - xfs_agblock_t end; - - begin = bnobt_root; - end = inobt_root + 1; - - for (i = 0; i < mp->m_sb.sb_agcount; i++) { - /* - * account for btree roots - */ - for (j = begin; j < end; j++) - set_bmap(i, j, XR_E_INUSE_FS); + for (i = 0; i < agcount; i++) { + size = roundup((numblocks+(NBBY/XR_BB)-1) / (NBBY/XR_BB), + sizeof(__uint64_t)); + + ba_bmap[i] = memalign(sizeof(__uint64_t), size); + if (!ba_bmap[i]) { + do_error(_("couldn't allocate block map, size = %d\n"), + numblocks); + return; + } + memset(ba_bmap[i], 0, size); + pthread_mutex_init(&ag_locks[i], NULL); } - return; + init_rt_bmap(mp); + reset_bmaps(mp); } -#endif void -incore_init(xfs_mount_t *mp) +free_bmaps(xfs_mount_t *mp) { - int agcount = mp->m_sb.sb_agcount; - extern void incore_ino_init(xfs_mount_t *); - extern void incore_ext_init(xfs_mount_t *); - - /* init block alloc bmap */ - - setup_bmap(agcount, mp->m_sb.sb_agblocks, mp->m_sb.sb_rextents); - incore_ino_init(mp); - incore_ext_init(mp); - - /* initialize random globals now that we know the fs geometry */ + xfs_agnumber_t i; - inodes_per_block = mp->m_sb.sb_inopblock; + for (i = 0; i < mp->m_sb.sb_agcount; i++) + free(ba_bmap[i]); + free(ba_bmap); + ba_bmap = NULL; - return; + free_rt_bmap(mp); } Index: xfsprogs-dev/repair/incore.h =================================================================== --- xfsprogs-dev.orig/repair/incore.h 2009-08-21 01:59:26.000000000 +0000 +++ xfsprogs-dev/repair/incore.h 2009-08-21 03:00:13.000000000 +0000 @@ -43,14 +43,10 @@ void free_allocations(ba_rec_t *list); */ #define BA_BMAP_SIZE(x) (howmany(x, 4)) -void set_bmap_rt(xfs_drfsbno_t numblocks); -void set_bmap_log(xfs_mount_t *mp); -void set_bmap_fs(xfs_mount_t *mp); -void teardown_bmap(xfs_mount_t *mp); - -void teardown_rt_bmap(xfs_mount_t *mp); -void teardown_ag_bmap(xfs_mount_t *mp, xfs_agnumber_t agno); -void teardown_bmap_finish(xfs_mount_t *mp); +void init_bmaps(xfs_mount_t *mp); +void reset_bmaps(xfs_mount_t *mp); +void free_bmaps(xfs_mount_t *mp); + /* blocks are numbered from zero */ @@ -254,6 +250,7 @@ void release_agbcnt_extent_tree(xfs_agn */ void free_rt_dup_extent_tree(xfs_mount_t *mp); +void incore_ext_init(xfs_mount_t *); /* * per-AG extent trees shutdown routine -- all (bno, bcnt and dup) * at once. this one actually frees the memory instead of just recyling @@ -261,6 +258,8 @@ void free_rt_dup_extent_tree(xfs_mount_ */ void incore_ext_teardown(xfs_mount_t *mp); +void incore_ino_init(xfs_mount_t *); + /* * inode definitions */ Index: xfsprogs-dev/repair/phase2.c =================================================================== --- xfsprogs-dev.orig/repair/phase2.c 2009-08-21 02:04:25.000000000 +0000 +++ xfsprogs-dev/repair/phase2.c 2009-08-21 02:41:43.000000000 +0000 @@ -134,12 +134,6 @@ phase2(xfs_mount_t *mp) do_log(_(" - scan filesystem freespace and inode maps...\n")); - /* - * account for space used by ag headers and log if internal - */ - set_bmap_log(mp); - set_bmap_fs(mp); - bad_ino_btree = 0; set_progress_msg(PROG_FMT_SCAN_AG, (__uint64_t) glob_agcount); Index: xfsprogs-dev/repair/xfs_repair.c =================================================================== --- xfsprogs-dev.orig/repair/xfs_repair.c 2009-08-21 02:47:02.000000000 +0000 +++ xfsprogs-dev/repair/xfs_repair.c 2009-08-21 03:03:51.000000000 +0000 @@ -39,7 +39,6 @@ extern void phase4(xfs_mount_t *); extern void phase5(xfs_mount_t *); extern void phase6(xfs_mount_t *); extern void phase7(xfs_mount_t *); -extern void incore_init(xfs_mount_t *); #define XR_MAX_SECT_SIZE (64 * 1024) @@ -694,9 +693,14 @@ main(int argc, char **argv) calc_mkfs(mp); /* - * check sb filesystem stats and initialize in-core data structures + * initialize block alloc map */ - incore_init(mp); + init_bmaps(mp); + incore_ino_init(mp); + incore_ext_init(mp); + + /* initialize random globals now that we know the fs geometry */ + inodes_per_block = mp->m_sb.sb_inopblock; if (parse_sb_version(&mp->m_sb)) { do_warn( @@ -724,6 +728,11 @@ main(int argc, char **argv) } timestamp(PHASE_END, 5, NULL); + /* + * Done with the block usage maps, toss them... + */ + free_bmaps(mp); + if (!bad_ino_btree) { phase6(mp); timestamp(PHASE_END, 6, NULL); Index: xfsprogs-dev/repair/phase6.c =================================================================== --- xfsprogs-dev.orig/repair/phase6.c 2009-08-21 02:44:58.000000000 +0000 +++ xfsprogs-dev/repair/phase6.c 2009-08-21 02:54:54.000000000 +0000 @@ -3661,11 +3661,6 @@ phase6(xfs_mount_t *mp) do_log(_("Phase 6 - check inode connectivity...\n")); - if (!no_modify) - teardown_bmap_finish(mp); - else - teardown_bmap(mp); - incore_ext_teardown(mp); add_ino_ex_data(mp); Index: xfsprogs-dev/repair/phase5.c =================================================================== --- xfsprogs-dev.orig/repair/phase5.c 2009-08-21 02:42:26.000000000 +0000 +++ xfsprogs-dev/repair/phase5.c 2009-08-21 03:00:07.000000000 +0000 @@ -1465,11 +1465,6 @@ phase5_func( } /* - * done with the AG bitmap, toss it... - */ - teardown_ag_bmap(mp, agno); - - /* * ok, now set up the btree cursors for the * on-disk btrees (includs pre-allocating all * required blocks for the trees themselves) @@ -1655,7 +1650,6 @@ phase5(xfs_mount_t *mp) _(" - generate realtime summary info and bitmap...\n")); rtinit(mp); generate_rtinfo(mp, btmcompute, sumcompute); - teardown_rt_bmap(mp); } do_log(_(" - reset superblock...\n")); From BATV+2d85c3858335d18f94a6+2201+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 2 12:58:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,LOCAL_GNU_PATCH autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82HwJRd034429 for ; Wed, 2 Sep 2009 12:58:34 -0500 X-ASG-Debug-ID: 1251914321-4f3302be0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 068A615B1A2F for ; Wed, 2 Sep 2009 10:58:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id L2AEtt0bguNXEgzI for ; Wed, 02 Sep 2009 10:58:41 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Miu6T-0006Y6-Ja; Wed, 02 Sep 2009 17:58:41 +0000 Message-Id: <20090902175841.479553130@bombadil.infradead.org> User-Agent: quilt/0.47-1 Date: Wed, 02 Sep 2009 13:55:41 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Barry Naujok X-ASG-Orig-Subj: [PATCH 10/14] repair: cleanup helpers for tracking block usage Subject: [PATCH 10/14] repair: cleanup helpers for tracking block usage References: <20090902175531.469184575@bombadil.infradead.org> Content-Disposition: inline; filename=repair-cleanup-bmap-helpers X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251914322 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Rename get_agbno_state/set_agbno_state to get_bmap/set_bmap because those names are more self-descriptive. Remove the superblous mount argument to the as the current filesystem is a global in repair. Remove the fsbno taking variant as they just complicated the code. Bring all uses of them into the canonical form. Signed-off-by: Barry Naujok Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/repair/dinode.c =================================================================== --- xfsprogs-dev.orig/repair/dinode.c 2009-08-21 19:05:41.000000000 +0000 +++ xfsprogs-dev/repair/dinode.c 2009-08-21 19:05:51.000000000 +0000 @@ -545,40 +545,33 @@ process_rt_rec( continue; } - state = get_rtbno_state(mp, ext); - + state = get_rtbmap(ext); switch (state) { - case XR_E_FREE: - case XR_E_UNKNOWN: - set_rtbno_state(mp, ext, XR_E_INUSE); + case XR_E_FREE: + case XR_E_UNKNOWN: + set_rtbmap(ext, XR_E_INUSE); + break; + case XR_E_BAD_STATE: + do_error(_("bad state in rt block map %llu\n"), ext); + case XR_E_FS_MAP: + case XR_E_INO: + case XR_E_INUSE_FS: + do_error(_("data fork in rt inode %llu found " + "metadata block %llu in rt bmap\n"), + ino, ext); + case XR_E_INUSE: + if (pwe) break; - - case XR_E_BAD_STATE: - do_error(_("bad state in rt block map %llu\n"), - ext); - - case XR_E_FS_MAP: - case XR_E_INO: - case XR_E_INUSE_FS: - do_error(_("data fork in rt inode %llu found " - "metadata block %llu in rt bmap\n"), + case XR_E_MULT: + set_rtbmap(ext, XR_E_MULT); + do_warn(_("data fork in rt inode %llu claims " + "used rt block %llu\n"), ino, ext); - - case XR_E_INUSE: - if (pwe) - break; - - case XR_E_MULT: - set_rtbno_state(mp, ext, XR_E_MULT); - do_warn(_("data fork in rt inode %llu claims " - "used rt block %llu\n"), - ino, ext); - return 1; - - case XR_E_FREE1: - default: - do_error(_("illegal state %d in rt block map " - "%llu\n"), state, b); + return 1; + case XR_E_FREE1: + default: + do_error(_("illegal state %d in rt block map " + "%llu\n"), state, b); } } @@ -770,8 +763,7 @@ process_bmbt_reclist_int( } - state = get_agbno_state(mp, agno, agbno); - + state = get_bmap(agno, agbno); switch (state) { case XR_E_FREE: case XR_E_FREE1: @@ -780,7 +772,7 @@ process_bmbt_reclist_int( forkname, ino, (__uint64_t) b); /* fall through ... */ case XR_E_UNKNOWN: - set_agbno_state(mp, agno, agbno, XR_E_INUSE); + set_bmap(agno, agbno, XR_E_INUSE); break; case XR_E_BAD_STATE: @@ -796,7 +788,7 @@ process_bmbt_reclist_int( case XR_E_INUSE: case XR_E_MULT: - set_agbno_state(mp, agno, agbno, XR_E_MULT); + set_bmap(agno, agbno, XR_E_MULT); do_warn(_("%s fork in %s inode %llu claims " "used block %llu\n"), forkname, ftype, ino, (__uint64_t) b); Index: xfsprogs-dev/repair/dino_chunks.c =================================================================== --- xfsprogs-dev.orig/repair/dino_chunks.c 2009-08-21 19:05:40.000000000 +0000 +++ xfsprogs-dev/repair/dino_chunks.c 2009-08-21 19:05:51.000000000 +0000 @@ -151,7 +151,8 @@ verify_inode_chunk(xfs_mount_t *mp, pthread_mutex_lock(&ag_locks[agno]); - switch (state = get_agbno_state(mp, agno, agbno)) { + state = get_bmap(agno, agbno); + switch (state) { case XR_E_INO: do_warn( _("uncertain inode block %d/%d already known\n"), @@ -160,7 +161,7 @@ verify_inode_chunk(xfs_mount_t *mp, case XR_E_UNKNOWN: case XR_E_FREE1: case XR_E_FREE: - set_agbno_state(mp, agno, agbno, XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); break; case XR_E_MULT: case XR_E_INUSE: @@ -172,14 +173,14 @@ verify_inode_chunk(xfs_mount_t *mp, do_warn( _("inode block %d/%d multiply claimed, (state %d)\n"), agno, agbno, state); - set_agbno_state(mp, agno, agbno, XR_E_MULT); + set_bmap(agno, agbno, XR_E_MULT); pthread_mutex_unlock(&ag_locks[agno]); return(0); default: do_warn( _("inode block %d/%d bad state, (state %d)\n"), agno, agbno, state); - set_agbno_state(mp, agno, agbno, XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); break; } @@ -434,7 +435,8 @@ verify_inode_chunk(xfs_mount_t *mp, pthread_mutex_lock(&ag_locks[agno]); for (j = 0, cur_agbno = chunk_start_agbno; cur_agbno < chunk_stop_agbno; cur_agbno++) { - switch (state = get_agbno_state(mp, agno, cur_agbno)) { + state = get_bmap(agno, cur_agbno); + switch (state) { case XR_E_MULT: case XR_E_INUSE: case XR_E_INUSE_FS: @@ -442,7 +444,7 @@ verify_inode_chunk(xfs_mount_t *mp, do_warn( _("inode block %d/%d multiply claimed, (state %d)\n"), agno, cur_agbno, state); - set_agbno_state(mp, agno, cur_agbno, XR_E_MULT); + set_bmap(agno, cur_agbno, XR_E_MULT); j = 1; break; case XR_E_INO: @@ -486,7 +488,8 @@ verify_inode_chunk(xfs_mount_t *mp, for (cur_agbno = chunk_start_agbno; cur_agbno < chunk_stop_agbno; cur_agbno++) { - switch (state = get_agbno_state(mp, agno, cur_agbno)) { + state = get_bmap(agno, cur_agbno); + switch (state) { case XR_E_INO: do_error( _("uncertain inode block %llu already known\n"), @@ -495,7 +498,7 @@ verify_inode_chunk(xfs_mount_t *mp, case XR_E_UNKNOWN: case XR_E_FREE1: case XR_E_FREE: - set_agbno_state(mp, agno, cur_agbno, XR_E_INO); + set_bmap(agno, cur_agbno, XR_E_INO); break; case XR_E_MULT: case XR_E_INUSE: @@ -509,7 +512,7 @@ verify_inode_chunk(xfs_mount_t *mp, do_warn( _("inode block %d/%d bad state, (state %d)\n"), agno, cur_agbno, state); - set_agbno_state(mp, agno, cur_agbno, XR_E_INO); + set_bmap(agno, cur_agbno, XR_E_INO); break; } } @@ -742,22 +745,23 @@ process_inode_chunk( * mark block as an inode block in the incore bitmap */ pthread_mutex_lock(&ag_locks[agno]); - switch (state = get_agbno_state(mp, agno, agbno)) { - case XR_E_INO: /* already marked */ - break; - case XR_E_UNKNOWN: - case XR_E_FREE: - case XR_E_FREE1: - set_agbno_state(mp, agno, agbno, XR_E_INO); - break; - case XR_E_BAD_STATE: - do_error(_("bad state in block map %d\n"), state); - break; - default: - set_agbno_state(mp, agno, agbno, XR_E_MULT); - do_warn(_("inode block %llu multiply claimed, state was %d\n"), - XFS_AGB_TO_FSB(mp, agno, agbno), state); - break; + state = get_bmap(agno, agbno); + switch (state) { + case XR_E_INO: /* already marked */ + break; + case XR_E_UNKNOWN: + case XR_E_FREE: + case XR_E_FREE1: + set_bmap(agno, agbno, XR_E_INO); + break; + case XR_E_BAD_STATE: + do_error(_("bad state in block map %d\n"), state); + break; + default: + set_bmap(agno, agbno, XR_E_MULT); + do_warn(_("inode block %llu multiply claimed, state was %d\n"), + XFS_AGB_TO_FSB(mp, agno, agbno), state); + break; } pthread_mutex_unlock(&ag_locks[agno]); @@ -923,20 +927,21 @@ process_inode_chunk( agbno++; pthread_mutex_lock(&ag_locks[agno]); - switch (state = get_agbno_state(mp, agno, agbno)) { + state = get_bmap(agno, agbno); + switch (state) { case XR_E_INO: /* already marked */ break; case XR_E_UNKNOWN: case XR_E_FREE: case XR_E_FREE1: - set_agbno_state(mp, agno, agbno, XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); break; case XR_E_BAD_STATE: do_error(_("bad state in block map %d\n"), state); break; default: - set_agbno_state(mp, agno, agbno, XR_E_MULT); + set_bmap(agno, agbno, XR_E_MULT); do_warn(_("inode block %llu multiply claimed, " "state was %d\n"), XFS_AGB_TO_FSB(mp, agno, agbno), state); Index: xfsprogs-dev/repair/phase4.c =================================================================== --- xfsprogs-dev.orig/repair/phase4.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/phase4.c 2009-08-21 19:05:51.000000000 +0000 @@ -247,8 +247,7 @@ phase4(xfs_mount_t *mp) } } - bstate = get_agbno_state(mp, i, j); - + bstate = get_bmap(i, j); switch (bstate) { case XR_E_BAD_STATE: default: @@ -305,9 +304,7 @@ phase4(xfs_mount_t *mp) rt_len = 0; for (bno = 0; bno < mp->m_sb.sb_rextents; bno++) { - - bstate = get_rtbno_state(mp, bno); - + bstate = get_rtbmap(bno); switch (bstate) { case XR_E_BAD_STATE: default: @@ -366,7 +363,7 @@ phase4(xfs_mount_t *mp) roundup((mp->m_sb.sb_agblocks+(NBBY/XR_BB)-1)/(NBBY/XR_BB), sizeof(__uint64_t))); for (j = 0; j < ag_hdr_block; j++) - set_agbno_state(mp, i, j, XR_E_INUSE_FS); + set_bmap(i, j, XR_E_INUSE_FS); } set_bmap_rt(mp->m_sb.sb_rextents); set_bmap_log(mp); Index: xfsprogs-dev/repair/phase5.c =================================================================== --- xfsprogs-dev.orig/repair/phase5.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/phase5.c 2009-08-21 19:05:51.000000000 +0000 @@ -123,7 +123,7 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_ag for (agbno = 0; agbno < ag_end; agbno++) { #if 0 old_state = state; - state = get_agbno_state(mp, agno, agbno); + state = get_bmap(agno, agbno); if (state != old_state) { fprintf(stderr, "agbno %u - new state is %d\n", agbno, state); @@ -142,7 +142,7 @@ mk_incore_fstree(xfs_mount_t *mp, xfs_ag } } - if (get_agbno_state(mp, agno, agbno) < XR_E_INUSE) { + if (get_bmap(agno, agbno) < XR_E_INUSE) { free_blocks++; if (in_extent == 0) { /* Index: xfsprogs-dev/repair/scan.c =================================================================== --- xfsprogs-dev.orig/repair/scan.c 2009-08-21 19:05:32.000000000 +0000 +++ xfsprogs-dev/repair/scan.c 2009-08-21 19:06:51.000000000 +0000 @@ -148,6 +148,9 @@ scanfunc_bmap( xfs_dfiloff_t last_key; char *forkname; int numrecs; + xfs_agnumber_t agno; + xfs_agblock_t agbno; + int state; if (whichfork == XFS_DATA_FORK) forkname = _("data"); @@ -229,11 +232,15 @@ _("bad back (left) sibling pointer (saw bm_cursor->level[level].right_fsbno = be64_to_cpu(block->bb_u.l.bb_rightsib); - switch (get_fsbno_state(mp, bno)) { + agno = XFS_FSB_TO_AGNO(mp, bno); + agbno = XFS_FSB_TO_AGBNO(mp, bno); + + state = get_bmap(agno, agbno); + switch (state) { case XR_E_UNKNOWN: case XR_E_FREE1: case XR_E_FREE: - set_fsbno_state(mp, bno, XR_E_INUSE); + set_bmap(agno, agbno, XR_E_INUSE); break; case XR_E_FS_MAP: case XR_E_INUSE: @@ -245,19 +252,17 @@ _("bad back (left) sibling pointer (saw * we made it here, the block probably * contains btree data. */ - set_fsbno_state(mp, bno, XR_E_MULT); + set_bmap(agno, agbno, XR_E_MULT); do_warn( _("inode 0x%llx bmap block 0x%llx claimed, state is %d\n"), - ino, (__uint64_t) bno, - get_fsbno_state(mp, bno)); + ino, (__uint64_t) bno, state); break; case XR_E_MULT: case XR_E_INUSE_FS: - set_fsbno_state(mp, bno, XR_E_MULT); + set_bmap(agno, agbno, XR_E_MULT); do_warn( _("inode 0x%llx bmap block 0x%llx claimed, state is %d\n"), - ino, (__uint64_t) bno, - get_fsbno_state(mp, bno)); + ino, (__uint64_t) bno, state); /* * if we made it to here, this is probably a bmap block * that is being used by *another* file as a bmap block @@ -272,8 +277,7 @@ _("bad back (left) sibling pointer (saw default: do_warn( _("bad state %d, inode 0x%llx bmap block 0x%llx\n"), - get_fsbno_state(mp, bno), - ino, (__uint64_t) bno); + state, ino, (__uint64_t) bno); break; } } else { @@ -476,19 +480,15 @@ scanfunc_allocbt( /* * check for btree blocks multiply claimed */ - state = get_agbno_state(mp, agno, bno); - - switch (state) { - case XR_E_UNKNOWN: - set_agbno_state(mp, agno, bno, XR_E_FS_MAP); - break; - default: - set_agbno_state(mp, agno, bno, XR_E_MULT); + state = get_bmap(agno, bno); + switch (state != XR_E_UNKNOWN) { + set_bmap(agno, bno, XR_E_MULT); do_warn( _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), name, state, agno, bno, suspect); return; } + set_bmap(agno, bno, XR_E_FS_MAP); numrecs = be16_to_cpu(block->bb_numrecs); @@ -523,11 +523,10 @@ _("%s freespace btree block claimed (sta continue; for ( ; b < end; b++) { - state = get_agbno_state(mp, agno, b); + state = get_bmap(agno, b); switch (state) { case XR_E_UNKNOWN: - set_agbno_state(mp, agno, b, - XR_E_FREE1); + set_bmap(agno, b, XR_E_FREE1); break; case XR_E_FREE1: /* @@ -535,8 +534,7 @@ _("%s freespace btree block claimed (sta * FREE1 blocks later */ if (magic != XFS_ABTB_MAGIC) { - set_agbno_state(mp, agno, b, - XR_E_FREE); + set_bmap(agno, b, XR_E_FREE); break; } default: @@ -698,13 +696,14 @@ _("bad ending inode # (%llu (0x%x 0x%x)) j < XFS_INODES_PER_CHUNK; j += mp->m_sb.sb_inopblock) { agbno = XFS_AGINO_TO_AGBNO(mp, ino + j); - state = get_agbno_state(mp, agno, agbno); + + state = get_bmap(agno, agbno); if (state == XR_E_UNKNOWN) { - set_agbno_state(mp, agno, agbno, XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); } else if (state == XR_E_INUSE_FS && agno == 0 && ino + j >= first_prealloc_ino && ino + j < last_prealloc_ino) { - set_agbno_state(mp, agno, agbno, XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); } else { do_warn( _("inode chunk claims used block, inobt block - agno %d, bno %d, inopb %d\n"), @@ -842,16 +841,15 @@ scanfunc_ino( * check for btree blocks multiply claimed, any unknown/free state * is ok in the bitmap block. */ - state = get_agbno_state(mp, agno, bno); - + state = get_bmap(agno, bno); switch (state) { case XR_E_UNKNOWN: case XR_E_FREE1: case XR_E_FREE: - set_agbno_state(mp, agno, bno, XR_E_FS_MAP); + set_bmap(agno, bno, XR_E_FS_MAP); break; default: - set_agbno_state(mp, agno, bno, XR_E_MULT); + set_bmap(agno, bno, XR_E_MULT); do_warn( _("inode btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), state, agno, bno, suspect); @@ -953,7 +951,7 @@ scan_freelist( if (XFS_SB_BLOCK(mp) != XFS_AGFL_BLOCK(mp) && XFS_AGF_BLOCK(mp) != XFS_AGFL_BLOCK(mp) && XFS_AGI_BLOCK(mp) != XFS_AGFL_BLOCK(mp)) - set_agbno_state(mp, agno, XFS_AGFL_BLOCK(mp), XR_E_FS_MAP); + set_bmap(agno, XFS_AGFL_BLOCK(mp), XR_E_FS_MAP); if (be32_to_cpu(agf->agf_flcount) == 0) return; @@ -971,7 +969,7 @@ scan_freelist( for (;;) { bno = be32_to_cpu(agfl->agfl_bno[i]); if (verify_agbno(mp, agno, bno)) - set_agbno_state(mp, agno, bno, XR_E_FREE); + set_bmap(agno, bno, XR_E_FREE); else do_warn(_("bad agbno %u in agfl, agno %d\n"), bno, agno); Index: xfsprogs-dev/repair/Makefile =================================================================== --- xfsprogs-dev.orig/repair/Makefile 2009-08-21 19:05:38.000000000 +0000 +++ xfsprogs-dev/repair/Makefile 2009-08-21 19:05:51.000000000 +0000 @@ -32,9 +32,7 @@ include $(BUILDRULES) # # Tracing flags: -# -DXR_BMAP_DBG incore block bitmap debugging # -DXR_INODE_TRACE inode processing -# -DXR_BMAP_TRACE bmap btree processing # -DXR_DIR_TRACE directory processing # -DXR_DUP_TRACE duplicate extent processing # -DXR_BCNT_TRACE incore bcnt freespace btree building Index: xfsprogs-dev/repair/incore.c =================================================================== --- xfsprogs-dev.orig/repair/incore.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/incore.c 2009-08-21 19:05:51.000000000 +0000 @@ -185,7 +185,8 @@ set_bmap_log(xfs_mount_t *mp) logend = mp->m_sb.sb_logstart + mp->m_sb.sb_logblocks; for (i = mp->m_sb.sb_logstart; i < logend ; i++) { - set_fsbno_state(mp, i, XR_E_INUSE_FS); + set_bmap(XFS_FSB_TO_AGNO(mp, i), + XFS_FSB_TO_AGBNO(mp, i), XR_E_INUSE_FS); } return; @@ -205,7 +206,7 @@ set_bmap_fs(xfs_mount_t *mp) for (i = 0; i < mp->m_sb.sb_agcount; i++) for (j = 0; j < end; j++) - set_agbno_state(mp, i, j, XR_E_INUSE_FS); + set_bmap(i, j, XR_E_INUSE_FS); return; } @@ -227,7 +228,7 @@ set_bmap_fs_bt(xfs_mount_t *mp) * account for btree roots */ for (j = begin; j < end; j++) - set_agbno_state(mp, i, j, XR_E_INUSE_FS); + set_bmap(i, j, XR_E_INUSE_FS); } return; @@ -253,44 +254,3 @@ incore_init(xfs_mount_t *mp) return; } - -#if defined(XR_BMAP_TRACE) || defined(XR_BMAP_DBG) -int -get_agbno_state(xfs_mount_t *mp, xfs_agnumber_t agno, - xfs_agblock_t ag_blockno) -{ - __uint64_t *addr; - - addr = ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM; - - return((*addr >> (((ag_blockno)%XR_BB_NUM)*XR_BB)) & XR_BB_MASK); -} - -void set_agbno_state(xfs_mount_t *mp, xfs_agnumber_t agno, - xfs_agblock_t ag_blockno, int state) -{ - __uint64_t *addr; - - addr = ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM; - - *addr = (((*addr) & - (~((__uint64_t) XR_BB_MASK << (((ag_blockno)%XR_BB_NUM)*XR_BB)))) | - (((__uint64_t) (state)) << (((ag_blockno)%XR_BB_NUM)*XR_BB))); -} - -int -get_fsbno_state(xfs_mount_t *mp, xfs_dfsbno_t blockno) -{ - return(get_agbno_state(mp, XFS_FSB_TO_AGNO(mp, blockno), - XFS_FSB_TO_AGBNO(mp, blockno))); -} - -void -set_fsbno_state(xfs_mount_t *mp, xfs_dfsbno_t blockno, int state) -{ - set_agbno_state(mp, XFS_FSB_TO_AGNO(mp, blockno), - XFS_FSB_TO_AGBNO(mp, blockno), state); - - return; -} -#endif Index: xfsprogs-dev/repair/incore.h =================================================================== --- xfsprogs-dev.orig/repair/incore.h 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/incore.h 2009-08-21 19:05:51.000000000 +0000 @@ -72,51 +72,23 @@ void teardown_bmap_finish(xfs_mount_t * you want to use the regular block map. */ -#if defined(XR_BMAP_TRACE) || defined(XR_BMAP_DBG) -/* - * implemented as functions for debugging purposes - */ -int get_agbno_state(xfs_mount_t *mp, xfs_agnumber_t agno, - xfs_agblock_t ag_blockno); -void set_agbno_state(xfs_mount_t *mp, xfs_agnumber_t agno, - xfs_agblock_t ag_blockno, int state); - -int get_fsbno_state(xfs_mount_t *mp, xfs_dfsbno_t blockno); -void set_fsbno_state(xfs_mount_t *mp, xfs_dfsbno_t blockno, int state); -#else -/* - * implemented as macros for performance purposes - */ - -#define get_agbno_state(mp, agno, ag_blockno) \ +#define get_bmap(agno, ag_blockno) \ ((int) (*(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) \ >> (((ag_blockno)%XR_BB_NUM)*XR_BB)) \ & XR_BB_MASK) -#define set_agbno_state(mp, agno, ag_blockno, state) \ +#define set_bmap(agno, ag_blockno, state) \ *(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) = \ ((*(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM) & \ (~((__uint64_t) XR_BB_MASK << (((ag_blockno)%XR_BB_NUM)*XR_BB)))) | \ (((__uint64_t) (state)) << (((ag_blockno)%XR_BB_NUM)*XR_BB))) -#define get_fsbno_state(mp, blockno) \ - get_agbno_state(mp, XFS_FSB_TO_AGNO(mp, (blockno)), \ - XFS_FSB_TO_AGBNO(mp, (blockno))) -#define set_fsbno_state(mp, blockno, state) \ - set_agbno_state(mp, XFS_FSB_TO_AGNO(mp, (blockno)), \ - XFS_FSB_TO_AGBNO(mp, (blockno)), (state)) - - -#define get_agbno_rec(mp, agno, ag_blockno) \ - (*(ba_bmap[(agno)] + (ag_blockno)/XR_BB_NUM)) -#endif /* XR_BMAP_TRACE */ - /* * these work in real-time extents (e.g. fsbno == rt extent number) */ -#define get_rtbno_state(mp, fsbno) \ +#define get_rtbmap(fsbno) \ ((*(rt_ba_bmap + (fsbno)/XR_BB_NUM) >> \ (((fsbno)%XR_BB_NUM)*XR_BB)) & XR_BB_MASK) -#define set_rtbno_state(mp, fsbno, state) \ +#define set_rtbmap(fsbno, state) \ *(rt_ba_bmap + (fsbno)/XR_BB_NUM) = \ ((*(rt_ba_bmap + (fsbno)/XR_BB_NUM) & \ (~((__uint64_t) XR_BB_MASK << (((fsbno)%XR_BB_NUM)*XR_BB)))) | \ Index: xfsprogs-dev/repair/phase2.c =================================================================== --- xfsprogs-dev.orig/repair/phase2.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/phase2.c 2009-08-21 19:05:51.000000000 +0000 @@ -176,7 +176,7 @@ phase2(xfs_mount_t *mp) * also mark blocks */ for (b = 0; b < mp->m_ialloc_blks; b++) { - set_agbno_state(mp, 0, + set_bmap(0, b + XFS_INO_TO_AGBNO(mp, mp->m_sb.sb_rootino), XR_E_INO); } Index: xfsprogs-dev/repair/phase3.c =================================================================== --- xfsprogs-dev.orig/repair/phase3.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/phase3.c 2009-08-21 19:05:51.000000000 +0000 @@ -61,14 +61,8 @@ walk_unlinked_list(xfs_mount_t *mp, xfs_ agbno = XFS_AGINO_TO_AGBNO(mp, current_ino); pthread_mutex_lock(&ag_locks[agno]); - switch (state = get_agbno_state(mp, - agno, agbno)) { - case XR_E_UNKNOWN: - case XR_E_FREE: - case XR_E_FREE1: - set_agbno_state(mp, agno, agbno, - XR_E_INO); - break; + state = get_bmap(agno, agbno); + switch (state) { case XR_E_BAD_STATE: do_error(_( "bad state in block map %d\n"), @@ -85,8 +79,7 @@ walk_unlinked_list(xfs_mount_t *mp, xfs_ * anyway, hopefully without * losing too much other data */ - set_agbno_state(mp, agno, agbno, - XR_E_INO); + set_bmap(agno, agbno, XR_E_INO); break; } pthread_mutex_unlock(&ag_locks[agno]); Index: xfsprogs-dev/repair/rt.c =================================================================== --- xfsprogs-dev.orig/repair/rt.c 2009-08-21 18:59:24.000000000 +0000 +++ xfsprogs-dev/repair/rt.c 2009-08-21 19:05:51.000000000 +0000 @@ -91,7 +91,7 @@ generate_rtinfo(xfs_mount_t *mp, bits = 0; for (i = 0; i < sizeof(xfs_rtword_t) * NBBY && extno < mp->m_sb.sb_rextents; i++, extno++) { - if (get_rtbno_state(mp, extno) == XR_E_FREE) { + if (get_rtbmap(extno) == XR_E_FREE) { sb_frextents++; bits |= freebit; @@ -218,7 +218,7 @@ process_rtbitmap(xfs_mount_t *mp, bit < bitsperblock && extno < mp->m_sb.sb_rextents; bit++, extno++) { if (xfs_isset(words, bit)) { - set_rtbno_state(mp, extno, XR_E_FREE); + set_rtbmap(extno, XR_E_FREE); sb_frextents++; if (prevbit == 0) { start_bmbno = bmbno; From rumi_ml@rtfm.hu Wed Sep 2 14:34:51 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82JYV4C040501 for ; Wed, 2 Sep 2009 14:34:41 -0500 X-ASG-Debug-ID: 1251920117-6a8903780000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nexus.dynaweb.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A9A2841E369 for ; Wed, 2 Sep 2009 12:35:17 -0700 (PDT) Received: from nexus.dynaweb.hu (nexus.dynaweb.hu [195.70.37.87]) by cuda.sgi.com with ESMTP id lE7xJlBgALz4shYf for ; Wed, 02 Sep 2009 12:35:17 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by nexus.dynaweb.hu (Postfix) with ESMTP id E9DC06CEEB; Wed, 2 Sep 2009 21:34:43 +0200 (CEST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Scanned: by amavisd-new using ClamAV at dynaweb.hu Received: from nexus.dynaweb.hu ([127.0.0.1]) by localhost (nexus.dynaweb.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p-NFC2ZeRGKc; Wed, 2 Sep 2009 21:34:42 +0200 (CEST) Received: from raketa.ipn.dynaweb.hu (catv-80-99-36-176.catv.broadband.hu [80.99.36.176]) by nexus.dynaweb.hu (Postfix) with ESMTPSA id 3BCD16CEE5; Wed, 2 Sep 2009 21:34:42 +0200 (CEST) Date: Wed, 2 Sep 2009 21:34:41 +0200 From: RUMI Szabolcs To: Eric Sandeen Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Structure needs cleaning? (take #2) Subject: Re: Structure needs cleaning? (take #2) Message-Id: <20090902213441.470b439c.rumi_ml@rtfm.hu> In-Reply-To: <4A9E81AD.70003@sandeen.net> References: <20090902152245.b2969883.rumi_ml@rtfm.hu> <4A9E81AD.70003@sandeen.net> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.5; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: nexus.dynaweb.hu[195.70.37.87] X-Barracuda-Start-Time: 1251920121 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7928 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean Hi! Well, what could be the reason? I mean, there was no hardware failure, no crash, no reboot, no errors in the disk's SMART error log, no nothing. What I did was that I've extracted and deleted the rather huge OpenOffice source tree several times (sometimes with overwriting) and finally it ended up with these undeletable files and xfs errors. Is it considered normal for xfs to get messed up like that under such load? Thanks, Sab The xfs_repair output and xfs_info output is included below: # xfs_repair -v /dev/sda10 Phase 1 - find and verify superblock... - block cache size set to 255664 entries Phase 2 - using internal log - zero log... zero_log: head block 37688 tail block 37688 - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 - agno = 39 - agno = 40 - agno = 41 - agno = 42 - agno = 43 - agno = 44 - agno = 45 - agno = 46 - agno = 47 - agno = 48 - agno = 49 - agno = 50 - agno = 51 - agno = 52 - agno = 53 - agno = 54 - agno = 55 - agno = 56 - agno = 57 - agno = 58 - agno = 59 - agno = 60 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 - agno = 39 - agno = 40 - agno = 41 - agno = 42 - agno = 43 - agno = 44 - agno = 45 - agno = 46 - agno = 47 - agno = 48 - agno = 49 - agno = 50 - agno = 51 - agno = 52 - agno = 53 - agno = 54 - agno = 55 - agno = 56 - agno = 57 - agno = 58 - agno = 59 - agno = 60 Phase 5 - rebuild AG headers and trees... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 - agno = 39 - agno = 40 - agno = 41 - agno = 42 - agno = 43 - agno = 44 - agno = 45 - agno = 46 - agno = 47 - agno = 48 - agno = 49 - agno = 50 - agno = 51 - agno = 52 - agno = 53 - agno = 54 - agno = 55 - agno = 56 - agno = 57 - agno = 58 - agno = 59 - agno = 60 - reset superblock... Phase 6 - check inode connectivity... - resetting contents of realtime bitmap and summary inodes - traversing filesystem ... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 leaf block 8388608 for directory inode 4051737 bad header rebuilding directory inode 4051737 leaf block 8388608 for directory inode 4053318 bad header rebuilding directory inode 4053318 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 - agno = 39 - agno = 40 - agno = 41 - agno = 42 - agno = 43 - agno = 44 - agno = 45 - agno = 46 - agno = 47 - agno = 48 - agno = 49 - agno = 50 - agno = 51 - agno = 52 - agno = 53 - agno = 54 - agno = 55 - agno = 56 - agno = 57 - agno = 58 - agno = 59 - agno = 60 - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify and correct link counts... XFS_REPAIR Summary Wed Sep 2 21:23:53 2009 Phase Start End Duration Phase 1: 09/02 21:23:33 09/02 21:23:33 Phase 2: 09/02 21:23:33 09/02 21:23:35 2 seconds Phase 3: 09/02 21:23:35 09/02 21:23:49 14 seconds Phase 4: 09/02 21:23:49 09/02 21:23:50 1 second Phase 5: 09/02 21:23:50 09/02 21:23:50 Phase 6: 09/02 21:23:50 09/02 21:23:50 Phase 7: 09/02 21:23:50 09/02 21:23:50 Total run time: 17 seconds done # xfs_info /dev/sda10 meta-data=/dev/sda10 isize=256 agcount=61, agsize=32768 blks = sectsz=512 attr=0 data = bsize=4096 blocks=1998848, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal bsize=4096 blocks=16384, version=2 = sectsz=512 sunit=1 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 On Wed, 02 Sep 2009 09:31:09 -0500 Eric Sandeen wrote: > RUMI Szabolcs wrote: > > Hi! > > > > Sorry but my previous post was missing the important first two lines: > > Yes, thanks. :) > > > d62c8000: 2c 30 78 41 41 41 41 30 30 30 30 2c 36 2c 30 78 ,0xAAAA0000,6,0x > > Filesystem "sda10": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xc02cc790 > > This is on-disk corruption, it found bad magic on something it expected > to be metadata. You should run xfs_repair. run with -n, or on a > restored xfs_metadump image as a dry-run first, if you prefer. > > -Eric > > > Pid: 29510, comm: mc Tainted: P 2.6.29-gentoo-r5-PAE #1 > > Call Trace: > > [] xfs_da_do_buf+0x8c4/0x900 > > [] xfs_da_read_buf+0x30/0x40 > > [] xfs_da_read_buf+0x30/0x40 > > [] pollwake+0x0/0x50 > > [] pollwake+0x0/0x50 > > [] xfs_da_read_buf+0x30/0x40 > > [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 > > [] xfs_dir2_leaf_lookup_int+0x63/0x2f0 > > [] xfs_dir2_leaf_lookup+0x27/0xc0 > > [] xfs_dir2_isleaf+0x1f/0x60 > > [] xfs_dir_lookup+0xd8/0x180 > > [] xfs_lookup+0x6b/0xf0 > > [] xfs_vn_lookup+0x55/0xa0 > > [] do_lookup+0x1ba/0x1e0 > > [] __link_path_walk+0x6cd/0xd60 > > [] xfs_dir2_leaf_getdents+0x5ff/0xad0 > > [] path_walk+0x54/0xc0 > > [] do_path_lookup+0x83/0x170 > > [] getname+0x9b/0xe0 > > [] user_path_at+0x5a/0x90 > > [] vfs_lstat_fd+0x1f/0x50 > > [] sys_lstat64+0xf/0x30 > > [] touch_atime+0x14/0x130 > > [] vfs_readdir+0x78/0xb0 > > [] sys_getdents64+0xa1/0xd0 > > [] sysenter_do_call+0x12/0x25 > > > > Thanks, > > Sab > > > > _______________________________________________ > > xfs mailing list > > xfs@oss.sgi.com > > http://oss.sgi.com/mailman/listinfo/xfs > > > From sandeen@sandeen.net Wed Sep 2 14:52:53 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82JqX3m041639 for ; Wed, 2 Sep 2009 14:52:43 -0500 X-ASG-Debug-ID: 1251921188-4afb000b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 64BD841E799 for ; Wed, 2 Sep 2009 12:53:08 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id 9vl1NYZVjxhromt4 for ; Wed, 02 Sep 2009 12:53:08 -0700 (PDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n82Jr5Qo031078; Wed, 2 Sep 2009 15:53:05 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n82Jr4Nq018954; Wed, 2 Sep 2009 15:53:05 -0400 Message-ID: <4A9ECD20.9090201@sandeen.net> Date: Wed, 02 Sep 2009 14:53:04 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: RUMI Szabolcs CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Structure needs cleaning? (take #2) Subject: Re: Structure needs cleaning? (take #2) References: <20090902152245.b2969883.rumi_ml@rtfm.hu> <4A9E81AD.70003@sandeen.net> <20090902213441.470b439c.rumi_ml@rtfm.hu> In-Reply-To: <20090902213441.470b439c.rumi_ml@rtfm.hu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1251921210 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7930 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean RUMI Szabolcs wrote: > Hi! > > Well, what could be the reason? I mean, there was no hardware failure, > no crash, no reboot, no errors in the disk's SMART error log, no nothing. > What I did was that I've extracted and deleted the rather huge OpenOffice > source tree several times (sometimes with overwriting) and finally it > ended up with these undeletable files and xfs errors. Is it considered > normal for xfs to get messed up like that under such load? No, not normal. It found the text "0xAAAA0000,6,0x" on disk in an area where it expected to find valid filesystem metadata. Corruption could come from anywhere - an xfs bug, some other bug, bad memory, bad cables, neon death rays from space, writing directly to the disk, who knows. Awfully hard to track down a one-off occurrence like this, I'm afraid. > Thanks, > Sab > > > > The xfs_repair output and xfs_info output is included below: > > # xfs_repair -v /dev/sda10 ... > Phase 6 - check inode connectivity... > - resetting contents of realtime bitmap and summary inodes > - traversing filesystem ... > - agno = 0 > - agno = 1 > - agno = 2 > - agno = 3 > - agno = 4 > - agno = 5 > - agno = 6 > - agno = 7 > leaf block 8388608 for directory inode 4051737 bad header > rebuilding directory inode 4051737 > leaf block 8388608 for directory inode 4053318 bad header > rebuilding directory inode 4053318 ... above is the problem, properly found & repaired. -Eric From jpiszcz@lucidpixels.com Wed Sep 2 16:01:57 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82L1bnX045657 for ; Wed, 2 Sep 2009 16:01:47 -0500 X-ASG-Debug-ID: 1251925349-01d303ce0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4FFAC15B7BC1 for ; Wed, 2 Sep 2009 14:02:29 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id SD8vEZJ326nRawpc for ; Wed, 02 Sep 2009 14:02:29 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id AA9E84667; Wed, 2 Sep 2009 17:02:29 -0400 (EDT) Date: Wed, 2 Sep 2009 17:02:29 -0400 (EDT) From: Justin Piszcz To: Eric Sandeen cc: RUMI Szabolcs , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Structure needs cleaning? (take #2) Subject: Re: Structure needs cleaning? (take #2) In-Reply-To: <4A9ECD20.9090201@sandeen.net> Message-ID: References: <20090902152245.b2969883.rumi_ml@rtfm.hu> <4A9E81AD.70003@sandeen.net> <20090902213441.470b439c.rumi_ml@rtfm.hu> <4A9ECD20.9090201@sandeen.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1251925350 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7934 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hi RUMI, 1. Have you run memtest86 for a few passes? 2. Have you run a short+long test against the drive? smartctl -t short /dev/sda # wait 10min smartctl -t long # wait until its done show smartctl -a /dev/sda output <- report this back 3. Is this the first time this has happened? 4. Is your system on a UPS? 5. How do you mount your XFS partition? a. Do you use any special parameters? Justin. On Wed, 2 Sep 2009, Eric Sandeen wrote: > RUMI Szabolcs wrote: >> Hi! >> >> Well, what could be the reason? I mean, there was no hardware failure, >> no crash, no reboot, no errors in the disk's SMART error log, no nothing. >> What I did was that I've extracted and deleted the rather huge OpenOffice >> source tree several times (sometimes with overwriting) and finally it >> ended up with these undeletable files and xfs errors. Is it considered >> normal for xfs to get messed up like that under such load? > > No, not normal. > > It found the text "0xAAAA0000,6,0x" on disk in an area where it expected > to find valid filesystem metadata. > > Corruption could come from anywhere - an xfs bug, some other bug, bad > memory, bad cables, neon death rays from space, writing directly to the > disk, who knows. Awfully hard to track down a one-off occurrence like > this, I'm afraid. > >> Thanks, >> Sab >> >> >> >> The xfs_repair output and xfs_info output is included below: >> >> # xfs_repair -v /dev/sda10 > > ... > >> Phase 6 - check inode connectivity... >> - resetting contents of realtime bitmap and summary inodes >> - traversing filesystem ... >> - agno = 0 >> - agno = 1 >> - agno = 2 >> - agno = 3 >> - agno = 4 >> - agno = 5 >> - agno = 6 >> - agno = 7 >> leaf block 8388608 for directory inode 4051737 bad header >> rebuilding directory inode 4051737 >> leaf block 8388608 for directory inode 4053318 bad header >> rebuilding directory inode 4053318 > > ... > > above is the problem, properly found & repaired. > > -Eric > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From felixb@sgi.com Wed Sep 2 16:43:43 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82LhNgD048118 for ; Wed, 2 Sep 2009 16:43:33 -0500 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay2.corp.sgi.com (Postfix) with ESMTP id EA54C3040BB for ; Wed, 2 Sep 2009 14:44:20 -0700 (PDT) Received: from eagdhcp-232-185.americas.sgi.com (eagdhcp-232-185.americas.sgi.com [128.162.232.185]) by estes.americas.sgi.com (Postfix) with ESMTP id 7269A70016DD; Wed, 2 Sep 2009 16:14:16 -0500 (CDT) Message-Id: <6959C33E-61FC-4C10-A055-D61580F16E82@sgi.com> From: Felix Blyakher To: xfs mailing list Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Change in maintainership Date: Wed, 2 Sep 2009 16:14:14 -0500 Cc: felix@xfs.org X-Mailer: Apple Mail (2.926) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hi all, I have accepted a position at another storage company and so will no longer be serving as the maintainer for XFS from SGI. Alex Elder has agreed to take on maintainer responsibilities in my place. I will be working with him initially to make sure the transition goes smoothly, but I don't expect there to be any major issues. Alex has been working with XFS (more behind the scenes) for quite a while now and has a long history working with storage software as well as Linux. He is very capable engineer, and I'm sure he'll be able to handle the maintainer duties. And SGI is supporting this decision by giving Alex all resources necessary for this work. On my part, I've enjoyed working on xfs for so long, that I can't just go completely away from it. I will continue to work on xfs in my spare time and stay in touch with community. I could be reached now at felix@xfs.org. Thanks, Felix From jessicabrooks@topspotdirectory.com Wed Sep 2 17:05:40 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_50,J_CHICKENPOX_33, MSGID_FROM_MTA_HEADER autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82M5KN0049187 for ; Wed, 2 Sep 2009 17:05:30 -0500 X-ASG-Debug-ID: 1251929162-59fd02fe0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp02.lnh.mail.rcn.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3299510A2E17 for ; Wed, 2 Sep 2009 15:06:02 -0700 (PDT) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by cuda.sgi.com with ESMTP id T9WbDZHBDWyQzKYS for ; Wed, 02 Sep 2009 15:06:02 -0700 (PDT) Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 02 Sep 2009 18:06:00 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.10.7-GA) with ESMTP id QDQ25216; Wed, 2 Sep 2009 18:05:58 -0400 (EDT) Message-Id: <200909022205.QDQ25216@mr02.lnh.mail.rcn.net> Received: from 24-136-17-129.alc-bsr1.chi-alc.il.cable.rcn.com (HELO SG-06) ([24.136.17.129]) by smtp01.lnh.mail.rcn.net with ESMTP; 02 Sep 2009 18:05:59 -0400 Reply-To: "Jessica Brooks" From: "Jessica Brooks" To: X-ASG-Orig-Subj: Link exchange with oss.sgi.com Subject: Link exchange with oss.sgi.com Date: Wed, 2 Sep 2009 17:03:57 -0500 Importance: Normal X-Priority: 3 (Normal) MIME-Version: 1.0 X-AntiAbuse: Message Originator UID: RI {1a52a-92599} X-AntiAbuse: Since we wish to continue to provide abuse tracking! X-AntiAbuse: Please do not use this header to filter out email X-AntiAbuse: Report abuse incidents to mach 5 enterprises X-AntiAbuse: This header is intended to track abuse. Include with any abuse report X-Mailer: Mach 5 Mailer version 4 RI{1a52a-92599} Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8bit X-Junkmail-Status: score=10/50, host=mr02.lnh.mail.rcn.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A020209.4A9EEC47.018C,ss=1,fgs=0, ip=207.172.4.11, so=2009-07-20 21:54:04, dmn=5.7.1/2009-06-05, mode=single engine X-Junkmail-IWF: false X-Barracuda-Connect: smtp02.lnh.mail.rcn.net[207.172.157.102] X-Barracuda-Start-Time: 1251929167 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5000 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.80 X-Barracuda-Spam-Status: No, SCORE=1.80 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MSGID_FROM_MTA_HEADER, MSGID_FROM_MTA_HEADER_2, NO_OBLIGATION X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7938 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.30 NO_OBLIGATION BODY: There is no obligation 0.00 MSGID_FROM_MTA_HEADER Message-Id was added by a relay 1.50 MSGID_FROM_MTA_HEADER_2 Message-Id was added by a relay X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hello, My name is Jessica Brooks. I was surfing the web and came across your site oss.sgi. com. I would like to add your site to a category specific page on our site topspotdirectory.com (Details about the directory are below). As you know, exchanging links will benefit both of us by raising our search engine rankings and generating more traffic to both of our sites. Best of all it's FREE; there is no cost or hidden fee. We simply ask for a link back from the home or an internal page of your site. Simple enough, don't you think? I hope you're interested because we have other quality linking opportunities to offer. If you are interested in exchanging links, please reply to this email with your link details and the URL of your links page below: Anchor Text: URL: Description: (Use up to 400 words) Links Page (where you will put my link): Once I hear back from you with the information above, I'll send you a reply regarding our link details. I look forward to your response. Best wishes, Jessica Brooks on behalf of Top Spot Directory jessicabrooks@topspotdirectory.com Ref: 9-2 ---------------------------------- Top Spot Directory topspotdirectory.com The Top Spot Directory was developed in 2006 as an online search aid with constantly updated categories and fresh topics. Our staff works diligently to create a database of links to the Web's best resources for some of the most sought after and researched topics. Unlike many directories, all of our links are hand selected by members of our staff. Our editors personally assess each submission and search for quality sites to include. PLEASE NOTICE: This is not part of a mass email. I, Jessica Brooks, personally sent this email to you. Our company considers this to be a polite way to contact you and I do apologize sincerely if you have been inconvenienced in any way. Please know that our sole purpose is to introduce ourselves to you with no obligation on your part. Abiding by rules of etiquette, we are obliged to offer you an 'OPT-OUT' from future mailings from us; should you wish to exercise this right, please reply to this email with "OPT-OUT" in the subject field. Please be certain to include your email address and the URL of your site so we can act promptly to appropriately remove your information from our list of preferred link exchanges. From info@Petroleum.com Wed Sep 2 18:44:01 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n82Nhfch053960 for ; Wed, 2 Sep 2009 18:43:51 -0500 X-ASG-Debug-ID: 1251935044-03d900af0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.thfd.gov.tw (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B005141F964 for ; Wed, 2 Sep 2009 16:44:05 -0700 (PDT) Received: from mail.thfd.gov.tw (210-241-111-171.HINET-IP.hinet.net [210.241.111.171]) by cuda.sgi.com with ESMTP id 0ZkpbChoDVfD0WuB for ; Wed, 02 Sep 2009 16:44:05 -0700 (PDT) Received: from mail.thfd.gov.tw (localhost [127.0.0.1]) by mail.thfd.gov.tw (8.14.3/8.14.3) with ESMTP id n82NXwCh067222; Thu, 3 Sep 2009 07:33:59 +0800 (CST) (envelope-from info@Petroleum.com) From: "MALAYSIA PETROLUEM COMPANY" Reply-To: mrllparker01@gmail.com X-ASG-Orig-Subj: N/A Subject: N/A Date: Thu, 3 Sep 2009 07:33:58 +0800 Message-Id: <20090902233547.M44808@Petroleum.com> X-Mailer: OpenWebMail 2.53 X-OriginatingIP: 41.220.75.16 (thfd3000) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 To: undisclosed-recipients:; X-Barracuda-Connect: 210-241-111-171.HINET-IP.hinet.net[210.241.111.171] X-Barracuda-Start-Time: 1251935075 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5019 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.85 X-Barracuda-Spam-Status: No, SCORE=0.85 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MAILTO_TO_SPAM_ADDR, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7944 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean MALAYSIA PETROLUEM COMPANY (MY) Address:Malaysia Petroleum House 8188 Jalan Tun Razak, 50400 Kuala Lumpur Malaysia. Hello, Malaysia Petroleum Company wishes to announce to the general public about it 1st Quota Recruitment excise which is currently going on now. For our three (3)newly commissioned offices around Malaysia MY. Send your CV to our Human Resources Department Via email. Officers:Mr.Allen Parker Head Human Resources Officer Email:mrllparker01@gmail.com Regards, HR Department Malays From dyorke16@intoscana.it Wed Sep 2 22:11:13 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50,UNPARSEABLE_RELAY autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n833ArdB064457 for ; Wed, 2 Sep 2009 22:11:03 -0500 X-ASG-Debug-ID: 1251947483-6ad902520000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.aruba.it (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 052FA420215 for ; Wed, 2 Sep 2009 20:11:23 -0700 (PDT) Received: from smtp1.aruba.it (smtp3.aruba.it [62.149.128.202]) by cuda.sgi.com with SMTP id 08apMZGigFV6zDpP for ; Wed, 02 Sep 2009 20:11:23 -0700 (PDT) Received: (qmail 18099 invoked by uid 89); 3 Sep 2009 03:10:17 -0000 Received: from unknown (HELO WebmailCustom.aruba.it) (dyorke16@intoscana.it@10.10.10.25) by smtp1.aruba.it with SMTP; 3 Sep 2009 03:10:17 -0000 To: (Recipient List Suppressed) Received: from 83.229.80.27 by HTTP Sender: dyorke16@intoscana.it From: "Dave Yorke" Reply-To: d.yorke48@yahoo.com.hk X-ASG-Orig-Subj: Request Subject: Request X-Mailer: Quality Web Email v3.1s X-Originating-IP: 83.229.80.27 Date: Thu, 03 Sep 2009 05:10:09 +0200 Message-id: <4a9f3391.20f.36f6.318960781@WebmailCustom.aruba.it> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Barracuda-Connect: smtp3.aruba.it[62.149.128.202] X-Barracuda-Start-Time: 1251947510 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4960 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.50 X-Barracuda-Spam-Status: No, SCORE=1.50 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=ADVANCE_FEE_1, BSF_SC0_SA083, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.7958 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.00 ADVANCE_FEE_1 Appears to be advance fee fraud (Nigerian 419) 1.50 BSF_SC0_SA083 Custom Rule SA083 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Greetings from Dave Yorke, I am Dr. Dave Yorke, Group Accountant (R.B.T.T) However, I have already sent you this same letter by post one month ago, but I am not sure if it did get to you since I have not heard from you, hence my resending it again. I discovered a dormant account in my office, as Group Accountant with Republic Bank of Trinidad and Tobago. It will be in my interest to transfer this fund worth $28.5M Dollars (Twenty Eight Million Five hundred thousand Dollars) in an account offshore. Can you be my partner? Regards and respect, Dave Yorke From noel123@netvigator.com Thu Sep 3 09:30:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83EUb6C106116 for ; Thu, 3 Sep 2009 09:30:48 -0500 X-ASG-Debug-ID: 1251988263-73ba01a00000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ymail03dat.netvigator.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B001E422808 for ; Thu, 3 Sep 2009 07:31:04 -0700 (PDT) Received: from ymail03dat.netvigator.com (ymail03dat.netvigator.com [218.102.23.51]) by cuda.sgi.com with ESMTP id yec0suTkTxul1WVQ for ; Thu, 03 Sep 2009 07:31:04 -0700 (PDT) Received: from woboas04.netvigator.com ([219.76.94.20]) by ymail03dat.netvigator.com (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20090903143102.BXXQ1029.ymail03dat.netvigator.com@woboas04.netvigator.com>; Thu, 3 Sep 2009 22:31:02 +0800 Received: from localhost (woboas04.netvigator.com [127.0.0.1]) by woboas04.netvigator.com (Postfix) with ESMTP id 5358A8C4E4; Thu, 3 Sep 2009 11:34:00 +0000 (GMT) Received: from obav02.netvigator.com (obav02.netvigator.com [127.0.0.1]) by obav02.netvigator.com (Postfix) with SMTP id 598201B1063; Thu, 3 Sep 2009 14:31:02 +0000 (GMT) X-Mailer: Openwave WebEngine, version 2.8.19 (webedge20-101-1110-20050615) X-Originating-IP: [66.237.61.213] From: "United Nations Human Settlements Board" , " "@obav02.netvigator.com To: info@netvigator.com X-ASG-Orig-Subj: REF:UN013-0156/UPS-UN-HABITAT Subject: REF:UN013-0156/UPS-UN-HABITAT Date: Thu, 3 Sep 2009 22:31:01 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: 7bit Message-Id: <20090903143102.598201B1063@obav02.netvigator.com> X-Barracuda-Connect: ymail03dat.netvigator.com[218.102.23.51] X-Barracuda-Start-Time: 1251988291 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5080 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8000 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Good Day Beneficiary, After several attempts to reach you, I deemed it necessary and urgent to contact you with your email address and to notify you finally about your outstanding mid year settlement/compensation which is being given out by the United Nations Human Settlements Programme. This compensation is being made to all of you who have lost your money through any online transactions this year or as a result of any internet fraudulent activities that you might have previousley being involved. The United Nations Human Settlements Programme, UN-HABITAT, is the United Nations agency for human settlements. It is mandated by the UN General Assembly to promote humanly, socially and environmentally with the goal of providing adequate shelter for all. As a result of the much fraudulent activities spreading over the internet, the Organizing Committee of the UN-HABITAT have decided to get details of most of the victims who were previously scammed by some internet fraudsters. The main purpose of this Programme is to compensate every one of you with a check sum of $500,000.00 each, to help settle all your debts and start a new business. The Financial Commitee of the UN-HABITAT Programme have deposited your Settlement Check sum of $500,000.00 USD to the United Parcel Service of Nigeria (UPS), for them to facilitate the delivery to you prior to your contact with them. Your Settlement Check Parcel was deposited and registered with Reference Number UN013-0156/UPS-UN-HABITAT. You are to contact the United Parcel Service of Nigeria (UPS), with your the below information: Full Name: Resident Address: Direct Telephone Number: Country: Reference Number: This will enable them further the delivery/shipment of your settlement check to you. Note that we have not paid the shipment fee for the delivery/shipment of your check to you. you are hereby advise to contact the United Parcel Service of Nigeria to book your settlement check shipment arrangements. ============================== United Parcel Service Nigeria LTD Plot 781 Emeka Anyaoku Street Area Eleven Garki FCT-Abuja Nigeria. Tel: +234-807-217-8475 Email: ups-customerservice@live.co.uk ============================== Accept Our Greetings. Evans Laurie UN-HABITAT Information Officer From Daniele.Passerone@empa.ch Thu Sep 3 10:31:22 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83FUu4l110900 for ; Thu, 3 Sep 2009 10:31:12 -0500 X-ASG-Debug-ID: 1251991899-221800260000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.empa.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AC2D44227B5 for ; Thu, 3 Sep 2009 08:31:40 -0700 (PDT) Received: from mx1.empa.ch (mx1.empa.ch [152.88.7.31]) by cuda.sgi.com with ESMTP id lszcSeTBK7xhJNh6 for ; Thu, 03 Sep 2009 08:31:40 -0700 (PDT) Received: from Du-Exc-Hub1.empa.emp-eaw.ch (localhost [127.0.0.1]) by mx1.empa.ch (Spam & Virus Firewall) with ESMTP id DE782D41D7 for ; Thu, 3 Sep 2009 17:31:36 +0200 (CEST) Received: from Du-Exc-Hub1.empa.emp-eaw.ch ([152.88.6.64]) by mx1.empa.ch with ESMTP id dopY9lSjzOCFrisv for ; Thu, 03 Sep 2009 17:31:36 +0200 (CEST) Received: from DU-Exc-Mail.empa.emp-eaw.ch ([fe80::bc9b:a2a9:e3fb:5e94]) by Du-Exc-Hub1.empa.emp-eaw.ch ([2002:9858:640::9858:640]) with mapi; Thu, 3 Sep 2009 17:31:36 +0200 From: "Passerone, Daniele" To: "xfs@oss.sgi.com" Date: Thu, 3 Sep 2009 17:31:36 +0200 X-ASG-Orig-Subj: RE: xfs data loss Subject: RE: xfs data loss Thread-Topic: RE: xfs data loss Thread-Index: Acosq599XJjOofGgRCSxA+/2swSBlQ== Message-ID: Accept-Language: it-IT, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: it-IT, de-CH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: mx1.empa.ch[152.88.7.31] X-Barracuda-Start-Time: 1251991904 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0011 1.0000 -2.0139 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8003 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Dear Peter,=20 Thank you very much for the time spent in writing this long and=20 interesting answer. Now I agree with you, that harsh and useful is better than emollient and lying :-) > When you write to a mailing list asking for free help and support, > it is rather rude to not have done some preliminary work, such as > figuring out the characterisics of RAID5 in case of failure. It > is also somewhat rude (but amazingly common) to make confused and > partial reports, such as not checking and reporting what has > actually failed. That is true. Unfortunately I am not the person who assembled the RAID5 and configured the machine, and I had to act mostly alone to figure out what to do. That is why I eventually preferred to make a partial report. > But a soft but more open assessment of how outrageous some queries > are is help too as it makes it easier to assess the gravity of the > situation. The smooth, emollient sell-side people will let you dig > your own grave. Just consider your statement below about "assume > clean" that to me sounds very dangerous (big euphemism), and that > did not elicit any warning from the sell-side: At the beginning of this week I was confronted with the following=20 situation: 1) /dev/md4 a 19+1 RAID 5, with the corresponding xfs /raidmd4 filesystem that had lost half of the directories=20 on the 24th of August; for NO PARTICULAR APPARENT REASON (and this still ma= kes me crazy). No logs, nothing.=20 2) /dev/md5, a 19+1 RAID 5, that could not mount anymore...lost superblock. 3) /dev/md6 , a 4+1 RAID5, that was not mounting anymore because 2 devices = were lost. My collegue zapped the filesystem (which was almost empty), and rebuilt the= RAID5.=20 Unfortunately I cannot say exactly what he did. For 2) it was clear what happened: At the distance of a few days, two devices of /dev/md5 died.=20 The information about the death of one device is issued in /var/log/warn. We did not check it during the last days, so when the second device died, i= t was too late. BUT: I followed the advice to make a read test on all devices (using dd) an= d all were ok. So it seemed to be a raid controller problem, of the same kind described h= ere http://maillists.uci.edu/mailman/public/uci-linux/2007-December/002225.html where a solution is proposed including the reassembling of the raid using m= dadm with the option=20 "assume-clean". This is where this "assume-clean" comes from: from a read t= est, followed by=20 the study of the above mailing list post. The resync of the /dev/md5 was performed, the raid was again with 20 workin= g devices,=20 but at the end of the day the filesystem still was not able to mount. So, I was eventually forced to do xfs_repair -L /dev/md5, which was a night= mare: incredible number of forking, inodes cleared... but eventually... successfu= l. I was in the meanwhile 10 years older and with all my hair suddenly greyed,= but... RESULT: /dev/md5 is again up and running, with all data. BUT at the same time, /dev/md4 was not able to mount anymore: superblock e= rror. So, at that point we bought another big drive (7 TB), we performed backup o= f /dev/md5 , and then we run the same procedure on /dev/md4.=20 RESULT: /dev/md4 is again up and running, but the data disappeared on Augus= t 24 were still missing. Since the structure was including all devices, at this point I run xfs_repa= ir -L /dev/md4. But nothing happens. No error, and half of the data still missing. So at this point I don't understand.=20 THERE IS ONE IMPORTANT THING THAT I DID NOT MENTION, BECAUSE IT WAS NOT EVI= DENT BY LOOKING AT /etc/raidtab,=20 /proc/mdstat, etc., and it was done by my collaborator All structure of the raids, partitioning etc. was done using Yast2 with LVM= . The use of LVM is a mistery to me, even more than the basic of the RAID ( := -) ) The /etc/lvm/backup and archive directories are empty. In yast2 now the LVM panel is empty, and I have forbidden my collaborator t= o try to go through LVM now... Coming to other specific questions: >Sure you can reassemble the RAID, but what do you mean by "still >ok"? Have you read-tested those 2 drives? Have you tested the >*other* 18 drives? How do you know none of the other 18 drives got >damaged? Have you verified that only the host adapter electronics >failed or whatever it was that made those 2 drives drop out? Tested all drives, but not the host adapter electronics. >Why do you *need* to assume clean? If the 2 "lost" drives are >really ok, you just resync the array.=20 Well, following the post above, after checking that the lost drives are ok,= =20 first I stop the raid, then I create the raid with 20 drives assuming them = clean,=20 then I stop it again, then assemble it with resyncing. >If you *need* to assume >clean, it is likely that you have lost something like 5% of data >in (every stripe and thus) most files and directories (and >internal metadata) and will be replacing it with random >bytes. That will very likely cause XFS problems (the least of the >problems of course). On the /raidmd5 fortunately this was not the case. >Especially in a place where part of the everyday >activity is earthquake simulation... LOL you are right. > But apart from that, it is not as easy to backup 20 TB, >Or to 'fsck' several TB as you also discovered. Anyhow my opinion >is that the best way to backup large storage servers is another >large storage server (or more than one). When I buy a hard drive I >buy 3 backup drives for each "live" drive I use -- at *home*. At least now, we did at least that right. >Not at all absurd -- if those users *really* accept that. But you >are trying to recover the arrays instead of scratching them and >restarting. That suggests to me that the users did not actually >accept that. If the real agreement with the users is "you have to >keep backups, but if something happens you will behave as if you >cannot or don't want to restore them" it is quite different. Well. You would be surprised to know how stupid can scientist be when=20 they ignore the worst case scenario.=20 Including myself. I knew exactly the situation, but if I had not succeeded in recovering=20 /raid/md5, it would have been a hard moment for me and my research group. And we ALL knew that there were no backups. >That's not so clear. One problem with trying to provide some >opinions on your issue and whether the filesystems are recoverable >is that you haven't made clear what failed and how you tested each >component of each array to make sure that what is still working is >known (and talk of "assume clean" is very suspicious). Just to clarify: assume-clean was an option to the mdadm --create command when I discovered that my 20 devices were there and running: I run a dd com= mand reading the first megabytes of each device. Was this wrong? >That you have tried to run repair tools on a filesystem with an >incomplete storage layer may have made things rather worse, so >knowing *exactly* what has failed may help you a lot. I will contact the Sun service and ask them to check the whole storage-cont= roller part. In the meanwhile I am almost convinced that that 4-5 TB lost on /dev/md4 ar= e lost for good. I sent the metadata one week ago to the mailing list. Do you think this cou= ld help in examining the famous 20 drives? I hope I could catch up. I am trying to learn quickly. Thanks, Daniele From BATV+e647964f7e3a8370884a+2202+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 3 10:45:20 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83FitGk111768 for ; Thu, 3 Sep 2009 10:45:10 -0500 X-ASG-Debug-ID: 1251992752-428601590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 001B915C5907; Thu, 3 Sep 2009 08:45:52 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id oninTJ3GlojV60Oy; Thu, 03 Sep 2009 08:45:52 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MjEVU-0004zh-3t; Thu, 03 Sep 2009 15:45:52 +0000 Date: Thu, 3 Sep 2009 11:45:52 -0400 From: Christoph Hellwig To: Alex Elder Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Subject: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Message-ID: <20090903154551.GA16715@infradead.org> References: <20090827231558.057467775@bombadil.infradead.org> <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF3@cf--amer001e--3.americas.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF3@cf--amer001e--3.americas.sgi.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251992753 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean FYI: I found some nasty deadlock in this on a large machine, please hold back until I've sorted it out. From BATV+e647964f7e3a8370884a+2202+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 3 10:45:39 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83FjDCf111807 for ; Thu, 3 Sep 2009 10:45:29 -0500 X-ASG-Debug-ID: 1251992771-73c7034d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8561D4240DF for ; Thu, 3 Sep 2009 08:46:11 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id G4xMP3NhRTSWBdiJ for ; Thu, 03 Sep 2009 08:46:11 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MjEVn-000532-5N for xfs@oss.sgi.com; Thu, 03 Sep 2009 15:46:11 +0000 Date: Thu, 3 Sep 2009 11:46:11 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: use correct log reservation when handling ENOSPC in xfs_create Subject: Re: [PATCH] xfs: use correct log reservation when handling ENOSPC in xfs_create Message-ID: <20090903154611.GB16715@infradead.org> References: <20090826113736.GA15562@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090826113736.GA15562@infradead.org> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251992771 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean ping? On Wed, Aug 26, 2009 at 07:37:36AM -0400, Christoph Hellwig wrote: > We added the ENOSPC handling patch in xfs_create just after it got mered > with xfs_mkdir. Change the log reservation to the variable for either > the create or mkdir value so it does the right thing if get here for creating > a directory. > > Signed-off-by: Christoph Hellwig > > Index: xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- xfs.orig/fs/xfs/xfs_vnodeops.c 2009-08-24 11:35:52.794261954 -0300 > +++ xfs/fs/xfs/xfs_vnodeops.c 2009-08-24 11:36:25.466636450 -0300 > @@ -1479,8 +1479,8 @@ xfs_create( > if (error == ENOSPC) { > /* flush outstanding delalloc blocks and retry */ > xfs_flush_inodes(dp); > - error = xfs_trans_reserve(tp, resblks, XFS_CREATE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT); > + error = xfs_trans_reserve(tp, resblks, log_res, 0, > + XFS_TRANS_PERM_LOG_RES, log_count); > } > if (error == ENOSPC) { > /* No space at all so try a "no-allocation" reservation */ > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs ---end quoted text--- From BATV+e647964f7e3a8370884a+2202+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 3 10:51:16 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83FoptX112119 for ; Thu, 3 Sep 2009 10:51:06 -0500 X-ASG-Debug-ID: 1251993109-1877002d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 47DAF15C0EE2 for ; Thu, 3 Sep 2009 08:51:49 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 2eRd6SaI86FzSQP2 for ; Thu, 03 Sep 2009 08:51:49 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MjEYB-0005Lr-CZ; Thu, 03 Sep 2009 15:48:39 +0000 Date: Thu, 3 Sep 2009 11:48:39 -0400 From: Christoph Hellwig To: Jan Engelhardt Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Mounted xfs slows down block device Subject: Re: Mounted xfs slows down block device Message-ID: <20090903154839.GC16715@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251993109 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Strange, as XFS doesn't actually use the block device mapping at all, so all the caching doesn't interact with each other. Maybe some throtteling code in the VM doesn't like these parallel accesses. But I need to add that reading the block device on a mounted filesystem is not a good idea anyay - you will not get any sort of concistency guarantee. From aelder@sgi.com Thu Sep 3 11:38:21 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83Gc1pH114883 for ; Thu, 3 Sep 2009 11:38:11 -0500 Received: from cf--amer001e--3.americas.sgi.com (cf--amer001e--3.americas.sgi.com [137.38.100.5]) by relay2.corp.sgi.com (Postfix) with ESMTP id C3C37304093 for ; Thu, 3 Sep 2009 09:38:58 -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" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] xfs: use correct log reservation when handling ENOSPC inxfs_create Date: Thu, 3 Sep 2009 11:35:41 -0500 Message-ID: <1AB9A794DBDDF54A8A81BE2296F7BDFE83AC27@cf--amer001e--3.americas.sgi.com> In-Reply-To: <20090826113736.GA15562@infradead.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] xfs: use correct log reservation when handling ENOSPC inxfs_create Thread-Index: AcomRnnZKIyKPu1vSRyNGJjitvdkDQGbf54A From: "Alex Elder" To: "Christoph Hellwig" Cc: X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > We added the ENOSPC handling patch in xfs_create just after it got = mered > with xfs_mkdir. Change the log reservation to the variable for either > the create or mkdir value so it does the right thing if get here for = creating > a directory. >=20 > Signed-off-by: Christoph Hellwig >=20 > Index: xfs/fs/xfs/xfs_vnodeops.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- xfs.orig/fs/xfs/xfs_vnodeops.c 2009-08-24 11:35:52.794261954 -0300 > +++ xfs/fs/xfs/xfs_vnodeops.c 2009-08-24 11:36:25.466636450 -0300 > @@ -1479,8 +1479,8 @@ xfs_create( > if (error =3D=3D ENOSPC) { > /* flush outstanding delalloc blocks and retry */ > xfs_flush_inodes(dp); > - error =3D xfs_trans_reserve(tp, resblks, XFS_CREATE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT); > + error =3D xfs_trans_reserve(tp, resblks, log_res, 0, > + XFS_TRANS_PERM_LOG_RES, log_count); > } > if (error =3D=3D ENOSPC) { > /* No space at all so try a "no-allocation" reservation */ >=20 Looks good. Reviewed-by: Alex Elder From BATV+e647964f7e3a8370884a+2202+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 3 11:41:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83GfJAA115065 for ; Thu, 3 Sep 2009 11:41:34 -0500 X-ASG-Debug-ID: 1251996136-198f01830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE6F615C65BE for ; Thu, 3 Sep 2009 09:42:16 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id dEKeAjXvAKBQ1GPU for ; Thu, 03 Sep 2009 09:42:16 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MjFNx-0008Mg-WA; Thu, 03 Sep 2009 16:42:10 +0000 Date: Thu, 3 Sep 2009 12:42:09 -0400 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , Theodore Tso , Chris Mason , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: ext4 writepages is making tiny bios? Subject: Re: ext4 writepages is making tiny bios? Message-ID: <20090903164209.GA28384@infradead.org> References: <20090901184450.GB7885@think> <20090901205744.GE6996@mit.edu> <20090901212740.GA9930@infradead.org> <20090903055201.GA7146@discord.disaster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903055201.GA7146@discord.disaster> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1251996136 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 03, 2009 at 03:52:01PM +1000, Dave Chinner wrote: > > XFS did the mistake of trusting the VM, while everyone more or less > > overrode it. Removing all those checks and writing out much larger > > data fixes it with a relatively small patch: > > > > http://verein.lst.de/~hch/xfs/xfs-writeback-scaling > > Careful: > > - tloff = min(tlast, startpage->index + 64); > + tloff = min(tlast, startpage->index + 8192); > > That will cause 64k page machines to try to write back 512MB at a > time. This will re-introduce similar to the behaviour in sles9 where > writeback would only terminate at the end of an extent (because the > mapping end wasn't capped like above). Pretty good point, any applies to all the different things we discussed recently. Ted, should be maybe introduce a max_writeback_mb instead of the max_writeback_pages in the VM, too? From gwehrman@sgi.com Thu Sep 3 15:56:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n83KuB4a131539 for ; Thu, 3 Sep 2009 15:56:21 -0500 Received: from goalpost.americas.sgi.com (goalpost.americas.sgi.com [128.162.232.54]) by relay1.corp.sgi.com (Postfix) with ESMTP id E36E58F8049 for ; Thu, 3 Sep 2009 13:57:08 -0700 (PDT) Received: by goalpost.americas.sgi.com (Postfix, from userid 14442) id 9127F2526DDC; Thu, 3 Sep 2009 15:49:40 -0500 (CDT) Date: Thu, 3 Sep 2009 15:49:40 -0500 From: Geoffrey Wehrman To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH 00/14] repair memory usage reductions Message-ID: <20090903204940.GB24510@sgi.com> References: <20090902175531.469184575@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902175531.469184575@bombadil.infradead.org> User-Agent: Mutt/1.5.14 (2007-02-12) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Wed, Sep 02, 2009 at 01:55:31PM -0400, Christoph Hellwig wrote: | This is a respin of the patches Barry Naujok wrote at SGI for reducing | the memory usage in repair. I've split it up, fixed a few small bugs | and added two preparatory cleanups - but all the real work is Barry's. | There has been lots of heavy testing on large filesystems by Barry | on the original patches, and quite a lot of testing on slightly smaller | filesystems by me. These were all ad-hoc tests as XFSQA coverage is | rather low on repair. My plan is to add various additional testcase | for XFSQA both for intentional corruptions as well as reproducing past | reported bugs before we'll release these patches in xfsprogs. But I think | it would be good if we could get them into the development git tree to | get wider coverage already. How do these changes affect xfs_repair I/O performance? Barry changes were previously withheld within SGI due to a regression in performance. -- Geoffrey Wehrman 651-683-5496 gwehrman@sgi.com From tytso@mit.edu Thu Sep 3 19:15:51 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_35 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n840FVR9146860 for ; Thu, 3 Sep 2009 19:15:41 -0500 X-ASG-Debug-ID: 1252023360-325100330000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from thunker.thunk.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A0EF015CF0C5 for ; Thu, 3 Sep 2009 17:16:00 -0700 (PDT) Received: from thunker.thunk.org (THUNK.ORG [69.25.196.29]) by cuda.sgi.com with ESMTP id rr96niqx4lMLm397 for ; Thu, 03 Sep 2009 17:16:00 -0700 (PDT) Received: from root (helo=closure.thunk.org) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1MjMSx-0000iR-0B; Thu, 03 Sep 2009 20:15:47 -0400 Received: from tytso by closure.thunk.org with local (Exim 4.69) (envelope-from ) id 1MjMSw-0001AH-0I; Thu, 03 Sep 2009 20:15:46 -0400 Date: Thu, 3 Sep 2009 20:15:45 -0400 From: Theodore Tso To: Christoph Hellwig Cc: Dave Chinner , Chris Mason , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, Jens Axboe X-ASG-Orig-Subj: Re: ext4 writepages is making tiny bios? Subject: Re: ext4 writepages is making tiny bios? Message-ID: <20090904001545.GA30759@mit.edu> References: <20090901184450.GB7885@think> <20090901205744.GE6996@mit.edu> <20090901212740.GA9930@infradead.org> <20090903055201.GA7146@discord.disaster> <20090903164209.GA28384@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903164209.GA28384@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false X-Barracuda-Connect: THUNK.ORG[69.25.196.29] X-Barracuda-Start-Time: 1252023382 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8033 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 03, 2009 at 12:42:09PM -0400, Christoph Hellwig wrote: > > Careful: > > > > - tloff = min(tlast, startpage->index + 64); > > + tloff = min(tlast, startpage->index + 8192); > > > > That will cause 64k page machines to try to write back 512MB at a > > time. This will re-introduce similar to the behaviour in sles9 where > > writeback would only terminate at the end of an extent (because the > > mapping end wasn't capped like above). > > Pretty good point, any applies to all the different things we discussed > recently. Ted, should be maybe introduce a max_writeback_mb instead of > the max_writeback_pages in the VM, too? Good point. Jens, maybe we should replace my patch with this one, which makes the tunable in terms of megabytes instead of pages? - Ted commit ed48d661394a6b22e9d376a7ad5327c2b9080a9c Author: Theodore Ts'o Date: Tue Sep 1 13:19:06 2009 +0200 vm: Add an tuning knob for vm.max_writeback_mb Originally, MAX_WRITEBACK_PAGES was hard-coded to 1024 because of a concern of not holding I_SYNC for too long. (At least, that was the comment previously.) This doesn't make sense now because the only time we wait for I_SYNC is if we are calling sync or fsync, and in that case we need to write out all of the data anyway. Previously there may have been other code paths that waited on I_SYNC, but not any more. According to Christoph, the current writeback size is way too small, and XFS had a hack that bumped out nr_to_write to four times the value sent by the VM to be able to saturate medium-sized RAID arrays. This value was also problematic for ext4 as well, as it caused large files to be come interleaved on disk by in 8 megabyte chunks (we bumped up the nr_to_write by a factor of two). So, in this patch, we make the MAX_WRITEBACK_PAGES a tunable, max_writeback_mb, and set it to a default value of 128 megabytes. http://bugzilla.kernel.org/show_bug.cgi?id=13930 Signed-off-by: "Theodore Ts'o" diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 38cb758..a9b230f 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -585,14 +585,7 @@ void generic_sync_bdi_inodes(struct writeback_control *wbc) generic_sync_wb_inodes(&bdi->wb, wbc); } -/* - * The maximum number of pages to writeout in a single bdi flush/kupdate - * operation. We do this so we don't hold I_SYNC against an inode for - * enormous amounts of time, which would block a userspace task which has - * been forced to throttle against that inode. Also, the code reevaluates - * the dirty each time it has written this many pages. - */ -#define MAX_WRITEBACK_PAGES 1024 +#define MAX_WRITEBACK_PAGES (max_writeback_mb << (20 - PAGE_SHIFT)) static inline bool over_bground_thresh(void) { diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 34c59f9..57cd3b5 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -103,6 +103,7 @@ extern int vm_dirty_ratio; extern unsigned long vm_dirty_bytes; extern unsigned int dirty_writeback_interval; extern unsigned int dirty_expire_interval; +extern unsigned int max_writeback_mb; extern int vm_highmem_is_dirtyable; extern int block_dump; extern int laptop_mode; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 58be760..315fc30 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1104,6 +1104,14 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { + .ctl_name = CTL_UNNUMBERED, + .procname = "max_writeback_mb", + .data = &max_writeback_mb, + .maxlen = sizeof(max_writeback_mb), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = VM_NR_PDFLUSH_THREADS, .procname = "nr_pdflush_threads", .data = &nr_pdflush_threads, diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 0fce7df..77decaa 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -55,6 +55,12 @@ static inline long sync_writeback_pages(void) /* The following parameters are exported via /proc/sys/vm */ /* + * The maximum amount of memory (in megabytes) to write out in a + * single bdflush/kupdate operation. + */ +unsigned int max_writeback_mb = 128; + +/* * Start background writeback (via pdflush) at this percentage */ int dirty_background_ratio = 10; From greg@kroah.com Thu Sep 3 19:58:07 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_34 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n840vlM1150210 for ; Thu, 3 Sep 2009 19:57:57 -0500 X-ASG-Debug-ID: 1252025917-7b5d01940000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5741F426D1F for ; Thu, 3 Sep 2009 17:58:37 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id uGaiTCt0zvcflikY for ; Thu, 03 Sep 2009 17:58:37 -0700 (PDT) Received: from localhost (c-98-246-45-209.hsd1.or.comcast.net [98.246.45.209]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id 689704825E; Thu, 3 Sep 2009 15:27:33 -0700 (PDT) Date: Thu, 3 Sep 2009 15:19:58 -0700 From: Greg KH To: Christoph Hellwig Cc: stable@kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [stable] [PATCH 0/4] 2.6.30-stable backport of the XFS+NFSD inode cache race fix Subject: Re: [stable] [PATCH 0/4] 2.6.30-stable backport of the XFS+NFSD inode cache race fix Message-ID: <20090903221958.GC23517@kroah.com> References: <20090819184258.542698202@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090819184258.542698202@bombadil.infradead.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Barracuda-Connect: kroah.org[198.145.64.141] X-Barracuda-Start-Time: 1252025921 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8037 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Wed, Aug 19, 2009 at 02:42:58PM -0400, Christoph Hellwig wrote: > > This is a backport of the fix for the XFS inode cache races lots of people > have reported. The context for the two VFS patches changed quite a bit from > 2.6.30 to 2.6.31-rc so I consider these backports. The backport has been > tested by me with xfstest for XFS and extN, and by lots of users that have > been waiting for the fix for their nfs servers still running 2.6.30. All queued up, thanks. greg k-h From bnaujok@optusnet.com.au Thu Sep 3 21:24:02 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n842Nfws156062 for ; Thu, 3 Sep 2009 21:23:52 -0500 X-ASG-Debug-ID: 1252031072-77cf03720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail04.syd.optusnet.com.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 18A02426F8C; Thu, 3 Sep 2009 19:24:32 -0700 (PDT) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by cuda.sgi.com with ESMTP id cZBVbpTnMLneUynq; Thu, 03 Sep 2009 19:24:32 -0700 (PDT) Received: from localhost.localdomain (webmail08.syd.optusnet.com.au [211.29.133.113]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n842OHYo023675; Fri, 4 Sep 2009 12:24:17 +1000 Message-Id: <200909040224.n842OHYo023675@mail04.syd.optusnet.com.au> Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary Mime-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) Received: from 203-206-165-193.perm.iinet.net.au ([203.206.165.193]) by webmail08.syd.optusnet.com.au with http (user=bnaujok@optusnet.com.au); Fri, 04 Sep 2009 12:24:17 +1000 From: Barry Naujok To: Geoffrey Wehrman Cc: Christoph Hellwig , xfs@oss.sgi.com Date: Fri, 04 Sep 2009 12:24:17 +1000 X-ASG-Orig-Subj: Re: Re: [PATCH 00/14] repair memory usage reductions Subject: Re: Re: [PATCH 00/14] repair memory usage reductions X-Barracuda-Connect: mail04.syd.optusnet.com.au[211.29.132.185] X-Barracuda-Start-Time: 1252031079 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.53 X-Barracuda-Spam-Status: No, SCORE=-0.53 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MSGID_FROM_MTA_HEADER, MSGID_FROM_MTA_HEADER_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8043 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MSGID_FROM_MTA_HEADER Message-Id was added by a relay 1.50 MSGID_FROM_MTA_HEADER_2 Message-Id was added by a relay X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Geoffrey Wehrman wrote: > > On Wed, Sep 02, 2009 at 01:55:31PM -0400, Christoph Hellwig wrote: > | This is a respin of the patches Barry Naujok wrote at SGI for reducing > | the memory usage in repair. I've split it up, fixed a few small bugs > | and added two preparatory cleanups - but all the real work is Barry's. > | There has been lots of heavy testing on large filesystems by Barry > | on the original patches, and quite a lot of testing on slightly > smaller > | filesystems by me. These were all ad-hoc tests as XFSQA coverage is > | rather low on repair. My plan is to add various additional testcase > | for XFSQA both for intentional corruptions as well as reproducing past > | reported bugs before we'll release these patches in xfsprogs. But I > think > | it would be good if we could get them into the development git tree to > | get wider coverage already. > > How do these changes affect xfs_repair I/O performance? Barry changes > were previously withheld within SGI due to a regression in performance. They were withheld? First I've heard about that. I spent a lot of time on those changes to minimize the performance impact, and with increasing xfs_repair's cache size, can actually be faster now depending on the system's RAM and filesystem size. And it's certainly faster than xfs_repair before my performance optimisation changes. Barry. From SRS0+7RX2+1+fromorbit.com=david@internode.on.net Thu Sep 3 21:57:49 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n842vTbQ158463 for ; Thu, 3 Sep 2009 21:57:39 -0500 X-ASG-Debug-ID: 1252033084-3ace004b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 775C915CFEFC for ; Thu, 3 Sep 2009 19:58:05 -0700 (PDT) Received: from mail.internode.on.net (bld-mail16.adl2.internode.on.net [150.101.137.101]) by cuda.sgi.com with ESMTP id hPG62UB754eENMMd for ; Thu, 03 Sep 2009 19:58:05 -0700 (PDT) Received: from discord (unverified [121.44.12.22]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 4673549-1927428 for multiple; Fri, 04 Sep 2009 12:27:55 +0930 (CST) Received: from dave by discord with local (Exim 4.69) (envelope-from ) id 1MjOzp-0007vO-PZ; Fri, 04 Sep 2009 12:57:53 +1000 Date: Fri, 4 Sep 2009 12:57:53 +1000 From: Dave Chinner To: Geoffrey Wehrman Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/14] repair memory usage reductions Subject: Re: [PATCH 00/14] repair memory usage reductions Message-ID: <20090904025753.GB7146@discord.disaster> References: <20090902175531.469184575@bombadil.infradead.org> <20090903204940.GB24510@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903204940.GB24510@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: bld-mail16.adl2.internode.on.net[150.101.137.101] X-Barracuda-Start-Time: 1252033106 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC5_SA210e X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8045 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC5_SA210e Custom Rule SA210e X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 03, 2009 at 03:49:40PM -0500, Geoffrey Wehrman wrote: > On Wed, Sep 02, 2009 at 01:55:31PM -0400, Christoph Hellwig wrote: > | This is a respin of the patches Barry Naujok wrote at SGI for reducing > | the memory usage in repair. I've split it up, fixed a few small bugs > | and added two preparatory cleanups - but all the real work is Barry's. > | There has been lots of heavy testing on large filesystems by Barry > | on the original patches, and quite a lot of testing on slightly smaller > | filesystems by me. These were all ad-hoc tests as XFSQA coverage is > | rather low on repair. My plan is to add various additional testcase > | for XFSQA both for intentional corruptions as well as reproducing past > | reported bugs before we'll release these patches in xfsprogs. But I think > | it would be good if we could get them into the development git tree to > | get wider coverage already. > > How do these changes affect xfs_repair I/O performance? Barry changes > were previously withheld within SGI due to a regression in performance. Christoph asked me to repeat what I said on #xfs w.r.t the regression. The repair slowdowns were a result of increased CPU usage of the btree structures used to track free space compared to manipulating massive bitmaps. Hence if you have a disk subsystem fast enough that prefetching could keep the CPUs 100% busy processing all the incoming metadata the memory-optimised repair was about 30% slower than the existing repair code. However, given that getting to being CPU bound with the current repair code requires having a *lot* of memory, so the more common case is that you have to add gigabytes of swap space so that repair can run. In these situations, the current repair will run much, much slower than the memory optimised repair because the new version does not have to swap. Indeed, I recall one of the driving factors for this work was the SGI customer that needed to connect their 300TB (or was it 600TB?) XFS filesystem to an Altix with 2TB of RAM to be able to repair it because the server head connected to the filesystem did not have 2TB of storage available to assign as swap space. That is, XFS scalability is limited by the amount of memory needed by repair.... Another mitigating factor is that the worst regressions were on ia64, for which bitmap manipulation is far more friendly than branchy, cache-miss causing btree traversals. Hence the regression will be less (maybe even not present) on current x86-64 CPUs which handle branches and cache misses far, far better than Altix/ia64.... With that in mind, I think the memory usage optimisation is far more important to the majority of XFS users than the CPU usage regression it causes as the majority of users don't have RAM-rich environments to run repair in. Cheers, Dave. -- Dave Chinner david@fromorbit.com From axboe@kernel.dk Fri Sep 4 02:19:45 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n847JO1r183045 for ; Fri, 4 Sep 2009 02:19:35 -0500 X-ASG-Debug-ID: 1252048816-1ba501590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from kernel.dk (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7C72A427849 for ; Fri, 4 Sep 2009 00:20:16 -0700 (PDT) Received: from kernel.dk (brick.kernel.dk [93.163.65.50]) by cuda.sgi.com with ESMTP id Nx0WC8pNEZFjnNh0 for ; Fri, 04 Sep 2009 00:20:16 -0700 (PDT) Received: by kernel.dk (Postfix, from userid 1000) id B625C37A0C7; Fri, 4 Sep 2009 09:20:13 +0200 (CEST) Date: Fri, 4 Sep 2009 09:20:13 +0200 From: Jens Axboe To: Theodore Tso Cc: Christoph Hellwig , Dave Chinner , Chris Mason , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: ext4 writepages is making tiny bios? Subject: Re: ext4 writepages is making tiny bios? Message-ID: <20090904072013.GR18599@kernel.dk> References: <20090901184450.GB7885@think> <20090901205744.GE6996@mit.edu> <20090901212740.GA9930@infradead.org> <20090903055201.GA7146@discord.disaster> <20090903164209.GA28384@infradead.org> <20090904001545.GA30759@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090904001545.GA30759@mit.edu> X-Barracuda-Connect: brick.kernel.dk[93.163.65.50] X-Barracuda-Start-Time: 1252048819 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8063 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 03 2009, Theodore Tso wrote: > On Thu, Sep 03, 2009 at 12:42:09PM -0400, Christoph Hellwig wrote: > > > Careful: > > > > > > - tloff = min(tlast, startpage->index + 64); > > > + tloff = min(tlast, startpage->index + 8192); > > > > > > That will cause 64k page machines to try to write back 512MB at a > > > time. This will re-introduce similar to the behaviour in sles9 where > > > writeback would only terminate at the end of an extent (because the > > > mapping end wasn't capped like above). > > > > Pretty good point, any applies to all the different things we discussed > > recently. Ted, should be maybe introduce a max_writeback_mb instead of > > the max_writeback_pages in the VM, too? > > Good point. > > Jens, maybe we should replace my patch with this one, which makes the > tunable in terms of megabytes instead of pages? That is probably a better metric than 'pages', lets update it. -- Jens Axboe From andi@firstfloor.org Fri Sep 4 06:08:25 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84B85uF202182 for ; Fri, 4 Sep 2009 06:08:15 -0500 X-ASG-Debug-ID: 1252062511-5c8e013e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from one.firstfloor.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 93B69428774 for ; Fri, 4 Sep 2009 04:08:31 -0700 (PDT) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by cuda.sgi.com with ESMTP id 6nD9mk7I7mNiIYbc for ; Fri, 04 Sep 2009 04:08:31 -0700 (PDT) Received: from basil.firstfloor.org (p5B3CB6DD.dip0.t-ipconnect.de [91.60.182.221]) by one.firstfloor.org (Postfix) with ESMTP id AD7821F0800E; Fri, 4 Sep 2009 13:08:25 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 37A1CB16FF; Fri, 4 Sep 2009 13:08:25 +0200 (CEST) To: pg_xf2@xf2.to.sabi.co.UK (Peter Grandi) Cc: Linux XFS X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss From: Andi Kleen References: <4A975A35.3060809@sandeen.net> <4A981133.6060009@sandeen.net> <19101.5976.387292.614270@tree.ty.sabi.co.uk> Date: Fri, 04 Sep 2009 13:08:25 +0200 In-Reply-To: <19101.5976.387292.614270@tree.ty.sabi.co.uk> (Peter Grandi's message of "Tue, 1 Sep 2009 12:45:12 +0000") Message-ID: <87tyzjufva.fsf@basil.nowhere.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Barracuda-Connect: one.firstfloor.org[213.235.205.2] X-Barracuda-Start-Time: 1252062539 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8075 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean pg_xf2@xf2.to.sabi.co.UK (Peter Grandi) writes: > > Depends -- some people here are XFS salesmen, in that their career > and employability depend at least in part on widespread adoption > of XFS, and on support from other kernel subsystem guys, who may > be one day on an interview panel (the guild of Linux kernel > hackers is a pretty small and closed world in practice). These are > sell-side engineers, and they will be smooth and emollient even in > the face of outrageously ridiculous stuff. The main thing that seems `outrageously ridiculous' is your cynical and totally unfair and in my experience incorrect description of the people who are doing great work on XFS and unlike you actually helping users on this mailing list and improving Linux. -Andi From Daniele.Passerone@empa.ch Fri Sep 4 06:45:28 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84Bj3eJ204182 for ; Fri, 4 Sep 2009 06:45:18 -0500 X-ASG-Debug-ID: 1252064755-0e7d00fd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.empa.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1AA2A1D68214 for ; Fri, 4 Sep 2009 04:45:55 -0700 (PDT) Received: from mx1.empa.ch (mx1.empa.ch [152.88.7.31]) by cuda.sgi.com with ESMTP id fUXphFPBvKP8bkGP for ; Fri, 04 Sep 2009 04:45:55 -0700 (PDT) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (localhost [127.0.0.1]) by mx1.empa.ch (Spam & Virus Firewall) with ESMTP id E010BD5FE1 for ; Fri, 4 Sep 2009 13:45:54 +0200 (CEST) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (eaw-exc-hub1.emp-eaw.ch [152.88.5.116]) by mx1.empa.ch with ESMTP id HsDkvChiYVU24MP7 for ; Fri, 04 Sep 2009 13:45:54 +0200 (CEST) Received: from DU-Exc-Mail.empa.emp-eaw.ch ([fe80::bc9b:a2a9:e3fb:5e94]) by eaw-exc-hub1.eawag.wroot.emp-eaw.ch ([2002:9858:574::9858:574]) with mapi; Fri, 4 Sep 2009 13:45:54 +0200 From: "Passerone, Daniele" To: "xfs@oss.sgi.com" Date: Fri, 4 Sep 2009 13:45:53 +0200 X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss Thread-Topic: Re: xfs data loss Thread-Index: AcotVUHk47j4TfaOStmYMe0NogtfMg== Message-ID: Accept-Language: it-IT, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: it-IT, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: mx1.empa.ch[152.88.7.31] X-Barracuda-Start-Time: 1252064758 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0618 1.0000 -1.6259 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.63 X-Barracuda-Spam-Status: No, SCORE=-1.63 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8077 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Commenting further on my preceding message, I just would like to stress the= fact that everybody here has tried to help - xfs and not-xfs people. So I = have seen no emollient answers here, at least not to my query. Mr. Peter Grandi was harsh - very harsh at the beginning, but I think he a= lso spent time to think about my problem. For that I am grateful. I am less grateful for being defined "outraugeously ridicolous". But I can = skip that in times of trouble... Daniele From gwehrman@sgi.com Fri Sep 4 08:46:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84DkA98211688 for ; Fri, 4 Sep 2009 08:46:21 -0500 Received: from goalpost.americas.sgi.com (goalpost.americas.sgi.com [128.162.232.54]) by relay2.corp.sgi.com (Postfix) with ESMTP id EAA65304064 for ; Fri, 4 Sep 2009 06:47:08 -0700 (PDT) Received: by goalpost.americas.sgi.com (Postfix, from userid 14442) id 6169E2526DDE; Fri, 4 Sep 2009 08:37:37 -0500 (CDT) Date: Fri, 4 Sep 2009 08:37:37 -0500 From: Geoffrey Wehrman To: Dave Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 00/14] repair memory usage reductions Message-ID: <20090904133737.GD12052@sgi.com> References: <20090902175531.469184575@bombadil.infradead.org> <20090903204940.GB24510@sgi.com> <20090904025753.GB7146@discord.disaster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090904025753.GB7146@discord.disaster> User-Agent: Mutt/1.5.14 (2007-02-12) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Sep 04, 2009 at 12:57:53PM +1000, Dave Chinner wrote: | Christoph asked me to repeat what I said on #xfs w.r.t the regression. Thank you for the detailed description. All I had was a statement from January 2008, "Barry has completed the memory optimization, but initial testing shows that performance has regressed." That was the last update recorded on Barry's work. | With that in mind, I think the memory usage optimisation is far more | important to the majority of XFS users than the CPU usage regression | it causes as the majority of users don't have RAM-rich environments | to run repair in. I agree. -- Geoffrey Wehrman 651-683-5496 gwehrman@sgi.com From BATV+e49c75e08a496b1b2e4f+2203+infradead.org+hch@bombadil.srs.infradead.org Fri Sep 4 09:53:52 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84ErPCh216643 for ; Fri, 4 Sep 2009 09:53:42 -0500 X-ASG-Debug-ID: 1252076063-738e02950000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7B0D1429773; Fri, 4 Sep 2009 07:54:23 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id ObPMo6K6OskN6uwm; Fri, 04 Sep 2009 07:54:23 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Mja85-0002mD-Dv; Fri, 04 Sep 2009 14:51:09 +0000 Date: Fri, 4 Sep 2009 10:51:09 -0400 From: Christoph Hellwig To: Geoffrey Wehrman Cc: Dave Chinner , Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/14] repair memory usage reductions Subject: Re: [PATCH 00/14] repair memory usage reductions Message-ID: <20090904145109.GA8351@infradead.org> References: <20090902175531.469184575@bombadil.infradead.org> <20090903204940.GB24510@sgi.com> <20090904025753.GB7146@discord.disaster> <20090904133737.GD12052@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090904133737.GD12052@sgi.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252076063 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Sep 04, 2009 at 08:37:37AM -0500, Geoffrey Wehrman wrote: > On Fri, Sep 04, 2009 at 12:57:53PM +1000, Dave Chinner wrote: > | Christoph asked me to repeat what I said on #xfs w.r.t the regression. > > Thank you for the detailed description. All I had was a statement from > January 2008, "Barry has completed the memory optimization, but initial > testing shows that performance has regressed." That was the last update > recorded on Barry's work. > > | With that in mind, I think the memory usage optimisation is far more > | important to the majority of XFS users than the CPU usage regression > | it causes as the majority of users don't have RAM-rich environments > | to run repair in. > > I agree. In my testing I haven't seen big differences in performance, it sometimes got a bit faster and sometimes a bit slower. I will send out a more detailed performace report in a few days. From pelerdin@gardner-webb.edu Fri Sep 4 10:04:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84F4Mbw217253 for ; Fri, 4 Sep 2009 10:04:34 -0500 X-ASG-Debug-ID: 1252076707-408401a20000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bay0-omc3-s22.bay0.hotmail.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 49E9E1D68EEA for ; Fri, 4 Sep 2009 08:05:07 -0700 (PDT) Received: from bay0-omc3-s22.bay0.hotmail.com (bay0-omc3-s22.bay0.hotmail.com [65.54.246.222]) by cuda.sgi.com with ESMTP id 5P3Beb2sdKwULGmS for ; Fri, 04 Sep 2009 08:05:07 -0700 (PDT) Received: from BL2PRD0102HT006.prod.exchangelabs.com ([65.55.174.125]) by bay0-omc3-s22.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Sep 2009 08:04:45 -0700 Received: from BL2PRD0102MB008.prod.exchangelabs.com ([169.254.14.67]) by BL2PRD0102HT006.prod.exchangelabs.com ([169.254.95.89]) with mapi; Fri, 4 Sep 2009 15:04:36 +0000 From: Patrick James Elerding To: "info@webservice.com" X-ASG-Orig-Subj: Web Service, Subject: Web Service, Thread-Topic: Web Service, Thread-Index: AcotcQOD7GT2Tl1HTgOBeMe4hwM0iA== Date: Fri, 4 Sep 2009 15:04:34 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_DEF75BDFECE5B249B3678C41B7B4EDD22EFC8C36BL2PRD0102MB008_" MIME-Version: 1.0 X-OriginalArrivalTime: 04 Sep 2009 15:04:45.0753 (UTC) FILETIME=[0A1A4A90:01CA2D71] X-Barracuda-Connect: bay0-omc3-s22.bay0.hotmail.com[65.54.246.222] X-Barracuda-Start-Time: 1252076714 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8091 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --_000_DEF75BDFECE5B249B3678C41B7B4EDD22EFC8C36BL2PRD0102MB008_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Web Service, You have exceeded the limit of your mailbox set by your Web service, and you will be having problems in sending and recieving mails. To prevent this, please click on the link below to reset your account. http://fd8.formdesk.com/webservice/form1 Failure to do this, will result in limited access to your mailbox. Warning!!! Do not send your username and password via email. Regards, Web Service. --_000_DEF75BDFECE5B249B3678C41B7B4EDD22EFC8C36BL2PRD0102MB008_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Web Service,
You have exceeded the limit of your mailbox set by your Web
service, and you will be having problems in sending and recieving mails. To prevent this, please click on the link below to reset your account.
Failure to do this, will result in limited access to your mailbox.
Warning!!! Do not send your username and password via email.
Regards,
Web Service.
--_000_DEF75BDFECE5B249B3678C41B7B4EDD22EFC8C36BL2PRD0102MB008_-- From michael.monnerie@is.it-management.at Fri Sep 4 12:26:12 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84HPo1f225931 for ; Fri, 4 Sep 2009 12:26:01 -0500 X-ASG-Debug-ID: 1252085181-351d00460000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F20F042A3CF for ; Fri, 4 Sep 2009 10:26:21 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id AqPWFdWAtapbA9kd for ; Fri, 04 Sep 2009 10:26:21 -0700 (PDT) Received: from mailsrv.i.zmi.at (h081217106033.dyn.cm.kabsi.at [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id 90A736CF for ; Fri, 4 Sep 2009 19:25:45 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id E0FB840015E for ; Fri, 4 Sep 2009 19:25:45 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/14] repair memory usage reductions Subject: Re: [PATCH 00/14] repair memory usage reductions Date: Fri, 4 Sep 2009 19:24:35 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: <20090902175531.469184575@bombadil.infradead.org> <20090904133737.GD12052@sgi.com> <20090904145109.GA8351@infradead.org> In-Reply-To: <20090904145109.GA8351@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200909041924.35987@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1252085201 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8101 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Freitag 04 September 2009 Christoph Hellwig wrote: > In my testing I haven't seen big differences in performance, it > sometimes got a bit faster and sometimes a bit slower. =A0I will send > out a more detailed performace report in a few days. =46rom what I've read, it should be faster on a machine with 2GB RAM and=20 10TB storage, while it's maybe slower on a 64GB RAM machine with a 1TB=20 xfs storage. Given that disks grow faster than RAM sizes, and that with=20 virtualization a single machine typically has not too much RAM these=20 days, I guess with the patches speed will improve overall. mfg zmi =2D-=20 // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From sandeen@sandeen.net Fri Sep 4 17:35:15 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, J_CHICKENPOX_74,J_CHICKENPOX_84 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84MYtZ7246830 for ; Fri, 4 Sep 2009 17:35:05 -0500 X-ASG-Debug-ID: 1252103740-3bd003560000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E82FB42B84F for ; Fri, 4 Sep 2009 15:35:40 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id D3x8zZYtZCmmAfIx for ; Fri, 04 Sep 2009 15:35:40 -0700 (PDT) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n84MZdGX025638 for ; Fri, 4 Sep 2009 18:35:39 -0400 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n84MZcZA009199 for ; Fri, 4 Sep 2009 18:35:38 -0400 Message-ID: <4AA19639.6090208@sandeen.net> Date: Fri, 04 Sep 2009 17:35:37 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: xfs mailing list X-ASG-Orig-Subj: [PATCH] xfsprogs: mark some functions as noreturn Subject: [PATCH] xfsprogs: mark some functions as noreturn Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1252103745 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8121 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Static checkers are a lot less noisy if they know certain functions are noreturn. Making this change removed about 50 errors from "clang" output. (http://clang-analyzer.llvm.org) output. Signed-off-by: Eric Sandeen --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 69d91c5..ab8a7d9 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -27,7 +27,7 @@ */ static void conflict(char opt, char *tab[], int oldidx, int newidx); static void illegal(char *value, char *opt); -static void reqval(char opt, char *tab[], int idx); +static __attribute__((noreturn)) void reqval(char opt, char *tab[], int idx); static void respec(char opt, char *tab[], int idx); static void unknown(char opt, char *s); static int ispow2(unsigned int i); @@ -2464,7 +2464,7 @@ ispow2( return (i & (i - 1)) == 0; } -static void +static void __attribute__((noreturn)) reqval( char opt, char *tab[], diff --git a/repair/err_protos.h b/repair/err_protos.h index 556e9b9..6944950 100644 --- a/repair/err_protos.h +++ b/repair/err_protos.h @@ -16,7 +16,11 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -void do_abort(char const *, ...); /* abort, internal error */ -void do_error(char const *, ...); /* abort, system error */ -void do_warn(char const *, ...); /* issue warning */ -void do_log(char const *, ...); /* issue log message */ +/* abort, internal error */ +void __attribute__((noreturn)) do_abort(char const *, ...); +/* abort, system error */ +void __attribute__((noreturn)) do_error(char const *, ...); +/* issue warning */ +void do_warn(char const *, ...); +/* issue log message */ +void do_log(char const *, ...); diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index e9e5965..5dfc3c3 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -351,7 +351,7 @@ do_msg(int do_abort, char const *msg, va_list args) } } -void +void __attribute__((noreturn)) do_error(char const *msg, ...) { va_list args; @@ -366,7 +366,7 @@ do_error(char const *msg, ...) * like do_error, only the error is internal, no system * error so no oserror processing */ -void +void __attribute__((noreturn)) do_abort(char const *msg, ...) { va_list args; From BATV+e49c75e08a496b1b2e4f+2203+infradead.org+hch@bombadil.srs.infradead.org Fri Sep 4 18:08:35 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n84N8AQ4248898 for ; Fri, 4 Sep 2009 18:08:25 -0500 X-ASG-Debug-ID: 1252105745-66ff00360000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AA72A15DFCE2 for ; Fri, 4 Sep 2009 16:09:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id DA75Dzvgw6cHJE6X for ; Fri, 04 Sep 2009 16:09:05 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Mjhtw-0006vI-Pv; Fri, 04 Sep 2009 23:09:04 +0000 Date: Fri, 4 Sep 2009 19:09:04 -0400 From: Christoph Hellwig To: Eric Sandeen Cc: xfs mailing list X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: mark some functions as noreturn Subject: Re: [PATCH] xfsprogs: mark some functions as noreturn Message-ID: <20090904230904.GA25934@infradead.org> References: <4AA19639.6090208@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA19639.6090208@sandeen.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252105745 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Sep 04, 2009 at 05:35:37PM -0500, Eric Sandeen wrote: > Static checkers are a lot less noisy if they know certain > functions are noreturn. > > Making this change removed about 50 errors from "clang" output. > (http://clang-analyzer.llvm.org) output. Not pretty but useful, Reviewed-by: Christoph Hellwig > -void do_abort(char const *, ...); /* abort, internal error */ > -void do_error(char const *, ...); /* abort, system error */ > -void do_warn(char const *, ...); /* issue warning */ > -void do_log(char const *, ...); /* issue log message */ > +/* abort, internal error */ > +void __attribute__((noreturn)) do_abort(char const *, ...); > +/* abort, system error */ > +void __attribute__((noreturn)) do_error(char const *, ...); > +/* issue warning */ > +void do_warn(char const *, ...); > +/* issue log message */ > +void do_log(char const *, ...); It would be good to add the proper printflike attributes to these to also get vararg typechecking. From greg@kroah.com Fri Sep 4 19:21:07 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_46 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n850KlBI253849 for ; Fri, 4 Sep 2009 19:20:57 -0500 X-ASG-Debug-ID: 1252110079-67f801990000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2D5BE42BEC7 for ; Fri, 4 Sep 2009 17:21:19 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id FqRHC31OShnAbn0g for ; Fri, 04 Sep 2009 17:21:19 -0700 (PDT) Received: from localhost (c-98-246-45-209.hsd1.or.comcast.net [98.246.45.209]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id A3D6149102; Fri, 4 Sep 2009 17:21:18 -0700 (PDT) X-Mailbox-Line: From gregkh@mini.kroah.org Fri Sep 4 17:14:55 2009 Message-Id: <20090905001455.221274331@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 04 Sep 2009 17:14:26 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, xfs@oss.sgi.com, Christoph Hellwig X-ASG-Orig-Subj: [patch 51/71] vfs: fix inode_init_always calling convention Subject: [patch 51/71] vfs: fix inode_init_always calling convention References: <20090905001335.106974681@mini.kroah.org> Content-Disposition: inline; filename=vfs-fix-inode_init_always-calling-convention.patch Lines: 144 In-Reply-To: <20090905001824.GA18171@kroah.com> X-Barracuda-Connect: kroah.org[198.145.64.141] X-Barracuda-Start-Time: 1252110102 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8129 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Christoph Hellwig backport of upstream commit 54e346215e4fe2ca8c94c54e546cc61902060510 Currently inode_init_always calls into ->destroy_inode if the additional initialization fails. That's not only counter-intuitive because inode_init_always did not allocate the inode structure, but in case of XFS it's actively harmful as ->destroy_inode might delete the inode from a radix-tree that has never been added. This in turn might end up deleting the inode for the same inum that has been instanciated by another process and cause lots of cause subtile problems. Also in the case of re-initializing a reclaimable inode in XFS it would free an inode we still want to keep alive. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen Signed-off-by: Greg Kroah-Hartman --- fs/inode.c | 30 +++++++++++++++++------------- fs/xfs/xfs_iget.c | 17 +++++------------ include/linux/fs.h | 2 +- 3 files changed, 23 insertions(+), 26 deletions(-) --- a/fs/inode.c +++ b/fs/inode.c @@ -118,12 +118,11 @@ static void wake_up_inode(struct inode * * These are initializations that need to be done on every inode * allocation as the fields are not initialised by slab allocation. */ -struct inode *inode_init_always(struct super_block *sb, struct inode *inode) +int inode_init_always(struct super_block *sb, struct inode *inode) { static const struct address_space_operations empty_aops; static struct inode_operations empty_iops; static const struct file_operations empty_fops; - struct address_space *const mapping = &inode->i_data; inode->i_sb = sb; @@ -150,7 +149,7 @@ struct inode *inode_init_always(struct s inode->dirtied_when = 0; if (security_inode_alloc(inode)) - goto out_free_inode; + goto out; /* allocate and initialize an i_integrity */ if (ima_inode_alloc(inode)) @@ -189,16 +188,12 @@ struct inode *inode_init_always(struct s inode->i_private = NULL; inode->i_mapping = mapping; - return inode; + return 0; out_free_security: security_inode_free(inode); -out_free_inode: - if (inode->i_sb->s_op->destroy_inode) - inode->i_sb->s_op->destroy_inode(inode); - else - kmem_cache_free(inode_cachep, (inode)); - return NULL; +out: + return -ENOMEM; } EXPORT_SYMBOL(inode_init_always); @@ -211,9 +206,18 @@ static struct inode *alloc_inode(struct else inode = kmem_cache_alloc(inode_cachep, GFP_KERNEL); - if (inode) - return inode_init_always(sb, inode); - return NULL; + if (!inode) + return NULL; + + if (unlikely(inode_init_always(sb, inode))) { + if (inode->i_sb->s_op->destroy_inode) + inode->i_sb->s_op->destroy_inode(inode); + else + kmem_cache_free(inode_cachep, inode); + return NULL; + } + + return inode; } void destroy_inode(struct inode *inode) --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -63,6 +63,10 @@ xfs_inode_alloc( ip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP); if (!ip) return NULL; + if (inode_init_always(mp->m_super, VFS_I(ip))) { + kmem_zone_free(xfs_inode_zone, ip); + return NULL; + } ASSERT(atomic_read(&ip->i_iocount) == 0); ASSERT(atomic_read(&ip->i_pincount) == 0); @@ -104,17 +108,6 @@ xfs_inode_alloc( #ifdef XFS_DIR2_TRACE ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS); #endif - /* - * Now initialise the VFS inode. We do this after the xfs_inode - * initialisation as internal failures will result in ->destroy_inode - * being called and that will pass down through the reclaim path and - * free the XFS inode. This path requires the XFS inode to already be - * initialised. Hence if this call fails, the xfs_inode has already - * been freed and we should not reference it at all in the error - * handling. - */ - if (!inode_init_always(mp->m_super, VFS_I(ip))) - return NULL; /* prevent anyone from using this yet */ VFS_I(ip)->i_state = I_NEW|I_LOCK; @@ -166,7 +159,7 @@ xfs_iget_cache_hit( * errors cleanly, then tag it so it can be set up correctly * later. */ - if (!inode_init_always(mp->m_super, VFS_I(ip))) { + if (inode_init_always(mp->m_super, VFS_I(ip))) { error = ENOMEM; goto out_error; } --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2135,7 +2135,7 @@ extern loff_t default_llseek(struct file extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); -extern struct inode * inode_init_always(struct super_block *, struct inode *); +extern int inode_init_always(struct super_block *, struct inode *); extern void inode_init_once(struct inode *); extern void inode_add_to_lists(struct super_block *, struct inode *); extern void iput(struct inode *); From greg@kroah.com Fri Sep 4 19:21:10 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n850KoMZ253853 for ; Fri, 4 Sep 2009 19:21:00 -0500 X-ASG-Debug-ID: 1252110080-3e6303190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E33642BEC9 for ; Fri, 4 Sep 2009 17:21:20 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id cpdJCYQ8cHIuQ8Gx for ; Fri, 04 Sep 2009 17:21:20 -0700 (PDT) Received: from localhost (c-98-246-45-209.hsd1.or.comcast.net [98.246.45.209]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id 9903D49107; Fri, 4 Sep 2009 17:21:19 -0700 (PDT) X-Mailbox-Line: From gregkh@mini.kroah.org Fri Sep 4 17:14:55 2009 Message-Id: <20090905001455.382972737@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 04 Sep 2009 17:14:27 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, xfs@oss.sgi.com, Christoph Hellwig X-ASG-Orig-Subj: [patch 52/71] vfs: add __destroy_inode Subject: [patch 52/71] vfs: add __destroy_inode References: <20090905001335.106974681@mini.kroah.org> Content-Disposition: inline; filename=vfs-add-__destroy_inode.patch Lines: 60 In-Reply-To: <20090905001824.GA18171@kroah.com> X-Barracuda-Connect: kroah.org[198.145.64.141] X-Barracuda-Start-Time: 1252110105 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8129 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Christoph Hellwig backport of upstream commit 2e00c97e2c1d2ffc9e26252ca26b237678b0b772 When we want to tear down an inode that lost the add to the cache race in XFS we must not call into ->destroy_inode because that would delete the inode that won the race from the inode cache radix tree. This patch provides the __destroy_inode helper needed to fix this, the actual fix will be in th next patch. As XFS was the only reason destroy_inode was exported we shift the export to the new __destroy_inode. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen Signed-off-by: Greg Kroah-Hartman --- fs/inode.c | 10 +++++++--- include/linux/fs.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) --- a/fs/inode.c +++ b/fs/inode.c @@ -220,18 +220,22 @@ static struct inode *alloc_inode(struct return inode; } -void destroy_inode(struct inode *inode) +void __destroy_inode(struct inode *inode) { BUG_ON(inode_has_buffers(inode)); ima_inode_free(inode); security_inode_free(inode); +} +EXPORT_SYMBOL(__destroy_inode); + +void destroy_inode(struct inode *inode) +{ + __destroy_inode(inode); if (inode->i_sb->s_op->destroy_inode) inode->i_sb->s_op->destroy_inode(inode); else kmem_cache_free(inode_cachep, (inode)); } -EXPORT_SYMBOL(destroy_inode); - /* * These are initializations that only need to be done --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2162,6 +2162,7 @@ extern void __iget(struct inode * inode) extern void iget_failed(struct inode *); extern void clear_inode(struct inode *); extern void destroy_inode(struct inode *); +extern void __destroy_inode(struct inode *); extern struct inode *new_inode(struct super_block *); extern int should_remove_suid(struct dentry *); extern int file_remove_suid(struct file *); From greg@kroah.com Fri Sep 4 19:21:07 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n850Klox253845 for ; Fri, 4 Sep 2009 19:20:57 -0500 X-ASG-Debug-ID: 1252110081-3e6602e00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3BED442BEC8 for ; Fri, 4 Sep 2009 17:21:22 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id lJtLpJ6HvXPsaDV5 for ; Fri, 04 Sep 2009 17:21:22 -0700 (PDT) Received: from localhost (c-98-246-45-209.hsd1.or.comcast.net [98.246.45.209]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id 9A99549111; Fri, 4 Sep 2009 17:21:21 -0700 (PDT) X-Mailbox-Line: From gregkh@mini.kroah.org Fri Sep 4 17:14:55 2009 Message-Id: <20090905001455.686767014@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 04 Sep 2009 17:14:29 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Felix Blyakher , xfs@oss.sgi.com, Christoph Hellwig X-ASG-Orig-Subj: [patch 54/71] xfs: fix spin_is_locked assert on uni-processor builds Subject: [patch 54/71] xfs: fix spin_is_locked assert on uni-processor builds References: <20090905001335.106974681@mini.kroah.org> Content-Disposition: inline; filename=xfs-fix-spin_is_locked-assert-on-uni-processor-builds.patch Lines: 32 In-Reply-To: <20090905001824.GA18171@kroah.com> X-Barracuda-Connect: kroah.org[198.145.64.141] X-Barracuda-Start-Time: 1252110105 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8129 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Christoph Hellwig upstream commit a8914f3a6d72c97328597a556a99daaf5cc288ae Without SMP or preemption spin_is_locked always returns false, so we can't do an assert with it. Instead use assert_spin_locked, which does the right thing on all builds. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen Reported-by: Johannes Engel Tested-by: Johannes Engel Signed-off-by: Felix Blyakher Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -3180,7 +3180,7 @@ try_again: STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog) { - ASSERT(spin_is_locked(&log->l_icloglock)); + assert_spin_locked(&log->l_icloglock); if (iclog->ic_state == XLOG_STATE_ACTIVE) { xlog_state_switch_iclogs(log, iclog, 0); From greg@kroah.com Fri Sep 4 19:21:14 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n850KsGT253858 for ; Fri, 4 Sep 2009 19:21:04 -0500 X-ASG-Debug-ID: 1252110080-6ea901300000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8065D42BEC9 for ; Fri, 4 Sep 2009 17:21:21 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id DEQR2KPjYbExrBt8 for ; Fri, 04 Sep 2009 17:21:21 -0700 (PDT) Received: from localhost (c-98-246-45-209.hsd1.or.comcast.net [98.246.45.209]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by coco.kroah.org (Postfix) with ESMTPSA id 86FE54910B; Fri, 4 Sep 2009 17:21:20 -0700 (PDT) X-Mailbox-Line: From gregkh@mini.kroah.org Fri Sep 4 17:14:55 2009 Message-Id: <20090905001455.522626105@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 04 Sep 2009 17:14:28 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, xfs@oss.sgi.com, Christoph Hellwig X-ASG-Orig-Subj: [patch 53/71] xfs: fix freeing of inodes not yet added to the inode cache Subject: [patch 53/71] xfs: fix freeing of inodes not yet added to the inode cache References: <20090905001335.106974681@mini.kroah.org> Content-Disposition: inline; filename=xfs-fix-freeing-of-inodes-not-yet-added-to-the-inode-cache.patch Lines: 215 In-Reply-To: <20090905001824.GA18171@kroah.com> X-Barracuda-Connect: kroah.org[198.145.64.141] X-Barracuda-Start-Time: 1252110109 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8129 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Christoph Hellwig upstream commit b36ec0428a06fcbdb67d61e9e664154e5dd9a8c7 When freeing an inode that lost race getting added to the inode cache we must not call into ->destroy_inode, because that would delete the inode that won the race from the inode cache radix tree. This patch uses splits a new xfs_inode_free helper out of xfs_ireclaim and uses that plus __destroy_inode to make sure we really only free the memory allocted for the inode that lost the race, and not mess with the inode cache state. Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen Reported-by: Alex Samad Reported-by: Andrew Randrianasulu Reported-by: Stephane Reported-by: Tommy Reported-by: Miah Gregory Reported-by: Gabriel Barazer Reported-by: Leandro Lucarella Reported-by: Daniel Burr Reported-by: Nickolay Reported-by: Michael Guntsche Reported-by: Dan Carley Reported-by: Michael Ole Olsen Reported-by: Michael Weissenbacher Reported-by: Martin Spott Reported-by: Christian Kujau Tested-by: Michael Guntsche Tested-by: Dan Carley Tested-by: Christian Kujau Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_iget.c | 125 ++++++++++++++++++++++++++++------------------------- fs/xfs/xfs_inode.h | 17 ------- 2 files changed, 68 insertions(+), 74 deletions(-) --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -115,6 +115,71 @@ xfs_inode_alloc( return ip; } +STATIC void +xfs_inode_free( + struct xfs_inode *ip) +{ + switch (ip->i_d.di_mode & S_IFMT) { + case S_IFREG: + case S_IFDIR: + case S_IFLNK: + xfs_idestroy_fork(ip, XFS_DATA_FORK); + break; + } + + if (ip->i_afp) + xfs_idestroy_fork(ip, XFS_ATTR_FORK); + +#ifdef XFS_INODE_TRACE + ktrace_free(ip->i_trace); +#endif +#ifdef XFS_BMAP_TRACE + ktrace_free(ip->i_xtrace); +#endif +#ifdef XFS_BTREE_TRACE + ktrace_free(ip->i_btrace); +#endif +#ifdef XFS_RW_TRACE + ktrace_free(ip->i_rwtrace); +#endif +#ifdef XFS_ILOCK_TRACE + ktrace_free(ip->i_lock_trace); +#endif +#ifdef XFS_DIR2_TRACE + ktrace_free(ip->i_dir_trace); +#endif + + if (ip->i_itemp) { + /* + * Only if we are shutting down the fs will we see an + * inode still in the AIL. If it is there, we should remove + * it to prevent a use-after-free from occurring. + */ + xfs_log_item_t *lip = &ip->i_itemp->ili_item; + struct xfs_ail *ailp = lip->li_ailp; + + ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) || + XFS_FORCED_SHUTDOWN(ip->i_mount)); + if (lip->li_flags & XFS_LI_IN_AIL) { + spin_lock(&ailp->xa_lock); + if (lip->li_flags & XFS_LI_IN_AIL) + xfs_trans_ail_delete(ailp, lip); + else + spin_unlock(&ailp->xa_lock); + } + xfs_inode_item_destroy(ip); + ip->i_itemp = NULL; + } + + /* asserts to verify all state is correct here */ + ASSERT(atomic_read(&ip->i_iocount) == 0); + ASSERT(atomic_read(&ip->i_pincount) == 0); + ASSERT(!spin_is_locked(&ip->i_flags_lock)); + ASSERT(completion_done(&ip->i_flush)); + + kmem_zone_free(xfs_inode_zone, ip); +} + /* * Check the validity of the inode we just found it the cache */ @@ -291,7 +356,8 @@ out_preload_end: if (lock_flags) xfs_iunlock(ip, lock_flags); out_destroy: - xfs_destroy_inode(ip); + __destroy_inode(VFS_I(ip)); + xfs_inode_free(ip); return error; } @@ -499,62 +565,7 @@ xfs_ireclaim( XFS_QM_DQDETACH(ip->i_mount, ip); xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); - switch (ip->i_d.di_mode & S_IFMT) { - case S_IFREG: - case S_IFDIR: - case S_IFLNK: - xfs_idestroy_fork(ip, XFS_DATA_FORK); - break; - } - - if (ip->i_afp) - xfs_idestroy_fork(ip, XFS_ATTR_FORK); - -#ifdef XFS_INODE_TRACE - ktrace_free(ip->i_trace); -#endif -#ifdef XFS_BMAP_TRACE - ktrace_free(ip->i_xtrace); -#endif -#ifdef XFS_BTREE_TRACE - ktrace_free(ip->i_btrace); -#endif -#ifdef XFS_RW_TRACE - ktrace_free(ip->i_rwtrace); -#endif -#ifdef XFS_ILOCK_TRACE - ktrace_free(ip->i_lock_trace); -#endif -#ifdef XFS_DIR2_TRACE - ktrace_free(ip->i_dir_trace); -#endif - if (ip->i_itemp) { - /* - * Only if we are shutting down the fs will we see an - * inode still in the AIL. If it is there, we should remove - * it to prevent a use-after-free from occurring. - */ - xfs_log_item_t *lip = &ip->i_itemp->ili_item; - struct xfs_ail *ailp = lip->li_ailp; - - ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) || - XFS_FORCED_SHUTDOWN(ip->i_mount)); - if (lip->li_flags & XFS_LI_IN_AIL) { - spin_lock(&ailp->xa_lock); - if (lip->li_flags & XFS_LI_IN_AIL) - xfs_trans_ail_delete(ailp, lip); - else - spin_unlock(&ailp->xa_lock); - } - xfs_inode_item_destroy(ip); - ip->i_itemp = NULL; - } - /* asserts to verify all state is correct here */ - ASSERT(atomic_read(&ip->i_iocount) == 0); - ASSERT(atomic_read(&ip->i_pincount) == 0); - ASSERT(!spin_is_locked(&ip->i_flags_lock)); - ASSERT(completion_done(&ip->i_flush)); - kmem_zone_free(xfs_inode_zone, ip); + xfs_inode_free(ip); } /* --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -309,23 +309,6 @@ static inline struct inode *VFS_I(struct } /* - * Get rid of a partially initialized inode. - * - * We have to go through destroy_inode to make sure allocations - * from init_inode_always like the security data are undone. - * - * We mark the inode bad so that it takes the short cut in - * the reclaim path instead of going through the flush path - * which doesn't make sense for an inode that has never seen the - * light of day. - */ -static inline void xfs_destroy_inode(struct xfs_inode *ip) -{ - make_bad_inode(VFS_I(ip)); - return destroy_inode(VFS_I(ip)); -} - -/* * i_flags helper functions */ static inline void From gpeters@deepsky.com Sat Sep 5 11:19:17 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n85GIu3F061949 for ; Sat, 5 Sep 2009 11:19:06 -0500 X-ASG-Debug-ID: 1252167557-05b302ae0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from deepsky.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 6B09215ECB0D for ; Sat, 5 Sep 2009 09:19:17 -0700 (PDT) Received: from deepsky.com (outrider.deepsky.com [66.207.216.43]) by cuda.sgi.com with SMTP id THbtZbr1QJylxyhF for ; Sat, 05 Sep 2009 09:19:17 -0700 (PDT) Received: (qmail 17833 invoked by uid 510); 5 Sep 2009 12:11:02 -0400 Date: Sat, 5 Sep 2009 12:11:02 -0400 From: Gavin Peters To: xfs@oss.sgi.com X-ASG-Orig-Subj: reservation ran out? Subject: reservation ran out? Message-ID: <20090905161102.GQ22496@outrider> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: outrider.deepsky.com[66.207.216.43] X-Barracuda-Start-Time: 1252167585 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8193 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean I just created bug 849, about a reservation problem I'm seeing on my x86_64 system on ubuntu jaunty (2.6.28-15-generic). http://oss.sgi.com/bugzilla/show_bug.cgi?id=849 Am I doin' something wrong, or is this a real problem? - Gavin From pg_mh@sabi.co.UK Sat Sep 5 13:32:14 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) 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.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n85IVhlh072621 for ; Sat, 5 Sep 2009 13:32:04 -0500 X-ASG-Debug-ID: 1252175533-23b600ea0000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E320A15ECEB3 for ; Sat, 5 Sep 2009 11:32:13 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id CBBlH7c5hVXqBjAO for ; Sat, 05 Sep 2009 11:32:13 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.63 #1) id 1Mk036-0004yP-VV for ; Sat, 05 Sep 2009 18:31:45 +0000 Resent-Message-ID: <19106.44684.280884.280828@tree.ty.sabi.co.uk> Resent-Date: Sat, 5 Sep 2009 18:31:40 +0000 Resent-To: xfs@OSS.SGI.com Content-Transfer-Encoding: 7bit X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> Message-ID: <19106.44559.288658.248853@tree.ty.sabi.co.uk> References: In-Reply-To: X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1252175555 Resent-From: pg_mh@sabi.co.UK X-Barracuda-Bayes: INNOCENT GLOBAL 0.0057 1.0000 -1.9836 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.88 X-Barracuda-Spam-Status: No, SCORE=-1.88 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8201 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean > [ ... ] > 1) /dev/md4 a 19+1 RAID 5, with the corresponding xfs /raidmd4 > filesystem that had lost half of the directories on the 24th > of August; for NO PARTICULAR APPARENT REASON (and this still > makes me crazy). No logs, nothing. But there was apparently a power "event" of some sort, and IIRC the system stopped working, and there were other signs that the block layer had suffered damage: > 2) /dev/md5, a 19+1 RAID 5, that could not mount > anymore...lost superblock. The fact that were was apparent difficulty means that the automatic "resync" that RAID5 implementatioqns do if only 1 drive has been lost did not work, which is ominous. > 3) /dev/md6 , a 4+1 RAID5, that was not mounting anymore because > 2 devices were lost. My collegue zapped the filesystem (which > was almost empty), and rebuilt the RAID5. So let's forget about it, except that it indicates that there was extensive storage system damage, wheter detected or not. > For 2) it was clear what happened: At the distance of a few > days, two devices of /dev/md5 died. The information about the > death of one device is issued in /var/log/warn. We did not > check it during the last days, so when the second device died, > it was too late. With a 19+1 RAID5 with 2 devices dead you have lost around 5-6% of the data; regrettably this is not 5-6% of the files, but most likely 5-6% of most files (and probably quite a bit of XFS metadata). > BUT: I followed the advice to make a read test on all devices > (using dd) and all were ok. That is good news, but it is not clear what "all ok" means here, when "two devices of /dev/md5 died". Maybe the two ports on the host adapter died, but it is far from clear even given this: > So it seemed to be a raid controller problem, of the same kind > described here > http://maillists.uci.edu/mailman/public/uci-linux/2007-December/002225.html > where a solution is proposed including the reassembling of the > raid using mdadm with the option "assume-clean". This is where > this "assume-clean" comes from: from a read test, followed by > the study of the above mailing list post. Oops. I suspect that one should not believe everything one reads in a mailing list. The statement over there: > It's set up as a RAID5 (one parity disk), with no spares. [ > ... ] Trying to force mdadm to assemble it did not work: $ > mdadm --assemble /dev/md0 --chunk 16 /dev/sd*1 mdadm: > /dev/md0 assembled from 2 drives - not enough to start the > array. It was a 4-disk array, so this is a failure. > However, it did not destroy any data either. Seems to extremely optimistic (I am trying to be emollient and mellifluous here :->). > The resync of the /dev/md5 was performed, the raid was again > with 20 working devices, The original 20 devices or did you put in 2 new blank hard drives? I feel like that 2 blank drives went in, but then later I read that all [original] 20 drives could be read for a few MB at the beginning. > but at the end of the day the filesystem still was not able to > mount. So, I was eventually forced to do xfs_repair -L > /dev/md5, which was a nightmare: incredible number of forking, > inodes cleared... but eventually... successful. I was in the > meanwhile 10 years older and with all my hair suddenly greyed, > but... RESULT: /dev/md5 is again up and running, with all > data. I suspect that "with all data" is also extremely optimistic. There is one vital detail here: the XFS design in effect makes two assumptions: * The block layer is error free. By and large XFS does not even check that the block layer behaves perfectly. It is the sysadm responsibility to ensure that. * XFS only ensures consistency of metadata, for data the application takes care. > BUT at the same time, /dev/md4 was not able to mount anymore: > superblock error. > So, at that point we bought another big drive (7 TB), we > performed backup of /dev/md5 , and then we run the same > procedure on /dev/md4. Backing up existing data is a very good idea before doing any repair work. > RESULT: /dev/md4 is again up and running, but the data > disappeared on August 24 were still missing. > Since the structure was including all devices, at this point I > run xfs_repair -L /dev/md4. But nothing happens. No error, and > half of the data still missing. So at this point I don't > understand. Well, I can try to explain the bits that maybe are missing. * Almost all your problems are block layer problems. Since XFS assumes error free block layer, it is your task to ensure that the black layer is error free. Which means that almost all the work that you should have done was to first ensure that the block layer is error free, byt testing fully each drive and then putting together the array. It is quite likely that none of the issues that your have reported has much to do with XFS. * The array contains an XFS filesystem with a bit of metadata and a lot of data. If something like 5% the array is replaced by random numbers (usually zeroes) one can be "lucky" and less than 5% of the metadata will be affected, and what is affected can be reconstructed by other information. If this is the case then 'xfs_repair' will reconstruct the metadata and leave alone the data. XFS and its utilities check the metadata and try to reconstruct it, but do nothing for the data. * This makes it look like that the *filesystem* is fine, even if quite a bit of data in each file has been replaced. XFS wisely does nothing for the data (other than avoiding to deliberately damage it) -- if your application does not add redundancy or checksums to the data, you have no way to reconstruct it or even check whether it is damaged in case of partial loss. > THERE IS ONE IMPORTANT THING THAT I DID NOT MENTION, BECAUSE IT > WAS NOT EVIDENT BY LOOKING AT /etc/raidtab, /proc/mdstat, etc., > and it was done by my collaborator All structure of the raids, > partitioning etc. was done using Yast2 with LVM. That's not important in itself, but it matters whether LVM used DM for RAIDing, as it has less checking and repair options than MD. >> Sure you can reassemble the RAID, but what do you mean by >> "still ok"? Have you read-tested those 2 drives? Have you >> tested the *other* 18 drives? How do you know none of the other >> 18 drives got damaged? Have you verified that only the host >> adapter electronics failed or whatever it was that made those 2 >> drives drop out? > Tested all drives, but not the host adapter electronics. Later on you say you tested only the first few MB of each drive. We still don't know what really happened. BTW, you mention LVM later but it is not clear whether you are using LVM on top of MD or LVM on top od DM. If it is on top of MD a good way to use regularly to check disk health is to use the option to verify the array. This is for example described here: http://en.gentoo-wiki.com/wiki/RAID/Software#Data_Scrubbing but this only works if the array was built with MD, not DM. >> Why do you *need* to assume clean? If the 2 "lost" drives are >> really ok, you just resync the array. > Well, following the post above, after checking that the lost > drives are ok, first I stop the raid, then I create the raid > with 20 drives assuming them clean, then I stop it again, then > assemble it with resyncing. If the array was very very lucky none of the 20 drives was actually damaged, some just stopped working momentarily, and you you could have actually just done the 'resync'; actually the 'resync' is automatic in both DM and MD arrays. >> If you *need* to assume clean, it is likely that you have lost >> something like 5% of data in (every stripe and thus) most files >> and directories (and internal metadata) and will be replacing >> it with random bytes. That will very likely cause XFS problems >> (the least of the problems of course). > On the /raidmd5 fortunately this was not the case. This still seems most likely extremely optimistic. [ ... ] > Well. You would be surprised to know how stupid can scientist > be they ignore the worst case scenario. Well, I am familiar with a new "big science" place where lab time costs several thousand $/hour; most of the scientists have had data losses at other places before, and they have become rather paranoid about that :-). > Just to clarify: assume-clean was an option to the mdadm > --create command when I discovered that my 20 devices were > there and running: I run a dd command reading the first > megabytes of each device. Was this wrong? Given that the extent of damage is unknown, you should have done a scan of each disk in its entirety. The killer for RAID5 is when 2 or more disks have damage at the same offset. > In the meanwhile I am almost convinced that that 4-5 TB lost > on /dev/md4 are lost for good. [ ... ] My current guess is: * 2 or more in each of the 20 disk arrays is damaged in the same offsets, and full data recovery is not possible. * Somehow 'xfs_repair' managed to rebuild the metadata of '/dev/md5' despite a loss of 5-6% of it, so it looks "consistent" as far as XFS is concerned, but up to 5-6% of each file is essentially random, and it is very difficult to know where the random part are. * With '/dev/md4' 'xfs_repair' the 5-6% metadata lost was in more critical parts of the filesystem, so the metadata for half of the files is gone. Of the remaining files, up to 5-6% of their data is random. It may well be more than 5-6% if in fact more than 2 drives per array lost data. Or the malfunction to the 2 or more drives that failed in each array was "temporary" but then it is hard to imagine why there were problems with RAID resync and XFS checking. From sandeen@sandeen.net Sat Sep 5 23:04:18 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8643wUX110174 for ; Sat, 5 Sep 2009 23:04:08 -0500 X-ASG-Debug-ID: 1252209868-12f5016b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 38AE142DB2B for ; Sat, 5 Sep 2009 21:04:28 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id XAV9x1Ty4yuYFy5H for ; Sat, 05 Sep 2009 21:04:28 -0700 (PDT) Received: from Liberator.local (sandeen.net [209.173.210.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id A3A0EA9ED26; Sat, 5 Sep 2009 23:03:54 -0500 (CDT) Message-ID: <4AA334AA.9050908@sandeen.net> Date: Sat, 05 Sep 2009 23:03:54 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Gavin Peters CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: reservation ran out? Subject: Re: reservation ran out? References: <20090905161102.GQ22496@outrider> In-Reply-To: <20090905161102.GQ22496@outrider> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252209894 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Gavin Peters wrote: > I just created bug 849, about a reservation problem I'm seeing > on my x86_64 system on ubuntu jaunty (2.6.28-15-generic). > > http://oss.sgi.com/bugzilla/show_bug.cgi?id=849 > > Am I doin' something wrong, or is this a real problem? Sounds like a real problem. Any reproducible testcase? -Eric > - Gavin From Daniele.Passerone@empa.ch Sun Sep 6 04:00:34 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_29 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n86909ci130156 for ; Sun, 6 Sep 2009 04:00:24 -0500 X-ASG-Debug-ID: 1252227633-25b301b20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx2.empa.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF23815ED773 for ; Sun, 6 Sep 2009 02:00:33 -0700 (PDT) Received: from mx2.empa.ch (mx2.empa.ch [152.88.7.32]) by cuda.sgi.com with ESMTP id xWdx8bKjZlDWp9Jb for ; Sun, 06 Sep 2009 02:00:33 -0700 (PDT) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (localhost [127.0.0.1]) by mx2.empa.ch (Spam & Virus Firewall) with ESMTP id A4A986D3C7 for ; Sun, 6 Sep 2009 11:00:30 +0200 (CEST) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (eaw-exc-hub1.emp-eaw.ch [152.88.5.116]) by mx2.empa.ch with ESMTP id VTcEZtgb7rd0J5xR for ; Sun, 06 Sep 2009 11:00:30 +0200 (CEST) Received: from DU-Exc-Mail.empa.emp-eaw.ch ([fe80::bc9b:a2a9:e3fb:5e94]) by eaw-exc-hub1.eawag.wroot.emp-eaw.ch ([2002:9858:574::9858:574]) with mapi; Sun, 6 Sep 2009 11:00:29 +0200 From: "Passerone, Daniele" To: "xfs@oss.sgi.com" Date: Sun, 6 Sep 2009 11:00:29 +0200 X-ASG-Orig-Subj: xfs data loss Subject: xfs data loss Thread-Topic: xfs data loss Thread-Index: AQHKLsyPo/C3t95IrE21xzhpmwwEnQ== Message-ID: Accept-Language: it-IT, en-US Content-Language: it-IT X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: it-IT, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: mx2.empa.ch[152.88.7.32] X-Barracuda-Start-Time: 1252227663 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8259 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean > [ ... ] Hi Peter, thank you for your long message. Some of the things you suppose, though, may not be exact. I'll try to give you some new element. >But there was apparently a power "event" of some sort, and IIRC >the system stopped working, and there were other signs that the >block layer had suffered damage DP> 2) /dev/md5, a 19+1 RAID 5, that could not mount DP> anymore...lost superblock. PG> The fact that were was apparent difficulty means that the PG> automatic "resync" that RAID5 implementatioqns do if only 1 drive PG> has been lost did not work, which is ominous. PG> With a 19+1 RAID5 with 2 devices dead you have lost around 5-6% PG> of the data; regrettably this is not 5-6% of the files, but most PG> likely 5-6% of most files (and probably quite a bit of XFS metadata). Up to now I found no damage in any file of md5 after recovery with the mdadm --assemble --assume-clean. Just an example: a MB-sized tar.gz file, compression of a postscript file, uncompressed perfectly and was visualized in a perfect way by ghostview. Moreover, a device died (a different one) yesterday, and in the messages I = have: Sep 4 11:00:44 ipazia-sun kernel: Badness in mv_start_dma at drivers/ata/sa= ta_mv.c:651 Sep 4 11:00:44 ipazia-sun kernel: Sep 4 11:00:44 ipazia-sun kernel: Call Trace: {:sata_mv:m= v_qc_issue+292} Sep 4 11:00:44 ipazia-sun kernel: {:scsi_mod:scsi_done+0}= {:libata:ata_scsi_rw_xlat+0} Sep 4 11:00:44 ipazia-sun kernel: {:libata:ata_qc_issue+1= 037} {:scsi_mod:scsi_done+0} Sep 4 11:00:44 ipazia-sun kernel: {:libata:ata_scsi_rw_xl= at+0} {:libata:ata_scsi_translate+286} Sep 4 11:00:44 ipazia-sun kernel: {:scsi_mod:scsi_done+0}= {:libata:ata_scsi_queuecmd+315} Sep 4 11:00:44 ipazia-sun kernel: {:scsi_mod:scsi_dispatc= h_cmd+546} Sep 4 11:00:44 ipazia-sun kernel: {:scsi_mod:scsi_request= _fn+760} {elv_insert+230} Sep 4 11:00:44 ipazia-sun kernel: {__make_request+987} {mempool_alloc+49} Sep 4 11:00:44 ipazia-sun kernel: {generic_make_request+5= 38} {__bio_clone+116} Sep 4 11:00:44 ipazia-sun kernel: {keventd_create_kthread= +0} {submit_bio+186} Sep 4 11:00:44 ipazia-sun kernel: {md_update_sb+270} {md_check_recovery+371} Sep 4 11:00:44 ipazia-sun kernel: {keventd_create_kthread= +0} {:raid5:raid5d+21} Sep 4 11:00:44 ipazia-sun kernel: {md_thread+267} {autoremove_wake_function+0} Sep 4 11:00:44 ipazia-sun kernel: {keventd_create_kthread= +0} {md_thread+0} Sep 4 11:00:44 ipazia-sun kernel: {kthread+236} {child_rip+8} Sep 4 11:00:44 ipazia-sun kernel: {keventd_create_kthread= +0} {kthread+0} Sep 4 11:00:44 ipazia-sun kernel: {child_rip+0} Sep 4 11:01:44 ipazia-sun kernel: ata42: Entering mv_eng_timeout Sep 4 11:01:44 ipazia-sun kernel: mmio_base ffffc20001000000 ap ffff8103f8b= 4c488 qc ffff8103f8b4cf68 scsi_cmnd ffff8101f7e556c0 &cmnd ffff8101f7e5571c Sep 4 11:01:44 ipazia-sun kernel: ata42: no sense translation for status: 0= x40 Sep 4 11:01:44 ipazia-sun kernel: ata42: translated ATA stat/err 0x40/00 to= SCSI SK/ASC/ASCQ 0xb/00/00 Sep 4 11:01:44 ipazia-sun kernel: ata42: status=3D0x40 { DriveReady } Sep 4 11:01:44 ipazia-sun kernel: end_request: I/O error, dev sdap, sector = 976767935 Sep 4 11:01:44 ipazia-sun kernel: RAID5 conf printout: (...) DP> The resync of the /dev/md5 was performed, the raid was again DP> with 20 working devices, PG> The original 20 devices or did you put in 2 new blank hard drives? PG> I feel like that 2 blank drives went in, but then later I read PG>that all [original] 20 drives could be read for a few MB at the PG>beginning. No. No blank drives went in. And I always used the original 20 devices. I therefore suspect that the "broken devices" indication, since it is repea= tedly found in the last weeks, and always for different devices/filesystems, has to do = with the RAID controller, and not with a specific device failure-. PG>Well, I can try to explain the bits that maybe are missing. PG>* Almost all your problems are block layer problems. Since XFS PG> assumes error free block layer, it is your task to ensure that PG> the black layer is error free. Which means that almost all the PG> work that you should have done was to first ensure that the PG> block layer is error free, byt testing fully each drive and PG> then putting together the array. It is quite likely that none PG> of the issues that your have reported has much to do with XFS. Couild have to do with the raid controller layer? PG>* This makes it look like that the *filesystem* is fine, even if PG> quite a bit of data in each file has been replaced. XFS wisely PG> does nothing for the data (other than avoiding to deliberately PG> damage it) -- if your application does not add redundancy or PG> checksums to the data, you have no way to reconstruct it or even PG> check whether it is damaged in case of partial loss. Well, a binary file with 5% data loss would simply not work. But I have executables on this filesystem, and they run! PG > * 2 or more in each of the 20 disk arrays is damaged in the same PG >offsets, and full data recovery is not possible. PG>* Somehow 'xfs_repair' managed to rebuild the metadata of PG> '/dev/md5' despite a loss of 5-6% of it, so it looks PG> "consistent" as far as XFS is concerned, but up to 5-6% of PG> each file is essentially random, and it is very difficult to PG> know where the random part are. I don't see any element to support this - at present. PG>* With '/dev/md4' 'xfs_repair' the 5-6% metadata lost was in PG> more critical parts of the filesystem, so the metadata for PG> half of the files is gone. Of the remaining files, up to PG> 5-6% of their data is random. Half of the file was gone already before repair, and it remains gone after, and for the remaining files, I have no sign of randomness. Summarizing, it may well be that the devices are broken but I suspect, agai= n, a failure in the controller. Could it be? I contacted Sun and they asked me output of Siga, ipmi, etc. DAniele ________________________________ * Previous message: xfs data loss * Next message: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the lo= g * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] ________________________________ More information about the xfs mailing list From info@loan.com Sun Sep 6 04:23:01 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n869MfrK132406 for ; Sun, 6 Sep 2009 04:22:51 -0500 X-ASG-Debug-ID: 1252228996-21a802970000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from zebra.uem.mz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8E37842DD60 for ; Sun, 6 Sep 2009 02:23:16 -0700 (PDT) Received: from zebra.uem.mz (mail.inovareganhar.org.mz [196.3.96.67]) by cuda.sgi.com with ESMTP id lXZWx0euyRdZ5s1q for ; Sun, 06 Sep 2009 02:23:16 -0700 (PDT) Received: from zebra.uem.mz (localhost.uem.mz [127.0.0.1]) by zebra.uem.mz (Postfix) with ESMTP id 36497980110; Sun, 6 Sep 2009 07:42:11 +0200 (CAT) Received: from nambu.uem.mz (localhost.uem.mz [127.0.0.1]) by zebra.uem.mz (Postfix) with ESMTP id EF4B5980207; Sun, 6 Sep 2009 07:36:41 +0200 (CAT) From: "global loan company" Reply-To: loan.dept100@live.com X-ASG-Orig-Subj: loan offer Subject: loan offer Date: Sun, 6 Sep 2009 08:36:41 +0300 Message-Id: <20090906053642.M58365@loan.com> X-Mailer: OpenWebMail 2.53 X-OriginatingIP: 41.220.75.3 (andrei@nambu.uem.mz) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 To: undisclosed-recipients:; X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP X-Barracuda-Connect: mail.inovareganhar.org.mz[196.3.96.67] X-Barracuda-Start-Time: 1252229017 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2964 1.0000 -0.3634 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.36 X-Barracuda-Spam-Status: No, SCORE=-0.36 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean contact us for 2% interest rate loan From michael.monnerie@is.it-management.at Sun Sep 6 04:31:33 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n869VCWW133288 for ; Sun, 6 Sep 2009 04:31:22 -0500 X-ASG-Debug-ID: 1252229518-13c2002e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv5.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7502D15EDB82 for ; Sun, 6 Sep 2009 02:31:58 -0700 (PDT) Received: from mailsrv5.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id 73wmeeTCXX9nGRzX for ; Sun, 06 Sep 2009 02:31:58 -0700 (PDT) Received: from mailsrv.i.zmi.at (h081217106033.dyn.cm.kabsi.at [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv5.zmi.at (Postfix) with ESMTP id 59C81693 for ; Sun, 6 Sep 2009 11:31:53 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id E48AF40015E for ; Sun, 6 Sep 2009 11:31:55 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss Date: Sun, 6 Sep 2009 11:30:41 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909061130.41912@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1252229523 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Sonntag 06 September 2009 Passerone, Daniele wrote: > Well, a binary file with 5% data loss would simply not work. > But I have executables on this filesystem, and they run! Optimist. It just means the part of the binary you run are not random. Randomness of *all* code paths would have to be checked, which you probably can't do manually, so binaries are not a good check at all. Since you didn't change any drives, chances are good that you really lost very little data. > a MB-sized tar.gz file, compression of a postscript file, > uncompressed perfectly and was visualized in a perfect way by > ghostview. That's a good test, so you are lucky. > Moreover, a device died (a different one) yesterday, and in the > messages I have ... Is this on the same controller as the other broken disks were? Then this should be it (or it's cabling, or the backplane, etc.). And you should immediately shut down the RAID on that controller, as you might loose data (or the whole RAID) when the controller writes random data. A broken hardware is the worst thing to have. Replace it, test the new parts *thouroughly*, and only then start to use the RAID again. mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From info@ebusinessregistry.com Sun Sep 6 04:41:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n869fAcw134369 for ; Sun, 6 Sep 2009 04:41:21 -0500 X-ASG-Debug-ID: 1252230121-215b033c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail5.ebusinessregistry.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 650C942DFBC for ; Sun, 6 Sep 2009 02:42:01 -0700 (PDT) Received: from mail5.ebusinessregistry.com (mail5.ebusinessregistry.com [76.73.19.254]) by cuda.sgi.com with SMTP id mpBb3iYQsLuGrDTx for ; Sun, 06 Sep 2009 02:42:01 -0700 (PDT) To: "xfs" From: "Princeton Premier" Reply-To: X-ASG-Orig-Subj: David Your Recent Nomination to the Princeton Premier Subject: David Your Recent Nomination to the Princeton Premier Date: Sun, 06 Sep 2009 05:41:59 -0400 MIME-Version: 1.0 List-Unsubscribe: Content-type: multipart/alternative; boundary="---------------------3Part.IPK984D17P.1_58C.2D_Z05.N4.65_UK3MM5"; X-Barracuda-Connect: mail5.ebusinessregistry.com[76.73.19.254] X-Barracuda-Start-Time: 1252230126 Message-Id: <20090906094201.650C942DFBC@cuda.sgi.com> X-Barracuda-Bayes: INNOCENT GLOBAL 0.0030 1.0000 -2.0012 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.50 X-Barracuda-Spam-Status: No, SCORE=-1.50 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC7_SA_HREF_HTTP_MISMATCH, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_SC7_SA_HREF_HTTP_MISMATCH BODY: Custom Phishing Mismatch 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean -----------------------3Part.IPK984D17P.1_58C.2D_Z05.N4.65_UK3MM5 Content-type: text/plain Dear David, It is my pleasure to inform you that you are being considered for inclusion into the 2009-2010 Princeton Premier Business Leaders and Professionals Honors Edition section of the registry. The 2009-2010 edition of the registry will include biographies of the world's most accomplished individuals. Recognition of this kind is an honor shared by thousands of executives and professionals throughout the world each year. Inclusion is considered by many as the single highest mark of achievement. You may access our application form using the following link: http://www.formdesk.com/pgn2/New Upon final confirmation, you will be listed among other accomplished individuals in the Princeton Premier Registry. For accuracy and publication deadlines, please complete your application form and return it to us within five business days. There is no cost to be included in the registry. If you've already received this email from us, there is no need to respond again. This email serves as our final invitation to potential members who have not yet responded. On behalf of the Executive Publisher, we wish you continued success. Sincerely, Jason Harris Managing Director Princeton Premier Princeton Premier 176-25 Union Turnpike #183 Fresh Meadows NY 11366 -----------------------3Part.IPK984D17P.1_58C.2D_Z05.N4.65_UK3MM5 Content-Type: text/html

Dear David,

It is my pleasure to inform you that you are being considered for inclusion into the 2009-2010 Princeton Premier Business Leaders and Professionals Honors Edition section of the registry.

The 2009-2010 edition of the registry will include biographies of the world's most accomplished individuals. Recognition of this kind is an honor shared by thousands of executives and professionals throughout the world each year. Inclusion is considered by many as the single highest mark of achievement.

You may access our application form using the following link:

http://www.formdesk.com/pgn2/New

Upon final confirmation, you will be listed among other accomplished individuals in the Princeton Premier Registry.

For accuracy and publication deadlines, please complete your application form and return it to us within five business days.

There is no cost to be included in the registry.

If you've already received this email from us, there is no need to respond again.

This email serves as our final invitation to potential members who have not yet responded.

On behalf of the Executive Publisher, we wish you continued success.

Sincerely,
Jason Harris

Managing Director
Princeton Premier


Princeton Premier
176-25 Union Turnpike #183
Fresh Meadows NY 11366

We only support ethical email marketing. To remove yourself from future mailings, please visit here to use our automated removal system. You will be removed from our mailing database within seven (7) days. 7505
Thanks

-----------------------3Part.IPK984D17P.1_58C.2D_Z05.N4.65_UK3MM5-- From Daniele.Passerone@empa.ch Sun Sep 6 05:45:27 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n86Aj1iG139558 for ; Sun, 6 Sep 2009 05:45:17 -0500 X-ASG-Debug-ID: 1252233954-23f601e40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx2.empa.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C12AF42E0C6 for ; Sun, 6 Sep 2009 03:45:54 -0700 (PDT) Received: from mx2.empa.ch (mx2.empa.ch [152.88.7.32]) by cuda.sgi.com with ESMTP id qNJQRQ6qnor03Xji for ; Sun, 06 Sep 2009 03:45:54 -0700 (PDT) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (localhost [127.0.0.1]) by mx2.empa.ch (Spam & Virus Firewall) with ESMTP id BAF796D4B1 for ; Sun, 6 Sep 2009 12:45:53 +0200 (CEST) Received: from eaw-exc-hub1.eawag.wroot.emp-eaw.ch (eaw-exc-hub1.emp-eaw.ch [152.88.5.116]) by mx2.empa.ch with ESMTP id x1zBiXOMlfUhqDFr for ; Sun, 06 Sep 2009 12:45:53 +0200 (CEST) Received: from DU-Exc-Mail.empa.emp-eaw.ch ([fe80::bc9b:a2a9:e3fb:5e94]) by eaw-exc-hub1.eawag.wroot.emp-eaw.ch ([2002:9858:574::9858:574]) with mapi; Sun, 6 Sep 2009 12:45:53 +0200 From: "Passerone, Daniele" To: "xfs@oss.sgi.com" Date: Sun, 6 Sep 2009 12:43:55 +0200 X-ASG-Orig-Subj: R: xfs data loss Subject: R: xfs data loss Thread-Topic: xfs data loss Thread-Index: AQHKLsyPo/C3t95IrE21xzhpmwwEnZDJYEPj Message-ID: References: In-Reply-To: Accept-Language: it-IT, en-US Content-Language: it-IT X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: it-IT, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: mx2.empa.ch[152.88.7.32] X-Barracuda-Start-Time: 1252233960 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8265 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean yes, the filesystems are now unmounted. let's what sun says. From gpeters@deepsky.com Sun Sep 6 07:17:09 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n86CGnt9144907 for ; Sun, 6 Sep 2009 07:16:59 -0500 X-ASG-Debug-ID: 1252239442-0b5600d60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from deepsky.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 6CDFE42E111 for ; Sun, 6 Sep 2009 05:17:23 -0700 (PDT) Received: from deepsky.com (outrider.deepsky.com [66.207.216.43]) by cuda.sgi.com with SMTP id vbDoWLcj3G40LZXt for ; Sun, 06 Sep 2009 05:17:23 -0700 (PDT) Received: (qmail 6712 invoked by uid 510); 6 Sep 2009 08:17:19 -0400 Date: Sun, 6 Sep 2009 08:17:19 -0400 From: Gavin Peters To: Eric Sandeen Cc: Gavin Peters , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: reservation ran out? Subject: Re: reservation ran out? Message-ID: <20090906121719.GV22496@outrider> References: <20090905161102.GQ22496@outrider> <4AA334AA.9050908@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA334AA.9050908@sandeen.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: outrider.deepsky.com[66.207.216.43] X-Barracuda-Start-Time: 1252239465 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8271 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Sat, Sep 05, 2009 at 11:03:54PM -0500, Eric Sandeen wrote: > Gavin Peters wrote: >> I just created bug 849, about a reservation problem I'm seeing >> on my x86_64 system on ubuntu jaunty (2.6.28-15-generic). >> >> http://oss.sgi.com/bugzilla/show_bug.cgi?id=849 >> >> Am I doin' something wrong, or is this a real problem? > > Sounds like a real problem. > > Any reproducible testcase? > Alas, no; I was running mythtv, and my disk was somewhat fragmented. root@mythmaker:~# xfs_db -c frag -r /dev/sda7 actual 17379, ideal 98, fragmentation factor 99.44% root@mythmaker:~# xfs_db -c frag -r /dev/sdb1 actual 4268, ideal 53, fragmentation factor 98.76% The disk that was having the trouble was sda7, my sdb1 was fine. Mythtv fragments disks so badly by appending to two, or three files, simultaniously and fsyncing on them a lot. Perhaps some hacking at that will give a reproduction, I'll see if I can take the time and do that. I've since defragmented both disks though; and I've set a large allocsize (512m) to prevent future fragmentation. We'll see if I get another crash. - Gavin From sim@netnation.com Mon Sep 7 01:37:24 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n876b4Cb218286 for ; Mon, 7 Sep 2009 01:37:14 -0500 X-ASG-Debug-ID: 1252305445-1be000c20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from peace.netnation.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 57E0542F620 for ; Sun, 6 Sep 2009 23:37:25 -0700 (PDT) Received: from peace.netnation.com (newpeace.netnation.com [204.174.223.7]) by cuda.sgi.com with ESMTP id wX8kmbFR9onFkCpZ for ; Sun, 06 Sep 2009 23:37:25 -0700 (PDT) Received: from sim by peace.netnation.com with local (Exim 4.63) (envelope-from ) id 1MkXqu-0001Bl-RQ for xfs@oss.sgi.com; Sun, 06 Sep 2009 23:37:24 -0700 Date: Sun, 6 Sep 2009 23:37:24 -0700 From: Simon Kirby To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS corruption [2.6.30.5+patches.2.6.30.tgz] Subject: XFS corruption [2.6.30.5+patches.2.6.30.tgz] Message-ID: <20090907063724.GB4568@hostway.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-Barracuda-Connect: newpeace.netnation.com[204.174.223.7] X-Barracuda-Start-Time: 1252305472 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8344 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hello! In a backup server attached to a Coraid shelf via AOE and DM, we saw 2.6.30.5+patches.2.6.30.tgz die with a corruption problem. The kernel logged many similar errors, and then stopped responding some time later. This particular storage is written to entirely by "cp" and "rsync", and is responsible for storing backups over NFS. The file system was created only a few days ago, and the system had not rebooted since mkfs.xfs. This is one of six volumes at 3 TB each. This file system stores a hardlink-based backup (eg: where each day's backups are hardlinked except where files change), and this crash occurred during a run of "cp -al" between backup trees: Sep 3 00:05:22 backup01 kernel: ffff880125072000: 54 03 62 d0 83 cf 00 00 00 6c 16 47 00 6c 16 47 T.b......l.G.l.G Sep 3 00:05:22 backup01 kernel: Filesystem "dm-59": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xffffffff803fec85 Sep 3 00:05:22 backup01 kernel: Sep 3 00:05:22 backup01 kernel: Pid: 2449, comm: cp Not tainted 2.6.30.5-hw-fixedxfs #1 Sep 3 00:05:22 backup01 kernel: Call Trace: Sep 3 00:05:22 backup01 kernel: [] xfs_error_report+0x3e/0x40 Sep 3 00:05:22 backup01 kernel: [] ? xfs_da_read_buf+0x25/0x30 Sep 3 00:05:22 backup01 kernel: [] xfs_corruption_error+0x58/0x70 Sep 3 00:05:22 backup01 kernel: [] xfs_da_do_buf+0x65d/0x6b0 Sep 3 00:05:22 backup01 kernel: [] ? xfs_da_read_buf+0x25/0x30 Sep 3 00:05:22 backup01 kernel: [] ? __down_read+0x17/0xc7 Sep 3 00:05:22 backup01 kernel: [] ? get_page_from_freelist+0x30a/0x480 Sep 3 00:05:22 backup01 kernel: [] ? filldir+0x0/0xe0 Sep 3 00:05:22 backup01 kernel: [] xfs_da_read_buf+0x25/0x30 Sep 3 00:05:22 backup01 kernel: [] ? xfs_dir2_block_getdents+0x7a/0x1e0 Sep 3 00:05:22 backup01 kernel: [] xfs_dir2_block_getdents+0x7a/0x1e0 Sep 3 00:05:22 backup01 kernel: [] ? filldir+0x0/0xe0 Sep 3 00:05:22 backup01 kernel: [] ? filldir+0x0/0xe0 Sep 3 00:05:22 backup01 kernel: [] xfs_readdir+0xd1/0xe0 Sep 3 00:05:22 backup01 kernel: [] ? filldir+0x0/0xe0 Sep 3 00:05:22 backup01 kernel: [] xfs_file_readdir+0x3a/0x50 Sep 3 00:05:22 backup01 kernel: [] vfs_readdir+0xa1/0xc0 Sep 3 00:05:22 backup01 kernel: [] sys_getdents+0x81/0xd0 Sep 3 00:05:22 backup01 kernel: [] ? page_fault+0x25/0x30 Sep 3 00:05:22 backup01 kernel: [] system_call_fastpath+0x16/0x1b Sep 3 00:05:22 backup01 kernel: ffff880228059000: f7 b6 37 2e cf dc e2 ea 00 00 00 00 00 00 00 00 ..7............. Sep 3 00:05:22 backup01 kernel: Filesystem "dm-59": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xffffffff803fec85 (same backtrace) Sep 3 00:05:22 backup01 kernel: Filesystem "dm-59": XFS internal error xfs_da_do_buf(2) at line 2112 of file fs/xfs/xfs_da_btree.c. Caller 0xffffffff803fec85 (same backtrace) Full kern.log including result from attempt to mount after reboot: http://0x.ca/sim/ref/2.6.30.5-hw-fixedxfs/kern_log_0.txt I've left the file system in this state for debugging purposes. I can run xfs_repair or metadata dumps, etc., on demand. Cheers, Simon- From sim@netnation.com Mon Sep 7 02:25:58 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n877PcBe221455 for ; Mon, 7 Sep 2009 02:25:48 -0500 X-ASG-Debug-ID: 1252308394-6377009c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from peace.netnation.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 672571B2C2A2 for ; Mon, 7 Sep 2009 00:26:34 -0700 (PDT) Received: from peace.netnation.com (newpeace.netnation.com [204.174.223.7]) by cuda.sgi.com with ESMTP id WEgANDiLC6IFG3fD for ; Mon, 07 Sep 2009 00:26:34 -0700 (PDT) Received: from sim by peace.netnation.com with local (Exim 4.63) (envelope-from ) id 1MkYbW-0002Og-1Z for xfs@oss.sgi.com; Mon, 07 Sep 2009 00:25:34 -0700 Date: Mon, 7 Sep 2009 00:25:34 -0700 From: Simon Kirby To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS corruption [2.6.30.5+patches.2.6.30.tgz] Subject: Re: XFS corruption [2.6.30.5+patches.2.6.30.tgz] Message-ID: <20090907072534.GC4568@hostway.ca> References: <20090907063724.GB4568@hostway.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090907063724.GB4568@hostway.ca> User-Agent: Mutt/1.5.13 (2006-08-11) X-Barracuda-Connect: newpeace.netnation.com[204.174.223.7] X-Barracuda-Start-Time: 1252308397 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8348 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hmm, I suspect the corruption here came from the RAID 6 implementation. I see corruption on another volume on this volume group now. We happened to test a two drive RAID 6 failure/rebuild shortly before this occurred. So, perhaps it's not worth looking at this further other than perhaps the part where the kernel hung. :) Simon- On Sun, Sep 06, 2009 at 11:37:24PM -0700, Simon Kirby wrote: > Hello! > > In a backup server attached to a Coraid shelf via AOE and DM, we saw > 2.6.30.5+patches.2.6.30.tgz die with a corruption problem. The kernel > logged many similar errors, and then stopped responding some time later. From feevs6s0@sina.com Mon Sep 7 19:09:53 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.7 required=5.0 tests=BAYES_50,HTML_MESSAGE, MIME_8BIT_HEADER,URI_HEX autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8809WvP020453 for ; Mon, 7 Sep 2009 19:09:43 -0500 X-ASG-Debug-ID: 1252368596-717d03ca0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail2-203.sinamail.sina.com.cn (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9379F431E1C for ; Mon, 7 Sep 2009 17:09:57 -0700 (PDT) Received: from mail2-203.sinamail.sina.com.cn (r2-203.sinamail.sina.com.cn [60.28.2.203]) by cuda.sgi.com with ESMTP id ovGNnpCcL77CKPAS for ; Mon, 07 Sep 2009 17:09:57 -0700 (PDT) Received: by mail2-203.sinamail.sina.com.cn (Postfix, from userid 99) id 1023F3EE89D; Tue, 8 Sep 2009 08:07:25 +0800 (CST) Received: from feevs6s0@sina.com([118.168.200.81]) by mail2-203.sinamail.sina.com.cn via HTTP; Tue, 08 Sep 2009 08:07:24 +0800 (CST) Date: Tue, 08 Sep 2009 08:07:24 +0800 From: feevs6s0@sina.com To: profhk@hknet.com Cc: linux-xfs@oss.sgi.com, alant1231@yahoo.com.tw, fqa@clevo.com.tw, contact@zitec.ro X-ASG-Orig-Subj: =?GBK?B?Ir6Ayc++zb+0La6Lw+azrMH3lbMtzOzM7N9N0MLGrCEhIDA3NTQxMiI=?= Subject: =?GBK?B?Ir6Ayc++zb+0La6Lw+azrMH3lbMtzOzM7N9N0MLGrCEhIDA3NTQxMiI=?= MIME-Version: 1.0 X-Priority: 3 X-MessageID: 1252368444.67.4617 X-OriginaIP: 60.28.2.203 X-Mailer: Sina WebMail 4.0 Content-Type: multipart/alternative; boundary="=-sinamail_alt_3c58a19407db9edf557ba14cc34380e8" Message-Id: <20090908000725.1023F3EE89D@mail2-203.sinamail.sina.com.cn> X-Barracuda-Connect: r2-203.sinamail.sina.com.cn[60.28.2.203] X-Barracuda-Start-Time: 1252368623 X-Barracuda-Bayes: INNOCENT GLOBAL 0.6240 1.0000 0.8691 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.19 X-Barracuda-Spam-Status: No, SCORE=1.19 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE, NO_REAL_NAME, URI_HEX X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8414 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.32 URI_HEX URI: URI hostname has long hexadecimal sequence 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --=-sinamail_alt_3c58a19407db9edf557ba14cc34380e8 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: base64 Content-Disposition: inline DQomIzI2OTg5OyYjMzAwMjg7JiMyMDk4NjsmIzI5MjU1OyYjMzY4OTU7JiMyNDIzMDsmIzI2MzY4 OyYjMjQ1NTU7JiM2NTI5MjsmIzIxNjk3OyYjMzYwNzQ7JiMyNjM2ODsmIzIyOTA5OyYjNjUyOTI7 JiMyMTgwNjsmIzI0NDYwOyYjMjYzODE7JiMyMTIwOTsmIzI2MzY4OyYjMjAzMzk7JiM2NTI5Mjsm IzIwNzI5OyYjMjY2ODQ7JiMyNjM2ODsmIzIwNzc4OyYjMjQ4MDA7JiM2NTI5MjsNCg0KJiMyNjQx MjsmIzMxNDQ5OyYjMzIwODU7JiMxOTk4MTsmIzI4NjUxOyYjMzE0ODU7JiMyMDgwNTsmIzI1OTc2 O34mIzMwMDAxOyYjMTk5Nzk7JiMyMTAxNTsmIzMyMTc4OyYjMjIzMzY7JiMzNjkxNDsmIzIwODM3 Ow0KDQoiJiMyMTQ4NzsmIzI0ODU5OyYjMzAzNDA7JiMyMjg5OTsmIzI5Njk5OyYjMzY4NTU7JiMz MTM1OTsmIzMzODc5OyYjMzI4ODc7JiMyNjgzNDsmIzI5Njk5OyYjMzQ5MTU7JiMyMjMxMjsmIzM5 MTUxOyYjMjQyMTU7JiMzNDk4NzsmIzI1NjMwOyYjMjYzNjg7JiMyNDQ2MDsmIzM2OTk2OyYjMzQ5 ODc7JiMyMDAxMzsmIzIwOTg2OyYjMjAxMDI7IDA3NTQxMiINCg0KJiMxMjI4ODsNCg0KIlcgaSBp ICYjMzY5Mzg7ICYjMjUxMzg7ICYjMzYwMzk7ICYjMzUzMzg7ICYjMjU5MTU7ICYjMzAwNTM7JiMz NjIyOTsmIzIwMzAyOzcwIDA3NTQxMiINCg0KJiMxMjI4ODsNCg0KInAgczIgeCBiMzYwICYjMzY5 Mzg7ICYjMjUxMzg7ICYjMzYwMzk7ICYjMzUzMzg7ICYjMjU5MTU7ICYjMzAwNTM7JiMzNjIyOTsm IzIwMzAyOzgwIDA3NTQxMiINCg0KJiMxMjI4ODsNCg0KIiYjMzA0NzU7ICYjMTk5ODE7ICYjMjI4 MTY7ICYjMjE5NjY7PyYjMTk5Njg7ICYjMjM1NjU7ICYjMTk5Njg7JiMyMDgxMzsgJiMzNjAyNzsm IzM1MjIyOyAmIzM1MzM4OyYjMzU3MzE7ICYjMjQ3NDQ7JiMzMjA4NTsgJiMyMzU2NTsmIzI4NDE1 OyAmIzM2Mjc1OyAwNzU0MTIiDQoNCiYjMTIyODg7DQoNCiImIzM2OTk2OyYjMjYzNzc7JiMyNjM1 NjsmIzIyODEwOyYjMjQ4NTk7JiMyNDg1OTsmIzIxODMwOyYjMjE2OTc7JiM2NTI5MjsmIzI5Njk0 OyYjMjIzMTI7JiMyMzYwMTsmIzM2OTE0OyYjMjAzNTg7JiMyNTIxNDsmIzM5NjQwOyYjMjg1MjY7 ISEgMDc1NDEyIg0KDQomIzIxNDc4OyYjMjYzNzc7JiMzNjIyOTsmIzIyODMxO0EmIzI5MjU1OyYj MzIyMTg7JiMxOTk3ODsmIzMwNDc1OyYjMjE2NDQ7JiMxOTk3OTsmIzM2NjE3OyYjMjA4NDA7JiMz ODc1NDsmIzIwODEzOyYjMzYwMjc7MDc1NDEyDQoNCiYjMzU1MzE7JiMyMjMxMjsmIzM4NTk3OyYj MzQzODI7ICYjMjU2Mjg7JiMyMzU2MzsmIzE5OTc4OyYjMjUxNzE7JiMxMjMwMjsmIzI5MTkwOyYj MjkxOTA7JiMyOTI0NTtBJiMyOTI1NTsmIzIwODEzOyYjMzYwMjc7JiMzMDQ3NTsgYmJzMyYjNjUy OTQ7eDM4MyYjNjUyOTQ7Y29tJiM2NTI5NTtkczE2OCYjMTIzMDM7JiMyNjU5NzsmIzM1NDI2OyYj MzIxNzg7JiMzMTQ0OTswNzU0MTINCg0K --=-sinamail_alt_3c58a19407db9edf557ba14cc34380e8 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: base64 Content-Disposition: inline PGJvZHkgYmdjb2xvcj0iI0ZGRkZGRiI+DQo8cD48Zm9udCBjb2xvcj0iIzkwQUQ2OCI+PHN0cm9u Zz4mIzI2OTg5OyYjMzAwMjg7JiMyMDk4NjsmIzI5MjU1OyYjMzY4OTU7JiMyNDIzMDsmIzI2MzY4 OyYjMjQ1NTU7JiM2NTI5MjsmIzIxNjk3OyYjMzYwNzQ7JiMyNjM2ODsmIzIyOTA5OyYjNjUyOTI7 JiMyMTgwNjsmIzI0NDYwOyYjMjYzODE7JiMyMTIwOTsmIzI2MzY4OyYjMjAzMzk7JiM2NTI5Mjsm IzIwNzI5OyYjMjY2ODQ7JiMyNjM2ODsmIzIwNzc4OyYjMjQ4MDA7JiM2NTI5Mjs8L3N0cm9uZz48 L2ZvbnQ+PC9wPg0KDQo8cD48Zm9udCBjb2xvcj0iIzkwQUQ2OCI+PHN0cm9uZz4mIzI2NDEyOyYj MzE0NDk7JiMzMjA4NTsmIzE5OTgxOyYjMjg2NTE7JiMzMTQ4NTsmIzIwODA1OyYjMjU5NzY7fiYj MzAwMDE7JiMxOTk3OTsmIzIxMDE1OyYjMzIxNzg7JiMyMjMzNjsmIzM2OTE0OyYjMjA4Mzc7PC9z dHJvbmc+PC9mb250PjwvcD4NCg0KPHAgY2xhc3M9Ik1zb05vcm1hbCI+PFNQQU4gc3R5bGU9IkZP TlQtRkFNSUxZOiAmIzI2MDMyOyYjMzIwNDg7JiMyNjEyNjsmIzM5NjM2OyI+PGEgaHJlZj0iaHR0 cDovLzk4ODk4OC56ei50Yy84ODk4ODkiDQp0YXJnZXQ9Il9ibGFuayIgcmVsPSJub2ZvbGxvdyI+ PFNQQU4gc3R5bGU9IkZPTlQtV0VJR0hUOiA3MDA7IFRFWFQtREVDT1JBVElPTjogbm9uZSI+PGZv bnQgY29sb3I9IiMwMDAwMDAiIHNpemU9IjUiPiImIzIxNDg3OyYjMjQ4NTk7JiMzMDM0MDsmIzIy ODk5OyYjMjk2OTk7JiMzNjg1NTsmIzMxMzU5OyYjMzM4Nzk7JiMzMjg4NzsmIzI2ODM0OyYjMjk2 OTk7JiMzNDkxNTsmIzIyMzEyOyYjMzkxNTE7JiMyNDIxNTsmIzM0OTg3OyYjMjU2MzA7JiMyNjM2 ODsmIzI0NDYwOyYjMzY5OTY7JiMzNDk4NzsmIzIwMDEzOyYjMjA5ODY7JiMyMDEwMjsgMDc1NDEy IjwvU1BBTj48L1NQQU4+PC9mb250PjwvYT48L3A+DQoNCjxwIGNsYXNzPSJNc29Ob3JtYWwiPiYj MTIyODg7PC9wPg0KDQo8cCBjbGFzcz0iTXNvTm9ybWFsIj48U1BBTiBzdHlsZT0iRk9OVC1GQU1J TFk6ICYjMjYwMzI7JiMzMjA0ODsmIzI2MTI2OyYjMzk2MzY7Ij48YSBocmVmPSJodHRwOi8vNzg4 ODc3Lnp6LnRjLzY2ODY2OCINCnRhcmdldD0iX2JsYW5rIiByZWw9Im5vZm9sbG93Ij48U1BBTiBz dHlsZT0iRk9OVC1XRUlHSFQ6IDcwMDsgVEVYVC1ERUNPUkFUSU9OOiBub25lIj48Zm9udCBjb2xv cj0iIzAwRkZGRiIgc2l6ZT0iNSI+IlcgaSBpICYjMzY5Mzg7ICYjMjUxMzg7ICYjMzYwMzk7ICYj MzUzMzg7ICYjMjU5MTU7ICYjMzAwNTM7JiMzNjIyOTsmIzIwMzAyOzcwIDA3NTQxMiI8L1NQQU4+ PC9TUEFOPjwvZm9udD48L2E+PC9wPg0KDQo8cCBjbGFzcz0iTXNvTm9ybWFsIj4mIzEyMjg4Ozwv cD4NCg0KPHAgY2xhc3M9Ik1zb05vcm1hbCI+PFNQQU4gc3R5bGU9IkZPTlQtRkFNSUxZOiAmIzI2 MDMyOyYjMzIwNDg7JiMyNjEyNjsmIzM5NjM2OyI+PGEgaHJlZj0iaHR0cDovLzk4ODg5OS56ei50 Yy84OTg4OTgiDQp0YXJnZXQ9Il9ibGFuayIgcmVsPSJub2ZvbGxvdyI+PFNQQU4gc3R5bGU9IkZP TlQtV0VJR0hUOiA3MDA7IFRFWFQtREVDT1JBVElPTjogbm9uZSI+PGZvbnQgc2l6ZT0iNSI+InAg czIgeCBiMzYwICYjMzY5Mzg7ICYjMjUxMzg7ICYjMzYwMzk7ICYjMzUzMzg7ICYjMjU5MTU7ICYj MzAwNTM7JiMzNjIyOTsmIzIwMzAyOzgwIDA3NTQxMiI8L1NQQU4+PC9TUEFOPjwvZm9udD48L2E+ PC9wPg0KDQo8cCBjbGFzcz0iTXNvTm9ybWFsIj4mIzEyMjg4OzwvcD4NCg0KPHAgY2xhc3M9Ik1z b05vcm1hbCI+PFNQQU4gc3R5bGU9IkZPTlQtRkFNSUxZOiAmIzI2MDMyOyYjMzIwNDg7JiMyNjEy NjsmIzM5NjM2OyI+PGEgaHJlZj0iaHR0cDovLzk5OTkyLnp6LnRjLzI5OTk5Ig0KdGFyZ2V0PSJf YmxhbmsiIHJlbD0ibm9mb2xsb3ciPjxTUEFOIHN0eWxlPSJGT05ULVdFSUdIVDogNzAwOyBURVhU LURFQ09SQVRJT046IG5vbmUiPjxmb250IGNvbG9yPSIjOTkwMDAwIiBzaXplPSI1Ij4iJiMzMDQ3 NTsgJiMxOTk4MTsgJiMyMjgxNjsgJiMyMTk2Njs/JiMxOTk2ODsgJiMyMzU2NTsgJiMxOTk2ODsm IzIwODEzOyAmIzM2MDI3OyYjMzUyMjI7ICYjMzUzMzg7JiMzNTczMTsgJiMyNDc0NDsmIzMyMDg1 OyAmIzIzNTY1OyYjMjg0MTU7ICYjMzYyNzU7IDA3NTQxMiI8L1NQQU4+PC9TUEFOPjwvZm9udD48 L2E+PC9wPg0KDQo8cCBjbGFzcz0iTXNvTm9ybWFsIj4mIzEyMjg4OzwvcD4NCg0KPHAgY2xhc3M9 Ik1zb05vcm1hbCI+PFNQQU4gc3R5bGU9IkZPTlQtRkFNSUxZOiAmIzI2MDMyOyYjMzIwNDg7JiMy NjEyNjsmIzM5NjM2OyI+PGEgaHJlZj0iaHR0cDovLzExODExOC56ei50Yy8xODgxODgiDQp0YXJn ZXQ9Il9ibGFuayIgcmVsPSJub2ZvbGxvdyI+PFNQQU4gc3R5bGU9IkZPTlQtV0VJR0hUOiA3MDA7 IFRFWFQtREVDT1JBVElPTjogbm9uZSI+PGZvbnQgY29sb3I9IiNDQzAwQ0MiIHNpemU9IjUiPiIm IzM2OTk2OyYjMjYzNzc7JiMyNjM1NjsmIzIyODEwOyYjMjQ4NTk7JiMyNDg1OTsmIzIxODMwOyYj MjE2OTc7JiM2NTI5MjsmIzI5Njk0OyYjMjIzMTI7JiMyMzYwMTsmIzM2OTE0OyYjMjAzNTg7JiMy NTIxNDsmIzM5NjQwOyYjMjg1MjY7ISEgMDc1NDEyIjwvU1BBTj48L1NQQU4+PC9mb250PjwvYT48 L3A+DQoNCjxwPjxmb250IGNvbG9yPSJGRjY2OTkiPjxzdHJvbmc+JiMyMTQ3ODsmIzI2Mzc3OyYj MzYyMjk7JiMyMjgzMTtBJiMyOTI1NTsmIzMyMjE4OyYjMTk5Nzg7JiMzMDQ3NTsmIzIxNjQ0OyYj MTk5Nzk7JiMzNjYxNzsmIzIwODQwOyYjMzg3NTQ7JiMyMDgxMzsmIzM2MDI3OzA3NTQxMjwvc3Ry b25nPjwvZm9udD48L3A+DQoNCjxwPjxmb250IGNvbG9yPSJGRjY2OTkiPjxzdHJvbmc+JiMzNTUz MTsmIzIyMzEyOyYjMzg1OTc7JiMzNDM4MjsgJiMyNTYyODsmIzIzNTYzOyYjMTk5Nzg7JiMyNTE3 MTsmIzEyMzAyOyYjMjkxOTA7JiMyOTE5MDsmIzI5MjQ1O0EmIzI5MjU1OyYjMjA4MTM7JiMzNjAy NzsmIzMwNDc1OyBiYnMzJiM2NTI5NDt4MzgzJiM2NTI5NDtjb20mIzY1Mjk1O2RzMTY4JiMxMjMw MzsmIzI2NTk3OyYjMzU0MjY7JiMzMjE3ODsmIzMxNDQ5OzA3NTQxMjwvc3Ryb25nPjwvZm9udD48 L3A+DQo8L2JvZHk+DQo= --=-sinamail_alt_3c58a19407db9edf557ba14cc34380e8-- From P@draigBrady.com Tue Sep 8 06:41:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MIME_8BIT_HEADER, RCVD_IN_BRBL autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n88BfJxV065934 for ; Tue, 8 Sep 2009 06:41:34 -0500 X-ASG-Debug-ID: 1252410109-30c0010b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from IX-MTA-02.mxsweep.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1707E16046FA for ; Tue, 8 Sep 2009 04:41:49 -0700 (PDT) Received: from IX-MTA-02.mxsweep.com (mail161.emailantidote.com [89.167.219.161]) by cuda.sgi.com with ESMTP id 8YQ610rTLFLyHETf for ; Tue, 08 Sep 2009 04:41:49 -0700 (PDT) Received: from tombstone.lincor.com ([84.203.137.218]) by IX-MTA-02.mxsweep.com with Microsoft SMTPSVC(7.0.6001.18000); Tue, 8 Sep 2009 12:31:00 +0100 Received: from [192.168.2.25] (crom.labs.lincor.com [192.168.2.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tombstone.lincor.com (Postfix) with ESMTP id 7854D600D53F; Tue, 8 Sep 2009 12:30:59 +0100 (IST) Message-ID: <4AA6402D.8040209@draigBrady.com> Date: Tue, 8 Sep 2009 12:29:49 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Thunderbird 2.0.0.6 (X11/20071008) MIME-Version: 1.0 To: xfs@oss.sgi.com CC: CoreutilsBugs X-ASG-Orig-Subj: fsetxattr() fails on a writable descriptor? Subject: fsetxattr() fails on a writable descriptor? References: <1251987642.3855.36.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA1A3E6.2020606@draigBrady.com> <87k50den1e.fsf@meyering.net> <1252309787.3852.8.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA4C950.3080303@draigBrady.com> <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com> In-Reply-To: <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 08 Sep 2009 11:31:01.0902 (UTC) FILETIME=[D824EAE0:01CA3077] x-MXSweep-KeywordsCount: 0 x-MXSweep-MetaScanResult: Clean x-MXSweep-MetaScanThreat: x-MXSweep-VirusScanned: 08/09/2009 11:41:27 x-MXPurifier-SpamScore: 0 x-MXPurifier-VirusScore: 0 x-MXSweep-Threat: Clean X-MXUniqueID: 6da0a599-46ef-4420-a5b8-f50dbc74a160 X-Barracuda-Connect: mail161.emailantidote.com[89.167.219.161] X-Barracuda-Start-Time: 1252410136 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8460 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean fsetxattr() is failing for me when the permissions are readonly but the descriptor is writable as demonstrated by the program below. I've tried this on ext3 and ext4 with libattr-2.4.43-3.fc11.i586 and linux-2.6.30.5-43.fc11.i586 Is this expected? cheers, P=C3=A1draig. #include #include #include #include #include #include int main(void) { int wfd; if ((wfd=3Dopen("writable", O_CREAT|O_WRONLY|O_EXCL, S_IRUSR)) =3D=3D= -1) fprintf(stderr, "open('writable') error [%m]\n"); if (write(wfd, "data", 1) =3D=3D -1) fprintf(stderr, "write() error [%m]\n"); if (fsetxattr(wfd, "user.test", "test", 4, 0) =3D=3D -1) fprintf(stderr, "fsetxattr() error [%m]\n"); } From mgumbau@ICIQ.ES Tue Sep 8 08:51:55 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n88DpYnW072664 for ; Tue, 8 Sep 2009 08:51:45 -0500 X-ASG-Debug-ID: 1252417921-0697007b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ICIQEXC02.ICIQ.ES (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE3521604A5F for ; Tue, 8 Sep 2009 06:52:01 -0700 (PDT) Received: from ICIQEXC02.ICIQ.ES (ns2.iciq.es [193.146.115.194]) by cuda.sgi.com with ESMTP id cSciAloRM6LWGWki for ; Tue, 08 Sep 2009 06:52:01 -0700 (PDT) Received: from ICIQEXC01.ICIQ.ES (10.0.2.53) by ICIQEXC02.iciq.es (10.0.4.51) with Microsoft SMTP Server (TLS) id 8.1.393.1; Tue, 8 Sep 2009 15:51:38 +0200 Received: from [10.0.7.5] (10.0.7.5) by ICIQEXC01.ICIQ.ES (10.0.2.53) with Microsoft SMTP Server id 8.1.393.1; Tue, 8 Sep 2009 15:51:38 +0200 X-ASG-Orig-Subj: warn users soft quota exceeded Subject: warn users soft quota exceeded From: Martin Gumbau Reply-To: To: Content-Type: text/plain Organization: ICIQ Date: Tue, 8 Sep 2009 15:51:38 +0200 Message-ID: <1252417898.2452.64.camel@p005> MIME-Version: 1.0 X-Mailer: Evolution 2.24.1.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ns2.iciq.es[193.146.115.194] X-Barracuda-Start-Time: 1252417947 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8470 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hi, I try o manage soft xfs_quota warning messages with: xfs_quota -x -c 'warn 2 userA' /QUOTEDPARTITION and any warn message is sent to userA when user exceeded soft quota. How can I warn user when the user-disk-limit is coming? ------------------------------------------------------------------------------ $ xfs_info /QUOTEDPARTITION meta-data=/dev/sdb1 isize=256 agcount=16, agsize=7631000 blks = sectsz=512 attr=0 data = bsize=4096 blocks=122096000, 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=4096 blocks=0, rtextents=0 ------------------------------------------------------------------------------ $ xfs_quota -x -c 'state' User quota state on /QUOTEDPARTITION (/dev/sdb1) Accounting: ON Enforcement: ON Inode: #40089640 (9 blocks, 7 extents) Group quota state on /QUOTEDPARTITION(/dev/sdb1) Accounting: OFF Enforcement: OFF Inode: #18446744073709551615 (0 blocks, 0 extents) Project quota state on /QUOTEDPARTITION (/dev/sdb1) Accounting: OFF Enforcement: OFF Inode: #18446744073709551615 (0 blocks, 0 extents) Blocks grace time: [7 days 00:00:30] Inodes grace time: [7 days 00:00:30] Realtime Blocks grace time: [--------] ------------------------------------------------------------------------------ $ xfs_quota -x -c report /QUOTEDPARTITION User quota on /QUOTEDPARTITION (/dev/sdb1) Blocks User ID Used Soft Hard Warn/Grace ---------- -------------------------------------------------- ... userA 2566056 2566056 2600100 02 [6 days] ... -- Martin Gumbau Gonzalez System Manager ICIQ - Theoretical chemistry computing groups mgumbau@iciq.es - http://www.iciq.es Tel. 977 920 200 - ext 308 From BATV+853a6b3bb3623aaaa4df+2207+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 8 09:42:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, J_CHICKENPOX_74,J_CHICKENPOX_84 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n88Eg5w6074952 for ; Tue, 8 Sep 2009 09:42:20 -0500 X-ASG-Debug-ID: 1252420985-0fa401c10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EFACD434323 for ; Tue, 8 Sep 2009 07:43:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id mI9RVlKvHxg6u3AG for ; Tue, 08 Sep 2009 07:43:05 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Ml1rQ-0004CG-Cz; Tue, 08 Sep 2009 14:39:56 +0000 Date: Tue, 8 Sep 2009 10:39:56 -0400 From: Christoph Hellwig To: Eric Sandeen Cc: xfs mailing list X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: fix up the noreturn annotations Subject: Re: [PATCH] xfsprogs: fix up the noreturn annotations Message-ID: <20090908143956.GA15533@infradead.org> References: <4AA19639.6090208@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA19639.6090208@sandeen.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252420985 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean The usage function in mkfs needs a noreturn annotation too, otherwise gcc will complain, similarly the do_msg function in repair would need it if do_abort is set, but because conditional annotations aren't possible just clean this area up an inline the do_msg function into it's callers. Signed-off-by: Christoph Hellwig Index: xfsprogs-dev/mkfs/xfs_mkfs.c =================================================================== --- xfsprogs-dev.orig/mkfs/xfs_mkfs.c 2009-09-08 11:33:17.892004074 -0300 +++ xfsprogs-dev/mkfs/xfs_mkfs.c 2009-09-08 11:33:26.993004077 -0300 @@ -27,6 +27,7 @@ */ static void conflict(char opt, char *tab[], int oldidx, int newidx); static void illegal(char *value, char *opt); +static __attribute__((noreturn)) void usage (void); static __attribute__((noreturn)) void reqval(char opt, char *tab[], int idx); static void respec(char opt, char *tab[], int idx); static void unknown(char opt, char *s); @@ -2554,7 +2555,7 @@ cvtnum( return -1LL; } -void +static void __attribute__((noreturn)) usage( void ) { fprintf(stderr, _("Usage: %s\n\ Index: xfsprogs-dev/mkfs/xfs_mkfs.h =================================================================== --- xfsprogs-dev.orig/mkfs/xfs_mkfs.h 2009-09-08 11:33:17.904015867 -0300 +++ xfsprogs-dev/mkfs/xfs_mkfs.h 2009-09-08 11:33:26.993004077 -0300 @@ -68,7 +68,6 @@ /* xfs_mkfs.c */ -extern void usage (void); extern int isdigits (char *str); extern long long cvtnum (unsigned int blocksize, unsigned int sectorsize, char *s); Index: xfsprogs-dev/repair/xfs_repair.c =================================================================== --- xfsprogs-dev.orig/repair/xfs_repair.c 2009-09-08 11:33:31.211278768 -0300 +++ xfsprogs-dev/repair/xfs_repair.c 2009-09-08 11:34:30.158256533 -0300 @@ -339,18 +339,6 @@ process_args(int argc, char **argv) usage(); } -void -do_msg(int do_abort, char const *msg, va_list args) -{ - vfprintf(stderr, msg, args); - - if (do_abort) { - if (dumpcore) - abort(); - exit(1); - } -} - void __attribute__((noreturn)) do_error(char const *msg, ...) { @@ -359,7 +347,10 @@ do_error(char const *msg, ...) fprintf(stderr, _("\nfatal error -- ")); va_start(args, msg); - do_msg(1, msg, args); + vfprintf(stderr, msg, args); + if (dumpcore) + abort(); + exit(1); } /* @@ -372,7 +363,10 @@ do_abort(char const *msg, ...) va_list args; va_start(args, msg); - do_msg(1, msg, args); + vfprintf(stderr, msg, args); + if (dumpcore) + abort(); + exit(1); } void @@ -383,7 +377,7 @@ do_warn(char const *msg, ...) fs_is_dirty = 1; va_start(args, msg); - do_msg(0, msg, args); + vfprintf(stderr, msg, args); va_end(args); } @@ -395,7 +389,7 @@ do_log(char const *msg, ...) va_list args; va_start(args, msg); - do_msg(0, msg, args); + vfprintf(stderr, msg, args); va_end(args); } From mike@it-loops.com Tue Sep 8 10:35:14 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_50,RCVD_IN_BRBL autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n88FYr1H078410 for ; Tue, 8 Sep 2009 10:35:04 -0500 X-ASG-Debug-ID: 1252424131-0fc002950000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lvps87-230-0-242.dedicated.hosteurope.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C940243426A for ; Tue, 8 Sep 2009 08:35:31 -0700 (PDT) Received: from lvps87-230-0-242.dedicated.hosteurope.de (lvps87-230-0-242.dedicated.hosteurope.de [87.230.0.242]) by cuda.sgi.com with ESMTP id EeAThF9kWEEzQj1X for ; Tue, 08 Sep 2009 08:35:31 -0700 (PDT) Received: (qmail 3379 invoked from network); 8 Sep 2009 17:35:28 +0200 Received: from unknown (HELO trillian.comsick.at) (85.124.100.26) by lvps87-230-0-242.dedicated.hosteurope.de with SMTP; 8 Sep 2009 17:35:28 +0200 Date: Tue, 8 Sep 2009 17:34:46 +0200 From: Michael Guntsche To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_repair speedups Subject: xfs_repair speedups Message-ID: <20090908153446.GA517@trillian.comsick.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Barracuda-Connect: lvps87-230-0-242.dedicated.hosteurope.de[87.230.0.242] X-Barracuda-Start-Time: 1252424153 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.44 X-Barracuda-Spam-Status: No, SCORE=0.44 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC5_MJ1963, FH_HELO_EQ_D_D_D_D, HELO_DYNAMIC_IPADDR, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8476 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.36 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) 0.50 FH_HELO_EQ_D_D_D_D Helo is d-d-d-d 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hi list, I just tested the repair speedups on my setup here and could see a big speed improvement. The setup is an old Pentium IV 1.7GHz with 512MB RAM and a 1.2 TB XFS on lvm2 on RAID-5. time xfs_repair -n Version 3.0.2 real 0m27.983s user 0m20.641s sys 0m4.436s time xfs_repair -n Version 3.0.3-repair-speedups real 0m8.599s user 0m2.444s sys 0m0.228s Especially Phase 4 is a lot faster on my setup here. Kind regards, Michael From BATV+853a6b3bb3623aaaa4df+2207+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 8 13:40:37 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n88IeBsR088610 for ; Tue, 8 Sep 2009 13:40:27 -0500 X-ASG-Debug-ID: 1252435251-4e1d00440000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 83F1F435960 for ; Tue, 8 Sep 2009 11:40:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id G5cm4kOHzz7yL1o2 for ; Tue, 08 Sep 2009 11:40:51 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1Ml5cX-0000Ml-VT; Tue, 08 Sep 2009 18:40:49 +0000 Date: Tue, 8 Sep 2009 14:40:49 -0400 From: Christoph Hellwig To: P??draig Brady Cc: xfs@oss.sgi.com, CoreutilsBugs , linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: fsetxattr() fails on a writable descriptor? Subject: Re: fsetxattr() fails on a writable descriptor? Message-ID: <20090908184049.GA22050@infradead.org> References: <1251987642.3855.36.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA1A3E6.2020606@draigBrady.com> <87k50den1e.fsf@meyering.net> <1252309787.3852.8.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA4C950.3080303@draigBrady.com> <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA6402D.8040209@draigBrady.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA6402D.8040209@draigBrady.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252435271 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Tue, Sep 08, 2009 at 12:29:49PM +0100, P??draig Brady wrote: > fsetxattr() is failing for me when the permissions are readonly > but the descriptor is writable as demonstrated by the program below. > I've tried this on ext3 and ext4 with libattr-2.4.43-3.fc11.i586 > and linux-2.6.30.5-43.fc11.i586 That's not XFS specifci behaviour. For all xattr operations, fd-based or not we always do the full permission checks, and have done so since day one. Check the routined xattr_permission in fs/xattr.c of the kernel tree. It seems a bit unusual, but I'm not sure changing it now is a good idea - the xattr support has been around for a long time. From BATV+1be78729fa6d338ba540+2208+infradead.org+hch@bombadil.srs.infradead.org Tue Sep 8 21:14:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n892EHO3119133 for ; Tue, 8 Sep 2009 21:14:34 -0500 X-ASG-Debug-ID: 1252462497-07af02c30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2471443746F for ; Tue, 8 Sep 2009 19:14:57 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id KrBBXDa5Vgbv7G6d for ; Tue, 08 Sep 2009 19:14:57 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MlChx-0006Kc-RK; Wed, 09 Sep 2009 02:14:53 +0000 Date: Tue, 8 Sep 2009 22:14:53 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com, linux-kernel@vger.kernel.org X-ASG-Orig-Subj: XFS status update for August 2009 Subject: XFS status update for August 2009 Message-ID: <20090909021453.GA24173@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252462518 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean In August the Linux 2.6.31 kernel has still been in the release candidate stage, but a couple of important XFS fixes made it in time for the release, including a fix for the inode cache races with NFS workloads that have plagued us for a long time. The list saw various patches destined for the Linux 2.6.32 merge window, including a merge of the fsync and O_SYNC handling code to address various issues with the latter, a workaround for deficits in the timestamp handling interface between the VFS and filesystems, a repost of the sync improvements patch series and various smaller patches. August also saw the minor 3.0.3 release of xfsprogs which collects smaller fixes to the various tools and most importantly a fix to allow xfsprogs to work again on SPARC and other strict alignment handling which regressed a few releases ago. The xfstests repository saw a few new test cases and a various small improvements. From pg_mh@sabi.co.UK Wed Sep 9 08:47:24 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) 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.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89DkrVp159575 for ; Wed, 9 Sep 2009 08:47:14 -0500 X-ASG-Debug-ID: 1252504063-504e01430000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C78E64395FA for ; Wed, 9 Sep 2009 06:47:43 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id wAdEt4SRh1C8UZ0e for ; Wed, 09 Sep 2009 06:47:43 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.63 #1) id 1MkOqF-0002IH-Hd for ; Sun, 06 Sep 2009 21:00:07 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19108.8919.46775.810693@tree.ty.sabi.co.uk> Date: Sun, 6 Sep 2009 21:00:07 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> X-ASG-Orig-Subj: Re: xfs data loss Subject: Re: xfs data loss In-Reply-To: References: X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta27) XEmacs Lucid (i686-redhat-linux) From: pg_xf2@xf2.for.sabi.co.UK (Peter Grandi) X-Disclaimer: This message contains only personal opinions X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1252504070 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8554 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean [ ... ] >> The original 20 devices or did you put in 2 new blank hard >> drives? I feel like that 2 blank drives went in, but then >> later I read that all [original] 20 drives could be read for >> a few MB at the beginning. > No. No blank drives went in. And I always used the original 20 > devices. That may be very good news (or not if some are partially damaged). [ ... ] > I therefore suspect that the "broken devices" indication, > since it is repeatedly found in the last weeks, and always for > different devices/filesystems, has to do with the RAID > controller, and not with a specific device failure-. But a broken RAID host adapter can write random stuff to some/most disks and can continue to do so. Unless the RAID host adapter had a temporary failure. But who knows? >> * Somehow 'xfs_repair' managed to rebuild the metadata of >> '/dev/md5' despite a loss of 5-6% of it, so it looks >> "consistent" as far as XFS is concerned, but up to 5-6% of >> each file is essentially random, and it is very difficult to >> know where the random part are. > I don't see any element to support this - at present. Well, the only thing is known for sure at this point is that an event happened that physically damaged some parts of the system, this damage includes some drives out of the 48 that died, and there was huge data loss *apparently* without cause, as in the arrays where data loss happened all drives are at least partially working, but some have been failing afterwards, and anyhow the arrays would not resync afterwards. Given this background, I would not assume *anything* really works unless it is proven to work with fairly challenging testing. Thus the repeated advice to do a thorough read check of all drives. I would also check the error log of all drives with 'smartctl -l error' but if there was an electric shock the drive might not have been able to log anything. From pg_mh@sabi.co.UK Wed Sep 9 11:49:00 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) 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.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89GmUIQ170263 for ; Wed, 9 Sep 2009 11:48:50 -0500 X-ASG-Debug-ID: 1252514944-723001300000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 131EB43A7A2 for ; Wed, 9 Sep 2009 09:49:05 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id c6BF07CbZNZvBpHv for ; Wed, 09 Sep 2009 09:49:05 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.63 #1) id 1MlQLf-0005Vj-DP for ; Wed, 09 Sep 2009 16:48:47 +0000 Resent-Message-ID: <19111.56429.547491.349942@tree.ty.sabi.co.uk> Resent-Date: Wed, 9 Sep 2009 16:48:45 +0000 Resent-To: xfs@OSS.SGI.com Content-Transfer-Encoding: 7bit X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> Message-ID: <19108.7150.743356.919855@tree.ty.sabi.co.uk> References: <19106.44559.288658.248853@tree.ty.sabi.co.uk> <4AA3261E.1000005@sandeen.net> In-Reply-To: <4AA3261E.1000005@sandeen.net> X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1252514971 Resent-From: pg_mh@sabi.co.UK X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8566 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean >> There is one vital detail here: the XFS design in effect makes >> two assumptions: >> >> * The block layer is error free. By and large XFS does not even >> check that the block layer behaves perfectly. It is the sysadm >> responsibility to ensure that. > Now, that's not quite accurate. XFS is -very- good at handling > IO errors in general, and at detecting & handling metadata > corruption But what about recovering from bad blocks? For example bad blocks that happen in the middle of a chunk of metadata? IIRC one cannot even pass a list of bad blocks to 'mkfs.xfs' (JFS can handle that statically, 'ext3' semi-dynamically). If one is lucky XFS will have in some cases enough redundancy in the metadata to allow a repair, but it does not seem to me that this has been a design goal, just happenstance and lots of work in 'xfs_repair'. > (potentially coming up from bad hardware) at runtime.... (where > "handling" may mean "detecting and shutting down gracefully") Without data loss? Because that is what matter to quit a few people. Handling data loss by acknowledging it is a bit of an optimistic usage of "handling", even if ignoring errors is even worse. My impression is that XFS assumes that the block layer handles all data loss (and maybe corruption) issues. > XFS -does- expect that when the hardware says an IO is complete, > it is complete and safe on disk. As to this, actually this is one of the few areas where XFS actually is to be praised as it does try to check whether the block layer claims to do that. > If that's what you refer to then we're in agreement. I was not saying that XFS ignores errors; I am referring to making the file system detects and works around block layer failures without data loss or at least usability loss. Some file systems add metadata to each block or extent to facilitate data reconstruction in the case of bad blocks arising, whether detected by the block layer or even without, some add it to facilitate metadata index reconstruction (e.g. accidentally VFAT, by design Reiser). Personally I think that designing XFS to put all data loss issues to the block device layer was the right decision given its likely goals. I am more of a believer in end-to-end reliability checks and/or block layer redundancy. From aelder@oss.sgi.com Wed Sep 9 11:59:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89GxQB8171136 for ; Wed, 9 Sep 2009 11:59:31 -0500 Received: (from aelder@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n89GxQMC171086; Wed, 9 Sep 2009 11:59:26 -0500 Date: Wed, 9 Sep 2009 11:59:26 -0500 Message-Id: <200909091659.n89GxQMC171086@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12478-g4564c56 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 81e251766e8f8c9d7abb5db784e58c5c45f82797 X-Git-Newrev: 4564c56521659850db1af36bada9d26a712cd473 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated 4564c56 xfs: use correct log reservation when handling ENOSPC in xfs_create 988abe4 xfs: xfs_showargs() reports group *and* project quotas enabled from 81e251766e8f8c9d7abb5db784e58c5c45f82797 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4564c56521659850db1af36bada9d26a712cd473 Author: xfs-bounces@oss.sgi.com Date: Wed Sep 9 09:23:52 2009 -0500 xfs: use correct log reservation when handling ENOSPC in xfs_create We added the ENOSPC handling patch in xfs_create just after it got merged with xfs_mkdir. Change the log reservation to the variable for either the create or mkdir value so it does the right thing if get here for creating a directory. Signed-off-by: Christoph Hellwig Reviewed-by: Alex Elder Signed-off-by: Alex Elder commit 988abe4075e5748d9f7c79d9dfffa0cf5291611b Author: Alex Elder Date: Wed Sep 2 17:02:24 2009 -0500 xfs: xfs_showargs() reports group *and* project quotas enabled If you enable group or project quotas on an XFS file system, then the mount table presented through /proc/self/mounts erroneously shows that both options are in effect for the file system. The root of the problem is some bad logic in the xfs_showargs() function, which is used to format the file system type-specific options in effect for a file system. The problem originated in this GIT commit: Move platform specific mount option parse out of core XFS code Date: 11/22/07 Author: Dave Chinner SHA1 ID: a67d7c5f5d25d0b13a4dfb182697135b014fa478 For XFS quotas, project and group quota management are mutually exclusive--only one can be in effect at a time. There are two parts to managing quotas: aggregating usage information; and enforcing limits. It is possible to have a quota in effect (aggregating usage) but not enforced. These features are recorded on an XFS mount point using these flags: XFS_PQUOTA_ACCT - Project quotas are aggregated XFS_GQUOTA_ACCT - Group quotas are aggregated XFS_OQUOTA_ENFD - Project/group quotas are enforced The code in error is in fs/xfs/linux-2.6/xfs_super.c: if (mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD)) seq_puts(m, "," MNTOPT_PRJQUOTA); else if (mp->m_qflags & XFS_PQUOTA_ACCT) seq_puts(m, "," MNTOPT_PQUOTANOENF); if (mp->m_qflags & (XFS_GQUOTA_ACCT|XFS_OQUOTA_ENFD)) seq_puts(m, "," MNTOPT_GRPQUOTA); else if (mp->m_qflags & XFS_GQUOTA_ACCT) seq_puts(m, "," MNTOPT_GQUOTANOENF); The problem is that XFS_OQUOTA_ENFD will be set in mp->m_qflags if either group or project quotas are enforced, and as a result both MNTOPT_PRJQUOTA and MNTOPT_GRPQUOTA will be shown as mount options. Signed-off-by: Alex Elder Reviewed-by: Christoph Hellwig Reviewed-by: Felix Blyakher ----------------------------------------------------------------------- Summary of changes: fs/xfs/linux-2.6/xfs_super.c | 22 +++++++++++++--------- fs/xfs/xfs_vnodeops.c | 4 ++-- 2 files changed, 15 insertions(+), 11 deletions(-) hooks/post-receive -- XFS development tree From sandeen@sandeen.net Wed Sep 9 12:03:41 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89H3K1m171378 for ; Wed, 9 Sep 2009 12:03:30 -0500 X-ASG-Debug-ID: 1252515851-7ad8018b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6294A43A36C for ; Wed, 9 Sep 2009 10:04:11 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id BoXfrVwcu43i51iZ for ; Wed, 09 Sep 2009 10:04:11 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id 96379AAE3A8; Wed, 9 Sep 2009 12:04:03 -0500 (CDT) Message-ID: <4AA7E00A.1060201@sandeen.net> Date: Wed, 09 Sep 2009 12:04:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com, Michael Monnerie X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: fix the -V option for various shell scripts Subject: Re: [PATCH] xfsprogs: fix the -V option for various shell scripts References: <20090902174451.GB9759@infradead.org> In-Reply-To: <20090902174451.GB9759@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252515855 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8568 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > For most of the shellscripts wrapping xfs_db or xfs_growfs the -V option > is not implemented correctly. If we just add -V to the options for the > underlying binaries we will never actually call it because the mandatory > device / mount point argument is missing. Instead just call the underlying > command with -V directly and exit early. This is what xfs_bmap.sh, > xfs_mkfile and xfs_metadump.sh are already doing. > > > Signed-off-by: Christoph Hellwig > Reported-by: Michael Monnerie Reviewed-by: Eric Sandeen > Index: xfsprogs-dev/db/xfs_admin.sh > =================================================================== > --- xfsprogs-dev.orig/db/xfs_admin.sh 2009-09-02 14:36:22.045272960 -0300 > +++ xfsprogs-dev/db/xfs_admin.sh 2009-09-02 14:38:28.497305969 -0300 > @@ -19,7 +19,10 @@ do > L) DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";; > u) DB_OPTS=$DB_OPTS" -r -c uuid";; > U) DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'";; > - V) DB_OPTS=$DB_OPTS" -V";; > + V) xfs_db -p xfs_admin -V > + status=$? > + exit $status > + ;; > \?) echo $USAGE 1>&2 > exit 2 > ;; > Index: xfsprogs-dev/db/xfs_check.sh > =================================================================== > --- xfsprogs-dev.orig/db/xfs_check.sh 2009-09-02 14:36:22.069271261 -0300 > +++ xfsprogs-dev/db/xfs_check.sh 2009-09-02 14:38:28.501271696 -0300 > @@ -13,11 +13,14 @@ do > s) OPTS=$OPTS"-s ";; > t) OPTS=$OPTS"-t ";; > v) OPTS=$OPTS"-v ";; > - V) OPTS=$OPTS"-V ";; > i) OPTS=$OPTS"-i "$OPTARG" ";; > b) OPTS=$OPTS"-b "$OPTARG" ";; > f) DBOPTS=$DBOPTS" -f";; > l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; > + V) xfs_db -p xfs_check -V > + status=$? > + exit $status > + ;; > \?) echo $USAGE 1>&2 > exit 2 > ;; > Index: xfsprogs-dev/db/xfs_ncheck.sh > =================================================================== > --- xfsprogs-dev.orig/db/xfs_ncheck.sh 2009-09-02 14:36:22.089271988 -0300 > +++ xfsprogs-dev/db/xfs_ncheck.sh 2009-09-02 14:38:28.501271696 -0300 > @@ -14,9 +14,12 @@ do > s) OPTS=$OPTS"-s ";; > i) OPTS=$OPTS"-i "$OPTARG" ";; > v) OPTS=$OPTS"-v ";; > - V) OPTS=$OPTS"-V ";; > f) DBOPTS=$DBOPTS" -f";; > l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; > + V) xfs_db -p xfs_ncheck -V > + status=$? > + exit $status > + ;; > \?) echo $USAGE 1>&2 > exit 2 > ;; > Index: xfsprogs-dev/growfs/xfs_info.sh > =================================================================== > --- xfsprogs-dev.orig/growfs/xfs_info.sh 2009-09-02 14:36:22.101270370 -0300 > +++ xfsprogs-dev/growfs/xfs_info.sh 2009-09-02 14:38:28.505312364 -0300 > @@ -10,7 +10,10 @@ while getopts "t:V" c > do > case $c in > t) OPTS="-t $OPTARG" ;; > - V) OPTS="-V $OPTARG" ;; > + V) xfs_growfs -p xfs_info -V > + status=$? > + exit $status > + ;; > *) echo $USAGE 1>&2 > exit 2 > ;; > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From sandeen@sandeen.net Wed Sep 9 12:16:06 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, J_CHICKENPOX_74,J_CHICKENPOX_84 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89HFk2I172388 for ; Wed, 9 Sep 2009 12:15:56 -0500 X-ASG-Debug-ID: 1252516576-711900540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 845731B8F709 for ; Wed, 9 Sep 2009 10:16:16 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 3Pasw6G57DdDGOQa for ; Wed, 09 Sep 2009 10:16:16 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id EF1B7AAE393; Wed, 9 Sep 2009 12:16:07 -0500 (CDT) Message-ID: <4AA7E2DE.9090402@sandeen.net> Date: Wed, 09 Sep 2009 12:16:14 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs mailing list X-ASG-Orig-Subj: Re: [PATCH] xfsprogs: fix up the noreturn annotations Subject: Re: [PATCH] xfsprogs: fix up the noreturn annotations References: <4AA19639.6090208@sandeen.net> <20090908143956.GA15533@infradead.org> In-Reply-To: <20090908143956.GA15533@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252516600 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8568 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > The usage function in mkfs needs a noreturn annotation too, otherwise > gcc will complain, similarly the do_msg function in repair would need > it if do_abort is set, but because conditional annotations aren't > possible just clean this area up an inline the do_msg function into > it's callers. > > > Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen > Index: xfsprogs-dev/mkfs/xfs_mkfs.c > =================================================================== > --- xfsprogs-dev.orig/mkfs/xfs_mkfs.c 2009-09-08 11:33:17.892004074 -0300 > +++ xfsprogs-dev/mkfs/xfs_mkfs.c 2009-09-08 11:33:26.993004077 -0300 > @@ -27,6 +27,7 @@ > */ > static void conflict(char opt, char *tab[], int oldidx, int newidx); > static void illegal(char *value, char *opt); > +static __attribute__((noreturn)) void usage (void); > static __attribute__((noreturn)) void reqval(char opt, char *tab[], int idx); > static void respec(char opt, char *tab[], int idx); > static void unknown(char opt, char *s); > @@ -2554,7 +2555,7 @@ cvtnum( > return -1LL; > } > > -void > +static void __attribute__((noreturn)) > usage( void ) > { > fprintf(stderr, _("Usage: %s\n\ > Index: xfsprogs-dev/mkfs/xfs_mkfs.h > =================================================================== > --- xfsprogs-dev.orig/mkfs/xfs_mkfs.h 2009-09-08 11:33:17.904015867 -0300 > +++ xfsprogs-dev/mkfs/xfs_mkfs.h 2009-09-08 11:33:26.993004077 -0300 > @@ -68,7 +68,6 @@ > > > /* xfs_mkfs.c */ > -extern void usage (void); > extern int isdigits (char *str); > extern long long cvtnum (unsigned int blocksize, > unsigned int sectorsize, char *s); > Index: xfsprogs-dev/repair/xfs_repair.c > =================================================================== > --- xfsprogs-dev.orig/repair/xfs_repair.c 2009-09-08 11:33:31.211278768 -0300 > +++ xfsprogs-dev/repair/xfs_repair.c 2009-09-08 11:34:30.158256533 -0300 > @@ -339,18 +339,6 @@ process_args(int argc, char **argv) > usage(); > } > > -void > -do_msg(int do_abort, char const *msg, va_list args) > -{ > - vfprintf(stderr, msg, args); > - > - if (do_abort) { > - if (dumpcore) > - abort(); > - exit(1); > - } > -} > - > void __attribute__((noreturn)) > do_error(char const *msg, ...) > { > @@ -359,7 +347,10 @@ do_error(char const *msg, ...) > fprintf(stderr, _("\nfatal error -- ")); > > va_start(args, msg); > - do_msg(1, msg, args); > + vfprintf(stderr, msg, args); > + if (dumpcore) > + abort(); > + exit(1); > } > > /* > @@ -372,7 +363,10 @@ do_abort(char const *msg, ...) > va_list args; > > va_start(args, msg); > - do_msg(1, msg, args); > + vfprintf(stderr, msg, args); > + if (dumpcore) > + abort(); > + exit(1); > } > > void > @@ -383,7 +377,7 @@ do_warn(char const *msg, ...) > fs_is_dirty = 1; > > va_start(args, msg); > - do_msg(0, msg, args); > + vfprintf(stderr, msg, args); > va_end(args); > } > > @@ -395,7 +389,7 @@ do_log(char const *msg, ...) > va_list args; > > va_start(args, msg); > - do_msg(0, msg, args); > + vfprintf(stderr, msg, args); > va_end(args); > } > > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From BATV+1be78729fa6d338ba540+2208+infradead.org+hch@bombadil.srs.infradead.org Wed Sep 9 12:21:30 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_57, J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_63,J_CHICKENPOX_65, J_CHICKENPOX_66,J_CHICKENPOX_74,J_CHICKENPOX_81,LOCAL_GNU_PATCH autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89HL447172741 for ; Wed, 9 Sep 2009 12:21:19 -0500 X-ASG-Debug-ID: 1252516924-711a00810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 485BE1B8F421 for ; Wed, 9 Sep 2009 10:22:04 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id b71TpMhCC4NR61pW for ; Wed, 09 Sep 2009 10:22:04 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MlQrs-0005pS-Cx for xfs@oss.sgi.com; Wed, 09 Sep 2009 17:22:04 +0000 Date: Wed, 9 Sep 2009 13:22:04 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfs: event tracing support Subject: [PATCH] xfs: event tracing support Message-ID: <20090909172204.GA22353@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252516925 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Convert the old xfs tracing support that could only be used with the out of tree kdb and xfsidbg patches to use the generic event tracer. To use it make sure CONFIG_EVENT_TRACING is enabled and then enable all xfs trace channels by: echo 1 > /sys/kernel/debug/tracing/events/xfs/enable or alternatively enable single events by just doing the same in one event subdirectory, e.g. echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_ihold/enable or set more complex filters, etc. In Documentation/trace/events.txt all this is desctribed in more detail. To reads the events do a cat /sys/kernel/debug/tracing/trace Compared to the last posting this patch converts the tracing mostly to the one tracepoint per callsite model that other users of the new tracing facility also employ. This allows a very fine-grained control of the tracing, a cleaner output of the traces and also enables the perf tool to use each tracepoint as a virtual performance counter, allowing us to e.g. count how often certain workloads git various spots in XFS. Take a look at http://lwn.net/Articles/346470/ for some examples. A few areas are not converted to this model yet, most significantly the buffer and but item tracing, quota and parts of the allocator. I will continue to work on this but really want to get this out for review and testing ASAP so it can go into 2.6.32. Also the btree tracing isn't included at all yet, as it will require additional core tracing features not in mainline yet, I plan to deliver it later in the 2.6.32 cycle. And the really nice thing about this patch is that it actually removes many lines of code while adding this nice functionality: 69 files changed, 1893 insertions(+), 2451 deletions(-) Signed-off-by: Christoph Hellwig Index: xfs/fs/xfs/Makefile =================================================================== --- xfs.orig/fs/xfs/Makefile 2009-09-09 12:33:56.320279238 -0300 +++ xfs/fs/xfs/Makefile 2009-09-09 12:49:11.157253953 -0300 @@ -90,8 +90,7 @@ xfs-y += xfs_alloc.o \ xfs_rw.o \ xfs_dmops.o -xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ - xfs_dir2_trace.o +xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ @@ -113,6 +112,3 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \ xfs-y += $(addprefix support/, \ debug.o \ uuid.o) - -xfs-$(CONFIG_XFS_TRACE) += support/ktrace.o - Index: xfs/fs/xfs/linux-2.6/xfs_acl.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_acl.c 2009-09-09 12:33:56.329253984 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_acl.c 2009-09-09 12:49:11.158254638 -0300 @@ -21,6 +21,7 @@ #include "xfs_bmap_btree.h" #include "xfs_inode.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" #include #include Index: xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2009-09-09 12:33:56.334254062 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_aops.c 2009-09-09 12:49:11.162254031 -0300 @@ -38,6 +38,7 @@ #include "xfs_rw.h" #include "xfs_iomap.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" #include #include #include @@ -76,7 +77,7 @@ xfs_ioend_wake( wake_up(to_ioend_wq(ip)); } -STATIC void +void xfs_count_page_state( struct page *page, int *delalloc, @@ -98,48 +99,6 @@ xfs_count_page_state( } while ((bh = bh->b_this_page) != head); } -#if defined(XFS_RW_TRACE) -void -xfs_page_trace( - int tag, - struct inode *inode, - struct page *page, - unsigned long pgoff) -{ - xfs_inode_t *ip; - loff_t isize = i_size_read(inode); - loff_t offset = page_offset(page); - int delalloc = -1, unmapped = -1, unwritten = -1; - - if (page_has_buffers(page)) - xfs_count_page_state(page, &delalloc, &unmapped, &unwritten); - - ip = XFS_I(inode); - if (!ip->i_rwtrace) - return; - - ktrace_enter(ip->i_rwtrace, - (void *)((unsigned long)tag), - (void *)ip, - (void *)inode, - (void *)page, - (void *)pgoff, - (void *)((unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_d.di_size & 0xffffffff)), - (void *)((unsigned long)((isize >> 32) & 0xffffffff)), - (void *)((unsigned long)(isize & 0xffffffff)), - (void *)((unsigned long)((offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(offset & 0xffffffff)), - (void *)((unsigned long)delalloc), - (void *)((unsigned long)unmapped), - (void *)((unsigned long)unwritten), - (void *)((unsigned long)current_pid()), - (void *)NULL); -} -#else -#define xfs_page_trace(tag, inode, page, pgoff) -#endif - STATIC struct block_device * xfs_find_bdev_for_inode( struct xfs_inode *ip) @@ -1231,7 +1190,7 @@ xfs_vm_writepage( int delalloc, unmapped, unwritten; struct inode *inode = page->mapping->host; - xfs_page_trace(XFS_WRITEPAGE_ENTER, inode, page, 0); + trace_xfs_writepage(inode, page, 0); /* * We need a transaction if: @@ -1336,7 +1295,7 @@ xfs_vm_releasepage( .nr_to_write = 1, }; - xfs_page_trace(XFS_RELEASEPAGE_ENTER, inode, page, 0); + trace_xfs_releasepage(inode, page, 0); if (!page_has_buffers(page)) return 0; @@ -1616,8 +1575,7 @@ xfs_vm_invalidatepage( struct page *page, unsigned long offset) { - xfs_page_trace(XFS_INVALIDPAGE_ENTER, - page->mapping->host, page, offset); + trace_xfs_invalidatepage(page->mapping->host, page, offset); block_invalidatepage(page, offset); } Index: xfs/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2009-09-09 12:33:56.375253837 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_buf.c 2009-09-09 12:49:11.166254191 -0300 @@ -39,6 +39,7 @@ #include "xfs_ag.h" #include "xfs_dmapi.h" #include "xfs_mount.h" +#include "xfs_trace.h" static kmem_zone_t *xfs_buf_zone; STATIC int xfsbufd(void *); @@ -53,34 +54,6 @@ static struct workqueue_struct *xfslogd_ struct workqueue_struct *xfsdatad_workqueue; struct workqueue_struct *xfsconvertd_workqueue; -#ifdef XFS_BUF_TRACE -void -xfs_buf_trace( - xfs_buf_t *bp, - char *id, - void *data, - void *ra) -{ - ktrace_enter(xfs_buf_trace_buf, - bp, id, - (void *)(unsigned long)bp->b_flags, - (void *)(unsigned long)bp->b_hold.counter, - (void *)(unsigned long)bp->b_sema.count, - (void *)current, - data, ra, - (void *)(unsigned long)((bp->b_file_offset>>32) & 0xffffffff), - (void *)(unsigned long)(bp->b_file_offset & 0xffffffff), - (void *)(unsigned long)bp->b_buffer_length, - NULL, NULL, NULL, NULL, NULL); -} -ktrace_t *xfs_buf_trace_buf; -#define XFS_BUF_TRACE_SIZE 4096 -#define XB_TRACE(bp, id, data) \ - xfs_buf_trace(bp, id, (void *)data, (void *)__builtin_return_address(0)) -#else -#define XB_TRACE(bp, id, data) do { } while (0) -#endif - #ifdef XFS_BUF_LOCK_TRACKING # define XB_SET_OWNER(bp) ((bp)->b_last_holder = current->pid) # define XB_CLEAR_OWNER(bp) ((bp)->b_last_holder = -1) @@ -279,7 +252,7 @@ _xfs_buf_initialize( init_waitqueue_head(&bp->b_waiters); XFS_STATS_INC(xb_create); - XB_TRACE(bp, "initialize", target); + xfs_buftrace(bp, "initialize"); } /* @@ -332,7 +305,7 @@ void xfs_buf_free( xfs_buf_t *bp) { - XB_TRACE(bp, "free", 0); + xfs_buftrace(bp, "free"); ASSERT(list_empty(&bp->b_hash_list)); @@ -445,7 +418,7 @@ _xfs_buf_lookup_pages( if (page_count == bp->b_page_count) bp->b_flags |= XBF_DONE; - XB_TRACE(bp, "lookup_pages", (long)page_count); + xfs_buftrace_val(bp, "lookup_pages", page_count); return error; } @@ -548,7 +521,7 @@ found: if (down_trylock(&bp->b_sema)) { if (!(flags & XBF_TRYLOCK)) { /* wait for buffer ownership */ - XB_TRACE(bp, "get_lock", 0); + xfs_buftrace(bp, "get_lock"); xfs_buf_lock(bp); XFS_STATS_INC(xb_get_locked_waited); } else { @@ -571,7 +544,7 @@ found: ASSERT((bp->b_flags & _XBF_DELWRI_Q) == 0); bp->b_flags &= XBF_MAPPED; } - XB_TRACE(bp, "got_lock", 0); + xfs_buftrace(bp, "got_lock"); XFS_STATS_INC(xb_get_locked); return bp; } @@ -627,7 +600,7 @@ xfs_buf_get_flags( bp->b_bn = ioff; bp->b_count_desired = bp->b_buffer_length; - XB_TRACE(bp, "get", (unsigned long)flags); + xfs_buftrace_val(bp, "get", flags); return bp; no_buffer: @@ -644,7 +617,7 @@ _xfs_buf_read( { int status; - XB_TRACE(bp, "_xfs_buf_read", (unsigned long)flags); + xfs_buftrace_val(bp, "_xfs_buf_read", flags); ASSERT(!(flags & (XBF_DELWRI|XBF_WRITE))); ASSERT(bp->b_bn != XFS_BUF_DADDR_NULL); @@ -674,18 +647,18 @@ xfs_buf_read_flags( bp = xfs_buf_get_flags(target, ioff, isize, flags); if (bp) { if (!XFS_BUF_ISDONE(bp)) { - XB_TRACE(bp, "read", (unsigned long)flags); + xfs_buftrace_val(bp, "read", flags); XFS_STATS_INC(xb_get_read); _xfs_buf_read(bp, flags); } else if (flags & XBF_ASYNC) { - XB_TRACE(bp, "read_async", (unsigned long)flags); + xfs_buftrace_val(bp, "read_async", flags); /* * Read ahead call which is already satisfied, * drop the buffer */ goto no_buffer; } else { - XB_TRACE(bp, "read_done", (unsigned long)flags); + xfs_buftrace_val(bp, "read_done", flags); /* We do not want read in the flags */ bp->b_flags &= ~XBF_READ; } @@ -823,7 +796,7 @@ xfs_buf_get_noaddr( xfs_buf_unlock(bp); - XB_TRACE(bp, "no_daddr", len); + xfs_buftrace_val(bp, "no_daddr", len); return bp; fail_free_mem: @@ -846,7 +819,7 @@ xfs_buf_hold( xfs_buf_t *bp) { atomic_inc(&bp->b_hold); - XB_TRACE(bp, "hold", 0); + xfs_buftrace_val(bp, "hold", 0); } /* @@ -859,7 +832,7 @@ xfs_buf_rele( { xfs_bufhash_t *hash = bp->b_hash; - XB_TRACE(bp, "rele", bp->b_relse); + xfs_buftrace(bp, "rele"); if (unlikely(!hash)) { ASSERT(!bp->b_relse); @@ -911,19 +884,20 @@ xfs_buf_cond_lock( locked = down_trylock(&bp->b_sema) == 0; if (locked) { XB_SET_OWNER(bp); + xfs_buftrace(bp, "cond_lock"); + return 0; } - XB_TRACE(bp, "cond_lock", (long)locked); - return locked ? 0 : -EBUSY; + + xfs_buftrace(bp, "cond_lock_fail"); + return -EBUSY; } -#if defined(DEBUG) || defined(XFS_BLI_TRACE) int xfs_buf_lock_value( xfs_buf_t *bp) { return bp->b_sema.count; } -#endif /* * Locks a buffer object. @@ -935,12 +909,12 @@ void xfs_buf_lock( xfs_buf_t *bp) { - XB_TRACE(bp, "lock", 0); + xfs_buftrace(bp, "lock"); if (atomic_read(&bp->b_io_remaining)) blk_run_address_space(bp->b_target->bt_mapping); down(&bp->b_sema); XB_SET_OWNER(bp); - XB_TRACE(bp, "locked", 0); + xfs_buftrace(bp, "locked"); } /* @@ -962,7 +936,7 @@ xfs_buf_unlock( XB_CLEAR_OWNER(bp); up(&bp->b_sema); - XB_TRACE(bp, "unlock", 0); + xfs_buftrace(bp, "unlock"); } @@ -975,7 +949,7 @@ xfs_buf_pin( xfs_buf_t *bp) { atomic_inc(&bp->b_pin_count); - XB_TRACE(bp, "pin", (long)bp->b_pin_count.counter); + xfs_buftrace_val(bp, "pin", bp->b_pin_count.counter); } void @@ -984,7 +958,7 @@ xfs_buf_unpin( { if (atomic_dec_and_test(&bp->b_pin_count)) wake_up_all(&bp->b_waiters); - XB_TRACE(bp, "unpin", (long)bp->b_pin_count.counter); + xfs_buftrace_val(bp, "unpin", bp->b_pin_count.counter); } int @@ -1035,7 +1009,7 @@ xfs_buf_iodone_work( */ if ((bp->b_error == EOPNOTSUPP) && (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) { - XB_TRACE(bp, "ordered_retry", bp->b_iodone); + xfs_buftrace(bp, "ordered_retry"); bp->b_flags &= ~XBF_ORDERED; bp->b_flags |= _XFS_BARRIER_FAILED; xfs_buf_iorequest(bp); @@ -1054,7 +1028,7 @@ xfs_buf_ioend( if (bp->b_error == 0) bp->b_flags |= XBF_DONE; - XB_TRACE(bp, "iodone", bp->b_iodone); + xfs_buftrace(bp, "iodone"); if ((bp->b_iodone) || (bp->b_flags & XBF_ASYNC)) { if (schedule) { @@ -1075,7 +1049,7 @@ xfs_buf_ioerror( { ASSERT(error >= 0 && error <= 0xffff); bp->b_error = (unsigned short)error; - XB_TRACE(bp, "ioerror", (unsigned long)error); + xfs_buftrace_val(bp, "ioerror", error); } int @@ -1083,7 +1057,7 @@ xfs_bawrite( void *mp, struct xfs_buf *bp) { - XB_TRACE(bp, "bawrite", 0); + xfs_buftrace(bp, "bawrite"); ASSERT(bp->b_bn != XFS_BUF_DADDR_NULL); @@ -1102,7 +1076,7 @@ xfs_bdwrite( void *mp, struct xfs_buf *bp) { - XB_TRACE(bp, "bdwrite", 0); + xfs_buftrace(bp, "bdwrite"); bp->b_strat = xfs_bdstrat_cb; bp->b_mount = mp; @@ -1253,7 +1227,7 @@ int xfs_buf_iorequest( xfs_buf_t *bp) { - XB_TRACE(bp, "iorequest", 0); + xfs_buftrace(bp, "iorequest"); if (bp->b_flags & XBF_DELWRI) { xfs_buf_delwri_queue(bp, 1); @@ -1287,11 +1261,11 @@ int xfs_buf_iowait( xfs_buf_t *bp) { - XB_TRACE(bp, "iowait", 0); + xfs_buftrace(bp, "iowait"); if (atomic_read(&bp->b_io_remaining)) blk_run_address_space(bp->b_target->bt_mapping); wait_for_completion(&bp->b_iowait); - XB_TRACE(bp, "iowaited", (long)bp->b_error); + xfs_buftrace_val(bp, "iowaited", bp->b_error); return bp->b_error; } @@ -1604,7 +1578,8 @@ xfs_buf_delwri_queue( struct list_head *dwq = &bp->b_target->bt_delwrite_queue; spinlock_t *dwlk = &bp->b_target->bt_delwrite_lock; - XB_TRACE(bp, "delwri_q", (long)unlock); + xfs_buftrace_val(bp, "delwri_q", unlock); + ASSERT((bp->b_flags&(XBF_DELWRI|XBF_ASYNC)) == (XBF_DELWRI|XBF_ASYNC)); spin_lock(dwlk); @@ -1644,7 +1619,7 @@ xfs_buf_delwri_dequeue( if (dequeued) xfs_buf_rele(bp); - XB_TRACE(bp, "delwri_dq", (long)dequeued); + xfs_buftrace_val(bp, "delwri_dq", dequeued); } STATIC void @@ -1692,7 +1667,7 @@ xfs_buf_delwri_split( INIT_LIST_HEAD(list); spin_lock(dwlk); list_for_each_entry_safe(bp, n, dwq, b_list) { - XB_TRACE(bp, "walkq1", (long)xfs_buf_ispin(bp)); + xfs_buftrace_val(bp, "walkq1", xfs_buf_ispin(bp)); ASSERT(bp->b_flags & XBF_DELWRI); if (!xfs_buf_ispin(bp) && !xfs_buf_cond_lock(bp)) { @@ -1816,14 +1791,10 @@ xfs_flush_buftarg( int __init xfs_buf_init(void) { -#ifdef XFS_BUF_TRACE - xfs_buf_trace_buf = ktrace_alloc(XFS_BUF_TRACE_SIZE, KM_NOFS); -#endif - xfs_buf_zone = kmem_zone_init_flags(sizeof(xfs_buf_t), "xfs_buf", KM_ZONE_HWALIGN, NULL); if (!xfs_buf_zone) - goto out_free_trace_buf; + goto out; xfslogd_workqueue = create_workqueue("xfslogd"); if (!xfslogd_workqueue) @@ -1846,10 +1817,7 @@ xfs_buf_init(void) destroy_workqueue(xfslogd_workqueue); out_free_buf_zone: kmem_zone_destroy(xfs_buf_zone); - out_free_trace_buf: -#ifdef XFS_BUF_TRACE - ktrace_free(xfs_buf_trace_buf); -#endif + out: return -ENOMEM; } @@ -1861,9 +1829,6 @@ xfs_buf_terminate(void) destroy_workqueue(xfsdatad_workqueue); destroy_workqueue(xfslogd_workqueue); kmem_zone_destroy(xfs_buf_zone); -#ifdef XFS_BUF_TRACE - ktrace_free(xfs_buf_trace_buf); -#endif } #ifdef CONFIG_KDB_MODULES Index: xfs/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2009-09-09 12:33:56.380253776 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_buf.h 2009-09-09 12:49:11.169294313 -0300 @@ -95,6 +95,28 @@ typedef enum { _XFS_BARRIER_FAILED = (1 << 23), } xfs_buf_flags_t; +#define XFS_BUF_FLAGS \ + { XBF_READ, "READ" }, \ + { XBF_WRITE, "WRITE" }, \ + { XBF_MAPPED, "MAPPED" }, \ + { XBF_ASYNC, "ASYNC" }, \ + { XBF_DONE, "DONE" }, \ + { XBF_DELWRI, "DELWRI" }, \ + { XBF_STALE, "STALE" }, \ + { XBF_FS_MANAGED, "FS_MANAGED" }, \ + { XBF_ORDERED, "ORDERED" }, \ + { XBF_READ_AHEAD, "READ_AHEAD" }, \ + { XBF_LOCK, "LOCK" }, /* should never be set */\ + { XBF_TRYLOCK, "TRYLOCK" }, /* ditto */\ + { XBF_DONT_BLOCK, "DONT_BLOCK" }, /* ditto */\ + { _XBF_PAGE_CACHE, "PAGE_CACHE" }, \ + { _XBF_PAGES, "PAGES" }, \ + { _XBF_RUN_QUEUES, "RUN_QUEUES" }, \ + { _XBF_DELWRI_Q, "DELWRI_Q" }, \ + { _XBF_PAGE_LOCKED, "PAGE_LOCKED" }, \ + { _XFS_BARRIER_FAILED, "BARRIER_FAILED" } + + typedef enum { XBT_FORCE_SLEEP = 0, XBT_FORCE_FLUSH = 1, @@ -248,13 +270,6 @@ extern void xfs_buf_delwri_dequeue(xfs_b extern int xfs_buf_init(void); extern void xfs_buf_terminate(void); -#ifdef XFS_BUF_TRACE -extern ktrace_t *xfs_buf_trace_buf; -extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *); -#else -#define xfs_buf_trace(bp,id,ptr,ra) do { } while (0) -#endif - #define xfs_buf_target_name(target) \ ({ char __b[BDEVNAME_SIZE]; bdevname((target)->bt_bdev, __b); __b; }) @@ -370,10 +385,6 @@ static inline void xfs_buf_relse(xfs_buf #define xfs_bpin(bp) xfs_buf_pin(bp) #define xfs_bunpin(bp) xfs_buf_unpin(bp) - -#define xfs_buftrace(id, bp) \ - xfs_buf_trace(bp, id, NULL, (void *)__builtin_return_address(0)) - #define xfs_biodone(bp) xfs_buf_ioend(bp, 0) #define xfs_biomove(bp, off, len, data, rw) \ Index: xfs/fs/xfs/linux-2.6/xfs_fs_subr.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_fs_subr.c 2009-09-09 12:33:56.387254458 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_fs_subr.c 2009-09-09 12:49:11.172298536 -0300 @@ -19,6 +19,7 @@ #include "xfs_vnodeops.h" #include "xfs_bmap_btree.h" #include "xfs_inode.h" +#include "xfs_trace.h" int fs_noerr(void) { return 0; } int fs_nosys(void) { return ENOSYS; } @@ -51,6 +52,8 @@ xfs_flushinval_pages( struct address_space *mapping = VFS_I(ip)->i_mapping; int ret = 0; + trace_xfs_pagecache_inval(ip, first, last); + if (mapping->nrpages) { xfs_iflags_clear(ip, XFS_ITRUNCATED); ret = filemap_write_and_wait(mapping); Index: xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2009-09-09 12:33:56.391254478 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2009-09-09 12:49:11.173254594 -0300 @@ -51,6 +51,7 @@ #include "xfs_quota.h" #include "xfs_inode_item.h" #include "xfs_export.h" +#include "xfs_trace.h" #include #include Index: xfs/fs/xfs/linux-2.6/xfs_ioctl32.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-09-09 12:33:56.396253928 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2009-09-09 12:49:11.177254615 -0300 @@ -46,6 +46,7 @@ #include "xfs_attr.h" #include "xfs_ioctl.h" #include "xfs_ioctl32.h" +#include "xfs_trace.h" #define _NATIVE_IOC(cmd, type) \ _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type)) Index: xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2009-09-09 12:33:56.400253879 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_iops.c 2009-09-09 12:49:11.182256509 -0300 @@ -47,6 +47,7 @@ #include "xfs_buf_item.h" #include "xfs_utils.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" #include #include Index: xfs/fs/xfs/linux-2.6/xfs_linux.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_linux.h 2009-09-09 12:33:56.405254446 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_linux.h 2009-09-09 12:49:11.185256263 -0300 @@ -40,7 +40,6 @@ #include #include -#include #include #include Index: xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2009-09-09 12:33:56.410254105 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_lrw.c 2009-09-09 12:49:11.187255959 -0300 @@ -48,73 +48,12 @@ #include "xfs_utils.h" #include "xfs_iomap.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" #include #include -#if defined(XFS_RW_TRACE) -void -xfs_rw_enter_trace( - int tag, - xfs_inode_t *ip, - void *data, - size_t segs, - loff_t offset, - int ioflags) -{ - if (ip->i_rwtrace == NULL) - return; - ktrace_enter(ip->i_rwtrace, - (void *)(unsigned long)tag, - (void *)ip, - (void *)((unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_d.di_size & 0xffffffff)), - (void *)data, - (void *)((unsigned long)segs), - (void *)((unsigned long)((offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(offset & 0xffffffff)), - (void *)((unsigned long)ioflags), - (void *)((unsigned long)((ip->i_new_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_new_size & 0xffffffff)), - (void *)((unsigned long)current_pid()), - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL); -} - -void -xfs_inval_cached_trace( - xfs_inode_t *ip, - xfs_off_t offset, - xfs_off_t len, - xfs_off_t first, - xfs_off_t last) -{ - - if (ip->i_rwtrace == NULL) - return; - ktrace_enter(ip->i_rwtrace, - (void *)(__psint_t)XFS_INVAL_CACHED, - (void *)ip, - (void *)((unsigned long)((offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(offset & 0xffffffff)), - (void *)((unsigned long)((len >> 32) & 0xffffffff)), - (void *)((unsigned long)(len & 0xffffffff)), - (void *)((unsigned long)((first >> 32) & 0xffffffff)), - (void *)((unsigned long)(first & 0xffffffff)), - (void *)((unsigned long)((last >> 32) & 0xffffffff)), - (void *)((unsigned long)(last & 0xffffffff)), - (void *)((unsigned long)current_pid()), - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL); -} -#endif - /* * xfs_iozero * @@ -250,8 +189,7 @@ xfs_read( } } - xfs_rw_enter_trace(XFS_READ_ENTER, ip, - (void *)iovp, segs, *offset, ioflags); + trace_xfs_file_read(ip, size, *offset, ioflags); iocb->ki_pos = *offset; ret = generic_file_aio_read(iocb, iovp, segs, *offset); @@ -294,8 +232,9 @@ xfs_splice_read( return -error; } } - xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, ip, - pipe, count, *ppos, ioflags); + + trace_xfs_file_splice_read(ip, count, *ppos, ioflags); + ret = generic_file_splice_read(infilp, ppos, pipe, count, flags); if (ret > 0) XFS_STATS_ADD(xs_read_bytes, ret); @@ -344,8 +283,8 @@ xfs_splice_write( ip->i_new_size = new_size; xfs_iunlock(ip, XFS_ILOCK_EXCL); - xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, ip, - pipe, count, *ppos, ioflags); + trace_xfs_file_splice_write(ip, count, *ppos, ioflags); + ret = generic_file_splice_write(pipe, outfilp, ppos, count, flags); if (ret > 0) XFS_STATS_ADD(xs_write_bytes, ret); @@ -712,8 +651,6 @@ start: if ((ioflags & IO_ISDIRECT)) { if (mapping->nrpages) { WARN_ON(need_i_mutex == 0); - xfs_inval_cached_trace(xip, pos, -1, - (pos & PAGE_CACHE_MASK), -1); error = xfs_flushinval_pages(xip, (pos & PAGE_CACHE_MASK), -1, FI_REMAPF_LOCKED); @@ -730,8 +667,7 @@ start: need_i_mutex = 0; } - xfs_rw_enter_trace(XFS_DIOWR_ENTER, xip, (void *)iovp, segs, - *offset, ioflags); + trace_xfs_file_direct_write(xip, count, *offset, ioflags); ret = generic_file_direct_write(iocb, iovp, &segs, pos, offset, count, ocount); @@ -754,8 +690,7 @@ start: ssize_t ret2 = 0; write_retry: - xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs, - *offset, ioflags); + trace_xfs_file_buffered_write(xip, count, *offset, ioflags); ret2 = generic_file_buffered_write(iocb, iovp, segs, pos, offset, count, ret); /* @@ -863,7 +798,7 @@ int xfs_bdstrat_cb(struct xfs_buf *bp) { if (XFS_FORCED_SHUTDOWN(bp->b_mount)) { - xfs_buftrace("XFS__BDSTRAT IOERROR", bp); + xfs_buftrace(bp, "bdstrat_cb_shut"); /* * Metadata write that didn't get logged but * written delayed anyway. These aren't associated @@ -896,7 +831,7 @@ xfsbdstrat( return; } - xfs_buftrace("XFSBDSTRAT IOERROR", bp); + xfs_buftrace(bp, "bdstrat_shut"); xfs_bioerror_relse(bp); } Index: xfs/fs/xfs/linux-2.6/xfs_lrw.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_lrw.h 2009-09-09 12:33:56.414253916 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_lrw.h 2009-09-09 12:49:11.190255992 -0300 @@ -20,52 +20,7 @@ struct xfs_mount; struct xfs_inode; -struct xfs_bmbt_irec; struct xfs_buf; -struct xfs_iomap; - -#if defined(XFS_RW_TRACE) -/* - * Defines for the trace mechanisms in xfs_lrw.c. - */ -#define XFS_RW_KTRACE_SIZE 128 - -#define XFS_READ_ENTER 1 -#define XFS_WRITE_ENTER 2 -#define XFS_IOMAP_READ_ENTER 3 -#define XFS_IOMAP_WRITE_ENTER 4 -#define XFS_IOMAP_READ_MAP 5 -#define XFS_IOMAP_WRITE_MAP 6 -#define XFS_IOMAP_WRITE_NOSPACE 7 -#define XFS_ITRUNC_START 8 -#define XFS_ITRUNC_FINISH1 9 -#define XFS_ITRUNC_FINISH2 10 -#define XFS_CTRUNC1 11 -#define XFS_CTRUNC2 12 -#define XFS_CTRUNC3 13 -#define XFS_CTRUNC4 14 -#define XFS_CTRUNC5 15 -#define XFS_CTRUNC6 16 -#define XFS_BUNMAP 17 -#define XFS_INVAL_CACHED 18 -#define XFS_DIORD_ENTER 19 -#define XFS_DIOWR_ENTER 20 -#define XFS_WRITEPAGE_ENTER 22 -#define XFS_RELEASEPAGE_ENTER 23 -#define XFS_INVALIDPAGE_ENTER 24 -#define XFS_IOMAP_ALLOC_ENTER 25 -#define XFS_IOMAP_ALLOC_MAP 26 -#define XFS_IOMAP_UNWRITTEN 27 -#define XFS_SPLICE_READ_ENTER 28 -#define XFS_SPLICE_WRITE_ENTER 29 -extern void xfs_rw_enter_trace(int, struct xfs_inode *, - void *, size_t, loff_t, int); -extern void xfs_inval_cached_trace(struct xfs_inode *, - xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t); -#else -#define xfs_rw_enter_trace(tag, ip, data, size, offset, ioflags) -#define xfs_inval_cached_trace(ip, offset, len, first, last) -#endif /* errors from xfsbdstrat() must be extracted from the buffer */ extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); Index: xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2009-09-09 12:33:56.419254483 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_super.c 2009-09-09 12:49:11.194307066 -0300 @@ -15,6 +15,7 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "xfs.h" #include "xfs_bit.h" #include "xfs_log.h" @@ -52,11 +53,12 @@ #include "xfs_trans_priv.h" #include "xfs_filestream.h" #include "xfs_da_btree.h" -#include "xfs_dir2_trace.h" #include "xfs_extfree_item.h" #include "xfs_mru_cache.h" #include "xfs_inode_item.h" #include "xfs_sync.h" +#define CREATE_TRACE_POINTS +#include "xfs_trace.h" #include #include @@ -67,6 +69,8 @@ #include #include + + static struct super_operations xfs_super_operations; static kmem_zone_t *xfs_ioend_zone; mempool_t *xfs_ioend_pool; @@ -1478,8 +1482,6 @@ xfs_fs_fill_super( goto fail_vnrele; kfree(mtpt); - - xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); return 0; out_filestream_unmount: @@ -1554,94 +1556,6 @@ static struct file_system_type xfs_fs_ty }; STATIC int __init -xfs_alloc_trace_bufs(void) -{ -#ifdef XFS_ALLOC_TRACE - xfs_alloc_trace_buf = ktrace_alloc(XFS_ALLOC_TRACE_SIZE, KM_MAYFAIL); - if (!xfs_alloc_trace_buf) - goto out; -#endif -#ifdef XFS_BMAP_TRACE - xfs_bmap_trace_buf = ktrace_alloc(XFS_BMAP_TRACE_SIZE, KM_MAYFAIL); - if (!xfs_bmap_trace_buf) - goto out_free_alloc_trace; -#endif -#ifdef XFS_BTREE_TRACE - xfs_allocbt_trace_buf = ktrace_alloc(XFS_ALLOCBT_TRACE_SIZE, - KM_MAYFAIL); - if (!xfs_allocbt_trace_buf) - goto out_free_bmap_trace; - - xfs_inobt_trace_buf = ktrace_alloc(XFS_INOBT_TRACE_SIZE, KM_MAYFAIL); - if (!xfs_inobt_trace_buf) - goto out_free_allocbt_trace; - - xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL); - if (!xfs_bmbt_trace_buf) - goto out_free_inobt_trace; -#endif -#ifdef XFS_ATTR_TRACE - xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL); - if (!xfs_attr_trace_buf) - goto out_free_bmbt_trace; -#endif -#ifdef XFS_DIR2_TRACE - xfs_dir2_trace_buf = ktrace_alloc(XFS_DIR2_GTRACE_SIZE, KM_MAYFAIL); - if (!xfs_dir2_trace_buf) - goto out_free_attr_trace; -#endif - - return 0; - -#ifdef XFS_DIR2_TRACE - out_free_attr_trace: -#endif -#ifdef XFS_ATTR_TRACE - ktrace_free(xfs_attr_trace_buf); - out_free_bmbt_trace: -#endif -#ifdef XFS_BTREE_TRACE - ktrace_free(xfs_bmbt_trace_buf); - out_free_inobt_trace: - ktrace_free(xfs_inobt_trace_buf); - out_free_allocbt_trace: - ktrace_free(xfs_allocbt_trace_buf); - out_free_bmap_trace: -#endif -#ifdef XFS_BMAP_TRACE - ktrace_free(xfs_bmap_trace_buf); - out_free_alloc_trace: -#endif -#ifdef XFS_ALLOC_TRACE - ktrace_free(xfs_alloc_trace_buf); - out: -#endif - return -ENOMEM; -} - -STATIC void -xfs_free_trace_bufs(void) -{ -#ifdef XFS_DIR2_TRACE - ktrace_free(xfs_dir2_trace_buf); -#endif -#ifdef XFS_ATTR_TRACE - ktrace_free(xfs_attr_trace_buf); -#endif -#ifdef XFS_BTREE_TRACE - ktrace_free(xfs_bmbt_trace_buf); - ktrace_free(xfs_inobt_trace_buf); - ktrace_free(xfs_allocbt_trace_buf); -#endif -#ifdef XFS_BMAP_TRACE - ktrace_free(xfs_bmap_trace_buf); -#endif -#ifdef XFS_ALLOC_TRACE - ktrace_free(xfs_alloc_trace_buf); -#endif -} - -STATIC int __init xfs_init_zones(void) { @@ -1782,7 +1696,6 @@ init_xfs_fs(void) printk(KERN_INFO XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n"); - ktrace_init(64); xfs_ioend_init(); xfs_dir_startup(); @@ -1790,13 +1703,9 @@ init_xfs_fs(void) if (error) goto out; - error = xfs_alloc_trace_bufs(); - if (error) - goto out_destroy_zones; - error = xfs_mru_cache_init(); if (error) - goto out_free_trace_buffers; + goto out_destroy_zones; error = xfs_filestream_init(); if (error) @@ -1831,8 +1740,6 @@ init_xfs_fs(void) xfs_filestream_uninit(); out_mru_cache_uninit: xfs_mru_cache_uninit(); - out_free_trace_buffers: - xfs_free_trace_bufs(); out_destroy_zones: xfs_destroy_zones(); out: @@ -1849,9 +1756,7 @@ exit_xfs_fs(void) xfs_buf_terminate(); xfs_filestream_uninit(); xfs_mru_cache_uninit(); - xfs_free_trace_bufs(); xfs_destroy_zones(); - ktrace_uninit(); } module_init(init_xfs_fs); Index: xfs/fs/xfs/linux-2.6/xfs_super.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_super.h 2009-09-09 12:33:56.423254364 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_super.h 2009-09-09 12:49:11.198028071 -0300 @@ -56,12 +56,6 @@ extern void xfs_qm_exit(void); # define XFS_BIGFS_STRING #endif -#ifdef CONFIG_XFS_TRACE -# define XFS_TRACE_STRING "tracing, " -#else -# define XFS_TRACE_STRING -#endif - #ifdef CONFIG_XFS_DMAPI # define XFS_DMAPI_STRING "dmapi support, " #else @@ -78,7 +72,6 @@ extern void xfs_qm_exit(void); XFS_SECURITY_STRING \ XFS_REALTIME_STRING \ XFS_BIGFS_STRING \ - XFS_TRACE_STRING \ XFS_DMAPI_STRING \ XFS_DBG_STRING /* DBG must be last */ Index: xfs/fs/xfs/linux-2.6/xfs_sync.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_sync.c 2009-09-09 12:33:56.429254011 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_sync.c 2009-09-09 12:49:11.199256440 -0300 @@ -44,6 +44,7 @@ #include "xfs_inode_item.h" #include "xfs_rw.h" #include "xfs_quota.h" +#include "xfs_trace.h" #include #include Index: xfs/fs/xfs/linux-2.6/xfs_trace.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xfs/fs/xfs/linux-2.6/xfs_trace.h 2009-09-09 13:25:13.612256052 -0300 @@ -0,0 +1,1255 @@ +/* + * Copyright (c) 2009, Christoph Hellwig + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM xfs + +#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_XFS_H + +#include + +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_types.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_da_btree.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_ialloc.h" +#include "xfs_itable.h" +#include "xfs_alloc.h" +#include "xfs_bmap.h" +#include "xfs_attr.h" +#include "xfs_attr_sf.h" +#include "xfs_attr_leaf.h" +#include "xfs_log_priv.h" +#include "xfs_buf_item.h" +#include "xfs_quota.h" +#include "xfs_iomap.h" +#include "quota/xfs_dquot_item.h" +#include "quota/xfs_dquot.h" + +char *xfs_fmtfsblock(xfs_fsblock_t bno); +void xfs_count_page_state(struct page *page, int *delalloc, + int *unmapped, int *unwritten); + +#define DEFINE_ATTR_LIST_TRACE(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_attr_list_context *ctx), \ + TP_ARGS(ctx), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(u32, hashval) \ + __field(u32, blkno) \ + __field(u32, offset) \ + __field(void *, alist) \ + __field(int, bufsize) \ + __field(int, count) \ + __field(int, firstu) \ + __field(int, dupcnt) \ + __field(int, flags) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; \ + __entry->ino = ctx->dp->i_ino; \ + __entry->hashval = ctx->cursor->hashval; \ + __entry->blkno = ctx->cursor->blkno; \ + __entry->offset = ctx->cursor->offset; \ + __entry->alist = ctx->alist; \ + __entry->bufsize = ctx->bufsize; \ + __entry->count = ctx->count; \ + __entry->firstu = ctx->firstu; \ + __entry->flags = ctx->flags; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " \ + "alist 0x%p size %u count %u firstu %u flags %d %s", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->hashval, \ + __entry->blkno, \ + __entry->offset, \ + __entry->dupcnt, \ + __entry->alist, \ + __entry->bufsize, \ + __entry->count, \ + __entry->firstu, \ + __entry->flags, \ + __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) \ + ) \ +) +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_sf); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_sf_all); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_leaf); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_leaf_end); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_full); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_add); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_wrong_blk); +DEFINE_ATTR_LIST_TRACE(xfs_attr_list_notfound); + +TRACE_EVENT(xfs_attr_list_node_descend, + TP_PROTO(struct xfs_attr_list_context *ctx, + struct xfs_da_node_entry *btree), + TP_ARGS(ctx, btree), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(u32, hashval) + __field(u32, blkno) + __field(u32, offset) + __field(void *, alist) + __field(int, bufsize) + __field(int, count) + __field(int, firstu) + __field(int, dupcnt) + __field(int, flags) + __field(u32, bt_hashval) + __field(u32, bt_before) + ), + TP_fast_assign( + __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; + __entry->ino = ctx->dp->i_ino; + __entry->hashval = ctx->cursor->hashval; + __entry->blkno = ctx->cursor->blkno; + __entry->offset = ctx->cursor->offset; + __entry->alist = ctx->alist; + __entry->bufsize = ctx->bufsize; + __entry->count = ctx->count; + __entry->firstu = ctx->firstu; + __entry->flags = ctx->flags; + __entry->bt_hashval = be32_to_cpu(btree->hashval); + __entry->bt_before = be32_to_cpu(btree->before); + ), + TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " + "alist 0x%p size %u count %u firstu %u flags %d %s " + "node hashval %u, node before %u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __entry->hashval, + __entry->blkno, + __entry->offset, + __entry->dupcnt, + __entry->alist, + __entry->bufsize, + __entry->count, + __entry->firstu, + __entry->flags, + __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), + __entry->bt_hashval, + __entry->bt_before) +); + +TRACE_EVENT(xfs_bmap_insert, + TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, + struct xfs_bmbt_irec *r, int whichfork, const char *desc), + TP_ARGS(ip, idx, r, whichfork, desc), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(xfs_extnum_t, idx) + __field(xfs_fileoff_t, startoff) + __field(xfs_fsblock_t, startblock) + __field(xfs_filblks_t, blockcount) + __field(xfs_exntst_t, state) + __field(int, whichfork) + __field(unsigned long, caller_ip) + __field(const char *, desc) + ), + TP_fast_assign( + __entry->dev = VFS_I(ip)->i_sb->s_dev; + __entry->ino = ip->i_ino; + __entry->idx = idx; + __entry->startoff = r->br_startoff; + __entry->startblock = r->br_startblock; + __entry->blockcount = r->br_blockcount; + __entry->state = r->br_state; + __entry->whichfork = whichfork; + __entry->caller_ip = _RET_IP_; + __entry->desc = desc; + ), + TP_printk("dev %d:%d ino 0x%llx func %pf state %s %cf idx %ld " + "offset %lld block %s count %lld flag %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + (char *)__entry->caller_ip, + __entry->desc, + "da"[!!__entry->whichfork], + (long)__entry->idx, + __entry->startoff, + xfs_fmtfsblock(__entry->startblock), + __entry->blockcount, + __entry->state) +); + +#define DEFINE_BMAP_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int whichfork, \ + const char *desc), \ + TP_ARGS(ip, idx, whichfork, desc), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(xfs_extnum_t, idx) \ + __field(xfs_fileoff_t, startoff) \ + __field(xfs_fsblock_t, startblock) \ + __field(xfs_filblks_t, blockcount) \ + __field(xfs_exntst_t, state) \ + __field(int, whichfork) \ + __field(unsigned long, caller_ip) \ + __field(const char *, desc) \ + ), \ + TP_fast_assign( \ + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); \ + struct xfs_bmbt_irec r; \ + \ + xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->idx = idx; \ + __entry->startoff = r.br_startoff; \ + __entry->startblock = r.br_startblock; \ + __entry->blockcount = r.br_blockcount; \ + __entry->state = r.br_state; \ + __entry->whichfork = whichfork; \ + __entry->caller_ip = _RET_IP_; \ + __entry->desc = desc; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx func %pf state %s %cf idx %ld " \ + "offset %lld block %s count %lld flag %d", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + (char *)__entry->caller_ip, \ + __entry->desc, \ + "da"[!!__entry->whichfork], \ + (long)__entry->idx, \ + __entry->startoff, \ + xfs_fmtfsblock(__entry->startblock), \ + __entry->blockcount, \ + __entry->state) \ +) + +DEFINE_BMAP_EVENT(xfs_bmap_delete); +DEFINE_BMAP_EVENT(xfs_bmap_pre_update); +DEFINE_BMAP_EVENT(xfs_bmap_post_update); + +TRACE_EVENT(xfs_buf, + TP_PROTO(struct xfs_buf *bp, char *id, unsigned long val, + unsigned long caller_ip), + TP_ARGS(bp, id, val, caller_ip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(char *, id) + __field(unsigned, flags) + __field(int, hold) + __field(unsigned, lockval) + __field(unsigned long, val) + __field(xfs_off_t, file_offset) + __field(size_t, buffer_length) + __field(unsigned long, caller_ip) + ), + TP_fast_assign( + __entry->dev = bp->b_target->bt_dev; + __entry->id = id; + __entry->hold = atomic_read(&bp->b_hold); + __entry->lockval = xfs_buf_lock_value(bp); + __entry->val = val; + __entry->file_offset = bp->b_file_offset; + __entry->buffer_length = bp->b_buffer_length; + __entry->flags = bp->b_flags; + __entry->caller_ip = caller_ip; + ), + TP_printk("dev %d:%d %s hold %d lock %d val 0x%lx " + "offset 0x%llx size 0x%zx flags %s caller %pf", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->id, + __entry->hold, + __entry->lockval, + __entry->val, + (unsigned long long)__entry->file_offset, + __entry->buffer_length, + __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), + (void *)__entry->caller_ip) +); + +#define xfs_buftrace_val(bp, id, val) \ + trace_xfs_buf((bp), (id), (val), _RET_IP_) +#define xfs_buftrace(bp, id) \ + trace_xfs_buf((bp), (id), 0, _RET_IP_) + + +TRACE_EVENT(xfs_buf_item, + TP_PROTO(char *id, struct xfs_buf_log_item *bip), + TP_ARGS(id, bip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(char *, id) + __field(void *, bip) + __field(void *, bp) + __field(unsigned, flags) + __field(unsigned, recur) + __field(int, refcount) + __field(xfs_daddr_t, buf_blkno) + __field(size_t, buf_len) + __field(unsigned, buf_flags) + __field(int, buf_pincount) + __field(int, buf_lockval) + __field(void *, li_desc) + __field(unsigned, li_flags) + ), + TP_fast_assign( + __entry->dev = bip->bli_buf->b_target->bt_dev; + __entry->id = id; + __entry->bip = bip; + __entry->bp = bip->bli_buf; + __entry->flags = bip->bli_flags; + __entry->recur = bip->bli_recur; + __entry->refcount = atomic_read(&bip->bli_refcount); + __entry->buf_blkno = XFS_BUF_ADDR(bip->bli_buf); + __entry->buf_len = XFS_BUF_COUNT(bip->bli_buf); + __entry->buf_flags = bip->bli_buf->b_flags; + __entry->buf_pincount = XFS_BUF_ISPINNED(bip->bli_buf); + __entry->buf_lockval = XFS_BUF_VALUSEMA(bip->bli_buf); + __entry->li_desc = bip->bli_item.li_desc; + __entry->li_flags = bip->bli_item.li_flags; + ), + TP_printk("dev %d:%d %s bip 0x%p bp 0x%p flags %s recur %d refcount %d " + "blkno 0x%llx blen %zd bpflags %s pincount %d " + "lockval %d lidesc 0x%p liflags %s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->id, + __entry->bip, + __entry->bp, + __print_flags(__entry->flags, "|", XFS_BLI_FLAGS), + __entry->recur, + __entry->refcount, + (unsigned long long)__entry->buf_blkno, + __entry->buf_len, + __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), + __entry->buf_pincount, + __entry->buf_lockval, + __entry->li_desc, + __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) +); + +#define xfs_buf_item_trace(id, bip) \ + trace_xfs_buf_item((id), (bip)); + +TRACE_EVENT(xfs_dquot, + TP_PROTO(struct xfs_dquot *dqp, char *func, struct xfs_inode *ip), + TP_ARGS(dqp, func, ip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino); + __field(__be32, id) + __field(char *, func) + __field(unsigned, flags) + __field(unsigned, nrefs) + __field(__u64, res_bcount) + __field(__be64, bcount) + __field(__be64, icount) + __field(__be64, blk_hardlimit) + __field(__be64, blk_softlimit) + __field(__be64, ino_hardlimit) + __field(__be64, ino_softlimit) + ), + TP_fast_assign( + __entry->dev = dqp->q_mount->m_super->s_dev; + __entry->ino = ip ? ip->i_ino : 0; + __entry->id = dqp->q_core.d_id; + __entry->func = func; + __entry->flags = dqp->dq_flags; + __entry->nrefs = dqp->q_nrefs; + __entry->res_bcount = dqp->q_res_bcount; + __entry->bcount = dqp->q_core.d_bcount; + __entry->icount = dqp->q_core.d_icount; + __entry->blk_hardlimit = dqp->q_core.d_blk_hardlimit; + __entry->blk_softlimit = dqp->q_core.d_blk_softlimit; + __entry->ino_hardlimit = dqp->q_core.d_ino_hardlimit; + __entry->ino_softlimit = dqp->q_core.d_ino_softlimit; + ), + TP_printk("dev %d:%d ino 0x%llx id 0x%x %s flags %s " + "nrefs %u res_bc 0x%llx " + "bcnt 0x%llx [hard 0x%llx | soft 0x%llx] " + "icnt 0x%llx [hard 0x%llx | soft 0x%llx]", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + be32_to_cpu(__entry->id), + __entry->func, + __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), + __entry->nrefs, + (unsigned long long)__entry->res_bcount, + (unsigned long long)be64_to_cpu(__entry->bcount), + (unsigned long long)be64_to_cpu(__entry->blk_hardlimit), + (unsigned long long)be64_to_cpu(__entry->blk_softlimit), + (unsigned long long)be64_to_cpu(__entry->icount), + (unsigned long long)be64_to_cpu(__entry->ino_hardlimit), + (unsigned long long)be64_to_cpu(__entry->ino_softlimit)) + +); + +#define xfs_dqtrace_entry_ino(dqp, func, ip) \ + trace_xfs_dquot((dqp), (func), (ip)); +#define xfs_dqtrace_entry(dqp, func) \ + trace_xfs_dquot((dqp), (func), NULL) + +#define DEFINE_LOCK_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ + unsigned long caller_ip), \ + TP_ARGS(ip, lock_flags, caller_ip), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(int, lock_flags) \ + __field(unsigned long, caller_ip) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->lock_flags = lock_flags; \ + __entry->caller_ip = caller_ip; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), \ + (void *)__entry->caller_ip) \ +) + +DEFINE_LOCK_EVENT(xfs_ilock); +DEFINE_LOCK_EVENT(xfs_ilock_nowait); +DEFINE_LOCK_EVENT(xfs_ilock_demote); +DEFINE_LOCK_EVENT(xfs_iunlock); + +#define DEFINE_IGET_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip), \ + TP_ARGS(ip), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino) \ +) +DEFINE_IGET_EVENT(xfs_iget_skip); +DEFINE_IGET_EVENT(xfs_iget_reclaim); +DEFINE_IGET_EVENT(xfs_iget_found); +DEFINE_IGET_EVENT(xfs_iget_alloc); + +#define DEFINE_INODE_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ + TP_ARGS(ip, caller_ip), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(int, count) \ + __field(unsigned long, caller_ip) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->count = atomic_read(&VFS_I(ip)->i_count); \ + __entry->caller_ip = caller_ip; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx count %d caller %pf", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->count, \ + (char *)__entry->caller_ip) \ +) +DEFINE_INODE_EVENT(xfs_ihold); +DEFINE_INODE_EVENT(xfs_irele); + +/* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */ +DEFINE_INODE_EVENT(xfs_inode); +#define xfs_itrace_entry(ip) \ + trace_xfs_inode(ip, _THIS_IP_) + +#define DEFINE_LOGGRANT_EVENT(tname) \ +TRACE_EVENT(tname, \ + TP_PROTO(struct log *log, struct xlog_ticket *tic), \ + TP_ARGS(log, tic), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(unsigned, trans_type) \ + __field(char, ocnt) \ + __field(char, cnt) \ + __field(int, curr_res) \ + __field(int, unit_res) \ + __field(unsigned int, flags) \ + __field(void *, reserve_headq) \ + __field(void *, write_headq) \ + __field(int, grant_reserve_cycle) \ + __field(int, grant_reserve_bytes) \ + __field(int, grant_write_cycle) \ + __field(int, grant_write_bytes) \ + __field(int, curr_cycle) \ + __field(int, curr_block) \ + __field(xfs_lsn_t, tail_lsn) \ + ), \ + TP_fast_assign( \ + __entry->dev = log->l_mp->m_super->s_dev; \ + __entry->trans_type = tic->t_trans_type; \ + __entry->ocnt = tic->t_ocnt; \ + __entry->cnt = tic->t_cnt; \ + __entry->curr_res = tic->t_curr_res; \ + __entry->unit_res = tic->t_unit_res; \ + __entry->flags = tic->t_flags; \ + __entry->reserve_headq = log->l_reserve_headq; \ + __entry->write_headq = log->l_write_headq; \ + __entry->grant_reserve_cycle = log->l_grant_reserve_cycle; \ + __entry->grant_reserve_bytes = log->l_grant_reserve_bytes; \ + __entry->grant_write_cycle = log->l_grant_write_cycle; \ + __entry->grant_write_bytes = log->l_grant_write_bytes; \ + __entry->curr_cycle = log->l_curr_cycle; \ + __entry->curr_block = log->l_curr_block; \ + __entry->tail_lsn = log->l_tail_lsn; \ + ), \ + TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u " \ + "t_unit_res %u t_flags %s reserve_headq 0x%p " \ + "write_headq 0x%p grant_reserve_cycle %d " \ + "grant_reserve_bytes %d grant_write_cycle %d " \ + "grant_write_bytes %d curr_cycle %d curr_block %d " \ + "tail_cycle %d tail_block %d", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES), \ + __entry->ocnt, \ + __entry->cnt, \ + __entry->curr_res, \ + __entry->unit_res, \ + __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), \ + __entry->reserve_headq, \ + __entry->write_headq, \ + __entry->grant_reserve_cycle, \ + __entry->grant_reserve_bytes, \ + __entry->grant_write_cycle, \ + __entry->grant_write_bytes, \ + __entry->curr_cycle, \ + __entry->curr_block, \ + CYCLE_LSN(__entry->tail_lsn), \ + BLOCK_LSN(__entry->tail_lsn) \ + ) \ +) +DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); +DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); +DEFINE_LOGGRANT_EVENT(xfs_log_reserve); +DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_error); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2); +DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); +DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); +DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); +DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); +DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); + +#define DEFINE_RW_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \ + TP_ARGS(ip, count, offset, flags), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(xfs_fsize_t, size) \ + __field(xfs_fsize_t, new_size) \ + __field(loff_t, offset) \ + __field(size_t, count) \ + __field(int, flags) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->size = ip->i_d.di_size; \ + __entry->new_size = ip->i_new_size; \ + __entry->offset = offset; \ + __entry->count = count; \ + __entry->flags = flags; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ + "offset 0x%llx count 0x%zx ioflags %s", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->size, \ + __entry->new_size, \ + __entry->offset, \ + __entry->count, \ + __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \ +) +DEFINE_RW_EVENT(xfs_file_read); +DEFINE_RW_EVENT(xfs_file_buffered_write); +DEFINE_RW_EVENT(xfs_file_direct_write); +DEFINE_RW_EVENT(xfs_file_splice_read); +DEFINE_RW_EVENT(xfs_file_splice_write); + + +#define DEFINE_PAGE_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \ + TP_ARGS(inode, page, off), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(pgoff_t, pgoff) \ + __field(loff_t, size) \ + __field(unsigned long, offset) \ + __field(int, delalloc) \ + __field(int, unmapped) \ + __field(int, unwritten) \ + ), \ + TP_fast_assign( \ + int delalloc = -1, unmapped = -1, unwritten = -1; \ + \ + if (page_has_buffers(page)) \ + xfs_count_page_state(page, &delalloc, \ + &unmapped, &unwritten); \ + __entry->dev = inode->i_sb->s_dev; \ + __entry->ino = XFS_I(inode)->i_ino; \ + __entry->pgoff = page_offset(page); \ + __entry->size = i_size_read(inode); \ + __entry->offset = off; \ + __entry->delalloc = delalloc; \ + __entry->unmapped = unmapped; \ + __entry->unwritten = unwritten; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \ + "delalloc %d unmapped %d unwritten %d", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->pgoff, \ + __entry->size, \ + __entry->offset, \ + __entry->delalloc, \ + __entry->unmapped, \ + __entry->unwritten) \ +) +DEFINE_PAGE_EVENT(xfs_writepage); +DEFINE_PAGE_EVENT(xfs_releasepage); +DEFINE_PAGE_EVENT(xfs_invalidatepage); + +#define DEFINE_IOMAP_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ + int flags, struct xfs_bmbt_irec *irec), \ + TP_ARGS(ip, offset, count, flags, irec), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(loff_t, size) \ + __field(loff_t, new_size) \ + __field(loff_t, offset) \ + __field(size_t, count) \ + __field(int, flags) \ + __field(xfs_fileoff_t, startoff) \ + __field(xfs_fsblock_t, startblock) \ + __field(xfs_filblks_t, blockcount) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->size = ip->i_d.di_size; \ + __entry->new_size = ip->i_new_size; \ + __entry->offset = offset; \ + __entry->count = count; \ + __entry->flags = flags; \ + __entry->startoff = irec ? irec->br_startoff : 0; \ + __entry->startblock = irec ? irec->br_startblock : 0; \ + __entry->blockcount = irec ? irec->br_blockcount : 0; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ + "offset 0x%llx count %zd flags %s " \ + "startoff 0x%llx startblock 0x%llx blockcount 0x%llx", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->size, \ + __entry->new_size, \ + __entry->offset, \ + __entry->count, \ + __print_flags(__entry->flags, "|", BMAPI_FLAGS), \ + __entry->startoff, \ + __entry->startblock, \ + __entry->blockcount) \ +) +DEFINE_IOMAP_EVENT(xfs_iomap_enter); +DEFINE_IOMAP_EVENT(xfs_iomap_found); +DEFINE_IOMAP_EVENT(xfs_iomap_alloc); + +#define DEFINE_SIMPLE_IO_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ + TP_ARGS(ip, offset, count), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(loff_t, size) \ + __field(loff_t, new_size) \ + __field(loff_t, offset) \ + __field(size_t, count) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->size = ip->i_d.di_size; \ + __entry->new_size = ip->i_new_size; \ + __entry->offset = offset; \ + __entry->count = count; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ + "offset 0x%llx count %zd", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->size, \ + __entry->new_size, \ + __entry->offset, \ + __entry->count) \ +); +DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); +DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); + + +TRACE_EVENT(xfs_itruncate_start, + TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size, int flag, + xfs_off_t toss_start, xfs_off_t toss_finish), + TP_ARGS(ip, new_size, flag, toss_start, toss_finish), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(xfs_fsize_t, size) + __field(xfs_fsize_t, new_size) + __field(xfs_off_t, toss_start) + __field(xfs_off_t, toss_finish) + __field(int, flag) + ), + TP_fast_assign( + __entry->dev = VFS_I(ip)->i_sb->s_dev; + __entry->ino = ip->i_ino; + __entry->size = ip->i_d.di_size; + __entry->new_size = new_size; + __entry->toss_start = toss_start; + __entry->toss_finish = toss_finish; + __entry->flag = flag; + ), + TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx " + "toss start 0x%llx toss finish 0x%llx", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __print_flags(__entry->flag, "|", XFS_ITRUNC_FLAGS), + __entry->size, + __entry->new_size, + __entry->toss_start, + __entry->toss_finish) +); + +#define DEFINE_ITRUNC_EVENT(name) \ +TRACE_EVENT(name, \ + TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ + TP_ARGS(ip, new_size), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(xfs_fsize_t, size) \ + __field(xfs_fsize_t, new_size) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(ip)->i_sb->s_dev; \ + __entry->ino = ip->i_ino; \ + __entry->size = ip->i_d.di_size; \ + __entry->new_size = new_size; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->size, \ + __entry->new_size) \ +) +DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start); +DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end); + +TRACE_EVENT(xfs_pagecache_inval, + TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), + TP_ARGS(ip, start, finish), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(xfs_fsize_t, size) + __field(xfs_off_t, start) + __field(xfs_off_t, finish) + ), + TP_fast_assign( + __entry->dev = VFS_I(ip)->i_sb->s_dev; + __entry->ino = ip->i_ino; + __entry->size = ip->i_d.di_size; + __entry->start = start; + __entry->finish = finish; + ), + TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __entry->size, + __entry->start, + __entry->finish) +); + +TRACE_EVENT(xfs_bunmap, + TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, + int flags, unsigned long caller_ip), + TP_ARGS(ip, bno, len, flags, caller_ip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(xfs_fsize_t, size) + __field(xfs_fileoff_t, bno) + __field(xfs_filblks_t, len) + __field(unsigned long, caller_ip) + __field(int, flags) + ), + TP_fast_assign( + __entry->dev = VFS_I(ip)->i_sb->s_dev; + __entry->ino = ip->i_ino; + __entry->size = ip->i_d.di_size; + __entry->bno = bno; + __entry->len = len; + __entry->caller_ip = caller_ip; + __entry->flags = flags; + ), + TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" + "flags %s caller %pf", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __entry->size, + __entry->bno, + __entry->len, + __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), + (void *)__entry->caller_ip) + +); + +#define xfs_bunmap_trace(ip, bno, len, flags) \ + trace_xfs_bunmap(ip, bno, len, flags, _RET_IP_) + +TRACE_EVENT(xfs_alloc_busy, + TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, + xfs_extlen_t len, int slot), + TP_ARGS(mp, agno, agbno, len, slot), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_agnumber_t, agno) + __field(xfs_agblock_t, agbno) + __field(xfs_extlen_t, len) + __field(int, slot) + ), + TP_fast_assign( + __entry->dev = mp->m_super->s_dev; + __entry->agno = agno; + __entry->agbno = agbno; + __entry->len = len; + __entry->slot = slot; + ), + TP_printk("dev %d:%d agno %u agbno %u len %u slot %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->agno, + __entry->agbno, + __entry->len, + __entry->slot) + +); + +/* XXX: make generic? */ +#define XFS_BUSY_STATES \ + { 0, "found" }, \ + { 1, "missing" } + + +TRACE_EVENT(xfs_alloc_unbusy, + TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, + int slot, int found), + TP_ARGS(mp, agno, slot, found), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_agnumber_t, agno) + __field(int, slot) + __field(int, found) + ), + TP_fast_assign( + __entry->dev = mp->m_super->s_dev; + __entry->agno = agno; + __entry->slot = slot; + __entry->found = found; + ), + TP_printk("dev %d:%d agno %u slot %d %s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->agno, + __entry->slot, + __print_symbolic(__entry->found, XFS_BUSY_STATES)) +); + +TRACE_EVENT(xfs_alloc_busysearch, + TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, + xfs_extlen_t len, int found), + TP_ARGS(mp, agno, agbno, len, found), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(const char *, op) + __field(xfs_agnumber_t, agno) + __field(xfs_agblock_t, agbno) + __field(xfs_extlen_t, len) + __field(int, found) + ), + TP_fast_assign( + __entry->dev = mp->m_super->s_dev; + __entry->agno = agno; + __entry->agbno = agbno; + __entry->len = len; + __entry->found = found; + ), + TP_printk("dev %d:%d agno %u agbno %u len %u %s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->agno, + __entry->agbno, + __entry->len, + __print_symbolic(__entry->found, XFS_BUSY_STATES)) +); + +TRACE_EVENT(xfs_agf, + TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, + unsigned long caller_ip), + TP_ARGS(mp, agf, flags, caller_ip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_agnumber_t, agno) + __field(int, flags) + __field(__u32, length) + __field(__u32, bno_root) + __field(__u32, cnt_root) + __field(__u32, bno_level) + __field(__u32, cnt_level) + __field(__u32, flfirst) + __field(__u32, fllast) + __field(__u32, flcount) + __field(__u32, freeblks) + __field(__u32, longest) + __field(unsigned long, caller_ip) + ), + TP_fast_assign( + __entry->dev = mp->m_super->s_dev; + __entry->agno = be32_to_cpu(agf->agf_seqno), + __entry->flags = flags; + __entry->length = be32_to_cpu(agf->agf_length), + __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), + __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), + __entry->bno_level = + be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), + __entry->cnt_level = + be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), + __entry->flfirst = be32_to_cpu(agf->agf_flfirst), + __entry->fllast = be32_to_cpu(agf->agf_fllast), + __entry->flcount = be32_to_cpu(agf->agf_flcount), + __entry->freeblks = be32_to_cpu(agf->agf_freeblks), + __entry->longest = be32_to_cpu(agf->agf_longest); + __entry->caller_ip = caller_ip; + ), + TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " + "levels b %u c %u flfirst %u fllast %u flcount %u " + "freeblks %u longest %u caller %pf", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->agno, + __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), + __entry->length, + __entry->bno_root, + __entry->cnt_root, + __entry->bno_level, + __entry->cnt_level, + __entry->flfirst, + __entry->fllast, + __entry->flcount, + __entry->freeblks, + __entry->longest, + (void *)__entry->caller_ip) +); + +#define xfs_trace_agf(mp, agf, flags) \ + trace_xfs_agf(mp, agf, flags, _THIS_IP_) + +TRACE_EVENT(xfs_free_extent, + TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, + xfs_extlen_t len, bool isfl, int haveleft, int haveright), + TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_agnumber_t, agno) + __field(xfs_agblock_t, agbno) + __field(xfs_extlen_t, len) + __field(int, isfl) + __field(int, haveleft) + __field(int, haveright) + ), + TP_fast_assign( + __entry->dev = mp->m_super->s_dev; + __entry->agno = agno; + __entry->agbno = agbno; + __entry->len = len; + __entry->isfl = isfl; + __entry->haveleft = haveleft; + __entry->haveright = haveright; + ), + TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->agno, + __entry->agbno, + __entry->len, + __entry->isfl, + __entry->haveleft ? + (__entry->haveright ? "both" : "left") : + (__entry->haveright ? "right" : "none")) + +); + +TRACE_EVENT(xfs_alloc_extent, + TP_PROTO(struct xfs_alloc_arg *args, char *op, + unsigned long caller_ip), + TP_ARGS(args, op, caller_ip), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_agnumber_t, agno) + __field(xfs_agblock_t, agbno) + __field(xfs_extlen_t, minlen) + __field(xfs_extlen_t, maxlen) + __field(xfs_extlen_t, mod) + __field(xfs_extlen_t, prod) + __field(xfs_extlen_t, minleft) + __field(xfs_extlen_t, total) + __field(xfs_extlen_t, alignment) + __field(xfs_extlen_t, minalignslop) + __field(xfs_extlen_t, len) + __field(short, type) + __field(short, otype) + __field(char, wasdel) + __field(char, wasfromfl) + __field(char, isfl) + __field(char, userdata) + __field(xfs_fsblock_t, firstblock) + __field(const char *, op) + __field(unsigned long, caller_ip) + ), + TP_fast_assign( + __entry->dev = args->mp->m_super->s_dev; + __entry->agno = args->agno; + __entry->agbno = args->agbno; + __entry->minlen = args->minlen; + __entry->maxlen = args->maxlen; + __entry->mod = args->mod; + __entry->prod = args->prod; + __entry->minleft = args->minleft; + __entry->total = args->total; + __entry->alignment = args->alignment; + __entry->minalignslop = args->minalignslop; + __entry->len = args->len; + __entry->type = args->type; + __entry->otype = args->otype; + __entry->wasdel = args->wasdel; + __entry->wasfromfl = args->wasfromfl; + __entry->isfl = args->isfl; + __entry->userdata = args->userdata; + __entry->firstblock = args->firstblock; + __entry->op = op; + __entry->caller_ip = caller_ip; + ), + TP_printk("dev %d:%d %s agno %u agbno %u minlen %u maxlen %u mod %u " + "prod %u minleft %u total %u alignment %u minalignslop %u " + "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d " + "userdata %d firstblock 0x%llx caller %pf", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->op, + __entry->agno, + __entry->agbno, + __entry->minlen, + __entry->maxlen, + __entry->mod, + __entry->prod, + __entry->minleft, + __entry->total, + __entry->alignment, + __entry->minalignslop, + __entry->len, + __print_symbolic(__entry->type, XFS_ALLOC_TYPES), + __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), + __entry->wasdel, + __entry->wasfromfl, + __entry->isfl, + __entry->userdata, + __entry->firstblock, + (char *)__entry->caller_ip) +); + +#define xfs_trace_alloc_extent(args, str) \ + trace_xfs_alloc_extent(args, str, _THIS_IP_) + +#define DEFINE_DIR2_TRACE(tname) \ +TRACE_EVENT(tname, \ + TP_PROTO(struct xfs_da_args *args), \ + TP_ARGS(args), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __dynamic_array(char, name, args->namelen) \ + __field(int, namelen) \ + __field(xfs_dahash_t, hashval) \ + __field(xfs_ino_t, inumber) \ + __field(int, op_flags) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(args->dp)->i_sb->s_dev; \ + __entry->ino = args->dp->i_ino; \ + if (args->namelen) \ + memcpy(__get_str(name), args->name, args->namelen); \ + __entry->namelen = args->namelen; \ + __entry->hashval = args->hashval; \ + __entry->inumber = args->inumber; \ + __entry->op_flags = args->op_flags; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " \ + "inumber 0x%llx op_flags %s", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __entry->namelen, \ + __entry->namelen ? __get_str(name) : NULL, \ + __entry->namelen, \ + __entry->hashval, \ + __entry->inumber, \ + __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) \ +) +DEFINE_DIR2_TRACE(xfs_dir2_sf_addname); +DEFINE_DIR2_TRACE(xfs_dir2_sf_create); +DEFINE_DIR2_TRACE(xfs_dir2_sf_lookup); +DEFINE_DIR2_TRACE(xfs_dir2_sf_replace); +DEFINE_DIR2_TRACE(xfs_dir2_sf_removename); +DEFINE_DIR2_TRACE(xfs_dir2_sf_toino4); +DEFINE_DIR2_TRACE(xfs_dir2_sf_toino8); +DEFINE_DIR2_TRACE(xfs_dir2_sf_to_block); +DEFINE_DIR2_TRACE(xfs_dir2_block_addname); +DEFINE_DIR2_TRACE(xfs_dir2_block_lookup); +DEFINE_DIR2_TRACE(xfs_dir2_block_replace); +DEFINE_DIR2_TRACE(xfs_dir2_block_removename); +DEFINE_DIR2_TRACE(xfs_dir2_block_to_sf); +DEFINE_DIR2_TRACE(xfs_dir2_block_to_leaf); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_addname); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_lookup); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_replace); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_removename); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_to_block); +DEFINE_DIR2_TRACE(xfs_dir2_leaf_to_node); +DEFINE_DIR2_TRACE(xfs_dir2_node_addname); +DEFINE_DIR2_TRACE(xfs_dir2_node_lookup); +DEFINE_DIR2_TRACE(xfs_dir2_node_replace); +DEFINE_DIR2_TRACE(xfs_dir2_node_removename); +DEFINE_DIR2_TRACE(xfs_dir2_node_to_leaf); + +#define DEFINE_DIR2_SPACE_TRACE(tname) \ +TRACE_EVENT(tname, \ + TP_PROTO(struct xfs_da_args *args, int idx), \ + TP_ARGS(args, idx), \ + TP_STRUCT__entry( \ + __field(dev_t, dev) \ + __field(xfs_ino_t, ino) \ + __field(int, op_flags) \ + __field(int, idx) \ + ), \ + TP_fast_assign( \ + __entry->dev = VFS_I(args->dp)->i_sb->s_dev; \ + __entry->ino = args->dp->i_ino; \ + __entry->op_flags = args->op_flags; \ + __entry->idx = idx; \ + ), \ + TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", \ + MAJOR(__entry->dev), MINOR(__entry->dev), \ + __entry->ino, \ + __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), \ + __entry->idx) \ +) +DEFINE_DIR2_SPACE_TRACE(xfs_dir2_leafn_add); +DEFINE_DIR2_SPACE_TRACE(xfs_dir2_leafn_remove); +DEFINE_DIR2_SPACE_TRACE(xfs_dir2_grow_inode); +DEFINE_DIR2_SPACE_TRACE(xfs_dir2_shrink_inode); + +TRACE_EVENT(xfs_dir2_leafn_moveents, + TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), + TP_ARGS(args, src_idx, dst_idx, count), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(int, op_flags) + __field(int, src_idx) + __field(int, dst_idx) + __field(int, count) + ), + TP_fast_assign( + __entry->dev = VFS_I(args->dp)->i_sb->s_dev; + __entry->ino = args->dp->i_ino; + __entry->op_flags = args->op_flags; + __entry->src_idx = src_idx; + __entry->dst_idx = dst_idx; + __entry->count = count; + ), + TP_printk("dev %d:%d ino 0x%llx op_flags %s " + "src_idx %d dst_idx %d count %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), + __entry->src_idx, + __entry->dst_idx, + __entry->count) +); + +#endif /* _TRACE_XFS_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . +#define TRACE_INCLUDE_FILE xfs_trace +#include Index: xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2009-09-09 12:33:56.437253912 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_vnode.h 2009-09-09 12:49:11.209028215 -0300 @@ -40,6 +40,11 @@ struct attrlist_cursor_kern; #define IO_ISDIRECT 0x00004 /* bypass page cache */ #define IO_INVIS 0x00020 /* don't update inode timestamps */ +#define XFS_IO_FLAGS \ + { IO_ISAIO, "AIO" }, \ + { IO_ISDIRECT, "DIRECT" }, \ + { IO_INVIS, "INVIS"} + /* * Flush/Invalidate options for vop_toss/flush/flushinval_pages. */ Index: xfs/fs/xfs/quota/xfs_dquot.c =================================================================== --- xfs.orig/fs/xfs/quota/xfs_dquot.c 2009-09-09 12:33:56.442254479 -0300 +++ xfs/fs/xfs/quota/xfs_dquot.c 2009-09-09 12:49:11.214255906 -0300 @@ -47,6 +47,7 @@ #include "xfs_trans_space.h" #include "xfs_trans_priv.h" #include "xfs_qm.h" +#include "xfs_trace.h" /* @@ -112,10 +113,7 @@ xfs_qm_dqinit( init_completion(&dqp->q_flush); complete(&dqp->q_flush); -#ifdef XFS_DQUOT_TRACE - dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_NOFS); xfs_dqtrace_entry(dqp, "DQINIT"); -#endif } else { /* * Only the q_core portion was zeroed in dqreclaim_one(). @@ -136,10 +134,7 @@ xfs_qm_dqinit( dqp->q_hash = NULL; ASSERT(dqp->dq_flnext == dqp->dq_flprev); -#ifdef XFS_DQUOT_TRACE - ASSERT(dqp->q_trace); xfs_dqtrace_entry(dqp, "DQRECLAIMED_INIT"); -#endif } /* @@ -167,13 +162,8 @@ xfs_qm_dqdestroy( mutex_destroy(&dqp->q_qlock); sv_destroy(&dqp->q_pinwait); - -#ifdef XFS_DQUOT_TRACE - if (dqp->q_trace) - ktrace_free(dqp->q_trace); - dqp->q_trace = NULL; -#endif kmem_zone_free(xfs_Gqm->qm_dqzone, dqp); + atomic_dec(&xfs_Gqm->qm_totaldquots); } @@ -195,49 +185,6 @@ xfs_qm_dqinit_core( d->dd_diskdq.d_flags = type; } - -#ifdef XFS_DQUOT_TRACE -/* - * Dquot tracing for debugging. - */ -/* ARGSUSED */ -void -__xfs_dqtrace_entry( - xfs_dquot_t *dqp, - char *func, - void *retaddr, - xfs_inode_t *ip) -{ - xfs_dquot_t *udqp = NULL; - xfs_ino_t ino = 0; - - ASSERT(dqp->q_trace); - if (ip) { - ino = ip->i_ino; - udqp = ip->i_udquot; - } - ktrace_enter(dqp->q_trace, - (void *)(__psint_t)DQUOT_KTRACE_ENTRY, - (void *)func, - (void *)(__psint_t)dqp->q_nrefs, - (void *)(__psint_t)dqp->dq_flags, - (void *)(__psint_t)dqp->q_res_bcount, - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_bcount), - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_icount), - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_hardlimit), - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_softlimit), - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_hardlimit), - (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_softlimit), - (void *)(__psint_t)be32_to_cpu(dqp->q_core.d_id), - (void *)(__psint_t)current_pid(), - (void *)(__psint_t)ino, - (void *)(__psint_t)retaddr, - (void *)(__psint_t)udqp); - return; -} -#endif - - /* * If default limits are in force, push them into the dquot now. * We overwrite the dquot limits only if they are zero and this Index: xfs/fs/xfs/quota/xfs_dquot.h =================================================================== --- xfs.orig/fs/xfs/quota/xfs_dquot.h 2009-09-09 12:33:56.446254919 -0300 +++ xfs/fs/xfs/quota/xfs_dquot.h 2009-09-09 12:49:11.217255311 -0300 @@ -85,9 +85,6 @@ typedef struct xfs_dquot { struct completion q_flush; /* flush completion queue */ atomic_t q_pincount; /* dquot pin count */ wait_queue_head_t q_pinwait; /* dquot pinning wait queue */ -#ifdef XFS_DQUOT_TRACE - struct ktrace *q_trace; /* trace header structure */ -#endif } xfs_dquot_t; @@ -144,24 +141,6 @@ static inline void xfs_dqfunlock(xfs_dqu (XFS_IS_UQUOTA_ON((d)->q_mount)) : \ (XFS_IS_OQUOTA_ON((d)->q_mount)))) -#ifdef XFS_DQUOT_TRACE -/* - * Dquot Tracing stuff. - */ -#define DQUOT_TRACE_SIZE 64 -#define DQUOT_KTRACE_ENTRY 1 - -extern void __xfs_dqtrace_entry(xfs_dquot_t *dqp, char *func, - void *, xfs_inode_t *); -#define xfs_dqtrace_entry_ino(a,b,ip) \ - __xfs_dqtrace_entry((a), (b), (void*)__return_address, (ip)) -#define xfs_dqtrace_entry(a,b) \ - __xfs_dqtrace_entry((a), (b), (void*)__return_address, NULL) -#else -#define xfs_dqtrace_entry(a,b) -#define xfs_dqtrace_entry_ino(a,b,ip) -#endif - #ifdef QUOTADEBUG extern void xfs_qm_dqprint(xfs_dquot_t *); #else Index: xfs/fs/xfs/quota/xfs_qm.c =================================================================== --- xfs.orig/fs/xfs/quota/xfs_qm.c 2009-09-09 12:33:56.452254146 -0300 +++ xfs/fs/xfs/quota/xfs_qm.c 2009-09-09 12:49:11.220256182 -0300 @@ -47,6 +47,7 @@ #include "xfs_trans_space.h" #include "xfs_utils.h" #include "xfs_qm.h" +#include "xfs_trace.h" /* * The global quota manager. There is only one of these for the entire @@ -1350,7 +1351,8 @@ xfs_qm_reset_dqcounts( xfs_disk_dquot_t *ddq; int j; - xfs_buftrace("RESET DQUOTS", bp); + xfs_buftrace(bp, "reset_dquots"); + /* * Reset all counters and timers. They'll be * started afresh by xfs_qm_quotacheck. Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c =================================================================== --- xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2009-09-09 12:33:56.457253876 -0300 +++ xfs/fs/xfs/quota/xfs_qm_syscalls.c 2009-09-09 12:49:11.224256622 -0300 @@ -49,6 +49,7 @@ #include "xfs_buf_item.h" #include "xfs_utils.h" #include "xfs_qm.h" +#include "xfs_trace.h" #ifdef DEBUG # define qdprintk(s, args...) cmn_err(CE_DEBUG, s, ## args) Index: xfs/fs/xfs/support/ktrace.c =================================================================== --- xfs.orig/fs/xfs/support/ktrace.c 2009-09-09 12:33:56.461253617 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include - -static kmem_zone_t *ktrace_hdr_zone; -static kmem_zone_t *ktrace_ent_zone; -static int ktrace_zentries; - -void __init -ktrace_init(int zentries) -{ - ktrace_zentries = roundup_pow_of_two(zentries); - - ktrace_hdr_zone = kmem_zone_init(sizeof(ktrace_t), - "ktrace_hdr"); - ASSERT(ktrace_hdr_zone); - - ktrace_ent_zone = kmem_zone_init(ktrace_zentries - * sizeof(ktrace_entry_t), - "ktrace_ent"); - ASSERT(ktrace_ent_zone); -} - -void __exit -ktrace_uninit(void) -{ - kmem_zone_destroy(ktrace_hdr_zone); - kmem_zone_destroy(ktrace_ent_zone); -} - -/* - * ktrace_alloc() - * - * Allocate a ktrace header and enough buffering for the given - * number of entries. Round the number of entries up to a - * power of 2 so we can do fast masking to get the index from - * the atomic index counter. - */ -ktrace_t * -ktrace_alloc(int nentries, unsigned int __nocast sleep) -{ - ktrace_t *ktp; - ktrace_entry_t *ktep; - int entries; - - ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep); - - if (ktp == (ktrace_t*)NULL) { - /* - * KM_SLEEP callers don't expect failure. - */ - if (sleep & KM_SLEEP) - panic("ktrace_alloc: NULL memory on KM_SLEEP request!"); - - return NULL; - } - - /* - * Special treatment for buffers with the ktrace_zentries entries - */ - entries = roundup_pow_of_two(nentries); - if (entries == ktrace_zentries) { - ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone, - sleep); - } else { - ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)), - sleep | KM_LARGE); - } - - if (ktep == NULL) { - /* - * KM_SLEEP callers don't expect failure. - */ - if (sleep & KM_SLEEP) - panic("ktrace_alloc: NULL memory on KM_SLEEP request!"); - - kmem_free(ktp); - - return NULL; - } - - ktp->kt_entries = ktep; - ktp->kt_nentries = entries; - ASSERT(is_power_of_2(entries)); - ktp->kt_index_mask = entries - 1; - atomic_set(&ktp->kt_index, 0); - ktp->kt_rollover = 0; - return ktp; -} - - -/* - * ktrace_free() - * - * Free up the ktrace header and buffer. It is up to the caller - * to ensure that no-one is referencing it. - */ -void -ktrace_free(ktrace_t *ktp) -{ - if (ktp == (ktrace_t *)NULL) - return; - - /* - * Special treatment for the Vnode trace buffer. - */ - if (ktp->kt_nentries == ktrace_zentries) - kmem_zone_free(ktrace_ent_zone, ktp->kt_entries); - else - kmem_free(ktp->kt_entries); - - kmem_zone_free(ktrace_hdr_zone, ktp); -} - - -/* - * Enter the given values into the "next" entry in the trace buffer. - * kt_index is always the index of the next entry to be filled. - */ -void -ktrace_enter( - ktrace_t *ktp, - void *val0, - void *val1, - void *val2, - void *val3, - void *val4, - void *val5, - void *val6, - void *val7, - void *val8, - void *val9, - void *val10, - void *val11, - void *val12, - void *val13, - void *val14, - void *val15) -{ - int index; - ktrace_entry_t *ktep; - - ASSERT(ktp != NULL); - - /* - * Grab an entry by pushing the index up to the next one. - */ - index = atomic_add_return(1, &ktp->kt_index); - index = (index - 1) & ktp->kt_index_mask; - if (!ktp->kt_rollover && index == ktp->kt_nentries - 1) - ktp->kt_rollover = 1; - - ASSERT((index >= 0) && (index < ktp->kt_nentries)); - - ktep = &(ktp->kt_entries[index]); - - ktep->val[0] = val0; - ktep->val[1] = val1; - ktep->val[2] = val2; - ktep->val[3] = val3; - ktep->val[4] = val4; - ktep->val[5] = val5; - ktep->val[6] = val6; - ktep->val[7] = val7; - ktep->val[8] = val8; - ktep->val[9] = val9; - ktep->val[10] = val10; - ktep->val[11] = val11; - ktep->val[12] = val12; - ktep->val[13] = val13; - ktep->val[14] = val14; - ktep->val[15] = val15; -} - -/* - * Return the number of entries in the trace buffer. - */ -int -ktrace_nentries( - ktrace_t *ktp) -{ - int index; - if (ktp == NULL) - return 0; - - index = atomic_read(&ktp->kt_index) & ktp->kt_index_mask; - return (ktp->kt_rollover ? ktp->kt_nentries : index); -} - -/* - * ktrace_first() - * - * This is used to find the start of the trace buffer. - * In conjunction with ktrace_next() it can be used to - * iterate through the entire trace buffer. This code does - * not do any locking because it is assumed that it is called - * from the debugger. - * - * The caller must pass in a pointer to a ktrace_snap - * structure in which we will keep some state used to - * iterate through the buffer. This state must not touched - * by any code outside of this module. - */ -ktrace_entry_t * -ktrace_first(ktrace_t *ktp, ktrace_snap_t *ktsp) -{ - ktrace_entry_t *ktep; - int index; - int nentries; - - if (ktp->kt_rollover) - index = atomic_read(&ktp->kt_index) & ktp->kt_index_mask; - else - index = 0; - - ktsp->ks_start = index; - ktep = &(ktp->kt_entries[index]); - - nentries = ktrace_nentries(ktp); - index++; - if (index < nentries) { - ktsp->ks_index = index; - } else { - ktsp->ks_index = 0; - if (index > nentries) - ktep = NULL; - } - return ktep; -} - -/* - * ktrace_next() - * - * This is used to iterate through the entries of the given - * trace buffer. The caller must pass in the ktrace_snap_t - * structure initialized by ktrace_first(). The return value - * will be either a pointer to the next ktrace_entry or NULL - * if all of the entries have been traversed. - */ -ktrace_entry_t * -ktrace_next( - ktrace_t *ktp, - ktrace_snap_t *ktsp) -{ - int index; - ktrace_entry_t *ktep; - - index = ktsp->ks_index; - if (index == ktsp->ks_start) { - ktep = NULL; - } else { - ktep = &ktp->kt_entries[index]; - } - - index++; - if (index == ktrace_nentries(ktp)) { - ktsp->ks_index = 0; - } else { - ktsp->ks_index = index; - } - - return ktep; -} - -/* - * ktrace_skip() - * - * Skip the next "count" entries and return the entry after that. - * Return NULL if this causes us to iterate past the beginning again. - */ -ktrace_entry_t * -ktrace_skip( - ktrace_t *ktp, - int count, - ktrace_snap_t *ktsp) -{ - int index; - int new_index; - ktrace_entry_t *ktep; - int nentries = ktrace_nentries(ktp); - - index = ktsp->ks_index; - new_index = index + count; - while (new_index >= nentries) { - new_index -= nentries; - } - if (index == ktsp->ks_start) { - /* - * We've iterated around to the start, so we're done. - */ - ktep = NULL; - } else if ((new_index < index) && (index < ktsp->ks_index)) { - /* - * We've skipped past the start again, so we're done. - */ - ktep = NULL; - ktsp->ks_index = ktsp->ks_start; - } else { - ktep = &(ktp->kt_entries[new_index]); - new_index++; - if (new_index == nentries) { - ktsp->ks_index = 0; - } else { - ktsp->ks_index = new_index; - } - } - return ktep; -} Index: xfs/fs/xfs/support/ktrace.h =================================================================== --- xfs.orig/fs/xfs/support/ktrace.h 2009-09-09 12:33:56.465253707 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __XFS_SUPPORT_KTRACE_H__ -#define __XFS_SUPPORT_KTRACE_H__ - -/* - * Trace buffer entry structure. - */ -typedef struct ktrace_entry { - void *val[16]; -} ktrace_entry_t; - -/* - * Trace buffer header structure. - */ -typedef struct ktrace { - int kt_nentries; /* number of entries in trace buf */ - atomic_t kt_index; /* current index in entries */ - unsigned int kt_index_mask; - int kt_rollover; - ktrace_entry_t *kt_entries; /* buffer of entries */ -} ktrace_t; - -/* - * Trace buffer snapshot structure. - */ -typedef struct ktrace_snap { - int ks_start; /* kt_index at time of snap */ - int ks_index; /* current index */ -} ktrace_snap_t; - - -#ifdef CONFIG_XFS_TRACE - -extern void ktrace_init(int zentries); -extern void ktrace_uninit(void); - -extern ktrace_t *ktrace_alloc(int, unsigned int __nocast); -extern void ktrace_free(ktrace_t *); - -extern void ktrace_enter( - ktrace_t *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *, - void *); - -extern ktrace_entry_t *ktrace_first(ktrace_t *, ktrace_snap_t *); -extern int ktrace_nentries(ktrace_t *); -extern ktrace_entry_t *ktrace_next(ktrace_t *, ktrace_snap_t *); -extern ktrace_entry_t *ktrace_skip(ktrace_t *, int, ktrace_snap_t *); - -#else -#define ktrace_init(x) do { } while (0) -#define ktrace_uninit() do { } while (0) -#endif /* CONFIG_XFS_TRACE */ - -#endif /* __XFS_SUPPORT_KTRACE_H__ */ Index: xfs/fs/xfs/xfs.h =================================================================== --- xfs.orig/fs/xfs/xfs.h 2009-09-09 12:33:56.469254356 -0300 +++ xfs/fs/xfs/xfs.h 2009-09-09 12:49:11.233256371 -0300 @@ -25,21 +25,5 @@ /* #define QUOTADEBUG 1 */ #endif -#ifdef CONFIG_XFS_TRACE -#define XFS_ALLOC_TRACE 1 -#define XFS_ATTR_TRACE 1 -#define XFS_BLI_TRACE 1 -#define XFS_BMAP_TRACE 1 -#define XFS_BTREE_TRACE 1 -#define XFS_DIR2_TRACE 1 -#define XFS_DQUOT_TRACE 1 -#define XFS_ILOCK_TRACE 1 -#define XFS_LOG_TRACE 1 -#define XFS_RW_TRACE 1 -#define XFS_BUF_TRACE 1 -#define XFS_INODE_TRACE 1 -#define XFS_FILESTREAMS_TRACE 1 -#endif - #include #endif /* __XFS_H__ */ Index: xfs/fs/xfs/xfs_ag.h =================================================================== --- xfs.orig/fs/xfs/xfs_ag.h 2009-09-09 12:33:56.475254422 -0300 +++ xfs/fs/xfs/xfs_ag.h 2009-09-09 12:49:11.235256347 -0300 @@ -86,6 +86,20 @@ typedef struct xfs_agf { #define XFS_AGF_NUM_BITS 12 #define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) +#define XFS_AGF_FLAGS \ + { XFS_AGF_MAGICNUM, "MAGICNUM" }, \ + { XFS_AGF_VERSIONNUM, "VERSIONNUM" }, \ + { XFS_AGF_SEQNO, "SEQNO" }, \ + { XFS_AGF_LENGTH, "LENGTH" }, \ + { XFS_AGF_ROOTS, "ROOTS" }, \ + { XFS_AGF_LEVELS, "LEVELS" }, \ + { XFS_AGF_FLFIRST, "FLFIRST" }, \ + { XFS_AGF_FLLAST, "FLLAST" }, \ + { XFS_AGF_FLCOUNT, "FLCOUNT" }, \ + { XFS_AGF_FREEBLKS, "FREEBLKS" }, \ + { XFS_AGF_LONGEST, "LONGEST" }, \ + { XFS_AGF_BTREEBLKS, "BTREEBLKS" } + /* disk block (xfs_daddr_t) in the AG */ #define XFS_AGF_DADDR(mp) ((xfs_daddr_t)(1 << (mp)->m_sectbb_log)) #define XFS_AGF_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp)) Index: xfs/fs/xfs/xfs_alloc.c =================================================================== --- xfs.orig/fs/xfs/xfs_alloc.c 2009-09-09 12:33:56.479253814 -0300 +++ xfs/fs/xfs/xfs_alloc.c 2009-09-09 12:49:11.241256482 -0300 @@ -38,6 +38,7 @@ #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" +#include "xfs_trace.h" #define XFS_ABSDIFF(a,b) (((a) <= (b)) ? ((b) - (a)) : ((a) - (b))) @@ -51,30 +52,6 @@ xfs_alloc_search_busy(xfs_trans_t *tp, xfs_agblock_t bno, xfs_extlen_t len); -#if defined(XFS_ALLOC_TRACE) -ktrace_t *xfs_alloc_trace_buf; - -#define TRACE_ALLOC(s,a) \ - xfs_alloc_trace_alloc(__func__, s, a, __LINE__) -#define TRACE_FREE(s,a,b,x,f) \ - xfs_alloc_trace_free(__func__, s, mp, a, b, x, f, __LINE__) -#define TRACE_MODAGF(s,a,f) \ - xfs_alloc_trace_modagf(__func__, s, mp, a, f, __LINE__) -#define TRACE_BUSY(__func__,s,ag,agb,l,sl,tp) \ - xfs_alloc_trace_busy(__func__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__) -#define TRACE_UNBUSY(__func__,s,ag,sl,tp) \ - xfs_alloc_trace_busy(__func__, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__) -#define TRACE_BUSYSEARCH(__func__,s,ag,agb,l,tp) \ - xfs_alloc_trace_busy(__func__, s, mp, ag, agb, l, 0, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__) -#else -#define TRACE_ALLOC(s,a) -#define TRACE_FREE(s,a,b,x,f) -#define TRACE_MODAGF(s,a,f) -#define TRACE_BUSY(s,a,ag,agb,l,sl,tp) -#define TRACE_UNBUSY(fname,s,ag,sl,tp) -#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,tp) -#endif /* XFS_ALLOC_TRACE */ - /* * Prototypes for per-ag allocation routines */ @@ -498,124 +475,6 @@ xfs_alloc_read_agfl( return 0; } -#if defined(XFS_ALLOC_TRACE) -/* - * Add an allocation trace entry for an alloc call. - */ -STATIC void -xfs_alloc_trace_alloc( - const char *name, /* function tag string */ - char *str, /* additional string */ - xfs_alloc_arg_t *args, /* allocation argument structure */ - int line) /* source line number */ -{ - ktrace_enter(xfs_alloc_trace_buf, - (void *)(__psint_t)(XFS_ALLOC_KTRACE_ALLOC | (line << 16)), - (void *)name, - (void *)str, - (void *)args->mp, - (void *)(__psunsigned_t)args->agno, - (void *)(__psunsigned_t)args->agbno, - (void *)(__psunsigned_t)args->minlen, - (void *)(__psunsigned_t)args->maxlen, - (void *)(__psunsigned_t)args->mod, - (void *)(__psunsigned_t)args->prod, - (void *)(__psunsigned_t)args->minleft, - (void *)(__psunsigned_t)args->total, - (void *)(__psunsigned_t)args->alignment, - (void *)(__psunsigned_t)args->len, - (void *)((((__psint_t)args->type) << 16) | - (__psint_t)args->otype), - (void *)(__psint_t)((args->wasdel << 3) | - (args->wasfromfl << 2) | - (args->isfl << 1) | - (args->userdata << 0))); -} - -/* - * Add an allocation trace entry for a free call. - */ -STATIC void -xfs_alloc_trace_free( - const char *name, /* function tag string */ - char *str, /* additional string */ - xfs_mount_t *mp, /* file system mount point */ - xfs_agnumber_t agno, /* allocation group number */ - xfs_agblock_t agbno, /* a.g. relative block number */ - xfs_extlen_t len, /* length of extent */ - int isfl, /* set if is freelist allocation/free */ - int line) /* source line number */ -{ - ktrace_enter(xfs_alloc_trace_buf, - (void *)(__psint_t)(XFS_ALLOC_KTRACE_FREE | (line << 16)), - (void *)name, - (void *)str, - (void *)mp, - (void *)(__psunsigned_t)agno, - (void *)(__psunsigned_t)agbno, - (void *)(__psunsigned_t)len, - (void *)(__psint_t)isfl, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -} - -/* - * Add an allocation trace entry for modifying an agf. - */ -STATIC void -xfs_alloc_trace_modagf( - const char *name, /* function tag string */ - char *str, /* additional string */ - xfs_mount_t *mp, /* file system mount point */ - xfs_agf_t *agf, /* new agf value */ - int flags, /* logging flags for agf */ - int line) /* source line number */ -{ - ktrace_enter(xfs_alloc_trace_buf, - (void *)(__psint_t)(XFS_ALLOC_KTRACE_MODAGF | (line << 16)), - (void *)name, - (void *)str, - (void *)mp, - (void *)(__psint_t)flags, - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_seqno), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_length), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_flfirst), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_fllast), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_flcount), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_freeblks), - (void *)(__psunsigned_t)be32_to_cpu(agf->agf_longest)); -} - -STATIC void -xfs_alloc_trace_busy( - const char *name, /* function tag string */ - char *str, /* additional string */ - xfs_mount_t *mp, /* file system mount point */ - xfs_agnumber_t agno, /* allocation group number */ - xfs_agblock_t agbno, /* a.g. relative block number */ - xfs_extlen_t len, /* length of extent */ - int slot, /* perag Busy slot */ - xfs_trans_t *tp, - int trtype, /* type: add, delete, search */ - int line) /* source line number */ -{ - ktrace_enter(xfs_alloc_trace_buf, - (void *)(__psint_t)(trtype | (line << 16)), - (void *)name, - (void *)str, - (void *)mp, - (void *)(__psunsigned_t)agno, - (void *)(__psunsigned_t)agbno, - (void *)(__psunsigned_t)len, - (void *)(__psint_t)slot, - (void *)tp, - NULL, NULL, NULL, NULL, NULL, NULL, NULL); -} -#endif /* XFS_ALLOC_TRACE */ - /* * Allocation group level functions. */ @@ -665,9 +524,7 @@ xfs_alloc_ag_vextent( */ if (args->agbno != NULLAGBLOCK) { xfs_agf_t *agf; /* allocation group freelist header */ -#ifdef XFS_ALLOC_TRACE xfs_mount_t *mp = args->mp; -#endif long slen = (long)args->len; ASSERT(args->len >= args->minlen && args->len <= args->maxlen); @@ -682,7 +539,7 @@ xfs_alloc_ag_vextent( args->pag->pagf_freeblks -= args->len; ASSERT(be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length)); - TRACE_MODAGF(NULL, agf, XFS_AGF_FREEBLKS); + xfs_trace_agf(mp, agf, XFS_AGF_FREEBLKS); xfs_alloc_log_agf(args->tp, args->agbp, XFS_AGF_FREEBLKS); /* search the busylist for these blocks */ @@ -792,13 +649,14 @@ xfs_alloc_ag_vextent_exact( } xfs_btree_del_cursor(bno_cur, XFS_BTREE_NOERROR); xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); - TRACE_ALLOC("normal", args); + + xfs_trace_alloc_extent(args, "normal"); args->wasfromfl = 0; return 0; error0: xfs_btree_del_cursor(bno_cur, XFS_BTREE_ERROR); - TRACE_ALLOC("error", args); + xfs_trace_alloc_extent(args, "error"); return error; } @@ -958,7 +816,7 @@ xfs_alloc_ag_vextent_near( args->len = blen; if (!xfs_alloc_fix_minleft(args)) { xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); - TRACE_ALLOC("nominleft", args); + xfs_trace_alloc_extent(args, "nominleft"); return 0; } blen = args->len; @@ -981,7 +839,8 @@ xfs_alloc_ag_vextent_near( goto error0; xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); xfs_btree_del_cursor(bno_cur_lt, XFS_BTREE_NOERROR); - TRACE_ALLOC("first", args); + + xfs_trace_alloc_extent(args, "first"); return 0; } /* @@ -1272,7 +1131,7 @@ xfs_alloc_ag_vextent_near( * If we couldn't get anything, give up. */ if (bno_cur_lt == NULL && bno_cur_gt == NULL) { - TRACE_ALLOC("neither", args); + xfs_trace_alloc_extent(args, "neither"); args->agbno = NULLAGBLOCK; return 0; } @@ -1299,7 +1158,7 @@ xfs_alloc_ag_vextent_near( args->len = XFS_EXTLEN_MIN(ltlena, args->maxlen); xfs_alloc_fix_len(args); if (!xfs_alloc_fix_minleft(args)) { - TRACE_ALLOC("nominleft", args); + xfs_trace_alloc_extent(args, "nominleft"); xfs_btree_del_cursor(bno_cur_lt, XFS_BTREE_NOERROR); xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); return 0; @@ -1314,13 +1173,14 @@ xfs_alloc_ag_vextent_near( if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno, ltlen, ltnew, rlen, XFSA_FIXUP_BNO_OK))) goto error0; - TRACE_ALLOC(j ? "gt" : "lt", args); + + xfs_trace_alloc_extent(args, j ? "gt" : "lt"); xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); xfs_btree_del_cursor(bno_cur_lt, XFS_BTREE_NOERROR); return 0; error0: - TRACE_ALLOC("error", args); + xfs_trace_alloc_extent(args, "error"); if (cnt_cur != NULL) xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR); if (bno_cur_lt != NULL) @@ -1371,7 +1231,7 @@ xfs_alloc_ag_vextent_size( goto error0; if (i == 0 || flen == 0) { xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); - TRACE_ALLOC("noentry", args); + xfs_trace_alloc_extent(args, "noentry"); return 0; } ASSERT(i == 1); @@ -1448,7 +1308,7 @@ xfs_alloc_ag_vextent_size( xfs_alloc_fix_len(args); if (rlen < args->minlen || !xfs_alloc_fix_minleft(args)) { xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); - TRACE_ALLOC("nominleft", args); + xfs_trace_alloc_extent(args, "nominleft"); args->agbno = NULLAGBLOCK; return 0; } @@ -1471,11 +1331,11 @@ xfs_alloc_ag_vextent_size( args->agbno + args->len <= be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length), error0); - TRACE_ALLOC("normal", args); + xfs_trace_alloc_extent(args, "normal"); return 0; error0: - TRACE_ALLOC("error", args); + xfs_trace_alloc_extent(args, "error"); if (cnt_cur) xfs_btree_del_cursor(cnt_cur, XFS_BTREE_ERROR); if (bno_cur) @@ -1534,7 +1394,7 @@ xfs_alloc_ag_vextent_small( be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length), error0); args->wasfromfl = 1; - TRACE_ALLOC("freelist", args); + xfs_trace_alloc_extent(args, "freelist"); *stat = 0; return 0; } @@ -1556,17 +1416,17 @@ xfs_alloc_ag_vextent_small( */ if (flen < args->minlen) { args->agbno = NULLAGBLOCK; - TRACE_ALLOC("notenough", args); + xfs_trace_alloc_extent(args, "notenough"); flen = 0; } *fbnop = fbno; *flenp = flen; *stat = 1; - TRACE_ALLOC("normal", args); + xfs_trace_alloc_extent(args, "normal"); return 0; error0: - TRACE_ALLOC("error", args); + xfs_trace_alloc_extent(args, "error"); return error; } @@ -1809,17 +1669,15 @@ xfs_free_ag_extent( be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length), error0); - TRACE_MODAGF(NULL, agf, XFS_AGF_FREEBLKS); + xfs_trace_agf(mp, agf, XFS_AGF_FREEBLKS); xfs_alloc_log_agf(tp, agbp, XFS_AGF_FREEBLKS); if (!isfl) xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, (long)len); XFS_STATS_INC(xs_freex); XFS_STATS_ADD(xs_freeb, len); } - TRACE_FREE(haveleft ? - (haveright ? "both" : "left") : - (haveright ? "right" : "none"), - agno, bno, len, isfl); + + trace_xfs_free_extent(mp, agno, bno, len, isfl, haveleft, haveright); /* * Since blocks move to the free list without the coordination @@ -1836,7 +1694,7 @@ xfs_free_ag_extent( return 0; error0: - TRACE_FREE("error", agno, bno, len, isfl); + trace_xfs_free_extent(mp, agno, bno, len, isfl, -1, -1); if (bno_cur) xfs_btree_del_cursor(bno_cur, XFS_BTREE_ERROR); if (cnt_cur) @@ -2122,7 +1980,7 @@ xfs_alloc_get_freelist( logflags |= XFS_AGF_BTREEBLKS; } - TRACE_MODAGF(NULL, agf, logflags); + xfs_trace_agf(mp, agf, logflags); xfs_alloc_log_agf(tp, agbp, logflags); *bnop = bno; @@ -2230,13 +2088,13 @@ xfs_alloc_put_freelist( logflags |= XFS_AGF_BTREEBLKS; } - TRACE_MODAGF(NULL, agf, logflags); + xfs_trace_agf(mp, agf, logflags); xfs_alloc_log_agf(tp, agbp, logflags); ASSERT(be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp)); blockp = &agfl->agfl_bno[be32_to_cpu(agf->agf_fllast)]; *blockp = cpu_to_be32(bno); - TRACE_MODAGF(NULL, agf, logflags); + xfs_trace_agf(mp, agf, logflags); xfs_alloc_log_agf(tp, agbp, logflags); xfs_trans_log_buf(tp, agflbp, (int)((xfs_caddr_t)blockp - (xfs_caddr_t)agfl), @@ -2399,7 +2257,7 @@ xfs_alloc_vextent( args->minlen > args->maxlen || args->minlen > agsize || args->mod >= args->prod) { args->fsbno = NULLFSBLOCK; - TRACE_ALLOC("badargs", args); + xfs_trace_alloc_extent(args, "badargs"); return 0; } minleft = args->minleft; @@ -2418,12 +2276,12 @@ xfs_alloc_vextent( error = xfs_alloc_fix_freelist(args, 0); args->minleft = minleft; if (error) { - TRACE_ALLOC("nofix", args); + xfs_trace_alloc_extent(args, "nofix"); goto error0; } if (!args->agbp) { up_read(&mp->m_peraglock); - TRACE_ALLOC("noagbp", args); + xfs_trace_alloc_extent(args, "noagbp"); break; } args->agbno = XFS_FSB_TO_AGBNO(mp, args->fsbno); @@ -2488,7 +2346,7 @@ xfs_alloc_vextent( error = xfs_alloc_fix_freelist(args, flags); args->minleft = minleft; if (error) { - TRACE_ALLOC("nofix", args); + xfs_trace_alloc_extent(args, "nofix"); goto error0; } /* @@ -2499,7 +2357,9 @@ xfs_alloc_vextent( goto error0; break; } - TRACE_ALLOC("loopfailed", args); + + xfs_trace_alloc_extent(args, "loopfailed"); + /* * Didn't work, figure out the next iteration. */ @@ -2526,7 +2386,8 @@ xfs_alloc_vextent( if (args->agno == sagno) { if (no_min == 1) { args->agbno = NULLAGBLOCK; - TRACE_ALLOC("allfailed", args); + xfs_trace_alloc_extent(args, + "allfailed"); break; } if (flags == 0) { @@ -2642,16 +2503,16 @@ xfs_alloc_mark_busy(xfs_trans_t *tp, } } + trace_xfs_alloc_busy(mp, agno, bno, len, n); + if (n < XFS_PAGB_NUM_SLOTS) { bsy = &mp->m_perag[agno].pagb_list[n]; mp->m_perag[agno].pagb_count++; - TRACE_BUSY("xfs_alloc_mark_busy", "got", agno, bno, len, n, tp); bsy->busy_start = bno; bsy->busy_length = len; bsy->busy_tp = tp; xfs_trans_add_busy(tp, agno, n); } else { - TRACE_BUSY("xfs_alloc_mark_busy", "FULL", agno, bno, len, -1, tp); /* * The busy list is full! Since it is now not possible to * track the free block, make this a synchronous transaction @@ -2678,12 +2539,12 @@ xfs_alloc_clear_busy(xfs_trans_t *tp, list = mp->m_perag[agno].pagb_list; ASSERT(idx < XFS_PAGB_NUM_SLOTS); + + trace_xfs_alloc_unbusy(mp, agno, idx, list[idx].busy_tp == tp); + if (list[idx].busy_tp == tp) { - TRACE_UNBUSY("xfs_alloc_clear_busy", "found", agno, idx, tp); list[idx].busy_tp = NULL; mp->m_perag[agno].pagb_count--; - } else { - TRACE_UNBUSY("xfs_alloc_clear_busy", "missing", agno, idx, tp); } spin_unlock(&mp->m_perag[agno].pagb_lock); @@ -2724,24 +2585,22 @@ xfs_alloc_search_busy(xfs_trans_t *tp, if ((bno > bend) || (uend < bsy->busy_start)) { cnt--; } else { - TRACE_BUSYSEARCH("xfs_alloc_search_busy", - "found1", agno, bno, len, tp); break; } } } + trace_xfs_alloc_busysearch(mp, agno, bno, len, !!cnt); + /* * If a block was found, force the log through the LSN of the * transaction that freed the block */ if (cnt) { - TRACE_BUSYSEARCH("xfs_alloc_search_busy", "found", agno, bno, len, tp); lsn = bsy->busy_tp->t_commit_lsn; spin_unlock(&mp->m_perag[agno].pagb_lock); xfs_log_force(mp, lsn, XFS_LOG_FORCE|XFS_LOG_SYNC); } else { - TRACE_BUSYSEARCH("xfs_alloc_search_busy", "not-found", agno, bno, len, tp); spin_unlock(&mp->m_perag[agno].pagb_lock); } } Index: xfs/fs/xfs/xfs_alloc.h =================================================================== --- xfs.orig/fs/xfs/xfs_alloc.h 2009-09-09 12:33:56.484253822 -0300 +++ xfs/fs/xfs/xfs_alloc.h 2009-09-09 12:49:11.244256306 -0300 @@ -37,6 +37,15 @@ typedef enum xfs_alloctype XFS_ALLOCTYPE_THIS_BNO /* at exactly this block */ } xfs_alloctype_t; +#define XFS_ALLOC_TYPES \ + { XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \ + { XFS_ALLOCTYPE_FIRST_AG, "FIRST_AG" }, \ + { XFS_ALLOCTYPE_START_AG, "START_AG" }, \ + { XFS_ALLOCTYPE_THIS_AG, "THIS_AG" }, \ + { XFS_ALLOCTYPE_START_BNO, "START_BNO" }, \ + { XFS_ALLOCTYPE_NEAR_BNO, "NEAR_BNO" }, \ + { XFS_ALLOCTYPE_THIS_BNO, "THIS_BNO" } + /* * Flags for xfs_alloc_fix_freelist. */ @@ -109,13 +118,6 @@ xfs_alloc_longest_free_extent(struct xfs #ifdef __KERNEL__ -#if defined(XFS_ALLOC_TRACE) -/* - * Allocation tracing buffer size. - */ -#define XFS_ALLOC_TRACE_SIZE 4096 -extern ktrace_t *xfs_alloc_trace_buf; - /* * Types for alloc tracing. */ @@ -125,7 +127,7 @@ extern ktrace_t *xfs_alloc_trace_buf; #define XFS_ALLOC_KTRACE_BUSY 4 #define XFS_ALLOC_KTRACE_UNBUSY 5 #define XFS_ALLOC_KTRACE_BUSYSEARCH 6 -#endif + void xfs_alloc_mark_busy(xfs_trans_t *tp, Index: xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- xfs.orig/fs/xfs/xfs_alloc_btree.c 2009-09-09 12:33:56.488253773 -0300 +++ xfs/fs/xfs/xfs_alloc_btree.c 2009-09-09 12:49:11.246256910 -0300 @@ -39,6 +39,7 @@ #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" +#include "xfs_trace.h" STATIC struct xfs_btree_cur * @@ -67,6 +68,7 @@ xfs_allocbt_set_root( be32_add_cpu(&agf->agf_levels[btnum], inc); cur->bc_mp->m_perag[seqno].pagf_levels[btnum] += inc; + xfs_trace_agf(cur->bc_mp, agf, XFS_AGF_ROOTS | XFS_AGF_LEVELS); xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); } @@ -193,6 +195,7 @@ xfs_allocbt_update_lastrec( agf->agf_longest = len; cur->bc_mp->m_perag[seqno].pagf_longest = be32_to_cpu(len); + xfs_trace_agf(cur->bc_mp, agf, XFS_AGF_LONGEST); xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } Index: xfs/fs/xfs/xfs_attr.c =================================================================== --- xfs.orig/fs/xfs/xfs_attr.c 2009-09-09 12:33:56.494253909 -0300 +++ xfs/fs/xfs/xfs_attr.c 2009-09-09 12:49:11.251256010 -0300 @@ -47,6 +47,7 @@ #include "xfs_trans_space.h" #include "xfs_rw.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" /* * xfs_attr.c @@ -89,10 +90,6 @@ STATIC int xfs_attr_rmtval_remove(xfs_da #define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */ -#if defined(XFS_ATTR_TRACE) -ktrace_t *xfs_attr_trace_buf; -#endif - STATIC int xfs_attr_name_to_xname( struct xfs_name *xname, @@ -636,7 +633,6 @@ xfs_attr_list_int(xfs_attr_list_context_ return EIO; xfs_ilock(dp, XFS_ILOCK_SHARED); - xfs_attr_trace_l_c("syscall start", context); /* * Decide on what work routines to call based on the inode size. @@ -652,7 +648,6 @@ xfs_attr_list_int(xfs_attr_list_context_ } xfs_iunlock(dp, XFS_ILOCK_SHARED); - xfs_attr_trace_l_c("syscall end", context); return error; } @@ -698,7 +693,7 @@ xfs_attr_put_listent(xfs_attr_list_conte context->count * sizeof(alist->al_offset[0]); context->firstu -= ATTR_ENTSIZE(namelen); if (context->firstu < arraytop) { - xfs_attr_trace_l_c("buffer full", context); + trace_xfs_attr_list_full(context); alist->al_more = 1; context->seen_enough = 1; return 1; @@ -710,7 +705,7 @@ xfs_attr_put_listent(xfs_attr_list_conte aep->a_name[namelen] = 0; alist->al_offset[context->count++] = context->firstu; alist->al_count = context->count; - xfs_attr_trace_l_c("add", context); + trace_xfs_attr_list_add(context); return 0; } @@ -1849,7 +1844,7 @@ xfs_attr_node_list(xfs_attr_list_context node = bp->data; switch (be16_to_cpu(node->hdr.info.magic)) { case XFS_DA_NODE_MAGIC: - xfs_attr_trace_l_cn("wrong blk", context, node); + trace_xfs_attr_list_wrong_blk(context); xfs_da_brelse(NULL, bp); bp = NULL; break; @@ -1857,20 +1852,18 @@ xfs_attr_node_list(xfs_attr_list_context leaf = bp->data; if (cursor->hashval > be32_to_cpu(leaf->entries[ be16_to_cpu(leaf->hdr.count)-1].hashval)) { - xfs_attr_trace_l_cl("wrong blk", - context, leaf); + trace_xfs_attr_list_wrong_blk(context); xfs_da_brelse(NULL, bp); bp = NULL; } else if (cursor->hashval <= be32_to_cpu(leaf->entries[0].hashval)) { - xfs_attr_trace_l_cl("maybe wrong blk", - context, leaf); + trace_xfs_attr_list_wrong_blk(context); xfs_da_brelse(NULL, bp); bp = NULL; } break; default: - xfs_attr_trace_l_c("wrong blk - ??", context); + trace_xfs_attr_list_wrong_blk(context); xfs_da_brelse(NULL, bp); bp = NULL; } @@ -1915,8 +1908,8 @@ xfs_attr_node_list(xfs_attr_list_context if (cursor->hashval <= be32_to_cpu(btree->hashval)) { cursor->blkno = be32_to_cpu(btree->before); - xfs_attr_trace_l_cb("descending", - context, btree); + trace_xfs_attr_list_node_descend(context, + btree); break; } } @@ -2266,85 +2259,3 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar } return(0); } - -#if defined(XFS_ATTR_TRACE) -/* - * Add a trace buffer entry for an attr_list context structure. - */ -void -xfs_attr_trace_l_c(char *where, struct xfs_attr_list_context *context) -{ - xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_C, where, context, - (__psunsigned_t)NULL, - (__psunsigned_t)NULL, - (__psunsigned_t)NULL); -} - -/* - * Add a trace buffer entry for a context structure and a Btree node. - */ -void -xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context, - struct xfs_da_intnode *node) -{ - xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CN, where, context, - (__psunsigned_t)be16_to_cpu(node->hdr.count), - (__psunsigned_t)be32_to_cpu(node->btree[0].hashval), - (__psunsigned_t)be32_to_cpu(node->btree[ - be16_to_cpu(node->hdr.count)-1].hashval)); -} - -/* - * Add a trace buffer entry for a context structure and a Btree element. - */ -void -xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context, - struct xfs_da_node_entry *btree) -{ - xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CB, where, context, - (__psunsigned_t)be32_to_cpu(btree->hashval), - (__psunsigned_t)be32_to_cpu(btree->before), - (__psunsigned_t)NULL); -} - -/* - * Add a trace buffer entry for a context structure and a leaf block. - */ -void -xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context, - struct xfs_attr_leafblock *leaf) -{ - xfs_attr_trace_enter(XFS_ATTR_KTRACE_L_CL, where, context, - (__psunsigned_t)be16_to_cpu(leaf->hdr.count), - (__psunsigned_t)be32_to_cpu(leaf->entries[0].hashval), - (__psunsigned_t)be32_to_cpu(leaf->entries[ - be16_to_cpu(leaf->hdr.count)-1].hashval)); -} - -/* - * Add a trace buffer entry for the arguments given to the routine, - * generic form. - */ -void -xfs_attr_trace_enter(int type, char *where, - struct xfs_attr_list_context *context, - __psunsigned_t a13, __psunsigned_t a14, - __psunsigned_t a15) -{ - ASSERT(xfs_attr_trace_buf); - ktrace_enter(xfs_attr_trace_buf, (void *)((__psunsigned_t)type), - (void *)((__psunsigned_t)where), - (void *)((__psunsigned_t)context->dp), - (void *)((__psunsigned_t)context->cursor->hashval), - (void *)((__psunsigned_t)context->cursor->blkno), - (void *)((__psunsigned_t)context->cursor->offset), - (void *)((__psunsigned_t)context->alist), - (void *)((__psunsigned_t)context->bufsize), - (void *)((__psunsigned_t)context->count), - (void *)((__psunsigned_t)context->firstu), - NULL, - (void *)((__psunsigned_t)context->dupcnt), - (void *)((__psunsigned_t)context->flags), - (void *)a13, (void *)a14, (void *)a15); -} -#endif /* XFS_ATTR_TRACE */ Index: xfs/fs/xfs/xfs_attr.h =================================================================== --- xfs.orig/fs/xfs/xfs_attr.h 2009-09-09 12:33:56.498254139 -0300 +++ xfs/fs/xfs/xfs_attr.h 2009-09-09 12:49:11.254255485 -0300 @@ -48,6 +48,16 @@ struct xfs_attr_list_context; #define ATTR_KERNOTIME 0x1000 /* [kernel] don't update inode timestamps */ #define ATTR_KERNOVAL 0x2000 /* [kernel] get attr size only, not value */ +#define XFS_ATTR_FLAGS \ + { ATTR_DONTFOLLOW, "DONTFOLLOW" }, \ + { ATTR_ROOT, "ROOT" }, \ + { ATTR_TRUST, "TRUST" }, \ + { ATTR_SECURE, "SECURE" }, \ + { ATTR_CREATE, "CREATE" }, \ + { ATTR_REPLACE, "REPLACE" }, \ + { ATTR_KERNOTIME, "KERNOTIME" }, \ + { ATTR_KERNOVAL, "KERNOVAL" } + /* * The maximum size (into the kernel or returned from the kernel) of an * attribute value or the buffer used for an attr_list() call. Larger Index: xfs/fs/xfs/xfs_attr_sf.h =================================================================== --- xfs.orig/fs/xfs/xfs_attr_sf.h 2009-09-09 12:33:56.503254497 -0300 +++ xfs/fs/xfs/xfs_attr_sf.h 2009-09-09 12:49:11.258027963 -0300 @@ -25,8 +25,6 @@ * to fit into the literal area of the inode. */ -struct xfs_inode; - /* * Entries are packed toward the top as tight as possible. */ @@ -69,42 +67,4 @@ typedef struct xfs_attr_sf_sort { (be16_to_cpu(((xfs_attr_shortform_t *) \ ((dp)->i_afp->if_u1.if_data))->hdr.totsize)) -#if defined(XFS_ATTR_TRACE) -/* - * Kernel tracing support for attribute lists - */ -struct xfs_attr_list_context; -struct xfs_da_intnode; -struct xfs_da_node_entry; -struct xfs_attr_leafblock; - -#define XFS_ATTR_TRACE_SIZE 4096 /* size of global trace buffer */ -extern ktrace_t *xfs_attr_trace_buf; - -/* - * Trace record types. - */ -#define XFS_ATTR_KTRACE_L_C 1 /* context */ -#define XFS_ATTR_KTRACE_L_CN 2 /* context, node */ -#define XFS_ATTR_KTRACE_L_CB 3 /* context, btree */ -#define XFS_ATTR_KTRACE_L_CL 4 /* context, leaf */ - -void xfs_attr_trace_l_c(char *where, struct xfs_attr_list_context *context); -void xfs_attr_trace_l_cn(char *where, struct xfs_attr_list_context *context, - struct xfs_da_intnode *node); -void xfs_attr_trace_l_cb(char *where, struct xfs_attr_list_context *context, - struct xfs_da_node_entry *btree); -void xfs_attr_trace_l_cl(char *where, struct xfs_attr_list_context *context, - struct xfs_attr_leafblock *leaf); -void xfs_attr_trace_enter(int type, char *where, - struct xfs_attr_list_context *context, - __psunsigned_t a13, __psunsigned_t a14, - __psunsigned_t a15); -#else -#define xfs_attr_trace_l_c(w,c) -#define xfs_attr_trace_l_cn(w,c,n) -#define xfs_attr_trace_l_cb(w,c,b) -#define xfs_attr_trace_l_cl(w,c,l) -#endif /* XFS_ATTR_TRACE */ - #endif /* __XFS_ATTR_SF_H__ */ Index: xfs/fs/xfs/xfs_bmap.c =================================================================== --- xfs.orig/fs/xfs/xfs_bmap.c 2009-09-09 12:33:56.507254656 -0300 +++ xfs/fs/xfs/xfs_bmap.c 2009-09-09 12:49:11.270256405 -0300 @@ -54,6 +54,7 @@ #include "xfs_buf_item.h" #include "xfs_filestream.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" #ifdef DEBUG @@ -272,71 +273,6 @@ xfs_bmap_isaeof( int whichfork, /* data or attribute fork */ char *aeof); /* return value */ -#ifdef XFS_BMAP_TRACE -/* - * Add bmap trace entry prior to a call to xfs_iext_remove. - */ -STATIC void -xfs_bmap_trace_delete( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry(entries) deleted */ - xfs_extnum_t cnt, /* count of entries deleted, 1 or 2 */ - int whichfork); /* data or attr fork */ - -/* - * Add bmap trace entry prior to a call to xfs_iext_insert, or - * reading in the extents list from the disk (in the btree). - */ -STATIC void -xfs_bmap_trace_insert( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry(entries) inserted */ - xfs_extnum_t cnt, /* count of entries inserted, 1 or 2 */ - xfs_bmbt_irec_t *r1, /* inserted record 1 */ - xfs_bmbt_irec_t *r2, /* inserted record 2 or null */ - int whichfork); /* data or attr fork */ - -/* - * Add bmap trace entry after updating an extent record in place. - */ -STATIC void -xfs_bmap_trace_post_update( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry updated */ - int whichfork); /* data or attr fork */ - -/* - * Add bmap trace entry prior to updating an extent record in place. - */ -STATIC void -xfs_bmap_trace_pre_update( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry to be updated */ - int whichfork); /* data or attr fork */ - -#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w) \ - xfs_bmap_trace_delete(__func__,d,ip,i,c,w) -#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) \ - xfs_bmap_trace_insert(__func__,d,ip,i,c,r1,r2,w) -#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) \ - xfs_bmap_trace_post_update(__func__,d,ip,i,w) -#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) \ - xfs_bmap_trace_pre_update(__func__,d,ip,i,w) -#else -#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w) -#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) -#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) -#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) -#endif /* XFS_BMAP_TRACE */ - /* * Compute the worst-case number of indirect blocks that will be used * for ip's delayed extent of length "len". @@ -363,18 +299,6 @@ xfs_bmap_validate_ret( #define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap) #endif /* DEBUG */ -#if defined(XFS_RW_TRACE) -STATIC void -xfs_bunmap_trace( - xfs_inode_t *ip, - xfs_fileoff_t bno, - xfs_filblks_t len, - int flags, - inst_t *ra); -#else -#define xfs_bunmap_trace(ip, bno, len, flags, ra) -#endif /* XFS_RW_TRACE */ - STATIC int xfs_bmap_count_tree( xfs_mount_t *mp, @@ -398,6 +322,11 @@ xfs_bmap_disk_count_leaves( int numrecs, int *count); +#define xfs_trace_bmap_post_update(d, ip, i, w) \ + trace_xfs_bmap_post_update(ip, i, w, d) +#define xfs_trace_bmap_pre_update(d, ip, i, w) \ + trace_xfs_bmap_pre_update(ip, i, w, d) + /* * Bmap internal routines. */ @@ -590,8 +519,7 @@ xfs_bmap_add_extent( * already extents in the list. */ if (nextents == 0) { - XFS_BMAP_TRACE_INSERT("insert empty", ip, 0, 1, new, NULL, - whichfork); + trace_xfs_bmap_insert(ip, 0, new, whichfork, "E"); xfs_iext_insert(ifp, 0, 1, new); ASSERT(cur == NULL); ifp->if_lastex = 0; @@ -844,14 +772,16 @@ xfs_bmap_add_extent_delay_real( * Filling in all of a previously delayed allocation extent. * The left and right neighbors are both contiguous with new. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1, - XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx - 1, XFS_DATA_FORK, + "LF|RF|LC|RC"); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + PREV.br_blockcount + RIGHT.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1, - XFS_DATA_FORK); - XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx - 1, XFS_DATA_FORK, + "LF|RF|LC|RC"); + + trace_xfs_bmap_delete(ip, idx, XFS_DATA_FORK, "LF|RF|LC|RC"); + trace_xfs_bmap_delete(ip, idx + 1, XFS_DATA_FORK, "LF|RF|LC|RC"); xfs_iext_remove(ifp, idx, 2); ip->i_df.if_lastex = idx - 1; ip->i_d.di_nextents--; @@ -890,14 +820,15 @@ xfs_bmap_add_extent_delay_real( * Filling in all of a previously delayed allocation extent. * The left neighbor is contiguous, the right is not. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1, - XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx - 1, XFS_DATA_FORK, + "LF|RF|LC"); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + PREV.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, - XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx - 1, XFS_DATA_FORK, + "LF|RF|LC"); + ip->i_df.if_lastex = idx - 1; - XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx, XFS_DATA_FORK, "LF|RF|LC"); xfs_iext_remove(ifp, idx, 1); if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -926,13 +857,14 @@ xfs_bmap_add_extent_delay_real( * Filling in all of a previously delayed allocation extent. * The right neighbor is contiguous, the left is not. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx, XFS_DATA_FORK, "LF|RF|RC"); xfs_bmbt_set_startblock(ep, new->br_startblock); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount + RIGHT.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx, XFS_DATA_FORK, "LF|RF|RC"); + ip->i_df.if_lastex = idx; - XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx + 1, XFS_DATA_FORK, "LF|RF|RC"); xfs_iext_remove(ifp, idx + 1, 1); if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -962,9 +894,10 @@ xfs_bmap_add_extent_delay_real( * Neither the left nor right neighbors are contiguous with * the new one. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx, XFS_DATA_FORK, "LF|RF"); xfs_bmbt_set_startblock(ep, new->br_startblock); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx, XFS_DATA_FORK, "LF|RF"); + ip->i_df.if_lastex = idx; ip->i_d.di_nextents++; if (cur == NULL) @@ -992,15 +925,19 @@ xfs_bmap_add_extent_delay_real( * Filling in the first part of a previous delayed allocation. * The left neighbor is contiguous. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx - 1, XFS_DATA_FORK, "LF|LC"); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + new->br_blockcount); xfs_bmbt_set_startoff(ep, PREV.br_startoff + new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx - 1, XFS_DATA_FORK, "LF|LC"); + temp = PREV.br_blockcount - new->br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); + + trace_xfs_bmap_pre_update(ip, idx, XFS_DATA_FORK, "LF|LC"); xfs_bmbt_set_blockcount(ep, temp); + trace_xfs_bmap_post_update(ip, idx, XFS_DATA_FORK, "LF|LC"); + ip->i_df.if_lastex = idx - 1; if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -1021,7 +958,7 @@ xfs_bmap_add_extent_delay_real( temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), startblockval(PREV.br_startblock)); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_post_update("LF|LC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ temp = LEFT.br_startoff; @@ -1034,12 +971,11 @@ xfs_bmap_add_extent_delay_real( * Filling in the first part of a previous delayed allocation. * The left neighbor is not contiguous. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx, XFS_DATA_FORK, "LF"); xfs_bmbt_set_startoff(ep, new_endoff); temp = PREV.br_blockcount - new->br_blockcount; xfs_bmbt_set_blockcount(ep, temp); - XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL, - XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx, new, XFS_DATA_FORK, "LF"); xfs_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; ip->i_d.di_nextents++; @@ -1071,7 +1007,7 @@ xfs_bmap_add_extent_delay_real( (cur ? cur->bc_private.b.allocated : 0)); ep = xfs_iext_get_ext(ifp, idx + 1); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK); + xfs_trace_bmap_post_update("LF", ip, idx + 1, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ temp = PREV.br_startoff; @@ -1084,14 +1020,14 @@ xfs_bmap_add_extent_delay_real( * The right neighbor is contiguous with the new allocation. */ temp = PREV.br_blockcount - new->br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); - XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); + trace_xfs_bmap_pre_update(ip, idx, XFS_DATA_FORK, "RF|RC"); + trace_xfs_bmap_pre_update(ip, idx + 1, XFS_DATA_FORK, "RF|RC"); xfs_bmbt_set_blockcount(ep, temp); xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), new->br_startoff, new->br_startblock, new->br_blockcount + RIGHT.br_blockcount, RIGHT.br_state); - XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); + trace_xfs_bmap_post_update(ip, idx + 1, XFS_DATA_FORK, "RF|RC"); ip->i_df.if_lastex = idx + 1; if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -1112,7 +1048,7 @@ xfs_bmap_add_extent_delay_real( temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), startblockval(PREV.br_startblock)); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_post_update("RF|RC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ temp = PREV.br_startoff; @@ -1126,10 +1062,9 @@ xfs_bmap_add_extent_delay_real( * The right neighbor is not contiguous. */ temp = PREV.br_blockcount - new->br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, temp); - XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL, - XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx + 1, new, XFS_DATA_FORK, "RF"); xfs_iext_insert(ifp, idx + 1, 1, new); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents++; @@ -1161,7 +1096,7 @@ xfs_bmap_add_extent_delay_real( (cur ? cur->bc_private.b.allocated : 0)); ep = xfs_iext_get_ext(ifp, idx); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_post_update("RF", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ temp = PREV.br_startoff; @@ -1175,7 +1110,7 @@ xfs_bmap_add_extent_delay_real( * This case is avoided almost all the time. */ temp = new->br_startoff - PREV.br_startoff; - XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("0", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, temp); r[0] = *new; r[1].br_state = PREV.br_state; @@ -1183,8 +1118,8 @@ xfs_bmap_add_extent_delay_real( r[1].br_startoff = new_endoff; temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff; r[1].br_blockcount = temp2; - XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], - XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx + 1, &r[0], XFS_DATA_FORK, "0"); + trace_xfs_bmap_insert(ip, idx + 1, &r[1], XFS_DATA_FORK, "0"); xfs_iext_insert(ifp, idx + 1, 2, &r[0]); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents++; @@ -1242,11 +1177,11 @@ xfs_bmap_add_extent_delay_real( } ep = xfs_iext_get_ext(ifp, idx); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); - XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); + xfs_trace_bmap_post_update("0", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("0", ip, idx + 2, XFS_DATA_FORK); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2), nullstartblock((int)temp2)); - XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); + xfs_trace_bmap_post_update("0", ip, idx + 2, XFS_DATA_FORK); *dnew = temp + temp2; /* DELTA: One in-core extent is split in three. */ temp = PREV.br_startoff; @@ -1405,14 +1340,15 @@ xfs_bmap_add_extent_unwritten_real( * Setting all of a previous oldext extent to newext. * The left and right neighbors are both contiguous with new. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1, + xfs_trace_bmap_pre_update("LF|RF|LC|RC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + PREV.br_blockcount + RIGHT.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1, + xfs_trace_bmap_post_update("LF|RF|LC|RC", ip, idx - 1, XFS_DATA_FORK); - XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx, XFS_DATA_FORK, "LF|RF|LC|RC"); + trace_xfs_bmap_delete(ip, idx + 1, XFS_DATA_FORK, "LF|RF|LC|RC"); xfs_iext_remove(ifp, idx, 2); ip->i_df.if_lastex = idx - 1; ip->i_d.di_nextents -= 2; @@ -1455,14 +1391,14 @@ xfs_bmap_add_extent_unwritten_real( * Setting all of a previous oldext extent to newext. * The left neighbor is contiguous, the right is not. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1, + xfs_trace_bmap_pre_update("LF|RF|LC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + PREV.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, + xfs_trace_bmap_post_update("LF|RF|LC", ip, idx - 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; - XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx, XFS_DATA_FORK, "LF|RF|LC"); xfs_iext_remove(ifp, idx, 1); ip->i_d.di_nextents--; if (cur == NULL) @@ -1497,15 +1433,15 @@ xfs_bmap_add_extent_unwritten_real( * Setting all of a previous oldext extent to newext. * The right neighbor is contiguous, the left is not. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, + xfs_trace_bmap_pre_update("LF|RF|RC", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount + RIGHT.br_blockcount); xfs_bmbt_set_state(ep, newext); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, + xfs_trace_bmap_post_update("LF|RF|RC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; - XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx + 1, XFS_DATA_FORK, "LF|RF|RC"); xfs_iext_remove(ifp, idx + 1, 1); ip->i_d.di_nextents--; if (cur == NULL) @@ -1541,10 +1477,10 @@ xfs_bmap_add_extent_unwritten_real( * Neither the left nor right neighbors are contiguous with * the new one. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, + xfs_trace_bmap_pre_update("LF|RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_state(ep, newext); - XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, + xfs_trace_bmap_post_update("LF|RF", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; if (cur == NULL) @@ -1571,21 +1507,21 @@ xfs_bmap_add_extent_unwritten_real( * Setting the first part of a previous oldext extent to newext. * The left neighbor is contiguous. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, + xfs_trace_bmap_pre_update("LF|LC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), LEFT.br_blockcount + new->br_blockcount); xfs_bmbt_set_startoff(ep, PREV.br_startoff + new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, + xfs_trace_bmap_post_update("LF|LC", ip, idx - 1, XFS_DATA_FORK); - XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, + xfs_trace_bmap_pre_update("LF|LC", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_startblock(ep, new->br_startblock + new->br_blockcount); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount - new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, + xfs_trace_bmap_post_update("LF|LC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; if (cur == NULL) @@ -1622,16 +1558,15 @@ xfs_bmap_add_extent_unwritten_real( * Setting the first part of a previous oldext extent to newext. * The left neighbor is not contiguous. */ - XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("LF", ip, idx, XFS_DATA_FORK); ASSERT(ep && xfs_bmbt_get_state(ep) == oldext); xfs_bmbt_set_startoff(ep, new_endoff); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount - new->br_blockcount); xfs_bmbt_set_startblock(ep, new->br_startblock + new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx, XFS_DATA_FORK); - XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL, - XFS_DATA_FORK); + xfs_trace_bmap_post_update("LF", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx, new, XFS_DATA_FORK, "LF"); xfs_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; ip->i_d.di_nextents++; @@ -1665,18 +1600,18 @@ xfs_bmap_add_extent_unwritten_real( * Setting the last part of a previous oldext extent to newext. * The right neighbor is contiguous with the new allocation. */ - XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, + xfs_trace_bmap_pre_update("RF|RC", ip, idx, XFS_DATA_FORK); - XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, + xfs_trace_bmap_pre_update("RF|RC", ip, idx + 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount - new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, + xfs_trace_bmap_post_update("RF|RC", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), new->br_startoff, new->br_startblock, new->br_blockcount + RIGHT.br_blockcount, newext); - XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, + xfs_trace_bmap_post_update("RF|RC", ip, idx + 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx + 1; if (cur == NULL) @@ -1712,12 +1647,11 @@ xfs_bmap_add_extent_unwritten_real( * Setting the last part of a previous oldext extent to newext. * The right neighbor is not contiguous. */ - XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount - new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); - XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL, - XFS_DATA_FORK); + xfs_trace_bmap_post_update("RF", ip, idx, XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx + 1, new, XFS_DATA_FORK, "RF"); xfs_iext_insert(ifp, idx + 1, 1, new); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents++; @@ -1756,18 +1690,18 @@ xfs_bmap_add_extent_unwritten_real( * newext. Contiguity is impossible here. * One extent becomes three extents. */ - XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("0", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, new->br_startoff - PREV.br_startoff); - XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_post_update("0", ip, idx, XFS_DATA_FORK); r[0] = *new; r[1].br_startoff = new_endoff; r[1].br_blockcount = PREV.br_startoff + PREV.br_blockcount - new_endoff; r[1].br_startblock = new->br_startblock + new->br_blockcount; r[1].br_state = oldext; - XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], - XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx + 1, &r[0], XFS_DATA_FORK, "0"); + trace_xfs_bmap_insert(ip, idx + 1, &r[1], XFS_DATA_FORK, "0"); xfs_iext_insert(ifp, idx + 1, 2, &r[0]); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents += 2; @@ -1935,7 +1869,7 @@ xfs_bmap_add_extent_hole_delay( */ temp = left.br_blockcount + new->br_blockcount + right.br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1, + xfs_trace_bmap_pre_update("LC|RC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); oldlen = startblockval(left.br_startblock) + @@ -1944,9 +1878,9 @@ xfs_bmap_add_extent_hole_delay( newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), nullstartblock((int)newlen)); - XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, + xfs_trace_bmap_post_update("LC|RC", ip, idx - 1, XFS_DATA_FORK); - XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK); + trace_xfs_bmap_delete(ip, idx, XFS_DATA_FORK, "LC|RC"); xfs_iext_remove(ifp, idx, 1); ip->i_df.if_lastex = idx - 1; /* DELTA: Two in-core extents were replaced by one. */ @@ -1961,7 +1895,7 @@ xfs_bmap_add_extent_hole_delay( * Merge the new allocation with the left neighbor. */ temp = left.br_blockcount + new->br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, + xfs_trace_bmap_pre_update("LC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); oldlen = startblockval(left.br_startblock) + @@ -1969,7 +1903,7 @@ xfs_bmap_add_extent_hole_delay( newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), nullstartblock((int)newlen)); - XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, + xfs_trace_bmap_post_update("LC", ip, idx - 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; /* DELTA: One in-core extent grew into a hole. */ @@ -1983,14 +1917,14 @@ xfs_bmap_add_extent_hole_delay( * on the right. * Merge the new allocation with the right neighbor. */ - XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_pre_update("RC", ip, idx, XFS_DATA_FORK); temp = new->br_blockcount + right.br_blockcount; oldlen = startblockval(new->br_startblock) + startblockval(right.br_startblock); newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_allf(ep, new->br_startoff, nullstartblock((int)newlen), temp, right.br_state); - XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, XFS_DATA_FORK); + xfs_trace_bmap_post_update("RC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; /* DELTA: One in-core extent grew into a hole. */ temp2 = temp; @@ -2004,8 +1938,7 @@ xfs_bmap_add_extent_hole_delay( * Insert a new entry. */ oldlen = newlen = 0; - XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, - XFS_DATA_FORK); + trace_xfs_bmap_insert(ip, idx, new, XFS_DATA_FORK, "0"); xfs_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; /* DELTA: A new in-core extent was added in a hole. */ @@ -2130,14 +2063,14 @@ xfs_bmap_add_extent_hole_real( * left and on the right. * Merge all three into a single extent record. */ - XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1, + xfs_trace_bmap_pre_update("LC|RC", ip, idx - 1, whichfork); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), left.br_blockcount + new->br_blockcount + right.br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, + xfs_trace_bmap_post_update("LC|RC", ip, idx - 1, whichfork); - XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, whichfork); + trace_xfs_bmap_delete(ip, idx, whichfork, "LC|RC"); xfs_iext_remove(ifp, idx, 1); ifp->if_lastex = idx - 1; XFS_IFORK_NEXT_SET(ip, whichfork, @@ -2179,10 +2112,10 @@ xfs_bmap_add_extent_hole_real( * on the left. * Merge the new allocation with the left neighbor. */ - XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, whichfork); + xfs_trace_bmap_pre_update("LC", ip, idx - 1, whichfork); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), left.br_blockcount + new->br_blockcount); - XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, whichfork); + xfs_trace_bmap_post_update("LC", ip, idx - 1, whichfork); ifp->if_lastex = idx - 1; if (cur == NULL) { rval = xfs_ilog_fext(whichfork); @@ -2213,11 +2146,11 @@ xfs_bmap_add_extent_hole_real( * on the right. * Merge the new allocation with the right neighbor. */ - XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, whichfork); + xfs_trace_bmap_pre_update("RC", ip, idx, whichfork); xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock, new->br_blockcount + right.br_blockcount, right.br_state); - XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, whichfork); + xfs_trace_bmap_post_update("RC", ip, idx, whichfork); ifp->if_lastex = idx; if (cur == NULL) { rval = xfs_ilog_fext(whichfork); @@ -2248,7 +2181,7 @@ xfs_bmap_add_extent_hole_real( * real allocation. * Insert a new entry. */ - XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, whichfork); + trace_xfs_bmap_insert(ip, idx, new, whichfork, "0"); xfs_iext_insert(ifp, idx, 1, new); ifp->if_lastex = idx; XFS_IFORK_NEXT_SET(ip, whichfork, @@ -3196,7 +3129,7 @@ xfs_bmap_del_extent( /* * Matches the whole extent. Delete the entry. */ - XFS_BMAP_TRACE_DELETE("3", ip, idx, 1, whichfork); + trace_xfs_bmap_delete(ip, idx, whichfork, "3"); xfs_iext_remove(ifp, idx, 1); ifp->if_lastex = idx; if (delay) @@ -3217,7 +3150,7 @@ xfs_bmap_del_extent( /* * Deleting the first part of the extent. */ - XFS_BMAP_TRACE_PRE_UPDATE("2", ip, idx, whichfork); + xfs_trace_bmap_pre_update("2", ip, idx, whichfork); xfs_bmbt_set_startoff(ep, del_endoff); temp = got.br_blockcount - del->br_blockcount; xfs_bmbt_set_blockcount(ep, temp); @@ -3226,13 +3159,13 @@ xfs_bmap_del_extent( temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), da_old); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, + xfs_trace_bmap_post_update("2", ip, idx, whichfork); da_new = temp; break; } xfs_bmbt_set_startblock(ep, del_endblock); - XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); + xfs_trace_bmap_post_update("2", ip, idx, whichfork); if (!cur) { flags |= xfs_ilog_fext(whichfork); break; @@ -3248,19 +3181,19 @@ xfs_bmap_del_extent( * Deleting the last part of the extent. */ temp = got.br_blockcount - del->br_blockcount; - XFS_BMAP_TRACE_PRE_UPDATE("1", ip, idx, whichfork); + xfs_trace_bmap_pre_update("1", ip, idx, whichfork); xfs_bmbt_set_blockcount(ep, temp); ifp->if_lastex = idx; if (delay) { temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), da_old); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); - XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, + xfs_trace_bmap_post_update("1", ip, idx, whichfork); da_new = temp; break; } - XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); + xfs_trace_bmap_post_update("1", ip, idx, whichfork); if (!cur) { flags |= xfs_ilog_fext(whichfork); break; @@ -3277,7 +3210,7 @@ xfs_bmap_del_extent( * Deleting the middle of the extent. */ temp = del->br_startoff - got.br_startoff; - XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, whichfork); + xfs_trace_bmap_pre_update("0", ip, idx, whichfork); xfs_bmbt_set_blockcount(ep, temp); new.br_startoff = del_endoff; temp2 = got_endoff - del_endoff; @@ -3364,9 +3297,8 @@ xfs_bmap_del_extent( } } } - XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, whichfork); - XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 1, &new, NULL, - whichfork); + xfs_trace_bmap_post_update("0", ip, idx, whichfork); + trace_xfs_bmap_insert(ip, idx + 1, &new, whichfork, "0"); xfs_iext_insert(ifp, idx + 1, 1, &new); ifp->if_lastex = idx + 1; break; @@ -3687,7 +3619,7 @@ xfs_bmap_local_to_extents( xfs_iext_add(ifp, 0, 1); ep = xfs_iext_get_ext(ifp, 0); xfs_bmbt_set_allf(ep, 0, args.fsbno, 1, XFS_EXT_NORM); - XFS_BMAP_TRACE_POST_UPDATE("new", ip, 0, whichfork); + xfs_trace_bmap_post_update("new", ip, 0, whichfork); XFS_IFORK_NEXT_SET(ip, whichfork, 1); ip->i_d.di_nblocks = 1; xfs_trans_mod_dquot_byino(tp, ip, @@ -3800,158 +3732,6 @@ xfs_bmap_search_extents( return ep; } - -#ifdef XFS_BMAP_TRACE -ktrace_t *xfs_bmap_trace_buf; - -/* - * Add a bmap trace buffer entry. Base routine for the others. - */ -STATIC void -xfs_bmap_trace_addentry( - int opcode, /* operation */ - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry(ies) */ - xfs_extnum_t cnt, /* count of entries, 1 or 2 */ - xfs_bmbt_rec_host_t *r1, /* first record */ - xfs_bmbt_rec_host_t *r2, /* second record or null */ - int whichfork) /* data or attr fork */ -{ - xfs_bmbt_rec_host_t tr2; - - ASSERT(cnt == 1 || cnt == 2); - ASSERT(r1 != NULL); - if (cnt == 1) { - ASSERT(r2 == NULL); - r2 = &tr2; - memset(&tr2, 0, sizeof(tr2)); - } else - ASSERT(r2 != NULL); - ktrace_enter(xfs_bmap_trace_buf, - (void *)(__psint_t)(opcode | (whichfork << 16)), - (void *)fname, (void *)desc, (void *)ip, - (void *)(__psint_t)idx, - (void *)(__psint_t)cnt, - (void *)(__psunsigned_t)(ip->i_ino >> 32), - (void *)(__psunsigned_t)(unsigned)ip->i_ino, - (void *)(__psunsigned_t)(r1->l0 >> 32), - (void *)(__psunsigned_t)(unsigned)(r1->l0), - (void *)(__psunsigned_t)(r1->l1 >> 32), - (void *)(__psunsigned_t)(unsigned)(r1->l1), - (void *)(__psunsigned_t)(r2->l0 >> 32), - (void *)(__psunsigned_t)(unsigned)(r2->l0), - (void *)(__psunsigned_t)(r2->l1 >> 32), - (void *)(__psunsigned_t)(unsigned)(r2->l1) - ); - ASSERT(ip->i_xtrace); - ktrace_enter(ip->i_xtrace, - (void *)(__psint_t)(opcode | (whichfork << 16)), - (void *)fname, (void *)desc, (void *)ip, - (void *)(__psint_t)idx, - (void *)(__psint_t)cnt, - (void *)(__psunsigned_t)(ip->i_ino >> 32), - (void *)(__psunsigned_t)(unsigned)ip->i_ino, - (void *)(__psunsigned_t)(r1->l0 >> 32), - (void *)(__psunsigned_t)(unsigned)(r1->l0), - (void *)(__psunsigned_t)(r1->l1 >> 32), - (void *)(__psunsigned_t)(unsigned)(r1->l1), - (void *)(__psunsigned_t)(r2->l0 >> 32), - (void *)(__psunsigned_t)(unsigned)(r2->l0), - (void *)(__psunsigned_t)(r2->l1 >> 32), - (void *)(__psunsigned_t)(unsigned)(r2->l1) - ); -} - -/* - * Add bmap trace entry prior to a call to xfs_iext_remove. - */ -STATIC void -xfs_bmap_trace_delete( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry(entries) deleted */ - xfs_extnum_t cnt, /* count of entries deleted, 1 or 2 */ - int whichfork) /* data or attr fork */ -{ - xfs_ifork_t *ifp; /* inode fork pointer */ - - ifp = XFS_IFORK_PTR(ip, whichfork); - xfs_bmap_trace_addentry(XFS_BMAP_KTRACE_DELETE, fname, desc, ip, idx, - cnt, xfs_iext_get_ext(ifp, idx), - cnt == 2 ? xfs_iext_get_ext(ifp, idx + 1) : NULL, - whichfork); -} - -/* - * Add bmap trace entry prior to a call to xfs_iext_insert, or - * reading in the extents list from the disk (in the btree). - */ -STATIC void -xfs_bmap_trace_insert( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry(entries) inserted */ - xfs_extnum_t cnt, /* count of entries inserted, 1 or 2 */ - xfs_bmbt_irec_t *r1, /* inserted record 1 */ - xfs_bmbt_irec_t *r2, /* inserted record 2 or null */ - int whichfork) /* data or attr fork */ -{ - xfs_bmbt_rec_host_t tr1; /* compressed record 1 */ - xfs_bmbt_rec_host_t tr2; /* compressed record 2 if needed */ - - xfs_bmbt_set_all(&tr1, r1); - if (cnt == 2) { - ASSERT(r2 != NULL); - xfs_bmbt_set_all(&tr2, r2); - } else { - ASSERT(cnt == 1); - ASSERT(r2 == NULL); - } - xfs_bmap_trace_addentry(XFS_BMAP_KTRACE_INSERT, fname, desc, ip, idx, - cnt, &tr1, cnt == 2 ? &tr2 : NULL, whichfork); -} - -/* - * Add bmap trace entry after updating an extent record in place. - */ -STATIC void -xfs_bmap_trace_post_update( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry updated */ - int whichfork) /* data or attr fork */ -{ - xfs_ifork_t *ifp; /* inode fork pointer */ - - ifp = XFS_IFORK_PTR(ip, whichfork); - xfs_bmap_trace_addentry(XFS_BMAP_KTRACE_POST_UP, fname, desc, ip, idx, - 1, xfs_iext_get_ext(ifp, idx), NULL, whichfork); -} - -/* - * Add bmap trace entry prior to updating an extent record in place. - */ -STATIC void -xfs_bmap_trace_pre_update( - const char *fname, /* function name */ - char *desc, /* operation description */ - xfs_inode_t *ip, /* incore inode pointer */ - xfs_extnum_t idx, /* index of entry to be updated */ - int whichfork) /* data or attr fork */ -{ - xfs_ifork_t *ifp; /* inode fork pointer */ - - ifp = XFS_IFORK_PTR(ip, whichfork); - xfs_bmap_trace_addentry(XFS_BMAP_KTRACE_PRE_UP, fname, desc, ip, idx, 1, - xfs_iext_get_ext(ifp, idx), NULL, whichfork); -} -#endif /* XFS_BMAP_TRACE */ - /* * Compute the worst-case number of indirect blocks that will be used * for ip's delayed extent of length "len". @@ -3983,37 +3763,6 @@ xfs_bmap_worst_indlen( return rval; } -#if defined(XFS_RW_TRACE) -STATIC void -xfs_bunmap_trace( - xfs_inode_t *ip, - xfs_fileoff_t bno, - xfs_filblks_t len, - int flags, - inst_t *ra) -{ - if (ip->i_rwtrace == NULL) - return; - ktrace_enter(ip->i_rwtrace, - (void *)(__psint_t)XFS_BUNMAP, - (void *)ip, - (void *)(__psint_t)((ip->i_d.di_size >> 32) & 0xffffffff), - (void *)(__psint_t)(ip->i_d.di_size & 0xffffffff), - (void *)(__psint_t)(((xfs_dfiloff_t)bno >> 32) & 0xffffffff), - (void *)(__psint_t)((xfs_dfiloff_t)bno & 0xffffffff), - (void *)(__psint_t)len, - (void *)(__psint_t)flags, - (void *)(unsigned long)current_cpu(), - (void *)ra, - (void *)0, - (void *)0, - (void *)0, - (void *)0, - (void *)0, - (void *)0); -} -#endif - /* * Convert inode from non-attributed to attributed. * Must not be in a transaction, ip must not be locked. @@ -4702,7 +4451,7 @@ error0: return XFS_ERROR(EFSCORRUPTED); } -#ifdef XFS_BMAP_TRACE +#ifdef DEBUG /* * Add bmap trace insert entries for all the contents of the extent records. */ @@ -4723,13 +4472,10 @@ xfs_bmap_trace_exlist( for (idx = 0; idx < cnt; idx++) { ep = xfs_iext_get_ext(ifp, idx); xfs_bmbt_get_all(ep, &s); - XFS_BMAP_TRACE_INSERT("exlist", ip, idx, 1, &s, NULL, - whichfork); + trace_xfs_bmap_insert(ip, idx, &s, whichfork, "extlist"); } } -#endif -#ifdef DEBUG /* * Validate that the bmbt_irecs being returned from bmapi are valid * given the callers original parameters. Specifically check the @@ -5478,7 +5224,8 @@ xfs_bunmapi( int rsvd; /* OK to allocate reserved blocks */ xfs_fsblock_t sum; - xfs_bunmap_trace(ip, bno, len, flags, (inst_t *)__return_address); + xfs_bunmap_trace(ip, bno, len, flags); + whichfork = (flags & XFS_BMAPI_ATTRFORK) ? XFS_ATTR_FORK : XFS_DATA_FORK; ifp = XFS_IFORK_PTR(ip, whichfork); Index: xfs/fs/xfs/xfs_bmap.h =================================================================== --- xfs.orig/fs/xfs/xfs_bmap.h 2009-09-09 12:33:56.511254188 -0300 +++ xfs/fs/xfs/xfs_bmap.h 2009-09-09 12:49:11.273258673 -0300 @@ -95,6 +95,21 @@ typedef struct xfs_bmap_free /* need write cache flushing and no */ /* additional allocation alignments */ +#define XFS_BMAPI_FLAGS \ + { XFS_BMAPI_WRITE, "WRITE" }, \ + { XFS_BMAPI_DELAY, "DELAY" }, \ + { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ + { XFS_BMAPI_METADATA, "METADATA" }, \ + { XFS_BMAPI_EXACT, "EXACT" }, \ + { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ + { XFS_BMAPI_ASYNC, "ASYNC" }, \ + { XFS_BMAPI_RSVBLOCKS, "RSVBLOCKS" }, \ + { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ + { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ + { XFS_BMAPI_CONTIG, "CONTIG" }, \ + { XFS_BMAPI_CONVERT, "CONVERT" } + + static inline int xfs_bmapi_aflag(int w) { return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); @@ -135,7 +150,6 @@ typedef struct xfs_bmalloca { char conv; /* overwriting unwritten extents */ } xfs_bmalloca_t; -#if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) /* * Trace operations for bmap extent tracing */ @@ -144,13 +158,18 @@ typedef struct xfs_bmalloca { #define XFS_BMAP_KTRACE_PRE_UP 3 #define XFS_BMAP_KTRACE_POST_UP 4 -#define XFS_BMAP_TRACE_SIZE 4096 /* size of global trace buffer */ -#define XFS_BMAP_KTRACE_SIZE 32 /* size of per-inode trace buffer */ -extern ktrace_t *xfs_bmap_trace_buf; +#define XFS_BMAP_KTRACE_TYPES \ + { XFS_BMAP_KTRACE_DELETE, "delete" }, \ + { XFS_BMAP_KTRACE_INSERT, "insert" }, \ + { XFS_BMAP_KTRACE_PRE_UP, "pre" }, \ + { XFS_BMAP_KTRACE_POST_UP, "post"} /* * Add bmap trace insert entries for all the contents of the extent list. + * + * Quite excessive tracing. Only do this for debug builds. */ +#if defined(__KERNEL) && defined(DEBUG) void xfs_bmap_trace_exlist( const char *fname, /* function name */ @@ -159,12 +178,9 @@ xfs_bmap_trace_exlist( int whichfork); /* data or attr fork */ #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ xfs_bmap_trace_exlist(__func__,ip,c,w) - -#else /* __KERNEL__ && XFS_BMAP_TRACE */ - +#else #define XFS_BMAP_TRACE_EXLIST(ip,c,w) - -#endif /* __KERNEL__ && XFS_BMAP_TRACE */ +#endif /* * Convert inode from non-attributed to attributed. Index: xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- xfs.orig/fs/xfs/xfs_bmap_btree.c 2009-09-09 12:33:56.517253905 -0300 +++ xfs/fs/xfs/xfs_bmap_btree.c 2009-09-09 12:49:11.276301588 -0300 @@ -769,12 +769,6 @@ xfs_bmbt_trace_enter( (void *)a0, (void *)a1, (void *)a2, (void *)a3, (void *)a4, (void *)a5, (void *)a6, (void *)a7, (void *)a8, (void *)a9, (void *)a10); - ktrace_enter(ip->i_btrace, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); } STATIC void Index: xfs/fs/xfs/xfs_btree.c =================================================================== --- xfs.orig/fs/xfs/xfs_btree.c 2009-09-09 12:33:56.521253297 -0300 +++ xfs/fs/xfs/xfs_btree.c 2009-09-09 12:49:11.280024619 -0300 @@ -39,6 +39,7 @@ #include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * Cursor allocation zone. @@ -81,7 +82,7 @@ xfs_btree_check_lblock( XFS_ERRTAG_BTREE_CHECK_LBLOCK, XFS_RANDOM_BTREE_CHECK_LBLOCK))) { if (bp) - xfs_buftrace("LBTREE ERROR", bp); + xfs_buftrace(bp, "lbtree_error"); XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, mp); return XFS_ERROR(EFSCORRUPTED); @@ -119,7 +120,7 @@ xfs_btree_check_sblock( XFS_ERRTAG_BTREE_CHECK_SBLOCK, XFS_RANDOM_BTREE_CHECK_SBLOCK))) { if (bp) - xfs_buftrace("SBTREE ERROR", bp); + xfs_buftrace(bp, "sbtree_error"); XFS_CORRUPTION_ERROR("xfs_btree_check_sblock", XFS_ERRLEVEL_LOW, cur->bc_mp, block); return XFS_ERROR(EFSCORRUPTED); Index: xfs/fs/xfs/xfs_btree_trace.h =================================================================== --- xfs.orig/fs/xfs/xfs_btree_trace.h 2009-09-09 12:33:56.526253655 -0300 +++ xfs/fs/xfs/xfs_btree_trace.h 2009-09-09 12:49:11.282255978 -0300 @@ -58,8 +58,6 @@ void xfs_btree_trace_argbi(const char *, struct xfs_buf *, int, int); void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *, struct xfs_buf *, int, int, int); -void xfs_btree_trace_argfffi(const char *, struct xfs_btree_cur *, - xfs_dfiloff_t, xfs_dfsbno_t, xfs_dfilblks_t, int, int); void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int); void xfs_btree_trace_argipk(const char *, struct xfs_btree_cur *, int, union xfs_btree_ptr, union xfs_btree_key *, int); @@ -71,24 +69,10 @@ void xfs_btree_trace_argr(const char *, union xfs_btree_rec *, int); void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int); - -#define XFS_ALLOCBT_TRACE_SIZE 4096 /* size of global trace buffer */ -extern ktrace_t *xfs_allocbt_trace_buf; - -#define XFS_INOBT_TRACE_SIZE 4096 /* size of global trace buffer */ -extern ktrace_t *xfs_inobt_trace_buf; - -#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ -#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ -extern ktrace_t *xfs_bmbt_trace_buf; - - #define XFS_BTREE_TRACE_ARGBI(c, b, i) \ xfs_btree_trace_argbi(__func__, c, b, i, __LINE__) #define XFS_BTREE_TRACE_ARGBII(c, b, i, j) \ xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__) -#define XFS_BTREE_TRACE_ARGFFFI(c, o, b, i, j) \ - xfs_btree_trace_argfffi(__func__, c, o, b, i, j, __LINE__) #define XFS_BTREE_TRACE_ARGI(c, i) \ xfs_btree_trace_argi(__func__, c, i, __LINE__) #define XFS_BTREE_TRACE_ARGIPK(c, i, p, k) \ @@ -104,7 +88,6 @@ extern ktrace_t *xfs_bmbt_trace_buf; #else #define XFS_BTREE_TRACE_ARGBI(c, b, i) #define XFS_BTREE_TRACE_ARGBII(c, b, i, j) -#define XFS_BTREE_TRACE_ARGFFFI(c, o, b, i, j) #define XFS_BTREE_TRACE_ARGI(c, i) #define XFS_BTREE_TRACE_ARGIPK(c, i, p, s) #define XFS_BTREE_TRACE_ARGIPR(c, i, p, r) Index: xfs/fs/xfs/xfs_buf_item.c =================================================================== --- xfs.orig/fs/xfs/xfs_buf_item.c 2009-09-09 12:33:56.530253885 -0300 +++ xfs/fs/xfs/xfs_buf_item.c 2009-09-09 12:49:11.286255859 -0300 @@ -29,6 +29,7 @@ #include "xfs_buf_item.h" #include "xfs_trans_priv.h" #include "xfs_error.h" +#include "xfs_trace.h" kmem_zone_t *xfs_buf_item_zone; @@ -356,7 +357,6 @@ xfs_buf_item_pin( ASSERT((bip->bli_flags & XFS_BLI_LOGGED) || (bip->bli_flags & XFS_BLI_STALE)); xfs_buf_item_trace("PIN", bip); - xfs_buftrace("XFS_PIN", bp); xfs_bpin(bp); } @@ -384,7 +384,6 @@ xfs_buf_item_unpin( ASSERT(XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *) == bip); ASSERT(atomic_read(&bip->bli_refcount) > 0); xfs_buf_item_trace("UNPIN", bip); - xfs_buftrace("XFS_UNPIN", bp); freed = atomic_dec_and_test(&bip->bli_refcount); ailp = bip->bli_item.li_ailp; @@ -396,7 +395,7 @@ xfs_buf_item_unpin( ASSERT(XFS_BUF_ISSTALE(bp)); ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); xfs_buf_item_trace("UNPIN STALE", bip); - xfs_buftrace("XFS_UNPIN STALE", bp); + xfs_buftrace(bp, "item_unpin_stale"); /* * If we get called here because of an IO error, we may * or may not have the item on the AIL. xfs_trans_ail_delete() @@ -441,7 +440,7 @@ xfs_buf_item_unpin_remove( (bip->bli_flags & XFS_BLI_STALE)) { ASSERT(XFS_BUF_VALUSEMA(bip->bli_buf) <= 0); xfs_buf_item_trace("UNPIN REMOVE", bip); - xfs_buftrace("XFS_UNPIN_REMOVE", bp); + xfs_buftrace(bp, "item_unpin_remove"); /* * yes -- clear the xaction descriptor in-use flag * and free the chunk if required. We can safely @@ -524,7 +523,7 @@ xfs_buf_item_unlock( uint hold; bp = bip->bli_buf; - xfs_buftrace("XFS_UNLOCK", bp); + xfs_buftrace(bp, "item_unlock"); /* * Clear the buffer's association with this transaction. @@ -738,9 +737,6 @@ xfs_buf_item_init( bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp); bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); bip->bli_format.blf_map_size = map_size; -#ifdef XFS_BLI_TRACE - bip->bli_trace = ktrace_alloc(XFS_BLI_TRACE_SIZE, KM_NOFS); -#endif #ifdef XFS_TRANS_DEBUG /* @@ -878,9 +874,6 @@ xfs_buf_item_free( kmem_free(bip->bli_logged); #endif /* XFS_TRANS_DEBUG */ -#ifdef XFS_BLI_TRACE - ktrace_free(bip->bli_trace); -#endif kmem_zone_free(xfs_buf_item_zone, bip); } @@ -897,7 +890,7 @@ xfs_buf_item_relse( { xfs_buf_log_item_t *bip; - xfs_buftrace("XFS_RELSE", bp); + xfs_buftrace(bp, "item_relse"); bip = XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t*); XFS_BUF_SET_FSPRIVATE(bp, bip->bli_item.li_bio_list); if ((XFS_BUF_FSPRIVATE(bp, void *) == NULL) && @@ -994,7 +987,7 @@ xfs_buf_iodone_callbacks( if (XFS_FORCED_SHUTDOWN(mp)) { ASSERT(XFS_BUF_TARGET(bp) == mp->m_ddev_targp); XFS_BUF_SUPER_STALE(bp); - xfs_buftrace("BUF_IODONE_CB", bp); + xfs_buftrace(bp, "item_iodone"); xfs_buf_do_callbacks(bp, lip); XFS_BUF_SET_FSPRIVATE(bp, NULL); XFS_BUF_CLR_IODONE_FUNC(bp); @@ -1030,7 +1023,7 @@ xfs_buf_iodone_callbacks( XFS_BUF_SET_START(bp); } ASSERT(XFS_BUF_IODONE_FUNC(bp)); - xfs_buftrace("BUF_IODONE ASYNC", bp); + xfs_buftrace(bp, "item_iodone_async"); xfs_buf_relse(bp); } else { /* @@ -1054,7 +1047,7 @@ xfs_buf_iodone_callbacks( return; } #ifdef XFSERRORDEBUG - xfs_buftrace("XFS BUFCB NOERR", bp); + xfs_buftrace(bp, "item_iodone_noerror"); #endif xfs_buf_do_callbacks(bp, lip); XFS_BUF_SET_FSPRIVATE(bp, NULL); @@ -1081,7 +1074,7 @@ xfs_buf_error_relse( XFS_BUF_DONE(bp); XFS_BUF_UNDELAYWRITE(bp); XFS_BUF_ERROR(bp,0); - xfs_buftrace("BUF_ERROR_RELSE", bp); + xfs_buftrace(bp, "item_error_relse"); if (! XFS_FORCED_SHUTDOWN(mp)) xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); /* @@ -1128,34 +1121,3 @@ xfs_buf_iodone( xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip); xfs_buf_item_free(bip); } - -#if defined(XFS_BLI_TRACE) -void -xfs_buf_item_trace( - char *id, - xfs_buf_log_item_t *bip) -{ - xfs_buf_t *bp; - ASSERT(bip->bli_trace != NULL); - - bp = bip->bli_buf; - ktrace_enter(bip->bli_trace, - (void *)id, - (void *)bip->bli_buf, - (void *)((unsigned long)bip->bli_flags), - (void *)((unsigned long)bip->bli_recur), - (void *)((unsigned long)atomic_read(&bip->bli_refcount)), - (void *)((unsigned long) - (0xFFFFFFFF & XFS_BUF_ADDR(bp) >> 32)), - (void *)((unsigned long)(0xFFFFFFFF & XFS_BUF_ADDR(bp))), - (void *)((unsigned long)XFS_BUF_COUNT(bp)), - (void *)((unsigned long)XFS_BUF_BFLAGS(bp)), - XFS_BUF_FSPRIVATE(bp, void *), - XFS_BUF_FSPRIVATE2(bp, void *), - (void *)(unsigned long)XFS_BUF_ISPINNED(bp), - (void *)XFS_BUF_IODONE_FUNC(bp), - (void *)((unsigned long)(XFS_BUF_VALUSEMA(bp))), - (void *)bip->bli_item.li_desc, - (void *)((unsigned long)bip->bli_item.li_flags)); -} -#endif /* XFS_BLI_TRACE */ Index: xfs/fs/xfs/xfs_buf_item.h =================================================================== --- xfs.orig/fs/xfs/xfs_buf_item.h 2009-09-09 12:33:56.536253951 -0300 +++ xfs/fs/xfs/xfs_buf_item.h 2009-09-09 12:49:11.289256382 -0300 @@ -70,22 +70,21 @@ typedef struct xfs_buf_log_format_t { #define XFS_BLI_INODE_ALLOC_BUF 0x10 #define XFS_BLI_STALE_INODE 0x20 +#define XFS_BLI_FLAGS \ + { XFS_BLI_HOLD, "HOLD" }, \ + { XFS_BLI_DIRTY, "DIRTY" }, \ + { XFS_BLI_STALE, "STALE" }, \ + { XFS_BLI_LOGGED, "LOGGED" }, \ + { XFS_BLI_INODE_ALLOC_BUF, "INODE_ALLOC" }, \ + { XFS_BLI_STALE_INODE, "STALE_INODE" } + #ifdef __KERNEL__ struct xfs_buf; -struct ktrace; struct xfs_mount; struct xfs_buf_log_item; -#if defined(XFS_BLI_TRACE) -#define XFS_BLI_TRACE_SIZE 32 - -void xfs_buf_item_trace(char *, struct xfs_buf_log_item *); -#else -#define xfs_buf_item_trace(id, bip) -#endif - /* * This is the in core log item structure used to track information * needed to log buffers. It tracks how many times the lock has been @@ -97,9 +96,6 @@ typedef struct xfs_buf_log_item { unsigned int bli_flags; /* misc flags */ unsigned int bli_recur; /* lock recursion count */ atomic_t bli_refcount; /* cnt of tp refs */ -#ifdef XFS_BLI_TRACE - struct ktrace *bli_trace; /* event trace buf */ -#endif #ifdef XFS_TRANS_DEBUG char *bli_orig; /* original buffer copy */ char *bli_logged; /* bytes logged (bitmap) */ Index: xfs/fs/xfs/xfs_da_btree.c =================================================================== --- xfs.orig/fs/xfs/xfs_da_btree.c 2009-09-09 12:33:56.540253762 -0300 +++ xfs/fs/xfs/xfs_da_btree.c 2009-09-09 12:49:11.292256344 -0300 @@ -46,6 +46,7 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * xfs_da_btree.c @@ -2107,7 +2108,7 @@ xfs_da_do_buf( (be32_to_cpu(free->hdr.magic) != XFS_DIR2_FREE_MAGIC), mp, XFS_ERRTAG_DA_READ_BUF, XFS_RANDOM_DA_READ_BUF))) { - xfs_buftrace("DA READ ERROR", rbp->bps[0]); + xfs_buftrace(rbp->bps[0], "da_read_error"); XFS_CORRUPTION_ERROR("xfs_da_do_buf(2)", XFS_ERRLEVEL_LOW, mp, info); error = XFS_ERROR(EFSCORRUPTED); Index: xfs/fs/xfs/xfs_da_btree.h =================================================================== --- xfs.orig/fs/xfs/xfs_da_btree.h 2009-09-09 12:33:56.545254119 -0300 +++ xfs/fs/xfs/xfs_da_btree.h 2009-09-09 12:49:11.295259171 -0300 @@ -125,6 +125,13 @@ typedef struct xfs_da_args { #define XFS_DA_OP_OKNOENT 0x0008 /* lookup/add op, ENOENT ok, else die */ #define XFS_DA_OP_CILOOKUP 0x0010 /* lookup to return CI name if found */ +#define XFS_DA_OP_FLAGS \ + { XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \ + { XFS_DA_OP_RENAME, "RENAME" }, \ + { XFS_DA_OP_ADDNAME, "ADDNAME" }, \ + { XFS_DA_OP_OKNOENT, "OKNOENT" }, \ + { XFS_DA_OP_CILOOKUP, "CILOOKUP" } + /* * Structure to describe buffer(s) for a block. * This is needed in the directory version 2 format case, when Index: xfs/fs/xfs/xfs_dfrag.c =================================================================== --- xfs.orig/fs/xfs/xfs_dfrag.c 2009-09-09 12:33:56.549254209 -0300 +++ xfs/fs/xfs/xfs_dfrag.c 2009-09-09 12:49:11.299255979 -0300 @@ -43,6 +43,7 @@ #include "xfs_error.h" #include "xfs_rw.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" /* * Syssgi interface for swapext @@ -168,7 +169,6 @@ xfs_swap_extents( } if (VN_CACHED(VFS_I(tip)) != 0) { - xfs_inval_cached_trace(tip, 0, -1, 0, -1); error = xfs_flushinval_pages(tip, 0, -1, FI_REMAPF_LOCKED); if (error) Index: xfs/fs/xfs/xfs_dir2.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2.c 2009-09-09 12:33:56.554254358 -0300 +++ xfs/fs/xfs/xfs_dir2.c 2009-09-09 12:49:11.301256095 -0300 @@ -40,9 +40,9 @@ #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" -#include "xfs_dir2_trace.h" #include "xfs_error.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" struct xfs_name xfs_name_dotdot = {"..", 2}; @@ -525,7 +525,8 @@ xfs_dir2_grow_inode( xfs_trans_t *tp; xfs_drfsbno_t nblks; - xfs_dir2_trace_args_s("grow_inode", args, space); + trace_xfs_dir2_grow_inode(args, space); + dp = args->dp; tp = args->trans; mp = dp->i_mount; @@ -703,7 +704,8 @@ xfs_dir2_shrink_inode( xfs_mount_t *mp; xfs_trans_t *tp; - xfs_dir2_trace_args_db("shrink_inode", args, db, bp); + trace_xfs_dir2_shrink_inode(args, db); + dp = args->dp; mp = dp->i_mount; tp = args->trans; Index: xfs/fs/xfs/xfs_dir2_block.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_block.c 2009-09-09 12:33:56.559253457 -0300 +++ xfs/fs/xfs/xfs_dir2_block.c 2009-09-09 12:49:11.305256255 -0300 @@ -36,8 +36,8 @@ #include "xfs_dir2_data.h" #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" -#include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * Local function prototypes. @@ -94,7 +94,8 @@ xfs_dir2_block_addname( __be16 *tagp; /* pointer to tag value */ xfs_trans_t *tp; /* transaction structure */ - xfs_dir2_trace_args("block_addname", args); + trace_xfs_dir2_block_addname(args); + dp = args->dp; tp = args->trans; mp = dp->i_mount; @@ -590,7 +591,8 @@ xfs_dir2_block_lookup( int error; /* error return value */ xfs_mount_t *mp; /* filesystem mount point */ - xfs_dir2_trace_args("block_lookup", args); + trace_xfs_dir2_block_lookup(args); + /* * Get the buffer, look up the entry. * If not found (ENOENT) then return, have no buffer. @@ -747,7 +749,8 @@ xfs_dir2_block_removename( int size; /* shortform size */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args("block_removename", args); + trace_xfs_dir2_block_removename(args); + /* * Look up the entry in the block. Gets the buffer and entry index. * It will always be there, the vnodeops level does a lookup first. @@ -823,7 +826,8 @@ xfs_dir2_block_replace( int error; /* error return value */ xfs_mount_t *mp; /* filesystem mount point */ - xfs_dir2_trace_args("block_replace", args); + trace_xfs_dir2_block_replace(args); + /* * Lookup the entry in the directory. Get buffer and entry index. * This will always succeed since the caller has already done a lookup. @@ -897,7 +901,8 @@ xfs_dir2_leaf_to_block( int to; /* block/leaf to index */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_bb("leaf_to_block", args, lbp, dbp); + trace_xfs_dir2_leaf_to_block(args); + dp = args->dp; tp = args->trans; mp = dp->i_mount; @@ -1044,7 +1049,8 @@ xfs_dir2_sf_to_block( xfs_trans_t *tp; /* transaction pointer */ struct xfs_name name; - xfs_dir2_trace_args("sf_to_block", args); + trace_xfs_dir2_sf_to_block(args); + dp = args->dp; tp = args->trans; mp = dp->i_mount; Index: xfs/fs/xfs/xfs_dir2_leaf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_leaf.c 2009-09-09 12:33:56.563254456 -0300 +++ xfs/fs/xfs/xfs_dir2_leaf.c 2009-09-09 12:49:11.309266682 -0300 @@ -38,8 +38,8 @@ #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" -#include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * Local function declarations. @@ -80,7 +80,8 @@ xfs_dir2_block_to_leaf( int needscan; /* need to rescan bestfree */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_b("block_to_leaf", args, dbp); + trace_xfs_dir2_block_to_leaf(args); + dp = args->dp; mp = dp->i_mount; tp = args->trans; @@ -188,7 +189,8 @@ xfs_dir2_leaf_addname( xfs_trans_t *tp; /* transaction pointer */ xfs_dir2_db_t use_block; /* data block number */ - xfs_dir2_trace_args("leaf_addname", args); + trace_xfs_dir2_leaf_addname(args); + dp = args->dp; tp = args->trans; mp = dp->i_mount; @@ -1264,7 +1266,8 @@ xfs_dir2_leaf_lookup( xfs_dir2_leaf_entry_t *lep; /* leaf entry */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args("leaf_lookup", args); + trace_xfs_dir2_leaf_lookup(args); + /* * Look up name in the leaf block, returning both buffers and index. */ @@ -1452,7 +1455,8 @@ xfs_dir2_leaf_removename( xfs_dir2_data_off_t oldbest; /* old value of best free */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args("leaf_removename", args); + trace_xfs_dir2_leaf_removename(args); + /* * Lookup the leaf entry, get the leaf and data blocks read in. */ @@ -1584,7 +1588,8 @@ xfs_dir2_leaf_replace( xfs_dir2_leaf_entry_t *lep; /* leaf entry */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args("leaf_replace", args); + trace_xfs_dir2_leaf_replace(args); + /* * Look up the entry. */ @@ -1764,7 +1769,9 @@ xfs_dir2_node_to_leaf( if (state->path.active > 1) return 0; args = state->args; - xfs_dir2_trace_args("node_to_leaf", args); + + trace_xfs_dir2_node_to_leaf(args); + mp = state->mp; dp = args->dp; tp = args->trans; Index: xfs/fs/xfs/xfs_dir2_node.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_node.c 2009-09-09 12:33:56.568252927 -0300 +++ xfs/fs/xfs/xfs_dir2_node.c 2009-09-09 12:49:11.312322867 -0300 @@ -37,8 +37,8 @@ #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" -#include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * Function declarations. @@ -123,7 +123,8 @@ xfs_dir2_leaf_to_node( __be16 *to; /* pointer to freespace entry */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_b("leaf_to_node", args, lbp); + trace_xfs_dir2_leaf_to_node(args); + dp = args->dp; mp = dp->i_mount; tp = args->trans; @@ -196,7 +197,8 @@ xfs_dir2_leafn_add( xfs_mount_t *mp; /* filesystem mount point */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_sb("leafn_add", args, index, bp); + trace_xfs_dir2_leafn_add(args, index); + dp = args->dp; mp = dp->i_mount; tp = args->trans; @@ -711,8 +713,8 @@ xfs_dir2_leafn_moveents( int stale; /* count stale leaves copied */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_bibii("leafn_moveents", args, bp_s, start_s, bp_d, - start_d, count); + trace_xfs_dir2_leafn_moveents(args, start_s, start_d, count); + /* * Silently return if nothing to do. */ @@ -933,7 +935,8 @@ xfs_dir2_leafn_remove( int needscan; /* need to rescan data frees */ xfs_trans_t *tp; /* transaction pointer */ - xfs_dir2_trace_args_sb("leafn_remove", args, index, bp); + trace_xfs_dir2_leafn_remove(args, index); + dp = args->dp; tp = args->trans; mp = dp->i_mount; @@ -1363,7 +1366,8 @@ xfs_dir2_node_addname( int rval; /* sub-return value */ xfs_da_state_t *state; /* btree cursor */ - xfs_dir2_trace_args("node_addname", args); + trace_xfs_dir2_node_addname(args); + /* * Allocate and initialize the state (btree cursor). */ @@ -1822,7 +1826,8 @@ xfs_dir2_node_lookup( int rval; /* operation return value */ xfs_da_state_t *state; /* btree cursor */ - xfs_dir2_trace_args("node_lookup", args); + trace_xfs_dir2_node_lookup(args); + /* * Allocate and initialize the btree cursor. */ @@ -1875,7 +1880,8 @@ xfs_dir2_node_removename( int rval; /* operation return value */ xfs_da_state_t *state; /* btree cursor */ - xfs_dir2_trace_args("node_removename", args); + trace_xfs_dir2_node_removename(args); + /* * Allocate and initialize the btree cursor. */ @@ -1944,7 +1950,8 @@ xfs_dir2_node_replace( int rval; /* internal return value */ xfs_da_state_t *state; /* btree cursor */ - xfs_dir2_trace_args("node_replace", args); + trace_xfs_dir2_node_replace(args); + /* * Allocate and initialize the btree cursor. */ Index: xfs/fs/xfs/xfs_dir2_sf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_sf.c 2009-09-09 12:33:56.572253716 -0300 +++ xfs/fs/xfs/xfs_dir2_sf.c 2009-09-09 12:49:11.317273917 -0300 @@ -37,7 +37,7 @@ #include "xfs_dir2_data.h" #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" -#include "xfs_dir2_trace.h" +#include "xfs_trace.h" /* * Prototypes for internal functions. @@ -169,7 +169,8 @@ xfs_dir2_block_to_sf( xfs_dir2_sf_t *sfp; /* shortform structure */ xfs_ino_t temp; - xfs_dir2_trace_args_sb("block_to_sf", args, size, bp); + trace_xfs_dir2_block_to_sf(args); + dp = args->dp; mp = dp->i_mount; @@ -281,7 +282,8 @@ xfs_dir2_sf_addname( xfs_dir2_sf_t *sfp; /* shortform structure */ xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */ - xfs_dir2_trace_args("sf_addname", args); + trace_xfs_dir2_sf_addname(args); + ASSERT(xfs_dir2_sf_lookup(args) == ENOENT); dp = args->dp; ASSERT(dp->i_df.if_flags & XFS_IFINLINE); @@ -654,7 +656,8 @@ xfs_dir2_sf_create( xfs_dir2_sf_t *sfp; /* shortform structure */ int size; /* directory size */ - xfs_dir2_trace_args_i("sf_create", args, pino); + trace_xfs_dir2_sf_create(args); + dp = args->dp; ASSERT(dp != NULL); @@ -808,7 +811,8 @@ xfs_dir2_sf_lookup( enum xfs_dacmp cmp; /* comparison result */ xfs_dir2_sf_entry_t *ci_sfep; /* case-insens. entry */ - xfs_dir2_trace_args("sf_lookup", args); + trace_xfs_dir2_sf_lookup(args); + xfs_dir2_sf_check(args); dp = args->dp; @@ -891,7 +895,8 @@ xfs_dir2_sf_removename( xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ xfs_dir2_sf_t *sfp; /* shortform structure */ - xfs_dir2_trace_args("sf_removename", args); + trace_xfs_dir2_sf_removename(args); + dp = args->dp; ASSERT(dp->i_df.if_flags & XFS_IFINLINE); @@ -982,7 +987,8 @@ xfs_dir2_sf_replace( xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ xfs_dir2_sf_t *sfp; /* shortform structure */ - xfs_dir2_trace_args("sf_replace", args); + trace_xfs_dir2_sf_replace(args); + dp = args->dp; ASSERT(dp->i_df.if_flags & XFS_IFINLINE); @@ -1125,7 +1131,8 @@ xfs_dir2_sf_toino4( xfs_dir2_sf_entry_t *sfep; /* new sf entry */ xfs_dir2_sf_t *sfp; /* new sf directory */ - xfs_dir2_trace_args("sf_toino4", args); + trace_xfs_dir2_sf_toino4(args); + dp = args->dp; /* @@ -1202,7 +1209,8 @@ xfs_dir2_sf_toino8( xfs_dir2_sf_entry_t *sfep; /* new sf entry */ xfs_dir2_sf_t *sfp; /* new sf directory */ - xfs_dir2_trace_args("sf_toino8", args); + trace_xfs_dir2_sf_toino8(args); + dp = args->dp; /* Index: xfs/fs/xfs/xfs_dir2_trace.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_trace.c 2009-09-09 12:33:56.576255343 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include "xfs.h" -#include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_inum.h" -#include "xfs_dir2.h" -#include "xfs_da_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_dir2_sf.h" -#include "xfs_attr_sf.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" -#include "xfs_dir2_trace.h" - -#ifdef XFS_DIR2_TRACE -ktrace_t *xfs_dir2_trace_buf; - -/* - * Enter something in the trace buffers. - */ -static void -xfs_dir2_trace_enter( - xfs_inode_t *dp, - int type, - char *where, - char *name, - int namelen, - void *a0, - void *a1, - void *a2, - void *a3, - void *a4, - void *a5, - void *a6, - void *a7) -{ - void *n[5]; - - ASSERT(xfs_dir2_trace_buf); - ASSERT(dp->i_dir_trace); - if (name) - memcpy(n, name, min((int)sizeof(n), namelen)); - else - memset((char *)n, 0, sizeof(n)); - ktrace_enter(xfs_dir2_trace_buf, - (void *)(long)type, (void *)where, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)(long)namelen, - (void *)n[0], (void *)n[1], (void *)n[2], - (void *)n[3], (void *)n[4]); - ktrace_enter(dp->i_dir_trace, - (void *)(long)type, (void *)where, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)(long)namelen, - (void *)n[0], (void *)n[1], (void *)n[2], - (void *)n[3], (void *)n[4]); -} - -void -xfs_dir2_trace_args( - char *where, - xfs_da_args_t *args) -{ - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - NULL, NULL); -} - -void -xfs_dir2_trace_args_b( - char *where, - xfs_da_args_t *args, - xfs_dabuf_t *bp) -{ - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_B, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)(bp ? bp->bps[0] : NULL), NULL); -} - -void -xfs_dir2_trace_args_bb( - char *where, - xfs_da_args_t *args, - xfs_dabuf_t *lbp, - xfs_dabuf_t *dbp) -{ - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BB, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)(lbp ? lbp->bps[0] : NULL), - (void *)(dbp ? dbp->bps[0] : NULL)); -} - -void -xfs_dir2_trace_args_bibii( - char *where, - xfs_da_args_t *args, - xfs_dabuf_t *bs, - int ss, - xfs_dabuf_t *bd, - int sd, - int c) -{ - xfs_buf_t *bpbs = bs ? bs->bps[0] : NULL; - xfs_buf_t *bpbd = bd ? bd->bps[0] : NULL; - - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BIBII, where, - (char *)args->name, (int)args->namelen, - (void *)args->dp, (void *)args->trans, - (void *)bpbs, (void *)(long)ss, (void *)bpbd, (void *)(long)sd, - (void *)(long)c, NULL); -} - -void -xfs_dir2_trace_args_db( - char *where, - xfs_da_args_t *args, - xfs_dir2_db_t db, - xfs_dabuf_t *bp) -{ - xfs_buf_t *dbp = bp ? bp->bps[0] : NULL; - - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_DB, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)(long)db, (void *)dbp); -} - -void -xfs_dir2_trace_args_i( - char *where, - xfs_da_args_t *args, - xfs_ino_t i) -{ - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_I, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)((unsigned long)(i >> 32)), - (void *)((unsigned long)(i & 0xFFFFFFFF))); -} - -void -xfs_dir2_trace_args_s( - char *where, - xfs_da_args_t *args, - int s) -{ - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_S, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)(long)s, NULL); -} - -void -xfs_dir2_trace_args_sb( - char *where, - xfs_da_args_t *args, - int s, - xfs_dabuf_t *bp) -{ - xfs_buf_t *dbp = bp ? bp->bps[0] : NULL; - - xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_SB, where, - (char *)args->name, (int)args->namelen, - (void *)(unsigned long)args->hashval, - (void *)((unsigned long)(args->inumber >> 32)), - (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)), - (void *)args->dp, (void *)args->trans, - (void *)(unsigned long)(args->op_flags & XFS_DA_OP_JUSTCHECK), - (void *)(long)s, (void *)dbp); -} -#endif /* XFS_DIR2_TRACE */ Index: xfs/fs/xfs/xfs_dir2_trace.h =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_trace.h 2009-09-09 12:33:56.581253955 -0300 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2000,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __XFS_DIR2_TRACE_H__ -#define __XFS_DIR2_TRACE_H__ - -/* - * Tracing for xfs v2 directories. - */ - -#if defined(XFS_DIR2_TRACE) - -struct ktrace; -struct xfs_dabuf; -struct xfs_da_args; - -#define XFS_DIR2_GTRACE_SIZE 4096 /* global buffer */ -#define XFS_DIR2_KTRACE_SIZE 32 /* per-inode buffer */ -extern struct ktrace *xfs_dir2_trace_buf; - -#define XFS_DIR2_KTRACE_ARGS 1 /* args only */ -#define XFS_DIR2_KTRACE_ARGS_B 2 /* args + buffer */ -#define XFS_DIR2_KTRACE_ARGS_BB 3 /* args + 2 buffers */ -#define XFS_DIR2_KTRACE_ARGS_DB 4 /* args, db, buffer */ -#define XFS_DIR2_KTRACE_ARGS_I 5 /* args, inum */ -#define XFS_DIR2_KTRACE_ARGS_S 6 /* args, int */ -#define XFS_DIR2_KTRACE_ARGS_SB 7 /* args, int, buffer */ -#define XFS_DIR2_KTRACE_ARGS_BIBII 8 /* args, buf/int/buf/int/int */ - -void xfs_dir2_trace_args(char *where, struct xfs_da_args *args); -void xfs_dir2_trace_args_b(char *where, struct xfs_da_args *args, - struct xfs_dabuf *bp); -void xfs_dir2_trace_args_bb(char *where, struct xfs_da_args *args, - struct xfs_dabuf *lbp, struct xfs_dabuf *dbp); -void xfs_dir2_trace_args_bibii(char *where, struct xfs_da_args *args, - struct xfs_dabuf *bs, int ss, - struct xfs_dabuf *bd, int sd, int c); -void xfs_dir2_trace_args_db(char *where, struct xfs_da_args *args, - xfs_dir2_db_t db, struct xfs_dabuf *bp); -void xfs_dir2_trace_args_i(char *where, struct xfs_da_args *args, xfs_ino_t i); -void xfs_dir2_trace_args_s(char *where, struct xfs_da_args *args, int s); -void xfs_dir2_trace_args_sb(char *where, struct xfs_da_args *args, int s, - struct xfs_dabuf *bp); - -#else /* XFS_DIR2_TRACE */ - -#define xfs_dir2_trace_args(where, args) -#define xfs_dir2_trace_args_b(where, args, bp) -#define xfs_dir2_trace_args_bb(where, args, lbp, dbp) -#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) -#define xfs_dir2_trace_args_db(where, args, db, bp) -#define xfs_dir2_trace_args_i(where, args, i) -#define xfs_dir2_trace_args_s(where, args, s) -#define xfs_dir2_trace_args_sb(where, args, s, bp) - -#endif /* XFS_DIR2_TRACE */ - -#endif /* __XFS_DIR2_TRACE_H__ */ Index: xfs/fs/xfs/xfs_error.c =================================================================== --- xfs.orig/fs/xfs/xfs_error.c 2009-09-09 12:33:56.585252928 -0300 +++ xfs/fs/xfs/xfs_error.c 2009-09-09 12:49:11.322256465 -0300 @@ -217,3 +217,19 @@ xfs_corruption_error( xfs_hex_dump(p, 16); xfs_error_report(tag, level, mp, fname, linenum, ra); } + +/* + * Format fsblock number into a static buffer & return it. + */ +char *xfs_fmtfsblock(xfs_fsblock_t bno) +{ + static char rval[50]; + + if (bno == NULLFSBLOCK) + sprintf(rval, "NULLFSBLOCK"); + else if (isnullstartblock(bno)) + sprintf(rval, "NULLSTARTBLOCK(%lld)", startblockval(bno)); + else + sprintf(rval, "%lld", (xfs_dfsbno_t)bno); + return rval; +} Index: xfs/fs/xfs/xfs_filestream.c =================================================================== --- xfs.orig/fs/xfs/xfs_filestream.c 2009-09-09 12:33:56.590253355 -0300 +++ xfs/fs/xfs/xfs_filestream.c 2009-09-09 12:49:11.324256161 -0300 @@ -34,6 +34,7 @@ #include "xfs_utils.h" #include "xfs_mru_cache.h" #include "xfs_filestream.h" +#include "xfs_trace.h" #ifdef XFS_FILESTREAMS_TRACE @@ -394,9 +395,7 @@ xfs_filestream_init(void) item_zone = kmem_zone_init(sizeof(fstrm_item_t), "fstrm_item"); if (!item_zone) return -ENOMEM; -#ifdef XFS_FILESTREAMS_TRACE - xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_NOFS); -#endif + return 0; } @@ -407,9 +406,6 @@ xfs_filestream_init(void) void xfs_filestream_uninit(void) { -#ifdef XFS_FILESTREAMS_TRACE - ktrace_free(xfs_filestreams_trace_buf); -#endif kmem_zone_destroy(item_zone); } Index: xfs/fs/xfs/xfs_fsops.c =================================================================== --- xfs.orig/fs/xfs/xfs_fsops.c 2009-09-09 12:33:56.594254004 -0300 +++ xfs/fs/xfs/xfs_fsops.c 2009-09-09 12:49:11.325256568 -0300 @@ -45,6 +45,7 @@ #include "xfs_rtalloc.h" #include "xfs_rw.h" #include "xfs_filestream.h" +#include "xfs_trace.h" /* * File system operations @@ -344,6 +345,8 @@ xfs_growfs_data_private( be32_add_cpu(&agf->agf_length, new); ASSERT(be32_to_cpu(agf->agf_length) == be32_to_cpu(agi->agi_length)); + + xfs_trace_agf(mp, agf, XFS_AGF_LENGTH); xfs_alloc_log_agf(tp, bp, XFS_AGF_LENGTH); /* * Free the new space. Index: xfs/fs/xfs/xfs_iget.c =================================================================== --- xfs.orig/fs/xfs/xfs_iget.c 2009-09-09 12:33:56.600254349 -0300 +++ xfs/fs/xfs/xfs_iget.c 2009-09-09 12:49:11.330256995 -0300 @@ -43,7 +43,7 @@ #include "xfs_inode_item.h" #include "xfs_bmap.h" #include "xfs_btree_trace.h" -#include "xfs_dir2_trace.h" +#include "xfs_trace.h" /* @@ -87,28 +87,6 @@ xfs_inode_alloc( ip->i_size = 0; ip->i_new_size = 0; - /* - * Initialize inode's trace buffers. - */ -#ifdef XFS_INODE_TRACE - ip->i_trace = ktrace_alloc(INODE_TRACE_SIZE, KM_NOFS); -#endif -#ifdef XFS_BMAP_TRACE - ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_NOFS); -#endif -#ifdef XFS_BTREE_TRACE - ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_NOFS); -#endif -#ifdef XFS_RW_TRACE - ip->i_rwtrace = ktrace_alloc(XFS_RW_KTRACE_SIZE, KM_NOFS); -#endif -#ifdef XFS_ILOCK_TRACE - ip->i_lock_trace = ktrace_alloc(XFS_ILOCK_KTRACE_SIZE, KM_NOFS); -#endif -#ifdef XFS_DIR2_TRACE - ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS); -#endif - /* prevent anyone from using this yet */ VFS_I(ip)->i_state = I_NEW|I_LOCK; @@ -130,25 +108,6 @@ xfs_inode_free( if (ip->i_afp) xfs_idestroy_fork(ip, XFS_ATTR_FORK); -#ifdef XFS_INODE_TRACE - ktrace_free(ip->i_trace); -#endif -#ifdef XFS_BMAP_TRACE - ktrace_free(ip->i_xtrace); -#endif -#ifdef XFS_BTREE_TRACE - ktrace_free(ip->i_btrace); -#endif -#ifdef XFS_RW_TRACE - ktrace_free(ip->i_rwtrace); -#endif -#ifdef XFS_ILOCK_TRACE - ktrace_free(ip->i_lock_trace); -#endif -#ifdef XFS_DIR2_TRACE - ktrace_free(ip->i_dir_trace); -#endif - if (ip->i_itemp) { /* * Only if we are shutting down the fs will we see an @@ -207,6 +166,7 @@ xfs_iget_cache_hit( * instead of polling for it. */ if (ip->i_flags & (XFS_INEW|XFS_IRECLAIM)) { + trace_xfs_iget_skip(ip); XFS_STATS_INC(xs_ig_frecycle); error = EAGAIN; goto out_error; @@ -225,7 +185,7 @@ xfs_iget_cache_hit( * Need to carefully get it back into useable state. */ if (ip->i_flags & XFS_IRECLAIMABLE) { - xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); + trace_xfs_iget_reclaim(ip); /* * We need to set XFS_INEW atomically with clearing the @@ -251,6 +211,7 @@ xfs_iget_cache_hit( ip->i_flags &= ~XFS_INEW; ip->i_flags |= XFS_IRECLAIMABLE; __xfs_inode_set_reclaim_tag(pag, ip); + trace_xfs_iget_reclaim(ip); goto out_error; } inode->i_state = I_LOCK|I_NEW; @@ -270,8 +231,9 @@ xfs_iget_cache_hit( xfs_ilock(ip, lock_flags); xfs_iflags_clear(ip, XFS_ISTALE); - xfs_itrace_exit_tag(ip, "xfs_iget.found"); XFS_STATS_INC(xs_ig_found); + + trace_xfs_iget_found(ip); return 0; out_error: @@ -305,7 +267,7 @@ xfs_iget_cache_miss( if (error) goto out_destroy; - xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); + xfs_itrace_entry(ip); if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { error = ENOENT; @@ -350,6 +312,8 @@ xfs_iget_cache_miss( write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); + + trace_xfs_iget_alloc(ip); *ipp = ip; return 0; @@ -636,7 +600,7 @@ xfs_ilock( else if (lock_flags & XFS_ILOCK_SHARED) mraccess_nested(&ip->i_lock, XFS_ILOCK_DEP(lock_flags)); - xfs_ilock_trace(ip, 1, lock_flags, (inst_t *)__return_address); + trace_xfs_ilock(ip, lock_flags, _RET_IP_); } /* @@ -681,7 +645,7 @@ xfs_ilock_nowait( if (!mrtryaccess(&ip->i_lock)) goto out_undo_iolock; } - xfs_ilock_trace(ip, 2, lock_flags, (inst_t *)__return_address); + trace_xfs_ilock_nowait(ip, lock_flags, _RET_IP_); return 1; out_undo_iolock: @@ -743,7 +707,7 @@ xfs_iunlock( xfs_trans_unlocked_item(ip->i_itemp->ili_item.li_ailp, (xfs_log_item_t*)(ip->i_itemp)); } - xfs_ilock_trace(ip, 3, lock_flags, (inst_t *)__return_address); + trace_xfs_iunlock(ip, lock_flags, _RET_IP_); } /* @@ -762,6 +726,8 @@ xfs_ilock_demote( mrdemote(&ip->i_lock); if (lock_flags & XFS_IOLOCK_EXCL) mrdemote(&ip->i_iolock); + + trace_xfs_ilock_demote(ip, lock_flags, _RET_IP_); } #ifdef DEBUG @@ -792,52 +758,3 @@ xfs_isilocked( return 1; } #endif - -#ifdef XFS_INODE_TRACE - -#define KTRACE_ENTER(ip, vk, s, line, ra) \ - ktrace_enter((ip)->i_trace, \ -/* 0 */ (void *)(__psint_t)(vk), \ -/* 1 */ (void *)(s), \ -/* 2 */ (void *)(__psint_t) line, \ -/* 3 */ (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \ -/* 4 */ (void *)(ra), \ -/* 5 */ NULL, \ -/* 6 */ (void *)(__psint_t)current_cpu(), \ -/* 7 */ (void *)(__psint_t)current_pid(), \ -/* 8 */ (void *)__return_address, \ -/* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL) - -/* - * Vnode tracing code. - */ -void -_xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra) -{ - KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra); -} - -void -_xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra) -{ - KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra); -} - -void -xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra) -{ - KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra); -} - -void -_xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra) -{ - KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra); -} - -void -xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra) -{ - KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra); -} -#endif /* XFS_INODE_TRACE */ Index: xfs/fs/xfs/xfs_inode.c =================================================================== --- xfs.orig/fs/xfs/xfs_inode.c 2009-09-09 12:33:56.604254090 -0300 +++ xfs/fs/xfs/xfs_inode.c 2009-09-09 12:49:11.336255734 -0300 @@ -47,10 +47,10 @@ #include "xfs_rw.h" #include "xfs_error.h" #include "xfs_utils.h" -#include "xfs_dir2_trace.h" #include "xfs_quota.h" #include "xfs_filestream.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" kmem_zone_t *xfs_ifork_zone; kmem_zone_t *xfs_inode_zone; @@ -1291,42 +1291,6 @@ xfs_file_last_byte( return last_byte; } -#if defined(XFS_RW_TRACE) -STATIC void -xfs_itrunc_trace( - int tag, - xfs_inode_t *ip, - int flag, - xfs_fsize_t new_size, - xfs_off_t toss_start, - xfs_off_t toss_finish) -{ - if (ip->i_rwtrace == NULL) { - return; - } - - ktrace_enter(ip->i_rwtrace, - (void*)((long)tag), - (void*)ip, - (void*)(unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff), - (void*)(unsigned long)(ip->i_d.di_size & 0xffffffff), - (void*)((long)flag), - (void*)(unsigned long)((new_size >> 32) & 0xffffffff), - (void*)(unsigned long)(new_size & 0xffffffff), - (void*)(unsigned long)((toss_start >> 32) & 0xffffffff), - (void*)(unsigned long)(toss_start & 0xffffffff), - (void*)(unsigned long)((toss_finish >> 32) & 0xffffffff), - (void*)(unsigned long)(toss_finish & 0xffffffff), - (void*)(unsigned long)current_cpu(), - (void*)(unsigned long)current_pid(), - (void*)NULL, - (void*)NULL, - (void*)NULL); -} -#else -#define xfs_itrunc_trace(tag, ip, flag, new_size, toss_start, toss_finish) -#endif - /* * Start the truncation of the file to new_size. The new size * must be smaller than the current size. This routine will @@ -1409,8 +1373,7 @@ xfs_itruncate_start( return 0; } last_byte = xfs_file_last_byte(ip); - xfs_itrunc_trace(XFS_ITRUNC_START, ip, flags, new_size, toss_start, - last_byte); + trace_xfs_itruncate_start(ip, flags, new_size, toss_start, last_byte); if (last_byte > toss_start) { if (flags & XFS_ITRUNC_DEFINITE) { xfs_tosspages(ip, toss_start, @@ -1514,7 +1477,8 @@ xfs_itruncate_finish( new_size = 0LL; } first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size); - xfs_itrunc_trace(XFS_ITRUNC_FINISH1, ip, 0, new_size, 0, 0); + trace_xfs_itruncate_finish_start(ip, new_size); + /* * The first thing we do is set the size to new_size permanently * on disk. This way we don't have to worry about anyone ever @@ -1731,7 +1695,7 @@ xfs_itruncate_finish( ASSERT((new_size != 0) || (fork == XFS_ATTR_FORK) || (ip->i_d.di_nextents == 0)); - xfs_itrunc_trace(XFS_ITRUNC_FINISH2, ip, 0, new_size, 0, 0); + trace_xfs_itruncate_finish_end(ip, new_size); return 0; } @@ -3252,23 +3216,6 @@ corrupt_out: return XFS_ERROR(EFSCORRUPTED); } - - -#ifdef XFS_ILOCK_TRACE -void -xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags, inst_t *ra) -{ - ktrace_enter(ip->i_lock_trace, - (void *)ip, - (void *)(unsigned long)lock, /* 1 = LOCK, 3=UNLOCK, etc */ - (void *)(unsigned long)lockflags, /* XFS_ILOCK_EXCL etc */ - (void *)ra, /* caller of ilock */ - (void *)(unsigned long)current_cpu(), - (void *)(unsigned long)current_pid(), - NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -} -#endif - /* * Return a pointer to the extent record at file index idx. */ Index: xfs/fs/xfs/xfs_inode.h =================================================================== --- xfs.orig/fs/xfs/xfs_inode.h 2009-09-09 12:33:56.609253750 -0300 +++ xfs/fs/xfs/xfs_inode.h 2009-09-09 12:49:11.339256047 -0300 @@ -213,7 +213,6 @@ typedef struct xfs_icdinode { struct bhv_desc; struct cred; -struct ktrace; struct xfs_buf; struct xfs_bmap_free; struct xfs_bmbt_irec; @@ -222,13 +221,6 @@ struct xfs_mount; struct xfs_trans; struct xfs_dquot; -#if defined(XFS_ILOCK_TRACE) -#define XFS_ILOCK_KTRACE_SIZE 32 -extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); -#else -#define xfs_ilock_trace(i,n,f,ra) -#endif - typedef struct dm_attrs_s { __uint32_t da_dmevmask; /* DMIG event mask */ __uint16_t da_dmstate; /* DMIG state info */ @@ -271,26 +263,6 @@ typedef struct xfs_inode { /* VFS inode */ struct inode i_vnode; /* embedded VFS inode */ - - /* Trace buffers per inode. */ -#ifdef XFS_INODE_TRACE - struct ktrace *i_trace; /* general inode trace */ -#endif -#ifdef XFS_BMAP_TRACE - struct ktrace *i_xtrace; /* inode extent list trace */ -#endif -#ifdef XFS_BTREE_TRACE - struct ktrace *i_btrace; /* inode bmap btree trace */ -#endif -#ifdef XFS_RW_TRACE - struct ktrace *i_rwtrace; /* inode read/write trace */ -#endif -#ifdef XFS_ILOCK_TRACE - struct ktrace *i_lock_trace; /* inode lock/unlock trace */ -#endif -#ifdef XFS_DIR2_TRACE - struct ktrace *i_dir_trace; /* inode directory trace */ -#endif } xfs_inode_t; #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ @@ -406,6 +378,14 @@ static inline void xfs_ifunlock(xfs_inod #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) +#define XFS_LOCK_FLAGS \ + { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \ + { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \ + { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \ + { XFS_ILOCK_SHARED, "ILOCK_SHARED" }, \ + { XFS_IUNLOCK_NONOTIFY, "IUNLOCK_NONOTIFY" } + + /* * Flags for lockdep annotations. * @@ -455,6 +435,10 @@ static inline void xfs_ifunlock(xfs_inod #define XFS_ITRUNC_DEFINITE 0x1 #define XFS_ITRUNC_MAYBE 0x2 +#define XFS_ITRUNC_FLAGS \ + { XFS_ITRUNC_DEFINITE, "DEFINITE" }, \ + { XFS_ITRUNC_MAYBE, "MAYBE" } + /* * For multiple groups support: if S_ISGID bit is set in the parent * directory, group of new file is set to that of the parent, and @@ -507,48 +491,16 @@ void xfs_lock_two_inodes(xfs_inode_t *, void xfs_synchronize_atime(xfs_inode_t *); void xfs_mark_inode_dirty_sync(xfs_inode_t *); -#if defined(XFS_INODE_TRACE) - -#define INODE_TRACE_SIZE 16 /* number of trace entries */ -#define INODE_KTRACE_ENTRY 1 -#define INODE_KTRACE_EXIT 2 -#define INODE_KTRACE_HOLD 3 -#define INODE_KTRACE_REF 4 -#define INODE_KTRACE_RELE 5 - -extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *); -extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *); -extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *); -extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *); -extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *); -#define xfs_itrace_entry(ip) \ - _xfs_itrace_entry(ip, __func__, (inst_t *)__return_address) -#define xfs_itrace_exit(ip) \ - _xfs_itrace_exit(ip, __func__, (inst_t *)__return_address) -#define xfs_itrace_exit_tag(ip, tag) \ - _xfs_itrace_exit(ip, tag, (inst_t *)__return_address) -#define xfs_itrace_ref(ip) \ - _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address) - -#else -#define xfs_itrace_entry(a) -#define xfs_itrace_exit(a) -#define xfs_itrace_exit_tag(a, b) -#define xfs_itrace_hold(a, b, c, d) -#define xfs_itrace_ref(a) -#define xfs_itrace_rele(a, b, c, d) -#endif - #define IHOLD(ip) \ do { \ ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ atomic_inc(&(VFS_I(ip)->i_count)); \ - xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ + trace_xfs_ihold(ip, _THIS_IP_); \ } while (0) #define IRELE(ip) \ do { \ - xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ + trace_xfs_irele(ip, _THIS_IP_); \ iput(VFS_I(ip)); \ } while (0) Index: xfs/fs/xfs/xfs_inode_item.c =================================================================== --- xfs.orig/fs/xfs/xfs_inode_item.c 2009-09-09 12:33:56.613255866 -0300 +++ xfs/fs/xfs/xfs_inode_item.c 2009-09-09 12:49:11.343256067 -0300 @@ -41,6 +41,7 @@ #include "xfs_ialloc.h" #include "xfs_rw.h" #include "xfs_error.h" +#include "xfs_trace.h" kmem_zone_t *xfs_ili_zone; /* inode log item zone */ @@ -796,7 +797,7 @@ xfs_inode_item_pushbuf( !completion_done(&ip->i_flush)); iip->ili_pushbuf_flag = 0; xfs_iunlock(ip, XFS_ILOCK_SHARED); - xfs_buftrace("INODE ITEM PUSH", bp); + xfs_buftrace(bp, "inode_item_push"); if (XFS_BUF_ISPINNED(bp)) { xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); Index: xfs/fs/xfs/xfs_iomap.c =================================================================== --- xfs.orig/fs/xfs/xfs_iomap.c 2009-09-09 12:33:56.618254616 -0300 +++ xfs/fs/xfs/xfs_iomap.c 2009-09-09 12:49:11.345320367 -0300 @@ -47,72 +47,8 @@ #include "xfs_trans_space.h" #include "xfs_utils.h" #include "xfs_iomap.h" +#include "xfs_trace.h" -#if defined(XFS_RW_TRACE) -void -xfs_iomap_enter_trace( - int tag, - xfs_inode_t *ip, - xfs_off_t offset, - ssize_t count) -{ - if (!ip->i_rwtrace) - return; - - ktrace_enter(ip->i_rwtrace, - (void *)((unsigned long)tag), - (void *)ip, - (void *)((unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_d.di_size & 0xffffffff)), - (void *)((unsigned long)((offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(offset & 0xffffffff)), - (void *)((unsigned long)count), - (void *)((unsigned long)((ip->i_new_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_new_size & 0xffffffff)), - (void *)((unsigned long)current_pid()), - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL, - (void *)NULL); -} - -void -xfs_iomap_map_trace( - int tag, - xfs_inode_t *ip, - xfs_off_t offset, - ssize_t count, - xfs_iomap_t *iomapp, - xfs_bmbt_irec_t *imapp, - int flags) -{ - if (!ip->i_rwtrace) - return; - - ktrace_enter(ip->i_rwtrace, - (void *)((unsigned long)tag), - (void *)ip, - (void *)((unsigned long)((ip->i_d.di_size >> 32) & 0xffffffff)), - (void *)((unsigned long)(ip->i_d.di_size & 0xffffffff)), - (void *)((unsigned long)((offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(offset & 0xffffffff)), - (void *)((unsigned long)count), - (void *)((unsigned long)flags), - (void *)((unsigned long)((iomapp->iomap_offset >> 32) & 0xffffffff)), - (void *)((unsigned long)(iomapp->iomap_offset & 0xffffffff)), - (void *)((unsigned long)(iomapp->iomap_delta)), - (void *)((unsigned long)(iomapp->iomap_bsize)), - (void *)((unsigned long)(iomapp->iomap_bn)), - (void *)(__psint_t)(imapp->br_startoff), - (void *)((unsigned long)(imapp->br_blockcount)), - (void *)(__psint_t)(imapp->br_startblock)); -} -#else -#define xfs_iomap_enter_trace(tag, io, offset, count) -#define xfs_iomap_map_trace(tag, io, offset, count, iomapp, imapp, flags) -#endif #define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ << mp->m_writeio_log) @@ -187,21 +123,20 @@ xfs_iomap( if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); + trace_xfs_iomap_enter(ip, offset, count, flags, NULL); + switch (flags & (BMAPI_READ | BMAPI_WRITE | BMAPI_ALLOCATE)) { case BMAPI_READ: - xfs_iomap_enter_trace(XFS_IOMAP_READ_ENTER, ip, offset, count); lockmode = xfs_ilock_map_shared(ip); bmapi_flags = XFS_BMAPI_ENTIRE; break; case BMAPI_WRITE: - xfs_iomap_enter_trace(XFS_IOMAP_WRITE_ENTER, ip, offset, count); lockmode = XFS_ILOCK_EXCL; if (flags & BMAPI_IGNSTATE) bmapi_flags |= XFS_BMAPI_IGSTATE|XFS_BMAPI_ENTIRE; xfs_ilock(ip, lockmode); break; case BMAPI_ALLOCATE: - xfs_iomap_enter_trace(XFS_IOMAP_ALLOC_ENTER, ip, offset, count); lockmode = XFS_ILOCK_SHARED; bmapi_flags = XFS_BMAPI_ENTIRE; @@ -237,8 +172,7 @@ xfs_iomap( if (nimaps && (imap.br_startblock != HOLESTARTBLOCK) && (imap.br_startblock != DELAYSTARTBLOCK)) { - xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, ip, - offset, count, iomapp, &imap, flags); + trace_xfs_iomap_found(ip, offset, count, flags, &imap); break; } @@ -250,8 +184,7 @@ xfs_iomap( &imap, &nimaps); } if (!error) { - xfs_iomap_map_trace(XFS_IOMAP_ALLOC_MAP, ip, - offset, count, iomapp, &imap, flags); + trace_xfs_iomap_alloc(ip, offset, count, flags, &imap); } iomap_flags = IOMAP_NEW; break; @@ -261,8 +194,7 @@ xfs_iomap( lockmode = 0; if (nimaps && !isnullstartblock(imap.br_startblock)) { - xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, ip, - offset, count, iomapp, &imap, flags); + trace_xfs_iomap_found(ip, offset, count, flags, &imap); break; } @@ -623,8 +555,7 @@ retry: * delalloc blocks and retry without EOF preallocation. */ if (nimaps == 0) { - xfs_iomap_enter_trace(XFS_IOMAP_WRITE_NOSPACE, - ip, offset, count); + trace_xfs_delalloc_enospc(ip, offset, count); if (flushed) return XFS_ERROR(ENOSPC); @@ -837,7 +768,7 @@ xfs_iomap_write_unwritten( int committed; int error; - xfs_iomap_enter_trace(XFS_IOMAP_UNWRITTEN, ip, offset, count); + trace_xfs_unwritten_convert(ip, offset, count); offset_fsb = XFS_B_TO_FSBT(mp, offset); count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count); Index: xfs/fs/xfs/xfs_iomap.h =================================================================== --- xfs.orig/fs/xfs/xfs_iomap.h 2009-09-09 12:33:56.623253717 -0300 +++ xfs/fs/xfs/xfs_iomap.h 2009-09-09 12:49:11.349004984 -0300 @@ -43,6 +43,14 @@ typedef enum { BMAPI_TRYLOCK = (1 << 7), /* non-blocking request */ } bmapi_flags_t; +#define BMAPI_FLAGS \ + { BMAPI_READ, "READ" }, \ + { BMAPI_WRITE, "WRITE" }, \ + { BMAPI_ALLOCATE, "ALLOCATE" }, \ + { BMAPI_IGNSTATE, "IGNSTATE" }, \ + { BMAPI_DIRECT, "DIRECT" }, \ + { BMAPI_MMAP, "MMAP" }, \ + { BMAPI_TRYLOCK, "TRYLOCK" } /* * xfs_iomap_t: File system I/O map Index: xfs/fs/xfs/xfs_log.c =================================================================== --- xfs.orig/fs/xfs/xfs_log.c 2009-09-09 12:33:56.627253877 -0300 +++ xfs/fs/xfs/xfs_log.c 2009-09-09 13:17:42.706021271 -0300 @@ -40,6 +40,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_rw.h" +#include "xfs_trace.h" kmem_zone_t *xfs_log_ticket_zone; @@ -122,85 +123,6 @@ STATIC void xlog_verify_tail_lsn(xlog_t STATIC int xlog_iclogs_empty(xlog_t *log); -#if defined(XFS_LOG_TRACE) - -#define XLOG_TRACE_LOGGRANT_SIZE 2048 -#define XLOG_TRACE_ICLOG_SIZE 256 - -void -xlog_trace_loggrant_alloc(xlog_t *log) -{ - log->l_grant_trace = ktrace_alloc(XLOG_TRACE_LOGGRANT_SIZE, KM_NOFS); -} - -void -xlog_trace_loggrant_dealloc(xlog_t *log) -{ - ktrace_free(log->l_grant_trace); -} - -void -xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) -{ - unsigned long cnts; - - /* ticket counts are 1 byte each */ - cnts = ((unsigned long)tic->t_ocnt) | ((unsigned long)tic->t_cnt) << 8; - - ktrace_enter(log->l_grant_trace, - (void *)tic, - (void *)log->l_reserve_headq, - (void *)log->l_write_headq, - (void *)((unsigned long)log->l_grant_reserve_cycle), - (void *)((unsigned long)log->l_grant_reserve_bytes), - (void *)((unsigned long)log->l_grant_write_cycle), - (void *)((unsigned long)log->l_grant_write_bytes), - (void *)((unsigned long)log->l_curr_cycle), - (void *)((unsigned long)log->l_curr_block), - (void *)((unsigned long)CYCLE_LSN(log->l_tail_lsn)), - (void *)((unsigned long)BLOCK_LSN(log->l_tail_lsn)), - (void *)string, - (void *)((unsigned long)tic->t_trans_type), - (void *)cnts, - (void *)((unsigned long)tic->t_curr_res), - (void *)((unsigned long)tic->t_unit_res)); -} - -void -xlog_trace_iclog_alloc(xlog_in_core_t *iclog) -{ - iclog->ic_trace = ktrace_alloc(XLOG_TRACE_ICLOG_SIZE, KM_NOFS); -} - -void -xlog_trace_iclog_dealloc(xlog_in_core_t *iclog) -{ - ktrace_free(iclog->ic_trace); -} - -void -xlog_trace_iclog(xlog_in_core_t *iclog, uint state) -{ - ktrace_enter(iclog->ic_trace, - (void *)((unsigned long)state), - (void *)((unsigned long)current_pid()), - (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, - (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, - (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, - (void *)NULL, (void *)NULL); -} -#else - -#define xlog_trace_loggrant_alloc(log) -#define xlog_trace_loggrant_dealloc(log) -#define xlog_trace_loggrant(log,tic,string) - -#define xlog_trace_iclog_alloc(iclog) -#define xlog_trace_iclog_dealloc(iclog) -#define xlog_trace_iclog(iclog,state) - -#endif /* XFS_LOG_TRACE */ - static void xlog_ins_ticketq(struct xlog_ticket **qp, struct xlog_ticket *tic) @@ -353,15 +275,17 @@ xfs_log_done(xfs_mount_t *mp, if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) == 0 || (flags & XFS_LOG_REL_PERM_RESERV)) { + trace_xfs_log_done_nonperm(log, ticket); + /* * Release ticket if not permanent reservation or a specific * request has been made to release a permanent reservation. */ - xlog_trace_loggrant(log, ticket, "xfs_log_done: (non-permanent)"); xlog_ungrant_log_space(log, ticket); xfs_log_ticket_put(ticket); } else { - xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)"); + trace_xfs_log_done_perm(log, ticket); + xlog_regrant_reserve_log_space(log, ticket); /* If this ticket was a permanent reservation and we aren't * trying to release it, reset the inited flags; so next time @@ -505,10 +429,13 @@ xfs_log_reserve(xfs_mount_t *mp, XFS_STATS_INC(xs_try_logspace); + if (*ticket != NULL) { ASSERT(flags & XFS_LOG_PERM_RESERV); internal_ticket = (xlog_ticket_t *)*ticket; - xlog_trace_loggrant(log, internal_ticket, "xfs_log_reserve: existing ticket (permanent trans)"); + + trace_xfs_log_reserve(log, internal_ticket); + xlog_grant_push_ail(mp, internal_ticket->t_unit_res); retval = xlog_regrant_write_log_space(log, internal_ticket); } else { @@ -519,10 +446,9 @@ xfs_log_reserve(xfs_mount_t *mp, return XFS_ERROR(ENOMEM); internal_ticket->t_trans_type = t_type; *ticket = internal_ticket; - xlog_trace_loggrant(log, internal_ticket, - (internal_ticket->t_flags & XLOG_TIC_PERM_RESERV) ? - "xfs_log_reserve: create new ticket (permanent trans)" : - "xfs_log_reserve: create new ticket"); + + trace_xfs_log_reserve(log, internal_ticket); + xlog_grant_push_ail(mp, (internal_ticket->t_unit_res * internal_ticket->t_cnt)); @@ -734,7 +660,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) spin_unlock(&log->l_icloglock); } if (tic) { - xlog_trace_loggrant(log, tic, "unmount rec"); + trace_xfs_log_umount_write(log, tic); xlog_ungrant_log_space(log, tic); xfs_log_ticket_put(tic); } @@ -1030,7 +956,7 @@ xlog_iodone(xfs_buf_t *bp) xfs_fs_cmn_err(CE_WARN, l->l_mp, "xlog_iodone: Barriers are no longer supported" " by device. Disabling barriers\n"); - xfs_buftrace("XLOG_IODONE BARRIERS OFF", bp); + xfs_buftrace(bp, "barriers_off"); } /* @@ -1085,7 +1011,7 @@ xlog_bdstrat_cb(struct xfs_buf *bp) return 0; } - xfs_buftrace("XLOG__BDSTRAT IOERROR", bp); + xfs_buftrace(bp, "xlog_ioerror"); XFS_BUF_ERROR(bp, EIO); XFS_BUF_STALE(bp); xfs_biodone(bp); @@ -1246,7 +1172,6 @@ xlog_alloc_log(xfs_mount_t *mp, spin_lock_init(&log->l_grant_lock); sv_init(&log->l_flush_wait, 0, "flush_wait"); - xlog_trace_loggrant_alloc(log); /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */ ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0); @@ -1305,8 +1230,6 @@ xlog_alloc_log(xfs_mount_t *mp, sv_init(&iclog->ic_force_wait, SV_DEFAULT, "iclog-force"); sv_init(&iclog->ic_write_wait, SV_DEFAULT, "iclog-write"); - xlog_trace_iclog_alloc(iclog); - iclogp = &iclog->ic_next; } *iclogp = log->l_iclog; /* complete ring */ @@ -1321,13 +1244,11 @@ out_free_iclog: sv_destroy(&iclog->ic_force_wait); sv_destroy(&iclog->ic_write_wait); xfs_buf_free(iclog->ic_bp); - xlog_trace_iclog_dealloc(iclog); } kmem_free(iclog); } spinlock_destroy(&log->l_icloglock); spinlock_destroy(&log->l_grant_lock); - xlog_trace_loggrant_dealloc(log); xfs_buf_free(log->l_xbuf); out_free_log: kmem_free(log); @@ -1607,7 +1528,6 @@ xlog_dealloc_log(xlog_t *log) sv_destroy(&iclog->ic_force_wait); sv_destroy(&iclog->ic_write_wait); xfs_buf_free(iclog->ic_bp); - xlog_trace_iclog_dealloc(iclog); next_iclog = iclog->ic_next; kmem_free(iclog); iclog = next_iclog; @@ -1616,7 +1536,6 @@ xlog_dealloc_log(xlog_t *log) spinlock_destroy(&log->l_grant_lock); xfs_buf_free(log->l_xbuf); - xlog_trace_loggrant_dealloc(log); log->l_mp->m_log = NULL; kmem_free(log); } /* xlog_dealloc_log */ @@ -2414,7 +2333,6 @@ restart: iclog = log->l_iclog; if (iclog->ic_state != XLOG_STATE_ACTIVE) { - xlog_trace_iclog(iclog, XLOG_TRACE_SLEEP_FLUSH); XFS_STATS_INC(xs_log_noiclogs); /* Wait for log writes to have flushed */ @@ -2520,13 +2438,15 @@ xlog_grant_log_space(xlog_t *log, /* Is there space or do we need to sleep? */ spin_lock(&log->l_grant_lock); - xlog_trace_loggrant(log, tic, "xlog_grant_log_space: enter"); + + trace_xfs_log_grant_enter(log, tic); /* something is already sleeping; insert new transaction at end */ if (log->l_reserve_headq) { xlog_ins_ticketq(&log->l_reserve_headq, tic); - xlog_trace_loggrant(log, tic, - "xlog_grant_log_space: sleep 1"); + + trace_xfs_log_grant_sleep1(log, tic); + /* * Gotta check this before going to sleep, while we're * holding the grant lock. @@ -2540,8 +2460,7 @@ xlog_grant_log_space(xlog_t *log, * If we got an error, and the filesystem is shutting down, * we'll catch it down below. So just continue... */ - xlog_trace_loggrant(log, tic, - "xlog_grant_log_space: wake 1"); + trace_xfs_log_grant_wake1(log, tic); spin_lock(&log->l_grant_lock); } if (tic->t_flags & XFS_LOG_PERM_RESERV) @@ -2558,8 +2477,9 @@ redo: if (free_bytes < need_bytes) { if ((tic->t_flags & XLOG_TIC_IN_Q) == 0) xlog_ins_ticketq(&log->l_reserve_headq, tic); - xlog_trace_loggrant(log, tic, - "xlog_grant_log_space: sleep 2"); + + trace_xfs_log_grant_sleep2(log, tic); + spin_unlock(&log->l_grant_lock); xlog_grant_push_ail(log->l_mp, need_bytes); spin_lock(&log->l_grant_lock); @@ -2571,8 +2491,8 @@ redo: if (XLOG_FORCED_SHUTDOWN(log)) goto error_return; - xlog_trace_loggrant(log, tic, - "xlog_grant_log_space: wake 2"); + trace_xfs_log_grant_wake2(log, tic); + goto redo; } else if (tic->t_flags & XLOG_TIC_IN_Q) xlog_del_ticketq(&log->l_reserve_headq, tic); @@ -2592,7 +2512,7 @@ redo: ASSERT(log->l_grant_write_bytes <= BBTOB(BLOCK_LSN(tail_lsn))); } #endif - xlog_trace_loggrant(log, tic, "xlog_grant_log_space: exit"); + trace_xfs_log_grant_exit(log, tic); xlog_verify_grant_head(log, 1); spin_unlock(&log->l_grant_lock); return 0; @@ -2600,7 +2520,9 @@ redo: error_return: if (tic->t_flags & XLOG_TIC_IN_Q) xlog_del_ticketq(&log->l_reserve_headq, tic); - xlog_trace_loggrant(log, tic, "xlog_grant_log_space: err_ret"); + + trace_xfs_log_grant_error(log, tic); + /* * If we are failing, make sure the ticket doesn't have any * current reservations. We don't want to add this back when @@ -2640,7 +2562,8 @@ xlog_regrant_write_log_space(xlog_t * #endif spin_lock(&log->l_grant_lock); - xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: enter"); + + trace_xfs_log_regrant_write_enter(log, tic); if (XLOG_FORCED_SHUTDOWN(log)) goto error_return; @@ -2669,8 +2592,8 @@ xlog_regrant_write_log_space(xlog_t * if ((tic->t_flags & XLOG_TIC_IN_Q) == 0) xlog_ins_ticketq(&log->l_write_headq, tic); - xlog_trace_loggrant(log, tic, - "xlog_regrant_write_log_space: sleep 1"); + trace_xfs_log_regrant_write_sleep1(log, tic); + spin_unlock(&log->l_grant_lock); xlog_grant_push_ail(log->l_mp, need_bytes); spin_lock(&log->l_grant_lock); @@ -2685,8 +2608,7 @@ xlog_regrant_write_log_space(xlog_t * if (XLOG_FORCED_SHUTDOWN(log)) goto error_return; - xlog_trace_loggrant(log, tic, - "xlog_regrant_write_log_space: wake 1"); + trace_xfs_log_regrant_write_wake1(log, tic); } } @@ -2704,6 +2626,8 @@ redo: spin_lock(&log->l_grant_lock); XFS_STATS_INC(xs_sleep_logspace); + trace_xfs_log_regrant_write_sleep2(log, tic); + sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); /* If we're shutting down, this tic is already off the queue */ @@ -2711,8 +2635,7 @@ redo: if (XLOG_FORCED_SHUTDOWN(log)) goto error_return; - xlog_trace_loggrant(log, tic, - "xlog_regrant_write_log_space: wake 2"); + trace_xfs_log_regrant_write_wake2(log, tic); goto redo; } else if (tic->t_flags & XLOG_TIC_IN_Q) xlog_del_ticketq(&log->l_write_headq, tic); @@ -2727,7 +2650,8 @@ redo: } #endif - xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: exit"); + trace_xfs_log_regrant_write_exit(log, tic); + xlog_verify_grant_head(log, 1); spin_unlock(&log->l_grant_lock); return 0; @@ -2736,7 +2660,9 @@ redo: error_return: if (tic->t_flags & XLOG_TIC_IN_Q) xlog_del_ticketq(&log->l_reserve_headq, tic); - xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: err_ret"); + + trace_xfs_log_regrant_write_error(log, tic); + /* * If we are failing, make sure the ticket doesn't have any * current reservations. We don't want to add this back when @@ -2760,8 +2686,8 @@ STATIC void xlog_regrant_reserve_log_space(xlog_t *log, xlog_ticket_t *ticket) { - xlog_trace_loggrant(log, ticket, - "xlog_regrant_reserve_log_space: enter"); + trace_xfs_log_regrant_reserve_enter(log, ticket); + if (ticket->t_cnt > 0) ticket->t_cnt--; @@ -2769,8 +2695,9 @@ xlog_regrant_reserve_log_space(xlog_t xlog_grant_sub_space(log, ticket->t_curr_res); ticket->t_curr_res = ticket->t_unit_res; xlog_tic_reset_res(ticket); - xlog_trace_loggrant(log, ticket, - "xlog_regrant_reserve_log_space: sub current res"); + + trace_xfs_log_regrant_reserve_sub(log, ticket); + xlog_verify_grant_head(log, 1); /* just return if we still have some of the pre-reserved space */ @@ -2780,8 +2707,9 @@ xlog_regrant_reserve_log_space(xlog_t } xlog_grant_add_space_reserve(log, ticket->t_unit_res); - xlog_trace_loggrant(log, ticket, - "xlog_regrant_reserve_log_space: exit"); + + trace_xfs_log_regrant_reserve_exit(log, ticket); + xlog_verify_grant_head(log, 0); spin_unlock(&log->l_grant_lock); ticket->t_curr_res = ticket->t_unit_res; @@ -2811,11 +2739,11 @@ xlog_ungrant_log_space(xlog_t *log, ticket->t_cnt--; spin_lock(&log->l_grant_lock); - xlog_trace_loggrant(log, ticket, "xlog_ungrant_log_space: enter"); + trace_xfs_log_ungrant_enter(log, ticket); xlog_grant_sub_space(log, ticket->t_curr_res); - xlog_trace_loggrant(log, ticket, "xlog_ungrant_log_space: sub current"); + trace_xfs_log_ungrant_sub(log, ticket); /* If this is a permanent reservation ticket, we may be able to free * up more space based on the remaining count. @@ -2825,7 +2753,8 @@ xlog_ungrant_log_space(xlog_t *log, xlog_grant_sub_space(log, ticket->t_unit_res*ticket->t_cnt); } - xlog_trace_loggrant(log, ticket, "xlog_ungrant_log_space: exit"); + trace_xfs_log_ungrant_exit(log, ticket); + xlog_verify_grant_head(log, 1); spin_unlock(&log->l_grant_lock); xfs_log_move_tail(log->l_mp, 1); Index: xfs/fs/xfs/xfs_log_priv.h =================================================================== --- xfs.orig/fs/xfs/xfs_log_priv.h 2009-09-09 12:33:56.632253746 -0300 +++ xfs/fs/xfs/xfs_log_priv.h 2009-09-09 12:56:59.390006528 -0300 @@ -19,7 +19,6 @@ #define __XFS_LOG_PRIV_H__ struct xfs_buf; -struct ktrace; struct log; struct xlog_ticket; struct xfs_buf_cancel; @@ -135,6 +134,12 @@ static inline uint xlog_get_client_id(__ #define XLOG_TIC_INITED 0x1 /* has been initialized */ #define XLOG_TIC_PERM_RESERV 0x2 /* permanent reservation */ #define XLOG_TIC_IN_Q 0x4 + +#define XLOG_TIC_FLAGS \ + { XLOG_TIC_INITED, "XLOG_TIC_INITED" }, \ + { XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" }, \ + { XLOG_TIC_IN_Q, "XLOG_TIC_IN_Q" } + #endif /* __KERNEL__ */ #define XLOG_UNMOUNT_TYPE 0x556e /* Un for Unmount */ @@ -361,9 +366,6 @@ typedef struct xlog_in_core { int ic_bwritecnt; unsigned short ic_state; char *ic_datap; /* pointer to iclog data */ -#ifdef XFS_LOG_TRACE - struct ktrace *ic_trace; -#endif /* Callback structures need their own cacheline */ spinlock_t ic_callback_lock ____cacheline_aligned_in_smp; @@ -429,10 +431,6 @@ typedef struct log { int l_grant_write_cycle; int l_grant_write_bytes; -#ifdef XFS_LOG_TRACE - struct ktrace *l_grant_trace; -#endif - /* The following field are used for debugging; need to hold icloglock */ #ifdef DEBUG char *l_iclog_bak[XLOG_MAX_ICLOGS]; @@ -456,12 +454,6 @@ extern void xlog_put_bp(struct xfs_buf extern kmem_zone_t *xfs_log_ticket_zone; -/* iclog tracing */ -#define XLOG_TRACE_GRAB_FLUSH 1 -#define XLOG_TRACE_REL_FLUSH 2 -#define XLOG_TRACE_SLEEP_FLUSH 3 -#define XLOG_TRACE_WAKE_FLUSH 4 - /* * Unmount record type is used as a pseudo transaction type for the ticket. * It's value must be outside the range of XFS_TRANS_* values. Index: xfs/fs/xfs/xfs_log_recover.c =================================================================== --- xfs.orig/fs/xfs/xfs_log_recover.c 2009-09-09 12:33:56.646253364 -0300 +++ xfs/fs/xfs/xfs_log_recover.c 2009-09-09 12:49:11.362256253 -0300 @@ -46,6 +46,7 @@ #include "xfs_quota.h" #include "xfs_rw.h" #include "xfs_utils.h" +#include "xfs_trace.h" STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *); STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t); Index: xfs/fs/xfs/xfs_mount.c =================================================================== --- xfs.orig/fs/xfs/xfs_mount.c 2009-09-09 12:33:56.650253734 -0300 +++ xfs/fs/xfs/xfs_mount.c 2009-09-09 12:49:11.368256878 -0300 @@ -44,6 +44,8 @@ #include "xfs_quota.h" #include "xfs_fsops.h" #include "xfs_utils.h" +#include "xfs_trace.h" + STATIC void xfs_unmountfs_wait(xfs_mount_t *); Index: xfs/fs/xfs/xfs_quota.h =================================================================== --- xfs.orig/fs/xfs/xfs_quota.h 2009-09-09 12:33:56.655253952 -0300 +++ xfs/fs/xfs/xfs_quota.h 2009-09-09 12:49:11.371256073 -0300 @@ -92,6 +92,14 @@ typedef struct xfs_dqblk { #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP) +#define XFS_DQ_FLAGS \ + { XFS_DQ_USER, "USER" }, \ + { XFS_DQ_PROJ, "PROJ" }, \ + { XFS_DQ_GROUP, "GROUP" }, \ + { XFS_DQ_DIRTY, "DIRTY" }, \ + { XFS_DQ_WANT, "WANT" }, \ + { XFS_DQ_INACTIVE, "INACTIVE" } + /* * In the worst case, when both user and group quotas are on, * we can have a max of three dquots changing in a single transaction. Index: xfs/fs/xfs/xfs_rename.c =================================================================== --- xfs.orig/fs/xfs/xfs_rename.c 2009-09-09 12:33:56.659253972 -0300 +++ xfs/fs/xfs/xfs_rename.c 2009-09-09 12:49:11.373257235 -0300 @@ -39,6 +39,7 @@ #include "xfs_utils.h" #include "xfs_trans_space.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" /* Index: xfs/fs/xfs/xfs_rtalloc.c =================================================================== --- xfs.orig/fs/xfs/xfs_rtalloc.c 2009-09-09 12:33:56.665253689 -0300 +++ xfs/fs/xfs/xfs_rtalloc.c 2009-09-09 12:49:11.377307402 -0300 @@ -45,6 +45,7 @@ #include "xfs_inode_item.h" #include "xfs_trans_space.h" #include "xfs_utils.h" +#include "xfs_trace.h" /* Index: xfs/fs/xfs/xfs_rw.c =================================================================== --- xfs.orig/fs/xfs/xfs_rw.c 2009-09-09 12:33:56.670252999 -0300 +++ xfs/fs/xfs/xfs_rw.c 2009-09-09 12:49:11.379255905 -0300 @@ -44,6 +44,7 @@ #include "xfs_error.h" #include "xfs_buf_item.h" #include "xfs_rw.h" +#include "xfs_trace.h" /* * This is a subroutine for xfs_write() and other writers (xfs_ioctl) @@ -171,7 +172,6 @@ xfs_bioerror( * No need to wait until the buffer is unpinned. * We aren't flushing it. */ - xfs_buftrace("XFS IOERROR", bp); XFS_BUF_ERROR(bp, EIO); /* * We're calling biodone, so delete B_DONE flag. Either way @@ -205,7 +205,6 @@ xfs_bioerror_relse( ASSERT(XFS_BUF_IODONE_FUNC(bp) != xfs_buf_iodone_callbacks); ASSERT(XFS_BUF_IODONE_FUNC(bp) != xlog_iodone); - xfs_buftrace("XFS IOERRELSE", bp); fl = XFS_BUF_BFLAGS(bp); /* * No need to wait until the buffer is unpinned. Index: xfs/fs/xfs/xfs_trans.h =================================================================== --- xfs.orig/fs/xfs/xfs_trans.h 2009-09-09 12:33:56.674253997 -0300 +++ xfs/fs/xfs/xfs_trans.h 2009-09-09 12:49:11.383255995 -0300 @@ -100,6 +100,49 @@ typedef struct xfs_trans_header { #define XFS_TRANS_TYPE_MAX 41 /* new transaction types need to be reflected in xfs_logprint(8) */ +#define XFS_TRANS_TYPES \ + { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \ + { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \ + { XFS_TRANS_INACTIVE, "INACTIVE" }, \ + { XFS_TRANS_CREATE, "CREATE" }, \ + { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \ + { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \ + { XFS_TRANS_REMOVE, "REMOVE" }, \ + { XFS_TRANS_LINK, "LINK" }, \ + { XFS_TRANS_RENAME, "RENAME" }, \ + { XFS_TRANS_MKDIR, "MKDIR" }, \ + { XFS_TRANS_RMDIR, "RMDIR" }, \ + { XFS_TRANS_SYMLINK, "SYMLINK" }, \ + { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \ + { XFS_TRANS_GROWFS, "GROWFS" }, \ + { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \ + { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \ + { XFS_TRANS_WRITEID, "WRITEID" }, \ + { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \ + { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \ + { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \ + { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \ + { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \ + { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \ + { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \ + { XFS_TRANS_QM_SBCHANGE, "QM_SBCHANGE" }, \ + { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \ + { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \ + { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \ + { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \ + { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \ + { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \ + { XFS_TRANS_SB_UNIT, "SB_UNIT" }, \ + { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \ + { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \ + { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \ + { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \ + { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \ + { XFS_TRANS_SB_COUNT, "SB_COUNT" }, \ + { XFS_TRANS_DUMMY1, "DUMMY1" }, \ + { XFS_TRANS_DUMMY2, "DUMMY2" }, \ + { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" } + /* * This structure is used to track log items associated with * a transaction. It points to the log item and keeps some @@ -782,6 +825,10 @@ typedef struct xfs_log_item { #define XFS_LI_IN_AIL 0x1 #define XFS_LI_ABORTED 0x2 +#define XFS_LI_FLAGS \ + { XFS_LI_IN_AIL, "IN_AIL" }, \ + { XFS_LI_ABORTED, "ABORTED" } + typedef struct xfs_item_ops { uint (*iop_size)(xfs_log_item_t *); void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *); Index: xfs/fs/xfs/xfs_trans_buf.c =================================================================== --- xfs.orig/fs/xfs/xfs_trans_buf.c 2009-09-09 12:33:56.679253935 -0300 +++ xfs/fs/xfs/xfs_trans_buf.c 2009-09-09 12:49:11.385256040 -0300 @@ -38,6 +38,7 @@ #include "xfs_trans_priv.h" #include "xfs_error.h" #include "xfs_rw.h" +#include "xfs_trace.h" STATIC xfs_buf_t *xfs_trans_buf_item_match(xfs_trans_t *, xfs_buftarg_t *, @@ -99,7 +100,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, if (bp != NULL) { ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) { - xfs_buftrace("TRANS GET RECUR SHUT", bp); + xfs_buftrace(bp, "trans_get_recur_shut"); XFS_BUF_SUPER_STALE(bp); } /* @@ -108,7 +109,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, * caller isn't allowed to use the data anyway. */ else if (XFS_BUF_ISSTALE(bp)) { - xfs_buftrace("TRANS GET RECUR STALE", bp); + xfs_buftrace(bp, "trans_get_recur_stale"); ASSERT(!XFS_BUF_ISDELAYWRITE(bp)); } ASSERT(XFS_BUF_FSPRIVATE2(bp, xfs_trans_t *) == tp); @@ -116,7 +117,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, ASSERT(bip != NULL); ASSERT(atomic_read(&bip->bli_refcount) > 0); bip->bli_recur++; - xfs_buftrace("TRANS GET RECUR", bp); + xfs_buftrace(bp, "trans_get_recur"); xfs_buf_item_trace("GET RECUR", bip); return (bp); } @@ -169,7 +170,7 @@ xfs_trans_get_buf(xfs_trans_t *tp, */ XFS_BUF_SET_FSPRIVATE2(bp, tp); - xfs_buftrace("TRANS GET", bp); + xfs_buftrace(bp, "trans_get"); xfs_buf_item_trace("GET", bip); return (bp); } @@ -350,7 +351,7 @@ xfs_trans_read_buf( ASSERT(XFS_BUF_FSPRIVATE(bp, void *) != NULL); ASSERT((XFS_BUF_ISERROR(bp)) == 0); if (!(XFS_BUF_ISDONE(bp))) { - xfs_buftrace("READ_BUF_INCORE !DONE", bp); + xfs_buftrace(bp, "trans_read_buf_io"); ASSERT(!XFS_BUF_ISASYNC(bp)); XFS_BUF_READ(bp); xfsbdstrat(tp->t_mountp, bp); @@ -375,7 +376,7 @@ xfs_trans_read_buf( * brelse it either. Just get out. */ if (XFS_FORCED_SHUTDOWN(mp)) { - xfs_buftrace("READ_BUF_INCORE XFSSHUTDN", bp); + xfs_buftrace(bp, "trans_read_buf_shut_incore"); *bpp = NULL; return XFS_ERROR(EIO); } @@ -405,7 +406,7 @@ xfs_trans_read_buf( } if (XFS_BUF_GETERROR(bp) != 0) { XFS_BUF_SUPER_STALE(bp); - xfs_buftrace("READ ERROR", bp); + xfs_buftrace(bp, "trans_read_buf_error"); error = XFS_BUF_GETERROR(bp); xfs_ioerror_alert("xfs_trans_read_buf", mp, @@ -464,7 +465,7 @@ xfs_trans_read_buf( */ XFS_BUF_SET_FSPRIVATE2(bp, tp); - xfs_buftrace("TRANS READ", bp); + xfs_buftrace(bp, "trans_read_buf"); xfs_buf_item_trace("READ", bip); *bpp = bp; return 0; @@ -483,7 +484,7 @@ shutdown_abort: ASSERT((XFS_BUF_BFLAGS(bp) & (XFS_B_STALE|XFS_B_DELWRI)) != (XFS_B_STALE|XFS_B_DELWRI)); - xfs_buftrace("READ_BUF XFSSHUTDN", bp); + xfs_buftrace(bp, "trans_read_buf_shut"); xfs_buf_relse(bp); *bpp = NULL; return XFS_ERROR(EIO); @@ -843,7 +844,7 @@ xfs_trans_binval( ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); ASSERT(lidp->lid_flags & XFS_LID_DIRTY); ASSERT(tp->t_flags & XFS_TRANS_DIRTY); - xfs_buftrace("XFS_BINVAL RECUR", bp); + xfs_buftrace(bp, "trans_binval_recur"); xfs_buf_item_trace("BINVAL RECUR", bip); return; } @@ -878,7 +879,7 @@ xfs_trans_binval( (bip->bli_format.blf_map_size * sizeof(uint))); lidp->lid_flags |= XFS_LID_DIRTY|XFS_LID_BUF_STALE; tp->t_flags |= XFS_TRANS_DIRTY; - xfs_buftrace("XFS_BINVAL", bp); + xfs_buftrace(bp, "trans_binval"); xfs_buf_item_trace("BINVAL", bip); } Index: xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- xfs.orig/fs/xfs/xfs_vnodeops.c 2009-09-09 12:33:56.685253443 -0300 +++ xfs/fs/xfs/xfs_vnodeops.c 2009-09-09 12:49:11.390256538 -0300 @@ -53,6 +53,7 @@ #include "xfs_log_priv.h" #include "xfs_filestream.h" #include "xfs_vnodeops.h" +#include "xfs_trace.h" int xfs_setattr( @@ -1380,7 +1381,6 @@ xfs_lookup( if (error) goto out_free_name; - xfs_itrace_ref(*ipp); return 0; out_free_name: @@ -1526,7 +1526,6 @@ xfs_create( * At this point, we've gotten a newly allocated inode. * It is locked (and joined to the transaction). */ - xfs_itrace_ref(ip); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); /* @@ -1986,9 +1985,6 @@ xfs_remove( if (!is_dir && link_zero && xfs_inode_is_filestream(ip)) xfs_filestream_deassociate(ip); - xfs_itrace_exit(ip); - xfs_itrace_exit(dp); - std_return: if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dp, DM_RIGHT_NULL, @@ -2285,7 +2281,6 @@ xfs_symlink( goto error_return; goto error1; } - xfs_itrace_ref(ip); /* * An error after we've joined dp to the transaction will result in the @@ -2874,7 +2869,6 @@ xfs_free_file_space( ioffset = offset & ~(rounding - 1); if (VN_CACHED(VFS_I(ip)) != 0) { - xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED); if (error) goto out_unlock_iolock; Index: xfs/fs/xfs/xfs_attr_leaf.c =================================================================== --- xfs.orig/fs/xfs/xfs_attr_leaf.c 2009-09-09 12:33:56.691253788 -0300 +++ xfs/fs/xfs/xfs_attr_leaf.c 2009-09-09 12:49:11.394257187 -0300 @@ -42,6 +42,7 @@ #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_error.h" +#include "xfs_trace.h" /* * xfs_attr_leaf.c @@ -594,7 +595,7 @@ xfs_attr_shortform_list(xfs_attr_list_co cursor = context->cursor; ASSERT(cursor != NULL); - xfs_attr_trace_l_c("sf start", context); + trace_xfs_attr_list_sf(context); /* * If the buffer is large enough and the cursor is at the start, @@ -627,7 +628,7 @@ xfs_attr_shortform_list(xfs_attr_list_co return error; sfe = XFS_ATTR_SF_NEXTENTRY(sfe); } - xfs_attr_trace_l_c("sf big-gulp", context); + trace_xfs_attr_list_sf_all(context); return(0); } @@ -653,7 +654,6 @@ xfs_attr_shortform_list(xfs_attr_list_co XFS_CORRUPTION_ERROR("xfs_attr_shortform_list", XFS_ERRLEVEL_LOW, context->dp->i_mount, sfe); - xfs_attr_trace_l_c("sf corrupted", context); kmem_free(sbuf); return XFS_ERROR(EFSCORRUPTED); } @@ -693,7 +693,6 @@ xfs_attr_shortform_list(xfs_attr_list_co } if (i == nsbuf) { kmem_free(sbuf); - xfs_attr_trace_l_c("blk end", context); return(0); } @@ -719,7 +718,6 @@ xfs_attr_shortform_list(xfs_attr_list_co } kmem_free(sbuf); - xfs_attr_trace_l_c("sf E-O-F", context); return(0); } @@ -2323,7 +2321,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, cursor = context->cursor; cursor->initted = 1; - xfs_attr_trace_l_cl("blk start", context, leaf); + trace_xfs_attr_list_leaf(context); /* * Re-find our place in the leaf block if this is a new syscall. @@ -2344,7 +2342,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, } } if (i == be16_to_cpu(leaf->hdr.count)) { - xfs_attr_trace_l_c("not found", context); + trace_xfs_attr_list_notfound(context); return(0); } } else { @@ -2419,7 +2417,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, break; cursor->offset++; } - xfs_attr_trace_l_cl("blk end", context, leaf); + trace_xfs_attr_list_leaf_end(context); return(retval); } From sandeen@sandeen.net Wed Sep 9 12:23:28 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89HN8a4172836 for ; Wed, 9 Sep 2009 12:23:18 -0500 X-ASG-Debug-ID: 1252517037-235302a10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C713E1B8F685 for ; Wed, 9 Sep 2009 10:23:57 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Zf6SXmHuIjcn1PQg for ; Wed, 09 Sep 2009 10:23:57 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id 6F2A4AAE3AA; Wed, 9 Sep 2009 12:23:20 -0500 (CDT) Message-ID: <4AA7E48E.5030100@sandeen.net> Date: Wed, 09 Sep 2009 12:23:26 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfsprogs: remove unused scripts Subject: Re: xfsprogs: remove unused scripts References: <20090902174407.GA9759@infradead.org> In-Reply-To: <20090902174407.GA9759@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252517042 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8570 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > xfs_check64.sh and xfs_ncheck64.sh are outdated copies of xfs_check.sh > and xfs_ncheck.sh which call a non-existant xfs_db64 binary. They > are never installed or otherwise used, so remove them. They are > probably a leftover from IRIX > > Signed-off-by: Christoph Hellwig OK with me, as long as sgi doesn't still have some secret xfs_db64 actually in use somewhere today that they still care about. Reviewed-by: Eric Sandeen > Index: xfsprogs-dev/db/Makefile > =================================================================== > --- xfsprogs-dev.orig/db/Makefile 2009-09-02 14:35:19.413268749 -0300 > +++ xfsprogs-dev/db/Makefile 2009-09-02 14:35:29.081614935 -0300 > @@ -15,7 +15,6 @@ HFILES = addr.h agf.h agfl.h agi.h attr. > text.h type.h write.h attrset.h > CFILES = $(HFILES:.h=.c) > LSRCFILES = xfs_admin.sh xfs_check.sh xfs_ncheck.sh xfs_metadump.sh > -LSRCFILES += xfs_check64.sh xfs_ncheck64.sh > > LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) > LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) > Index: xfsprogs-dev/db/xfs_check64.sh > =================================================================== > --- xfsprogs-dev.orig/db/xfs_check64.sh 2009-09-02 14:35:39.477268924 -0300 > +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 > @@ -1,36 +0,0 @@ > -#!/bin/sh -f > -# > -# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. > -# > - > -OPTS=" " > -DBOPTS=" " > -USAGE="Usage: xfs_check64 [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" > - > -while getopts "b:fi:l:stvV" c > -do > - case $c in > - s) OPTS=$OPTS"-s ";; > - t) OPTS=$OPTS"-t ";; > - v) OPTS=$OPTS"-v ";; > - V) OPTS=$OPTS"-V ";; > - i) OPTS=$OPTS"-i "$OPTARG" ";; > - b) OPTS=$OPTS"-b "$OPTARG" ";; > - f) DBOPTS=" -f";; > - l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; > - \?) echo $USAGE 1>&2 > - exit 2 > - ;; > - esac > -done > -set -- extra $@ > -shift $OPTIND > -case $# in > - 1) xfs_db64$DBOPTS -F -i -p xfs_check64 -c "check$OPTS" $1 > - status=$? > - ;; > - *) echo $USAGE 1>&2 > - exit 2 > - ;; > -esac > -exit $status > Index: xfsprogs-dev/db/xfs_ncheck64.sh > =================================================================== > --- xfsprogs-dev.orig/db/xfs_ncheck64.sh 2009-09-02 14:35:33.717268763 -0300 > +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 > @@ -1,34 +0,0 @@ > -#!/bin/sh -f > -# > -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. > -# > - > -OPTS=" " > -DBOPTS=" " > -USAGE="usage: xfs_ncheck64 [-sfvV] [-l logdev] [-i ino]... special" > - > -while getopts "b:fi:l:svV" c > -do > - case $c in > - s) OPTS=$OPTS"-s ";; > - i) OPTS=$OPTS"-i "$OPTARG" ";; > - v) OPTS=$OPTS"-v ";; > - V) OPTS=$OPTS"-V ";; > - f) DBOPTS=" -f";; > - l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; > - \?) echo $USAGE 1>&2 > - exit 2 > - ;; > - esac > -done > -set -- extra $@ > -shift $OPTIND > -case $# in > - 1) xfs_db64$DBOPTS -r -p xfs_ncheck64 -c "blockget -ns" -c "ncheck$OPTS" $1 > - status=$? > - ;; > - *) echo $USAGE 1>&2 > - exit 2 > - ;; > -esac > -exit $status > > _______________________________________________ > xfs mailing list > xfs@oss.sgi.com > http://oss.sgi.com/mailman/listinfo/xfs > From P@draigBrady.com Wed Sep 9 16:25:49 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MIME_8BIT_HEADER, RCVD_IN_BRBL autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89LPOHr182311 for ; Wed, 9 Sep 2009 16:25:39 -0500 X-ASG-Debug-ID: 1252531554-79f903580000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail1.slb.deg.dub.stisp.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id D1433161FB79 for ; Wed, 9 Sep 2009 14:25:54 -0700 (PDT) Received: from mail1.slb.deg.dub.stisp.net (mail1.slb.deg.dub.stisp.net [84.203.253.98]) by cuda.sgi.com with SMTP id Tc5wLx6eWtUDxsIm for ; Wed, 09 Sep 2009 14:25:54 -0700 (PDT) Received: (qmail 86264 invoked from network); 9 Sep 2009 21:24:54 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 9 Sep 2009 21:24:54 -0000 Message-ID: <4AA81CDB.8070509@draigBrady.com> Date: Wed, 09 Sep 2009 22:23:39 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Thunderbird 2.0.0.6 (X11/20071008) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com, CoreutilsBugs , linux-fsdevel@vger.kernel.org X-ASG-Orig-Subj: Re: fsetxattr() fails on a writable descriptor? Subject: Re: fsetxattr() fails on a writable descriptor? References: <1251987642.3855.36.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA1A3E6.2020606@draigBrady.com> <87k50den1e.fsf@meyering.net> <1252309787.3852.8.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA4C950.3080303@draigBrady.com> <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com> <4AA6402D.8040209@draigBrady.com> <20090908184049.GA22050@infradead.org> In-Reply-To: <20090908184049.GA22050@infradead.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: mail1.slb.deg.dub.stisp.net[84.203.253.98] X-Barracuda-Start-Time: 1252531579 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.02 X-Barracuda-Spam-Status: No, SCORE=-1.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_TG075d X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8577 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.00 BSF_SC0_TG075d Message contains obfuscated urls X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > On Tue, Sep 08, 2009 at 12:29:49PM +0100, P??draig Brady wrote: >> fsetxattr() is failing for me when the permissions are readonly >> but the descriptor is writable as demonstrated by the program below. >> I've tried this on ext3 and ext4 with libattr-2.4.43-3.fc11.i586 >> and linux-2.6.30.5-43.fc11.i586 > > That's not XFS specifci behaviour. For all xattr operations, fd-based > or not we always do the full permission checks, and have done so since > day one. Check the routined xattr_permission in fs/xattr.c of the > kernel tree. It seems a bit unusual, but I'm not sure changing it now > is a good idea - the xattr support has been around for a long time. Sorry if you get this twice. Resending using another server... Thanks for this info Christoph. http://lxr.linux.no/#linux+v2.6.30.5/fs/xattr.c The specific issue we have is that `cp --preserve=xattr` gets an error when copying xattrs from a read only file. Since this has been an xattr issue since the start, we'll have to work around it. We'll probably temporarily set u+w on the new file to apply xattrs. cheers, Pádraig. From michael.monnerie@is.it-management.at Wed Sep 9 17:14:51 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89MEVIr184023 for ; Wed, 9 Sep 2009 17:14:41 -0500 X-ASG-Debug-ID: 1252534492-252f00500000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailsrv1.zmi.at (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BB9A543C20B for ; Wed, 9 Sep 2009 15:14:52 -0700 (PDT) Received: from mailsrv1.zmi.at (mailsrv5.zmi.at [212.69.164.54]) by cuda.sgi.com with ESMTP id VppKRglF8wGfNoTb for ; Wed, 09 Sep 2009 15:14:52 -0700 (PDT) Received: from mailsrv.i.zmi.at (h081217106033.dyn.cm.kabsi.at [81.217.106.33]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailsrv2.i.zmi.at", Issuer "power4u.zmi.at" (not verified)) by mailsrv1.zmi.at (Postfix) with ESMTP id C55F0687 for ; Thu, 10 Sep 2009 00:14:11 +0200 (CEST) Received: from saturn.localnet (saturn.i.zmi.at [10.72.27.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mailsrv.i.zmi.at (Postfix) with ESMTPSA id 95F7B400169 for ; Thu, 10 Sep 2009 00:14:18 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: fsetxattr() fails on a writable descriptor? Subject: Re: fsetxattr() fails on a writable descriptor? Date: Thu, 10 Sep 2009 00:14:10 +0200 User-Agent: KMail/1.10.3 (Linux/2.6.30.5-ZMI; KDE/4.1.3; x86_64; ; ) References: <1251987642.3855.36.camel@dhcp-lab-219.englab.brq.redhat.com> <20090908184049.GA22050@infradead.org> <4AA81CDB.8070509@draigBrady.com> In-Reply-To: <4AA81CDB.8070509@draigBrady.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200909100014.10833@zmi.at> X-Barracuda-Connect: mailsrv5.zmi.at[212.69.164.54] X-Barracuda-Start-Time: 1252534517 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8577 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Mittwoch 09 September 2009 P=E1draig Brady wrote: > The specific issue we have is that `cp --preserve=3Dxattr` gets an > error when copying xattrs from a read only file. Since this has been > an xattr issue since the start, we'll have to work around it. In that context I would call it a bug - shouldn't it be fixed? When you=20 copy and want xattrs, and it fails sometimes, that's not what's=20 expected. So if xattr is broken from day one and it should stay like=20 this, should a bug report to "cp" be opened? Do you get the same error when "rsync -aHAX"? I always use that to make=20 a 1:1 copy, but if said problem exists that would be troublesome. > [ch writes:] > It seems a bit unusual, but I'm not sure changing it now > is a good idea - the xattr support has been around for a long time. I don't understand the inner depths, and didn't from the OP code,=20 but a failing "cp" is not nice, too. Why shouldn't the behaviour be=20 fixed? mfg zmi =2D-=20 // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4 From aelder@oss.sgi.com Wed Sep 9 18:22:40 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n89NMZqI186576 for ; Wed, 9 Sep 2009 18:22:40 -0500 Received: (from aelder@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n89NMZGH186529; Wed, 9 Sep 2009 18:22:35 -0500 Date: Wed, 9 Sep 2009 18:22:35 -0500 Message-Id: <200909092322.n89NMZGH186529@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12478-g4734d40 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 988abe4075e5748d9f7c79d9dfffa0cf5291611b X-Git-Newrev: 4734d401d43c6469d568caf223d37aa0fc1bf4dc This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated 4734d40 xfs: use correct log reservation when handling ENOSPC in xfs_create from 988abe4075e5748d9f7c79d9dfffa0cf5291611b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4734d401d43c6469d568caf223d37aa0fc1bf4dc Author: Christoph Hellwig Date: Wed Sep 9 18:19:02 2009 -0500 xfs: use correct log reservation when handling ENOSPC in xfs_create We added the ENOSPC handling patch in xfs_create just after it got mered with xfs_mkdir. Change the log reservation to the variable for either the create or mkdir value so it does the right thing if get here for creating a directory. Signed-off-by: Christoph Hellwig Signed-off-by: Alex Elder ----------------------------------------------------------------------- Summary of changes: fs/xfs/xfs_vnodeops.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- XFS development tree From info@ihug.co.uk Thu Sep 10 03:34:16 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,MSGID_FROM_MTA_HEADER autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8A8XtJC204922 for ; Thu, 10 Sep 2009 03:34:06 -0500 X-ASG-Debug-ID: 1252571671-607603060000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailfilter39.ihug.co.nz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3506A43D3BB for ; Thu, 10 Sep 2009 01:34:31 -0700 (PDT) Received: from mailfilter39.ihug.co.nz (mailfilter39.ihug.co.nz [203.109.136.39]) by cuda.sgi.com with ESMTP id GJlpSikr8sO7BcN1 for ; Thu, 10 Sep 2009 01:34:31 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEeAC5WqErUdNus/2dsb2JhbACBU4pdkAuGBq91iwiEGAWBVIkNAg X-IronPort-AV: E=Sophos;i="4.44,363,1249214400"; d="scan'208";a="129325801" Received: from ip-203-109-137-24.content.ihug.net.nz (HELO webmail.vodafone.co.nz) ([203.109.137.24]) by smtp.mailfilter6.ihug.co.nz with ESMTP; 10 Sep 2009 20:33:30 +1200 MIME-Version: 1.0 Date: Thu, 10 Sep 2009 20:33:30 +1200 From: Hyundai To: undisclosed-recipients:; X-ASG-Orig-Subj: (no subject) Subject: (no subject) Reply-To: dr.wright@w.cn Message-ID: <3059ccdc4156611c6114640e8a25dd76@vodafone.co.nz> X-Sender: info@ihug.co.uk SenderIP: 212.116.219.172 Received: from [212.116.219.172] (212.116.219.172) (login=Z29sZGZpbmNoQGlodWcuY28ubno=) by webmail.vodafone.co.nz (running Vodafone Webmail) via TCP with HTTP/1.1 id <3059ccdc4156611c6114640e8a25dd76@vodafone.co.nz>; 10 Sep 2009 20:33:30 +1200 User-Agent: Vodafone Webmail Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" X-Barracuda-Connect: mailfilter39.ihug.co.nz[203.109.136.39] X-Barracuda-Start-Time: 1252571697 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4645 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.50 X-Barracuda-Spam-Status: No, SCORE=1.50 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MSGID_FROM_MTA_HEADER, MSGID_FROM_MTA_HEADER_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8612 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MSGID_FROM_MTA_HEADER Message-Id was added by a relay 1.50 MSGID_FROM_MTA_HEADER_2 Message-Id was added by a relay X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Congrats... you have won, confirm receipt by sending your name, address, age, phone number etc to wright Smith (dr.wright00@sify.com) From web473@nextlogin.net Thu Sep 10 05:02:29 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,MIME_8BIT_HEADER, SUBJECT_NEEDS_ENCODING,SUBJ_ALL_CAPS autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8AA28BK207728 for ; Thu, 10 Sep 2009 05:02:19 -0500 X-ASG-Debug-ID: 1252576989-32b103b00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from nextlogin.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C364E1624609 for ; Thu, 10 Sep 2009 03:03:09 -0700 (PDT) Received: from nextlogin.net (nextlogin.net [195.10.195.144]) by cuda.sgi.com with ESMTP id mm8lDN2aT4PKGMtv for ; Thu, 10 Sep 2009 03:03:09 -0700 (PDT) Received: by nextlogin.net (postfix, from userid 1854) id 220F28CE59; Thu, 10 Sep 2009 12:01:54 +0200 (CEST) To: xfs@oss.sgi.com X-ASG-Orig-Subj: EMPLOYMENT: £350GBP PER WEEK! Subject: EMPLOYMENT: £350GBP PER WEEK! From: Sandex Logistics Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20090910100155.220F28CE59@nextlogin.net> Date: Thu, 10 Sep 2009 12:01:54 +0200 (CEST) X-Barracuda-Connect: nextlogin.net[195.10.195.144] X-Barracuda-Start-Time: 1252576989 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3258 1.0000 -0.2428 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Header-Alert: BAD HEADER Non-encoded 8-bit data (char A3 hex) in message header 'X-ASG-Orig-Subj' X-ASG-Orig-Subj: EMPLOYMENT: \243350GBP PER WEEK!\n ^ X-Barracuda-Spam-Score: 1.03 X-Barracuda-Spam-Status: No, SCORE=1.03 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=SUBJECT_NEEDS_ENCODING X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8617 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.28 SUBJECT_NEEDS_ENCODING SUBJECT_NEEDS_ENCODING X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hello, Are you intrested in taking a "Cashout Agent" job that pays you £350GBP per week with extra compesation worth £100GBP every month? A job you do and you feel like you are doing nothing because of its unstressful and legit nature. If yes? then you have a chance with us at Sandex Logistics, a firm based in Canada and offering services to firms and individual outside canada We have problems cashing checks offered to us by some UK citizens and big firms for the service we provide to them from here in canada. However, for you to be finally considerd, you must have the below requirements. You must Have : - A physical address - Ability to cash a check - Excellent telephone communication - Ability to flawlessly execute business plans We offer: - Regular mentoring and coaching - Generous package - Supports and Risk Free Contact Sandex Logistics through the below e-mail address with a mail subject titled "I m Intrested" thereafter, you would be indulged with the next and final step to taking up the job. E-mail: sandexlogistics@gmail.com Regards, SANDEX TEAM. SANDEX LOGISTICS No 44 Robert St, Hamilton, Ontario Canada. l8l-7z8. From BATV+656a8db192bf5e14e0cd+2209+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 10 11:08:06 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8AG7dJ0225860 for ; Thu, 10 Sep 2009 11:07:56 -0500 X-ASG-Debug-ID: 1252598901-04e502990000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6686443F2AD for ; Thu, 10 Sep 2009 09:08:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id umhFa49IH2OCxAR4 for ; Thu, 10 Sep 2009 09:08:21 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MlmC3-0005XK-PP for xfs@oss.sgi.com; Thu, 10 Sep 2009 16:08:19 +0000 Date: Thu, 10 Sep 2009 12:08:19 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling Subject: Re: PATCH] xfs: implement .dirty_inode to fix timestamp handling Message-ID: <20090910160819.GA21031@infradead.org> References: <20090827031242.GB6147@infradead.org> <20090901180820.GB26071@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090901180820.GB26071@infradead.org> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252598921 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Tue, Sep 01, 2009 at 02:08:20PM -0400, Christoph Hellwig wrote: > I managed to trigger the ASSERT in the reclaim path, so it looks both > this version and our previous code is buggy. It's back to the drawing > board for now until I gifure out what's going on. Okay, figured it out - didn't actually test the asserts as the were added last minute. Looks like we could always (before and after the patch) get into the reclaim path with the timestamp in the xfs inode not uptodate, and due to the I_CLEAR check we would never update it. From BATV+656a8db192bf5e14e0cd+2209+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 10 11:11:54 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8AGBTi2226113 for ; Thu, 10 Sep 2009 11:11:44 -0500 X-ASG-Debug-ID: 1252599150-059802720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E023143F33D for ; Thu, 10 Sep 2009 09:12:30 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id qAaLUv4WTuBOrFDY for ; Thu, 10 Sep 2009 09:12:30 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MlmD3-0005dZ-G6 for xfs@oss.sgi.com; Thu, 10 Sep 2009 16:09:21 +0000 Date: Thu, 10 Sep 2009 12:09:21 -0400 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] xfs: implement ->dirty_inode to fix timestamp handling Subject: [PATCH] xfs: implement ->dirty_inode to fix timestamp handling Message-ID: <20090910160921.GB21031@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252599150 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean This is picking up on Felix's repost of Dave's patch to implement a .dirty_inode method. We really need this notification because the VFS keeps writing directly into the inode structure instead of going through methods to update this state. In addition to the long-known atime issue we now also have a caller in VM code that updates c/mtime that way for shared writeable mmaps. And I found another one that no one has noticed in practice in the FIFO code. So implement ->dirty_inode to set i_update_core whenever the inode gets externally dirties, and switch the c/mtime handling to the same scheme we already use for atime (always picking up the value from the Linux inode). Note that this patch also removes the xfs_synchronize_atime call in xfs_reclaim it was superflous as we already synchronize the time when writing the inode via the log (xfs_inode_item_format) or the normal buffers (xfs_iflush_int). In addition also remove the I_CLEAR check before copying the Linux timestamps - now that we always have the Linux inode available we can always use the timestampts in it. Also switch to just using file_update_time for regular reads/writes - that will get us all optimization done to it for free and make sure we notice early when it breaks. Signed-off-by: Christoph Hellwig Reviewed-by: Felix Blyakher Index: xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2009-09-09 21:01:45.220253759 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_iops.c 2009-09-09 21:04:03.145006265 -0300 @@ -58,19 +58,22 @@ #include /* - * Bring the atime in the XFS inode uptodate. - * Used before logging the inode to disk or when the Linux inode goes away. + * Bring the timestamps in the XFS inode uptodate. + * + * Used before writing the inode to disk. */ void -xfs_synchronize_atime( +xfs_synchronize_times( xfs_inode_t *ip) { struct inode *inode = VFS_I(ip); - if (!(inode->i_state & I_CLEAR)) { - ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; - ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; - } + ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; + ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; + ip->i_d.di_ctime.t_sec = (__int32_t)inode->i_ctime.tv_sec; + ip->i_d.di_ctime.t_nsec = (__int32_t)inode->i_ctime.tv_nsec; + ip->i_d.di_mtime.t_sec = (__int32_t)inode->i_mtime.tv_sec; + ip->i_d.di_mtime.t_nsec = (__int32_t)inode->i_mtime.tv_nsec; } /* @@ -107,32 +110,20 @@ xfs_ichgtime( if ((flags & XFS_ICHGTIME_MOD) && !timespec_equal(&inode->i_mtime, &tv)) { inode->i_mtime = tv; - ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; sync_it = 1; } if ((flags & XFS_ICHGTIME_CHG) && !timespec_equal(&inode->i_ctime, &tv)) { inode->i_ctime = tv; - ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; sync_it = 1; } /* - * We update the i_update_core field _after_ changing - * the timestamps in order to coordinate properly with - * xfs_iflush() so that we don't lose timestamp updates. - * This keeps us from having to hold the inode lock - * while doing this. We use the SYNCHRONIZE macro to - * ensure that the compiler does not reorder the update - * of i_update_core above the timestamp updates above. + * Update complete - now make sure everyone knows that the inode + * is dirty. */ - if (sync_it) { - SYNCHRONIZE(); - ip->i_update_core = 1; + if (sync_it) xfs_mark_inode_dirty_sync(ip); - } } /* @@ -515,10 +506,8 @@ xfs_vn_getattr( stat->gid = ip->i_d.di_gid; stat->ino = ip->i_ino; stat->atime = inode->i_atime; - stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec; - stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - stat->ctime.tv_sec = ip->i_d.di_ctime.t_sec; - stat->ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; + stat->mtime = inode->i_mtime; + stat->ctime = inode->i_ctime; stat->blocks = XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); Index: xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2009-09-09 21:01:45.224254059 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_super.c 2009-09-09 21:02:14.989003628 -0300 @@ -977,6 +977,28 @@ xfs_fs_inode_init_once( } /* + * Dirty the XFS inode when mark_inode_dirty_sync() is called so that + * we catch unlogged VFS level updates to the inode. Care must be taken + * here - the transaction code calls mark_inode_dirty_sync() to mark the + * VFS inode dirty in a transaction and clears the i_update_core field; + * it must clear the field after calling mark_inode_dirty_sync() to + * correctly indicate that the dirty state has been propagated into the + * inode log item. + * + * We need the barrier() to maintain correct ordering between unlogged + * updates and the transaction commit code that clears the i_update_core + * field. This requires all updates to be completed before marking the + * inode dirty. + */ +STATIC void +xfs_fs_dirty_inode( + struct inode *inode) +{ + barrier(); + XFS_I(inode)->i_update_core = 1; +} + +/* * Attempt to flush the inode, this will actually fail * if the inode is pinned, but we dirty the inode again * at the point when it is unpinned after a log write, @@ -1539,6 +1561,7 @@ xfs_fs_get_sb( static struct super_operations xfs_super_operations = { .alloc_inode = xfs_fs_alloc_inode, .destroy_inode = xfs_fs_destroy_inode, + .dirty_inode = xfs_fs_dirty_inode, .write_inode = xfs_fs_write_inode, .clear_inode = xfs_fs_clear_inode, .put_super = xfs_fs_put_super, Index: xfs/fs/xfs/xfs_inode_item.c =================================================================== --- xfs.orig/fs/xfs/xfs_inode_item.c 2009-09-09 21:01:45.238254098 -0300 +++ xfs/fs/xfs/xfs_inode_item.c 2009-09-09 21:02:14.990004244 -0300 @@ -232,6 +232,15 @@ xfs_inode_item_format( nvecs = 1; /* + * Make sure the linux inode is dirty. We do this before + * clearing i_update_core as the VFS will call back into + * XFS here and set i_update_core, so we need to dirty the + * inode first so that the ordering of i_update_core and + * unlogged modifications still works as described below. + */ + xfs_mark_inode_dirty_sync(ip); + + /* * Clear i_update_core if the timestamps (or any other * non-transactional modification) need flushing/logging * and we're about to log them with the rest of the core. @@ -263,14 +272,9 @@ xfs_inode_item_format( } /* - * Make sure to get the latest atime from the Linux inode. + * Make sure to get the latest timestamps from the Linux inode. */ - xfs_synchronize_atime(ip); - - /* - * make sure the linux inode is dirty - */ - xfs_mark_inode_dirty_sync(ip); + xfs_synchronize_times(ip); vecp->i_addr = (xfs_caddr_t)&ip->i_d; vecp->i_len = sizeof(struct xfs_icdinode); Index: xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2009-09-09 21:01:45.229253789 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_aops.c 2009-09-09 21:02:14.993004487 -0300 @@ -215,7 +215,6 @@ xfs_setfilesize( if (ip->i_d.di_size < isize) { ip->i_d.di_size = isize; - ip->i_update_core = 1; xfs_mark_inode_dirty_sync(ip); } Index: xfs/fs/xfs/xfs_dfrag.c =================================================================== --- xfs.orig/fs/xfs/xfs_dfrag.c 2009-09-09 21:01:45.266253337 -0300 +++ xfs/fs/xfs/xfs_dfrag.c 2009-09-09 21:02:14.995003346 -0300 @@ -206,10 +206,10 @@ xfs_swap_extents( * process that the file was not changed out from * under it. */ - if ((sbp->bs_ctime.tv_sec != ip->i_d.di_ctime.t_sec) || - (sbp->bs_ctime.tv_nsec != ip->i_d.di_ctime.t_nsec) || - (sbp->bs_mtime.tv_sec != ip->i_d.di_mtime.t_sec) || - (sbp->bs_mtime.tv_nsec != ip->i_d.di_mtime.t_nsec)) { + if ((sbp->bs_ctime.tv_sec != VFS_I(ip)->i_ctime.tv_sec) || + (sbp->bs_ctime.tv_nsec != VFS_I(ip)->i_ctime.tv_nsec) || + (sbp->bs_mtime.tv_sec != VFS_I(ip)->i_mtime.tv_sec) || + (sbp->bs_mtime.tv_nsec != VFS_I(ip)->i_mtime.tv_nsec)) { error = XFS_ERROR(EBUSY); goto out_unlock; } Index: xfs/fs/xfs/xfs_itable.c =================================================================== --- xfs.orig/fs/xfs/xfs_itable.c 2009-09-09 21:01:45.271254184 -0300 +++ xfs/fs/xfs/xfs_itable.c 2009-09-09 21:02:14.998004077 -0300 @@ -59,6 +59,7 @@ xfs_bulkstat_one_iget( { xfs_icdinode_t *dic; /* dinode core info pointer */ xfs_inode_t *ip; /* incore inode pointer */ + struct inode *inode; int error; error = xfs_iget(mp, NULL, ino, @@ -72,6 +73,7 @@ xfs_bulkstat_one_iget( ASSERT(ip->i_imap.im_blkno != 0); dic = &ip->i_d; + inode = VFS_I(ip); /* xfs_iget returns the following without needing * further change. @@ -83,16 +85,19 @@ xfs_bulkstat_one_iget( buf->bs_uid = dic->di_uid; buf->bs_gid = dic->di_gid; buf->bs_size = dic->di_size; + /* - * We are reading the atime from the Linux inode because the - * dinode might not be uptodate. + * We need to read the timestamps from the Linux inode because + * the VFS keeps writing directly into the inode structure instead + * of telling us about the updates. */ - buf->bs_atime.tv_sec = VFS_I(ip)->i_atime.tv_sec; - buf->bs_atime.tv_nsec = VFS_I(ip)->i_atime.tv_nsec; - buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; - buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; - buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; - buf->bs_ctime.tv_nsec = dic->di_ctime.t_nsec; + buf->bs_atime.tv_sec = inode->i_atime.tv_sec; + buf->bs_atime.tv_nsec = inode->i_atime.tv_nsec; + buf->bs_mtime.tv_sec = inode->i_mtime.tv_sec; + buf->bs_mtime.tv_nsec = inode->i_mtime.tv_nsec; + buf->bs_ctime.tv_sec = inode->i_ctime.tv_sec; + buf->bs_ctime.tv_nsec = inode->i_ctime.tv_nsec; + buf->bs_xflags = xfs_ip2xflags(ip); buf->bs_extsize = dic->di_extsize << mp->m_sb.sb_blocklog; buf->bs_extents = dic->di_nextents; Index: xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2009-09-09 21:01:45.234253728 -0300 +++ xfs/fs/xfs/linux-2.6/xfs_lrw.c 2009-09-09 21:02:15.001004460 -0300 @@ -667,7 +667,7 @@ start: xip->i_new_size = new_size; if (likely(!(ioflags & IO_INVIS))) - xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); + file_update_time(file); /* * If the offset is beyond the size of the file, we have a couple Index: xfs/fs/xfs/xfs_inode.c =================================================================== --- xfs.orig/fs/xfs/xfs_inode.c 2009-09-09 21:01:45.275254065 -0300 +++ xfs/fs/xfs/xfs_inode.c 2009-09-09 21:04:39.394255702 -0300 @@ -3068,9 +3068,9 @@ xfs_iflush_int( SYNCHRONIZE(); /* - * Make sure to get the latest atime from the Linux inode. + * Make sure to get the latest timestamps from the Linux inode. */ - xfs_synchronize_atime(ip); + xfs_synchronize_times(ip); if (XFS_TEST_ERROR(be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC, mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) { Index: xfs/fs/xfs/xfs_inode.h =================================================================== --- xfs.orig/fs/xfs/xfs_inode.h 2009-09-09 21:01:45.281254271 -0300 +++ xfs/fs/xfs/xfs_inode.h 2009-09-09 21:02:15.009004153 -0300 @@ -504,7 +504,7 @@ void xfs_ichgtime(xfs_inode_t *, int); void xfs_lock_inodes(xfs_inode_t **, int, uint); void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); -void xfs_synchronize_atime(xfs_inode_t *); +void xfs_synchronize_times(xfs_inode_t *); void xfs_mark_inode_dirty_sync(xfs_inode_t *); #if defined(XFS_INODE_TRACE) Index: xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- xfs.orig/fs/xfs/xfs_vnodeops.c 2009-09-09 21:02:18.472028392 -0300 +++ xfs/fs/xfs/xfs_vnodeops.c 2009-09-09 21:06:19.814256069 -0300 @@ -2476,12 +2476,6 @@ xfs_reclaim( ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0); /* - * Make sure the atime in the XFS inode is correct before freeing the - * Linux inode. - */ - xfs_synchronize_atime(ip); - - /* * If we have nothing to flush with this inode then complete the * teardown now, otherwise break the link between the xfs inode and the * linux inode and clean up the xfs inode later. This avoids flushing From aelder@oss.sgi.com Thu Sep 10 15:33:26 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8AKXLsN239636 for ; Thu, 10 Sep 2009 15:33:26 -0500 Received: (from aelder@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n8AKXLe3239603; Thu, 10 Sep 2009 15:33:21 -0500 Date: Thu, 10 Sep 2009 15:33:21 -0500 Message-Id: <200909102033.n8AKXLe3239603@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12967-ga4872d5 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4734d401d43c6469d568caf223d37aa0fc1bf4dc X-Git-Newrev: a4872d5b6ad69a49975c0268828b5bb2317ea5a0 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated 3725867 xfs: actually enable the swapext compat handler from 4734d401d43c6469d568caf223d37aa0fc1bf4dc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- XFS development tree From jsipek@manchester.citi.umich.edu Thu Sep 10 17:43:54 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8AMhsdk246577 for ; Thu, 10 Sep 2009 17:43:54 -0500 X-ASG-Debug-ID: 1252622702-741d02430000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from manchester.citi.umich.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EE884441314 for ; Thu, 10 Sep 2009 15:45:02 -0700 (PDT) Received: from manchester.citi.umich.edu (manchester.citi.umich.edu [141.212.112.29]) by cuda.sgi.com with ESMTP id fbhri9KbN3Y8L6pa for ; Thu, 10 Sep 2009 15:45:02 -0700 (PDT) Received: from manchester.citi.umich.edu (localhost.localdomain [127.0.0.1]) by manchester.citi.umich.edu (8.14.3/8.14.3) with ESMTP id n8AMkQaL007681; Thu, 10 Sep 2009 18:46:26 -0400 Received: (from jsipek@localhost) by manchester.citi.umich.edu (8.14.3/8.14.3/Submit) id n8AMkQbK007678; Thu, 10 Sep 2009 18:46:26 -0400 From: "Josef 'Jeff' Sipek" To: xfs@oss.sgi.com Cc: "Josef 'Jeff' Sipek" X-ASG-Orig-Subj: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Subject: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Date: Thu, 10 Sep 2009 18:46:26 -0400 Message-Id: <1252622786-7653-1-git-send-email-jeffpc@josefsipek.net> X-Mailer: git-send-email 1.6.0.6 X-Barracuda-Connect: manchester.citi.umich.edu[141.212.112.29] X-Barracuda-Start-Time: 1252622704 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8660 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Signed-off-by: Josef 'Jeff' Sipek --- db/Makefile | 3 +- db/xfs_df.sh | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 1 deletions(-) create mode 100755 db/xfs_df.sh diff --git a/db/Makefile b/db/Makefile index 93ab040..96f220e 100644 --- a/db/Makefile +++ b/db/Makefile @@ -14,7 +14,7 @@ HFILES = addr.h agf.h agfl.h agi.h attr.h attrshort.h bit.h block.h bmap.h \ io.h malloc.h metadump.h output.h print.h quit.h sb.h sig.h strvec.h \ text.h type.h write.h attrset.h CFILES = $(HFILES:.h=.c) -LSRCFILES = xfs_admin.sh xfs_check.sh xfs_ncheck.sh xfs_metadump.sh +LSRCFILES = xfs_admin.sh xfs_check.sh xfs_ncheck.sh xfs_metadump.sh xfs_df.sh LSRCFILES += xfs_check64.sh xfs_ncheck64.sh LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) @@ -42,4 +42,5 @@ install: default $(INSTALL) -m 755 xfs_check.sh $(PKG_BIN_DIR)/xfs_check $(INSTALL) -m 755 xfs_ncheck.sh $(PKG_BIN_DIR)/xfs_ncheck $(INSTALL) -m 755 xfs_metadump.sh $(PKG_BIN_DIR)/xfs_metadump + $(INSTALL) -m 755 xfs_df.sh $(PKG_BIN_DIR)/xfs_df install-dev: diff --git a/db/xfs_df.sh b/db/xfs_df.sh new file mode 100755 index 0000000..27840ac --- /dev/null +++ b/db/xfs_df.sh @@ -0,0 +1,144 @@ +#!/bin/sh +# +# Copyright (c) 2007-2009 Josef 'Jeff' Sipek +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# + +status=0 +DB_OPTS="-p xfs_df -r" +USAGE="Usage: xfs_df [-i] |" + +while test $# -gt 1; do + case "$1" in + -i) + print_inodes=t + ;; + *) + break + ;; + esac + shift +done + +dev="$1" + +if [ -z "$dev" -o $# -ne 1 ]; then + echo $USAGE 2>&1 + exit 1 +fi + +if [ -d "$dev" ]; then + # it's a dir => assume mountpoint + + mnt=`echo "$dev" | sed -e 's,/$,,'` + [ "$dev" = "/" ] && mnt="/" + + fdev=`awk -v "mnt=$mnt" ' + ($2 == mnt && $3 == "xfs") { print $1; exit } + ' < /proc/mounts` + + if [ -z "$fdev" ]; then + echo "\"$dev\" looks like a mountpoint, but is not mounted as xfs" + exit 2 + fi + + dev="$fdev" +elif [ -b "$dev" -o -f "$dev" ] ; then + # just use the path specified + true +else + # ??? + echo "\"$dev\" is not a device or mountpoint" + exit 3 +fi + +abort() +{ + echo "Error executing xfs_db" >&2 + exit 4 +} + +db_wrapper() +{ + tmp=`xfs_db $DB_OPTS "$@" "$dev"` + status=$? + [ $status -ne 0 ] && abort + echo "$tmp" | awk '{print $3}' +} + +agcount=`db_wrapper -c 'sb 0' -c 'p agcount'` +blocksize=`db_wrapper -c 'sb 0' -c 'p blocksize'` + +maxagno=`expr $agcount - 1` + +echo "$dev:" + +case "$print_inodes" in + t) + echo "AG Inodes IUsed IFree Use%" + + tot_ino=0 + tot_use=0 + tot_fre=0 + + for ag in `seq 0 $maxagno`; do + count=`db_wrapper -c "agi $ag" -c "p count"` + freecount=`db_wrapper -c "agi $ag" -c "p freecount"` + + used=`expr $count - $freecount` + + if [ $count -gt 0 ]; then + pused=`expr $used \* 100` + pused=`expr $pused / $count` + else + pused=0 + fi + + tot_ino=`expr $tot_ino + $count` + tot_use=`expr $tot_use + $used` + tot_fre=`expr $tot_fre + $freecount` + + printf "%3d %8d %8d %8d %3d%%\n" $ag $count $used $freecount $pused + done + + pused=`expr $tot_use \* 100` + pused=`expr $pused / $tot_ino` + printf "ALL %8d %8d %8d %3d%%\n" $tot_ino $tot_use $tot_fre $pused + ;; + *) + echo "AG 1K-blocks Used Available Use%" + + tot_blo=0 + tot_use=0 + tot_ava=0 + + for ag in `seq 0 $maxagno`; do + length=`db_wrapper -c "agf $ag" -c "p length"` + freeblks=`db_wrapper -c "agf $ag" -c "p freeblks"` + + displen=`expr $length \* $blocksize` + displen=`expr $displen / 1024` + + dispfree=`expr $freeblks \* $blocksize` + dispfree=`expr $dispfree / 1024` + + dispused=`expr $displen - $dispfree` + + pused=`expr $dispused \* 100` + pused=`expr $pused / $displen` + + tot_blo=`expr $tot_blo + $displen` + tot_use=`expr $tot_use + $dispused` + tot_ava=`expr $tot_ava + $dispfree` + + printf "%3d %10d %10d %10d %3d%%\n" $ag $displen $dispused $dispfree $pused + done + + pused=`expr $tot_use \* 100` + pused=`expr $pused / $tot_blo` + printf "ALL %10d %10d %10d %3d%%\n" $tot_blo $tot_use $tot_ava $pused + ;; +esac -- 1.6.0.6 From BATV+656a8db192bf5e14e0cd+2209+infradead.org+hch@bombadil.srs.infradead.org Thu Sep 10 18:20:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8ANKTOx248838 for ; Thu, 10 Sep 2009 18:20:31 -0500 X-ASG-Debug-ID: 1252624900-04ae008e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 032451630531 for ; Thu, 10 Sep 2009 16:21:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id SA0MNnDaRROBEkoU for ; Thu, 10 Sep 2009 16:21:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MlsxP-0004y7-VS; Thu, 10 Sep 2009 23:21:39 +0000 Date: Thu, 10 Sep 2009 19:21:39 -0400 From: Christoph Hellwig To: "Josef 'Jeff' Sipek" Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Subject: Re: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Message-ID: <20090910232139.GA27678@infradead.org> References: <1252622786-7653-1-git-send-email-jeffpc@josefsipek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1252622786-7653-1-git-send-email-jeffpc@josefsipek.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252624901 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 10, 2009 at 06:46:26PM -0400, Josef 'Jeff' Sipek wrote: > +++ b/db/xfs_df.sh > @@ -0,0 +1,144 @@ > +#!/bin/sh > +# > +# Copyright (c) 2007-2009 Josef 'Jeff' Sipek > +# > +# This program is free software; you can redistribute it and/or modify it > +# under the terms of the GNU General Public License version 2 as published > +# by the Free Software Foundation. > +# > + > +status=0 > +DB_OPTS="-p xfs_df -r" > +USAGE="Usage: xfs_df [-i] |" > + > +while test $# -gt 1; do > + case "$1" in > + -i) > + print_inodes=t > + ;; > + *) > + break > + ;; > + esac > + shift > +done > + > +dev="$1" Can you use the same boilerplate code as the other wrappers for xfs_db parsing the options and showing the usage to make things more consistant? Also any new tools in xfsprogs should really come with a manpage. > +case "$print_inodes" in > + t) > + echo "AG Inodes IUsed IFree Use%" > + > + tot_ino=0 > + tot_use=0 > + tot_fre=0 > + > + for ag in `seq 0 $maxagno`; do > + count=`db_wrapper -c "agi $ag" -c "p count"` > + freecount=`db_wrapper -c "agi $ag" -c "p freecount"` > + > + used=`expr $count - $freecount` > + > + if [ $count -gt 0 ]; then > + pused=`expr $used \* 100` > + pused=`expr $pused / $count` > + else > + pused=0 > + fi Wouldn't it be much easier to implement all this in C as a new xfs_db subcommand? From jeffpc@josefsipek.net Thu Sep 10 18:29:52 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8ANTpxf249358 for ; Thu, 10 Sep 2009 18:29:51 -0500 X-ASG-Debug-ID: 1252625462-338b010c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from josefsipek.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F020644124D for ; Thu, 10 Sep 2009 16:31:02 -0700 (PDT) Received: from josefsipek.net (josefsipek.net [141.212.112.196]) by cuda.sgi.com with ESMTP id BYGmBviBejdXlZrp for ; Thu, 10 Sep 2009 16:31:02 -0700 (PDT) Received: by josefsipek.net (Postfix, from userid 1000) id CED181C00E3B; Thu, 10 Sep 2009 19:31:01 -0400 (EDT) Date: Thu, 10 Sep 2009 19:31:01 -0400 From: "Josef 'Jeff' Sipek" To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Subject: Re: [PATCH] xfs_df: a df(1)-like command to list per-ag block and inode usage Message-ID: <20090910233101.GE2343@josefsipek.net> References: <1252622786-7653-1-git-send-email-jeffpc@josefsipek.net> <20090910232139.GA27678@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090910232139.GA27678@infradead.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Barracuda-Connect: josefsipek.net[141.212.112.196] X-Barracuda-Start-Time: 1252625462 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 10, 2009 at 07:21:39PM -0400, Christoph Hellwig wrote: > On Thu, Sep 10, 2009 at 06:46:26PM -0400, Josef 'Jeff' Sipek wrote: > > +++ b/db/xfs_df.sh > > @@ -0,0 +1,144 @@ > > +#!/bin/sh > > +# > > +# Copyright (c) 2007-2009 Josef 'Jeff' Sipek > > +# > > +# This program is free software; you can redistribute it and/or modify it > > +# under the terms of the GNU General Public License version 2 as published > > +# by the Free Software Foundation. > > +# > > + > > +status=0 > > +DB_OPTS="-p xfs_df -r" > > +USAGE="Usage: xfs_df [-i] |" > > + > > +while test $# -gt 1; do > > + case "$1" in > > + -i) > > + print_inodes=t > > + ;; > > + *) > > + break > > + ;; > > + esac > > + shift > > +done > > + > > +dev="$1" > > Can you use the same boilerplate code as the other wrappers for > xfs_db parsing the options and showing the usage to make things more > consistant? You mean using getopts? Yeah, I was going to, but decided against it since there's only one option -i, and the other arg is a device name. I'll fix it up. > Also any new tools in xfsprogs should really come with a manpage. Oh, right...documentation :) > > +case "$print_inodes" in > > + t) > > + echo "AG Inodes IUsed IFree Use%" > > + > > + tot_ino=0 > > + tot_use=0 > > + tot_fre=0 > > + > > + for ag in `seq 0 $maxagno`; do > > + count=`db_wrapper -c "agi $ag" -c "p count"` > > + freecount=`db_wrapper -c "agi $ag" -c "p freecount"` > > + > > + used=`expr $count - $freecount` > > + > > + if [ $count -gt 0 ]; then > > + pused=`expr $used \* 100` > > + pused=`expr $pused / $count` > > + else > > + pused=0 > > + fi > > Wouldn't it be much easier to implement all this in C as a new xfs_db > subcommand? Ideally, db could do some basic expressions, e.g., xfs_db> agi 0 xfs_db> print (count-freecount)/count expr = 0.12345 I tried looking at db code to make it have a quiet mode (so a print will not display the 'field = ' part), but I got a bit lost. It's quite possible that making a df command in db would be simple, I'd have to look at the code more (it'd certainly run faster). Josef 'Jeff' Sipek. -- What is the difference between Mechanical Engineers and Civil Engineers? Mechanical Engineers build weapons, Civil Engineers build targets. From riku.paananen@helsinki.fi Fri Sep 11 04:16:20 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_66 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8B9GIbw017544 for ; Fri, 11 Sep 2009 04:16:19 -0500 X-ASG-Debug-ID: 1252660647-3aed01970000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp-rs1.it.helsinki.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6199314A9731 for ; Fri, 11 Sep 2009 02:17:27 -0700 (PDT) Received: from smtp-rs1.it.helsinki.fi (smtp-rs1.it.helsinki.fi [128.214.148.199]) by cuda.sgi.com with ESMTP id GO0rRxEAF5R8Q6KP for ; Fri, 11 Sep 2009 02:17:27 -0700 (PDT) Received: from [127.0.0.1] (mli105.lib.helsinki.fi [193.166.183.105]) by smtp-rs1.it.helsinki.fi (8.13.1/8.13.1) with ESMTP id n8B9HQ8K017643 for ; Fri, 11 Sep 2009 12:17:26 +0300 Message-ID: <4AAA15A6.8070700@helsinki.fi> Date: Fri, 11 Sep 2009 12:17:26 +0300 From: Riku Paananen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_repair hangs at Phase 6 Subject: xfs_repair hangs at Phase 6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp-rs1.it.helsinki.fi[128.214.148.199] X-Barracuda-Start-Time: 1252660649 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8703 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Hello. I have a 39TB xfs filesystem in a SAN that got corrupted. The reasons for the corruption are unclear. I've been trying to fix it using xfs_repair but the repair operation always hangs at Phase 6 "traversing filesystem ...". Here's some information about the distro, kernel and xfsprogs versions I'm using. server:~# cat /etc/debian_version 5.0.2 server:~# uname -a Linux server 2.6.16.62-c4 #7 SMP Tue Oct 14 14:45:38 EDT 2008 x86_64 GNU/Linux server:~# apt-cache show coraid-xfsprogs Package: coraid-xfsprogs Version: 2.9.4-1-2 Architecture: amd64 Essential: no Provides: xfsprogs, fsck-backend Conflicts: xfsprogs Depends: libc6 (>= 2.3.5-1) Installed-Size: 12056 Maintainer: Ed L Cashin Priority: optional Section: admin Filename: pool/main/c/coraid-xfsprogs/coraid-xfsprogs_2.9.4-1-2_amd64.deb Size: 4279420 SHA1: efd8573f4bd06c2a3ff39978042967e8bbdbdd18 MD5sum: 9e255d427272b646cb25218a36e70421 Description: Utilities and development files for XFS This coraid-xfsprogs package is compatible with coraid-kernel and contains XFS-related programs like mkfs.xfs and xfs_growfs. server:~# I don't have xfs_info or xfs_check on this system. It's not possible (not recommended by the supplier of the system) to upgrade xfsprogs. Here's what made me find out something's wrong: Aug 25 02:16:45 server.domain local@server kernel: 0x0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Aug 25 02:16:45 server.domain local@server kernel: Filesystem "etherd/e100.0": XFS internal error xfs_da_do_buf(2) at line 2221 of file fs/xfs/xfs_da_btree.c. Caller 0xffffffff880e3586 Aug 25 02:16:45 server.domain local@server kernel: Aug 25 02:16:45 server.domain local@server kernel: Call Trace: {:xfs:xfs_error_report+50} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_da_read_buf+26} {:xfs:xfs_corruption_error+256} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:kmem_zone_alloc+76} {:xfs:xfs_trans_read_buf+85} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_da_do_buf+1299} {:xfs:xfs_da_read_buf+26} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_da_read_buf+26} {:xfs:xfs_dir2_leaf_getdents+1061} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_dir2_leaf_getdents+1061} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_dir2_put_dirent64_direct+0} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_dir2_put_dirent64_direct+0} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:xfs_dir2_getdents+246} {:xfs:xfs_readdir+83} Aug 25 02:16:45 server.domain local@server kernel: {:xfs:linvfs_readdir+172} {filldir+0} Aug 25 02:16:45 server.domain local@server kernel: {filldir+0} {vfs_readdir+101} Aug 25 02:16:45 server.domain local@server kernel: {sys_getdents+122} {error_exit+0} Aug 25 02:16:45 server.domain local@server kernel: {system_call+126} The filesystem is mountable and usable. However there was one directory with corrupted files in it. I first ran xfs_repair with no additional options and - even though it hung at Phase 6 and I eventually killed it - it did fix this directory. However I'd rather have the repair operation finish to be sure everything's ok. I have also tried running xfs_repair with the '-P' option and it's currently running with the '-n' option. At the moment it's been stuck at Phase 6 for about 36 hours. I don't see any activity with strace. Here's the output for the current '-n' run: Phase 1 - find and verify superblock... Phase 2 - using internal log - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - agno = 16 - agno = 17 - agno = 18 - agno = 19 - agno = 20 - agno = 21 - agno = 22 - agno = 23 - agno = 24 - agno = 25 - agno = 26 - agno = 27 - agno = 28 - agno = 29 - agno = 30 - agno = 31 - agno = 32 - agno = 33 - agno = 34 - agno = 35 - agno = 36 - agno = 37 - agno = 38 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... Please let me know if there's anything I can do and please ask for any additional information you may need. Cheers, Riku Paananen From eflorac@intellique.com Fri Sep 11 04:57:49 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BRBL autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8B9vnMu019948 for ; Fri, 11 Sep 2009 04:57:49 -0500 X-ASG-Debug-ID: 1252663136-206e03d10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BB07E1BE86DC for ; Fri, 11 Sep 2009 02:58:57 -0700 (PDT) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by cuda.sgi.com with ESMTP id T52sv03JXTOFsWR1 for ; Fri, 11 Sep 2009 02:58:57 -0700 (PDT) Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 8FCD34B01F0; Fri, 11 Sep 2009 11:58:53 +0200 (CEST) Received: from harpe.intellique.com (labo.djinux.com [82.225.196.72]) by smtp2-g21.free.fr (Postfix) with ESMTP id 430CD4B0172; Fri, 11 Sep 2009 11:58:51 +0200 (CEST) Date: Fri, 11 Sep 2009 11:58:53 +0200 From: Emmanuel Florac To: xfs@oss.sgi.com, Riku Paananen X-ASG-Orig-Subj: Re: xfs_repair hangs at Phase 6 Subject: Re: xfs_repair hangs at Phase 6 Message-ID: <20090911115853.54426b7a@harpe.intellique.com> In-Reply-To: <4AAA15A6.8070700@helsinki.fi> References: <4AAA15A6.8070700@helsinki.fi> Organization: Intellique X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.4; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Barracuda-Connect: smtp2-g21.free.fr[212.27.42.2] X-Barracuda-Start-Time: 1252663139 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8706 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Le Fri, 11 Sep 2009 12:17:26 +0300 Riku Paananen =E9crivait: > Please let me know if there's anything I can do and please ask for > any additional information you may need. In such cases I use a live CD with a recent xfs_progs version and run xfs_repair from it. --=20 ---------------------------------------- Emmanuel Florac | Intellique ---------------------------------------- From sales1@segon.net Fri Sep 11 05:01:54 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_22,J_CHICKENPOX_33,J_CHICKENPOX_44,J_CHICKENPOX_55 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BA1jBD020221 for ; Fri, 11 Sep 2009 05:01:53 -0500 X-ASG-Debug-ID: 1252663372-2d9a01020000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from corp.21cn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B6C4244282B for ; Fri, 11 Sep 2009 03:02:53 -0700 (PDT) Received: from corp.21cn.com (corp.forptr.21cn.com [121.14.129.91]) by cuda.sgi.com with ESMTP id UBZAiwYAo3F8GG0A for ; Fri, 11 Sep 2009 03:02:53 -0700 (PDT) HMM_SOURCE_IP:10.27.101.4:49262.1458048738 HMM_ATTACHE_NUM:0000 HMM_SOURCE_TYPE:SMTP Received: from entas4-smtp (unknown [10.27.101.4]) by corp.21cn.com (HERMES) with ESMTP id C4F573808C for ; Fri, 11 Sep 2009 18:02:49 +0800 (CST) Received: from sonyxp([114.43.104.166]) by entas4-smtp(Knowledge-based Antispam Gateway 2.127s34(2009-06-12),121.14.129.84) with ESMTP id local17091.1252663227 for ; Fri, 11 Sep 2009 18:02:49 +0800 X-Original-AuthLogin: sales1@segon.net Reply-To: From: "SEGON MEMORY" To: X-ASG-Orig-Subj: USB Drive 2GB offer Aluminum casing Attn: linux-xfs@oss.sgi.com Subject: USB Drive 2GB offer Aluminum casing Attn: linux-xfs@oss.sgi.com Date: Fri, 11 Sep 2009 18:00:48 +0800 Organization: SEGON MEMORY Message-ID: <08e201ca32c7$0a5d7c60$1f187520$@net> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_08E3_01CA330A.1880BC60" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acox9K0/rkGgc69sSeO6phB2/OaeCwAAprpgAAARfOA= Content-Language: zh-tw X-Barracuda-Connect: corp.forptr.21cn.com[121.14.129.91] X-Barracuda-Start-Time: 1252663375 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5000 1.0000 0.0100 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.01 X-Barracuda-Spam-Status: No, SCORE=1.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA038b, BSF_SC0_SA090e, BSF_SC5_SA161f, HTML_MESSAGE, PR0N_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8706 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.20 BSF_SC0_SA038b RAW: Custom Rule SA038b 0.20 PR0N_SUBJECT Subject has letters around special characters (pr0n) 0.20 BSF_SC5_SA161f Custom Rule SA161f 0.40 BSF_SC0_SA090e Custom Rule SA090e X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean &9,0 MIME .f&!*:&h-+3!%w6l%s!C ------=_NextPart_000_08E3_01CA330A.1880BC60 Content-Type: multipart/alternative; boundary="----=_NextPart_001_08E4_01CA330A.1880BC60" ------=_NextPart_001_08E4_01CA330A.1880BC60 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Attn : linux-xfs@oss.sgi.com SEGON has great offer for Aluminum USB Flash drive Offering at USD 6 (Call for price fluctuation=EF=BC=89 in bulk =20 Photo Link: http://www.segon.net/Aluminum%20Long.JPG Spec Link: = http://www.segon.net/en/images/oem/Aluminum%20Stick%20Pro%20USB%20Drive%2= 0S.jpg MOQ : 5000 Pcs Pcs for customize , 1000 Pcs for bulk in Generic Payment term : T/T in advance ( Down payment available case by case) Leadtime : For customize 2-3 days after payment received and art work = file confirmed. Faster lead time apply for bulk Generic Packing : Retail adding USD 0.1/Pcs =20 Other competitive price for product list as below 1. Call to supply for Generic Printing(OEM) Bulk Micro SD(TF Card) = 1GB/2GB/4GB/8GB/16GB SMI+SAM 4GB/8GB/16GB are Micro SDHC class 6 with = CPRM 2. Call to supply for Generic Printing(OEM) Bulk SD Card = 1GB/2GB/4GB/8GB/16 GB SMI+SAM 4GB/8GB/16GB are SDHC class 6 with CPRM 3. Call to supply Generic M2 Memory card in bulk(with Sony Brand = printed) 4. Call for UPD COB Memory Stick 1GB/2GB/4GB/8GB/16GB SMI +SAM = /UT165+SAM 5. Various Form type Micro SD or M2 Card Reader or Dual. 6. SEGON branded various innovative type of USB Flash Drive(Turbo,G1, = Ceramic, Bees, Stride Forward, Speed, Coin Hard drive, Chocolate, Key, = Sailing) 2GB/4GB/8GB/16GB 7. Various OEM USB Flash Drive , please visit : = http://www.segon.net/en/oem.asp (Please state whether you need in bulk = or in Retail Packing) .=20 =20 Download SEGON Technology Company Profile : = http://www.segon.net/en/images/oem/SEGON%20Company%20Profile.pdf SEGON =C2=A1=C3=93=C3=AD=C3=AE^.jpg Best Regards Harry SALES MANAGER Segon Technology Co.,Ltd Address: 12F,10,No.866 , JhongJheng Road., Jhonghe City ,Taipei County = 235 ,Taiwan TEL:+886-2-2221-6689 FAX:+886-2-2221-8990 Email 1: harry@segon.net Email 2: sales1@segon.net Website: www.segon.net msn: harry@segon.net skypeID: harrysegon Yahoo Messenger: harrysegon =20 PS: This business later is sent solely to intended receiver. If you wish = to be unsubscribed, please simply reply with subject unsubsricb .make = sure that reply email addres is harry@segon.net ------=_NextPart_001_08E4_01CA330A.1880BC60 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Attn : = linux-xfs@oss.sgi.com<= o:p>

&= nbsp; SEGON has great offer for Aluminum USB Flash drive

 Offering = at USD 6 = (Call for price fluctuation=EF=BC=89 in = bulk =  

Photo Link: http://www.segon.net/Al= uminum%20Long.JPG

Spec Link: http://www.segon.net/en/images/oem/Aluminum%20Stick%20Pro= %20USB%20Drive%20S.jpg

MOQ : 5000 Pcs = Pcs for customize , 1000 Pcs for bulk in Generic

Payment term : = T/T in advance ( Down payment available case by case)

Leadtime<= /span> : = For customize 2-3 days after payment received and art work file confirmed. = Faster lead time apply for bulk Generic=

  Packing : Retail adding USD 0.1/Pcs

 

Other competitive price for product list as = below

1.  &n= bsp; Call = to supply for Generic Printing(OEM) Bulk Micro SD(TF Card)  1GB/2GB/4GB/8GB/16GB  SMI+SAM 4GB/8GB/16GB are Micro SDHC class 6 = with CPRM

2.  &n= bsp; Call = to supply for Generic Printing(OEM) Bulk SD Card  1GB/2GB/4GB/8GB/16 GB = SMI+SAM 4GB/8GB/16GB are SDHC class 6 with CPRM

3.  &n= bsp; Call = to supply Generic M2 Memory card in bulk(with Sony Brand printed)

4.  &nbs= p; Call for UPD COB Memory Stick 1GB/2GB/4GB/8GB/16GB SMI +SAM /UT165+SAM

5.  &nbs= p; Various Form type Micro SD or M2 Card Reader or Dual.

6.  &nbs= p; SEGON branded various innovative type of USB Flash Drive(Turbo,G1, Ceramic, = Bees, Stride Forward, Speed, Coin Hard drive, Chocolate, Key, Sailing) 2GB/4GB/8GB/16GB

7.  &nbs= p; Various OEM USB Flash Drive , please visit : http://www.segon.net/en/oem.asp (Please state whether you need in bulk or in Retail Packing) . =

 

Download SEGON Technology Company Profile : = http://www.segon.net/en/images/oem/SEGON%20Company%20Profile.pdf

3D"SEGON
Best Regards
Harry
SALES MANAGER
Segon Technology Co.,Ltd
Address: 12F,10,No.866 , JhongJheng Road., Jhonghe City ,Taipei County = 235 ,Taiwan
TEL:+886-2-2221-6689
FAX:+886-2-2221-8990
Email 1: harry@segon.net
Email 2: sales1@segon.net
Website: www.segon.net
msn: harry@segon.net
skypeID: harrysegon
Yahoo Messenger: harrysegon

&= nbsp;

PS: = This business later is sent solely to intended receiver. If you wish to be = unsubscribed, please simply reply with subject unsubsricb = .make sure that reply email addres is = harry@segon.net

------=_NextPart_001_08E4_01CA330A.1880BC60-- ------=_NextPart_000_08E3_01CA330A.1880BC60 Content-Type: image/jpeg; name="image001.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCABDAOcDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD2aisz V/EWlaFGG1C7SIt91B8zN9AOawT8UPDgPBuz9If/AK9Wqc5K6RlKtTi7SZ2NFcd/wtHw7/09/wDf n/69aGieNtI1+/8AsVl9o83YX/eR7Rgfj703SmldoFXpt2UjoaKKKzNQooooAKKKKACiiigAoorM 13X7Lw7aJdX3m+W7+WPLXcc4J/pTSbdkKUlFXZp0Vy2n/ETQdSv4bKF50kmbahkj2rnsM5rqacou O6JhOM1eLuFFc9rfjbSPD9/9ivvtHmlA/wC7j3DB/H2rY06/h1TT4L633eVOu9Nwwce4ocZJXaBT i24p6lmiiipLCikJCjJIAHc1n3fiHRrEH7TqdrGR2MoJ/Ic00m9hOSW7NGiuSu/iX4btsiOea5I/ 55RHH5nFYt38XI8EWWksfRppQP0A/rWio1H0MJYmjHeR6PRXA6N8VLK4Ii1a2a0c/wDLWPLp+I6j 9a7azvrXUIBPZ3Ec8R6NGwIqZ05Q+JF060KnwssUUUVBqFFFFAHzzq+ozatqtzfzMS00hYAn7o7D 8BivQbH4UWclnFJdalP5roGYRqoUEjoM1yvizwlf6HqM8iWzyWDuWilQZCg84Ppjp+FLY/EHxFYW qW0d4kkcY2r5sQYgema9SXNKK9kzwoclOb9urnY/8Kl0r/oI3n/jv+Fanh7wHY+HdT+3293cSv5Z TbJtxg49B7Vwa/E7xIG/1tsfYwj/ABrr/CHxAGu3a6dqECQXTAmN4z8kmOowehrnqRrqLu9DrpTw rmuVWZ10uoWUMhjlvII3HVWlUEfhmmf2rp3/AEELX/v8v+Ncd4i8AWus65cahJrKW7TFcxmMHbhQ PX2rN/4VbY/9DDH/AN+l/wDiqyUKbWsvwN5VaybSh+J6RBd21zu+z3EU23r5bhsflUGo6xpukIH1 C9htw3QO3J+g6mub8PaBB4LsNTvIb0ahmIPsRADlQ2BwT1zXnsGma34t8RAXSTLNcMS80sbBY1HP 5DsKcKUZN66IVTEThFLl95nqP/CfeF/+gsn/AH7f/Cpbbxr4dvLmO2t9SR5ZWCooRuSeg6Vzq/CX TQo36ldlu5CqB/KuE8NoI/GGnoDkLeKB+DVpGlSkm4t6GUsRXptKaWp7tNNFbwtNNIkUaDLO7YAH ua56f4g+GIJNh1IOR1McbMPzxXF/EXUtT1PWX06C3uDZWuBhI2xI+OSfXHQVqaN8LLOXTYptUurg XEqBikRCiPPbkHJqFShGKlN7mkq9WU3Gktu52Wl+ItI1okaffRTOBkpnDD8DzXM/Ff8A5Fy2/wCv of8AoLVxWu+G9S8K66gsWnlCgSwXESHI9jjvXSeN9Rk1bwBpl7NE0U0k6+YjKRhgrA8H3FXGmozj KLumZTrSnSnCas0edKJUCzqGUBsBx2Yc9fWvc/COvL4g0CG6JHnp+7nHo47/AI9fxrgPB2hJ4g8J axZ4HnCVHgY9nCnH59Pxqn4D1x9A8R/ZLomOC5byZlbjY4OAT+PH41rWSqJpboww0nRlFvaRu+Pr TQJ/EQbUtVuLWfyFHlx228YycHOa7XwwlvH4asEtJmmgEIEcjrtLD1I7V5p8Uf8Aka1/69k/ma9F 8G/8ihpf/XuKwqL91F3OqhJPETVjbqO4h+0QPEZJI9wxujbaw+hptxeW1ou+5uIoV9ZHC/zrBvvi B4bssg34nYfwwKX/AF6frXPGMnsjslOMV7zOX8TeAtecvPZapcalH18meU7x9OcH9K89ntprSdoL iF4ZV+8jqVI/CvWbT4paJcXhhmhuLaI/dmcAj8QORXQXenaJ4osVaaOC9hYfJKhBI+jDkV2RrTp6 TR588NTra0pangVFega78LbmDdNos/2hOvkSkBx9D0P6Vwt1aXNjcNb3cEkEq9UkUg11wqRn8LPO qUZ037yIas2Oo3umTiexupbeT1jbGfqO9VqKtq5mm07o9C0X4q3EW2LWbUTL086DhvxXofwxXfaT 4h0rW49+n3kcpxzHnDr9VPNfP9SW5kFzH5LskhYBWQ4IOfUVyzw0JarQ7aWNqR0lqfR1FMiUpEiE klVAye9Feae2KWXoSKhNraE5MEJP+4K8v8TeDfEd/wCJL+7tLNngll3IwmUZGB2zWX/wgXiv/nxf /wACF/xrqVGLV+c4ZYmabXs2/wCvQ9K8WWeh/wDCPXbX0VtGBExR9qhg+Pl2985xXkPhsyr4l00x Z3/aY8Y/3hmtQfD7xTIw3WH4tOn+Ndf4L+H82j3q6nqrxtOgPlRIchCe5PrWycKUGua5zSjUr1Iv ktYPEXw6fXNdudRGqRwCYr+7MWSMKB1z7Vmf8Klk/wCg3F/35/8Asq0fEfw7vdb1251GLUYYUmK4 RlYkYUD+lZn/AAqbUf8AoLwf98NURqWivf8AwNJ0ryb9lf5nQeHfDkngiw1O8+0DUC0Yfy412H5A TjqfWmaN8S7DVtUhsXs5LTzjhZZJAVz2H41b8GeEbjwx9s+03cdyLkIAFUjGM+v1rmvEfwxu/tj3 OhmN4ZDu+zu20xn0B6EVC9nOT538zR+2pwi6cbLqtz049K8I8P8A/I6WP/X6P/Qq1l8LePI0Cr9r VV6AXgwP/HqxvDAYeLdNDcsLtM9+c1tSpqEZWdzmr1XUlC8WtT0bWviRDourXGnTaVO7wNjcJAAw xkH9a62xvIdQsobu3cPFMgdSD61zPjPwQniPbeWkiw3yLty33ZB2B9D71xMPhzx1pAa3s47uOMnk W9wNp9+tYKFOcVZ2Z1OrWpzfMrrpY7jxL4+s/DmpLYm1e6k2B3KOBsz0B9+9YXjnVf7b8C2Go/Zn t1musqjnJxhhmqOjfDTVb+8Fxrj+RCW3SL5m+WT8e31zXU+O/D93qXh60sNItQ/kTKRGGChVCkd/ wq17OEopPXuQ3WqU5uS06Iy/hJ/yD9S/66p/I1k/E3w99i1JdYt0xDdHEuP4ZPX8R+oNdN8OtC1L QrO9j1K38hpZFKDeGyAPY10ms6XBrWlXGn3A+SZcA/3W7H8DUury1nJbFRoOeGUGtTw3WtYk1qW2 nnB86K3WF2P8RUnn8sV7L4N/5FDS/wDr3FeWv8PPE6uyjTwwBIDCVMH3616z4Zs59P8ADdhaXSeX NDCFdcg4P4VeIlBwSizLBxqKo3NDdc8M6X4hh2X1uDIowkycOn0P+NeX+Ifh5qujb57UG+tBzujH zqPdf6ivZqKwp1pQ22Oyth4Vd9z5tq5pur6hpE/nafdyQN3CnhvqOhr1vxX4L0jVLS4vfL+y3Ucb OZYhjdgZ+YdD/OvGB0r0KdSNVHj1qM8PJanpeh/FRG2w63bbD0+0QDI/Ff8ACu3vdM0zX7FBd20d zDIoZGZcEAjIIPUV4BDE08yQopZ3YKABknNfRcEYht44h0RAo/AVyYiEabTjoehhKs6yanrY8Z8c +F7Twze262c8jx3IZhHJyUxjv361y9dz8V5t/iC1hz/q7bP5sf8ACuHVWdgqqWZjgADJJrsotuCb PNxEUqrUdhK3vCXh6/1rVreS3gJtoJlaWVuFAByRnufat7w98O3+znUvEAeKBBvFqv33/wB70+nX 6V2djrMdm62SWUVvBEWTy4v+WYUgMffGeenfGayqV9GoanRRwuqlU0OjopKK809oWiiigAooooAK KKKACvJ7yP4hfbp/IOpeV5rbMOMbc8fpXrFFaU6nJ0uY1aXtLateh49JbfESaNo3/tQqwwR5gGR+ davgjwHqNpq8WqatEIFt/miiLAszdicdAK9MorR4iTTSSRjHCRUlJtuwlZK3F5ea95cUiwQWWRPE wJeXcPlI7be+evBFO1LxBa2ExtY4p7y8xkW1vGWbnpk9FH1NcD4OvNUtdeeZ51+z31z5DCTdMSQS cBhwO/J49qmFNuLZdSqlKMT1LpWNB4o0+61pNMtvNmcoxaRI22oQcYPHH16VstwpOCfpXlkN3qN9 rutTTzajutLVglsHDMAecMRgDGM4HOaVOCle5Vao4Wt1PS4r6Ga+ms03GWBVZ+OOc45/Cn3c0lva SzRQPcOilliQgM/sM1yPg6zubPWrsyCLdcW8U8wZ3aRS24gc/qPpXUXun/bnTzLmZIFzvhjbaJP9 4jnHsDUyioysVCcpQvbUwYdc1fVL27h0yGKJWjTymuXGYH53blXJJxjiugtbpGc2j3MUt3CimZU4 IJHXHYGseO7trfxJb2VvcPBA0REdrDa4jkPOWL47Y7Vr2mlWFjPLPbWscUs3+skA+Z/qeppyt2FT v3uW6KKKzNjM8SO0fhvUWUEt9mcAAZJJBFeY6D8NtV1MLNf/AOgW55wwzIw9l7fjXsFLWsKsoJqJ z1cPGrJSl0MfRPC2kaAg+xWw83HzTSfM5/Ht+FbFFFZttu7NoxUVZI8p8XaNqPiXx7cW2nwlxDHG jyNwkfy55P49K7Hwx4I07w6qzEC5vcczuPu/7o7fzro1RFLFVALHJwMZPrTq1lWk4qK2MYYeEZub 1bIriBbm3khckK64JHUe9ZEWgOLlndol3lvOkjBDzBiCQR0HI9++K3KKyUmjZxT3EopaKRQUUUUA FFFFABRRRQAUUUUAFFFFAFa/Uf2fdcYzE+SOD0NcglpBZ6X4YktlMTKFIKORy+3dnnnPvRRWtPb+ uxzVlr/XdHcVWh06ztrhriC2jjlcEM6rgtk5OfXnmiisjosh0Vnbw3EtxHCqzT48xwOWx0zU9FFA JWPKNN13VG+IrRteSMj3bQFTgjyw3Cj0H0r1eiiunEJJq3Y48G21K/cKKKK5jtCiiigAooooAKKK KACiiigAooooA//Z ------=_NextPart_000_08E3_01CA330A.1880BC60-- From aelder@oss.sgi.com Fri Sep 11 09:56:26 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from oss.sgi.com (localhost [127.0.0.1]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BEuQ5Q032764 for ; Fri, 11 Sep 2009 09:56:26 -0500 Received: (from aelder@localhost) by oss.sgi.com (8.14.3/8.14.3/Submit) id n8BEuJWo032741; Fri, 11 Sep 2009 09:56:19 -0500 Date: Fri, 11 Sep 2009 09:56:19 -0500 Message-Id: <200909111456.n8BEuJWo032741@oss.sgi.com> From: xfs@oss.sgi.com To: xfs@oss.sgi.com Subject: [XFS updates] XFS development tree branch, master, updated. v2.6.30-rc4-12968-gf08a59f X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a4872d5b6ad69a49975c0268828b5bb2317ea5a0 X-Git-Newrev: f08a59f1467b92cd9b8c78961506f69c74bb01a5 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "XFS development tree". The branch, master has been updated from a4872d5b6ad69a49975c0268828b5bb2317ea5a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- XFS development tree From sandeen@sandeen.net Fri Sep 11 10:50:20 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BFoJ0x034474 for ; Fri, 11 Sep 2009 10:50:19 -0500 X-ASG-Debug-ID: 1252684289-07c0025c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B35D21218C1F for ; Fri, 11 Sep 2009 08:51:29 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id LaljVswDzjOWKvhV for ; Fri, 11 Sep 2009 08:51:29 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id E874BAAE3A9; Fri, 11 Sep 2009 10:51:27 -0500 (CDT) Message-ID: <4AAA71FF.3060706@sandeen.net> Date: Fri, 11 Sep 2009 10:51:27 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Riku Paananen CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_repair hangs at Phase 6 Subject: Re: xfs_repair hangs at Phase 6 References: <4AAA15A6.8070700@helsinki.fi> In-Reply-To: <4AAA15A6.8070700@helsinki.fi> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252684290 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8729 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Riku Paananen wrote: > Hello. > > I have a 39TB xfs filesystem in a SAN that got corrupted. The reasons > for the corruption are unclear. I've been trying to fix it using > xfs_repair but the repair operation always hangs at Phase 6 "traversing > filesystem ...". Ok, so strace was stuck? Can you try again with -P? If that fails can you try again with -P -o bhashsize=1024 ? (or so; 1024 is the default, you could double it again if it still hangs) You might also attach gdb and see where it is. If increasing the bhashsize fixes it then I probably know what the bug is (though not yet the solution...) If you want to provide an xfs_metadump image of it from before you repair it, I could test any eventual fix against that. thanks, -Eric From sandeen@sandeen.net Fri Sep 11 12:32:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BHWVFl037408 for ; Fri, 11 Sep 2009 12:32:31 -0500 X-ASG-Debug-ID: 1252690421-3dff00350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B9D471BEA20B for ; Fri, 11 Sep 2009 10:33:41 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id XVto0b0ZrVHpGgHc for ; Fri, 11 Sep 2009 10:33:41 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id DD4B8AAE3AE for ; Fri, 11 Sep 2009 12:33:40 -0500 (CDT) Message-ID: <4AAA89F4.8060708@sandeen.net> Date: Fri, 11 Sep 2009 12:33:40 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH] libdisk: use major/minor when calling dmsetup Subject: [PATCH] libdisk: use major/minor when calling dmsetup Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252690422 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8736 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean In RH bugzilla, [Bug 471102] Error message seen during mkfs.xfs on multipath device (unfortunately marked private) reports problems when making xfs fileystems on multipath devices: # mkfs -t xfs -f /dev/mpath/oramp4 dm_task_set_name: Device /dev/dm-12 not found Command failed dm_task_set_name: Device /dev/dm-12 not found Command failed meta-data=/dev/mpath/oramp4 isize=256 agcount=4, agsize=2359680 blks ... This is because dmsetup takes a "name" which is sometimes, but not always (I think) the same as the device name. dmsetup also can take major/minor as arguments, so this may be simpler at this point. Signed-off-by: Eric Sandeen --- Index: xfsprogs-3.0.3/libdisk/dm.c =================================================================== --- xfsprogs-3.0.3.orig/libdisk/dm.c +++ xfsprogs-3.0.3/libdisk/dm.c @@ -36,10 +36,11 @@ dm_get_subvol_stripe( { int count, stripes = 0, stripesize = 0; int dmpipe[2]; - char *dpath, *largv[4], tmppath[PATH_MAX]; + char *largv[7]; FILE *stream; long long offset, size; static char *command = "table"; /* dmsetup table /dev/xxx */ + char major_str[4], minor_str[4]; if (!mnt_is_dm_subvol(sb->st_rdev)) return 0; @@ -57,16 +58,15 @@ dm_get_subvol_stripe( return 0; } - if (!(dpath = realpath(dfile, tmppath))) { - fprintf(stderr, - _("Warning - device mapper device, but cannot resolve path %s: %s\n"), - dfile, strerror(errno)); - return 0; - } + snprintf(major_str, 4, "%d", major(sb->st_rdev)); + snprintf(minor_str, 4, "%d", minor(sb->st_rdev)); largv[1] = command; - largv[2] = dpath; - largv[3] = NULL; + largv[2] = "-j"; + largv[3] = major_str; + largv[4] = "-m"; + largv[5] = minor_str; + largv[6] = NULL; /* Open pipe */ if (pipe(dmpipe) < 0) { From BATV+b1df6fa203aeffc2ccb6+2210+infradead.org+hch@bombadil.srs.infradead.org Fri Sep 11 13:50:22 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BIoJJN040176 for ; Fri, 11 Sep 2009 13:50:22 -0500 X-ASG-Debug-ID: 1252695091-3ae101d00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9A5EA12B1BC1 for ; Fri, 11 Sep 2009 11:51:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id ZdkaxRVrug8t5XqJ for ; Fri, 11 Sep 2009 11:51:31 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MmBDW-0003kQ-Hn; Fri, 11 Sep 2009 18:51:30 +0000 Date: Fri, 11 Sep 2009 14:51:30 -0400 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] libdisk: use major/minor when calling dmsetup Subject: Re: [PATCH] libdisk: use major/minor when calling dmsetup Message-ID: <20090911185130.GA11671@infradead.org> References: <4AAA89F4.8060708@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AAA89F4.8060708@sandeen.net> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252695091 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Looks good to me. A library API to device mapper would be even better.. Reviewed-by: Christoph Hellwig From sandeen@sandeen.net Fri Sep 11 13:59:01 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BIx06l040585 for ; Fri, 11 Sep 2009 13:59:01 -0500 X-ASG-Debug-ID: 1252695611-33d4024b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9D270B2EEDE for ; Fri, 11 Sep 2009 12:00:12 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id HMIFZm8YICq0k8em for ; Fri, 11 Sep 2009 12:00:12 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sandeen.net (Postfix) with ESMTP id 9679DAAE3AF; Fri, 11 Sep 2009 14:00:11 -0500 (CDT) Message-ID: <4AAA9E3B.8000904@sandeen.net> Date: Fri, 11 Sep 2009 14:00:11 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] libdisk: use major/minor when calling dmsetup Subject: Re: [PATCH] libdisk: use major/minor when calling dmsetup References: <4AAA89F4.8060708@sandeen.net> <20090911185130.GA11671@infradead.org> In-Reply-To: <20090911185130.GA11671@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1252695612 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8741 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean Christoph Hellwig wrote: > Looks good to me. A library API to device mapper would be even better.. But IIRC agk said that will never happen ;) mkp's stuff will be even better when it's ready... -Eric > > Reviewed-by: Christoph Hellwig > From BATV+b1df6fa203aeffc2ccb6+2210+infradead.org+hch@bombadil.srs.infradead.org Fri Sep 11 14:27:55 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8BJRsvG042062 for ; Fri, 11 Sep 2009 14:27:54 -0500 X-ASG-Debug-ID: 1252697346-2a4303650000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 65645B2FCB3; Fri, 11 Sep 2009 12:29:06 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id qiAbj0ix0oBSCu4X; Fri, 11 Sep 2009 12:29:06 -0700 (PDT) X-ASG-Whitelist: Client Received: from hch by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MmBns-0003Ow-RD; Fri, 11 Sep 2009 19:29:04 +0000 Date: Fri, 11 Sep 2009 15:29:04 -0400 From: Christoph Hellwig To: Alex Elder Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Subject: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Message-ID: <20090911192904.GA2746@infradead.org> References: <20090827231558.057467775@bombadil.infradead.org> <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF3@cf--amer001e--3.americas.sgi.com> <20090903154551.GA16715@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903154551.GA16715@infradead.org> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1252697346 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Thu, Sep 03, 2009 at 11:45:52AM -0400, Christoph Hellwig wrote: > > FYI: I found some nasty deadlock in this on a large machine, please > hold back until I've sorted it out. Turns out it's the following: Thread A is in xfs_sync_fsdata from sys_sync, flushing the workqueues while holding b_sema of the superblock: [78901.232282] Call Trace: [78901.232282] [] schedule_timeout+0x155/0x190 [78901.232282] [] wait_for_common+0x101/0x120 [78901.232282] [] wait_for_completion+0x12/0x20 [78901.232282] [] flush_cpu_workqueue+0x3c/0x70 [78901.232282] [] flush_workqueue+0x7e/0xa0 [78901.232282] [] xfs_flush_buftarg+0x19/0x170 [78901.232282] [] xfs_sync_fsdata+0xb8/0x150 [78901.232282] [] xfs_quiesce_data+0x45/0x70 [78901.232282] [] xfs_fs_sync_fs+0x20/0xd0 [78901.232282] [] __sync_filesystem+0x39/0x60 [78901.232282] [] sync_filesystems+0xdb/0x110 [78901.232282] [] sys_sync+0x1b/0x40 This causes a wakeup of xfsconvertd performing outstanding unwritten extent conversions: [32160.551805] Call Trace: [32160.553843] [] schedule_timeout+0x155/0x190 [32160.556965] [] __down+0x50/0x80 [32160.557838] [] down+0x3e/0x40 [32160.559675] [] xfs_buf_lock+0x32/0xe0 [32160.560795] [] xfs_getsb+0x45/0x90 [32160.561700] [] xfs_trans_getsb+0x91/0x180 [32160.562723] [] xfs_trans_apply_sb_deltas+0x15/0x450 [32160.564995] [] _xfs_trans_commit+0xe1/0x410 [32160.570459] [] xfs_iomap_write_unwritten+0x1cc/0x300 [32160.571678] [] xfs_end_bio_unwritten+0x62/0x70 [32160.573007] [] worker_thread+0x18d/0x280 [32160.577650] [] ? worker_thread+0x0/0x280 [32160.578666] [] kthread+0x7c/0x90 Which we already hold in the Thread A. I don't really see why we have to do these waits at all - xfsdatad and xfsconvertd are for data I/O completion and not buffers, and we already track their completion for data integrity syncs using the per-inode iocount that we wait for during the data writeout. From SRS0+hUu6+9+fromorbit.com=david@internode.on.net Fri Sep 11 22:31:44 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8C3Vh2B080949 for ; Fri, 11 Sep 2009 22:31:44 -0500 X-ASG-Debug-ID: 1252726372-4d2000d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 112CB1314EF6 for ; Fri, 11 Sep 2009 20:32:52 -0700 (PDT) Received: from mail.internode.on.net (bld-mail19.adl2.internode.on.net [150.101.137.104]) by cuda.sgi.com with ESMTP id GReRRRa4NAMcSkZY for ; Fri, 11 Sep 2009 20:32:52 -0700 (PDT) Received: from discord (unverified [121.44.141.236]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 4977146-1927428 for multiple; Sat, 12 Sep 2009 13:02:51 +0930 (CST) Received: from dave by discord with local (Exim 4.69) (envelope-from ) id 1MmJM1-00048z-KB; Sat, 12 Sep 2009 13:32:49 +1000 Date: Sat, 12 Sep 2009 13:32:49 +1000 From: Dave Chinner To: Christoph Hellwig Cc: Alex Elder , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Subject: Re: [PATCH 2/4] xfs: make sure xfs_sync_fsdata covers the log Message-ID: <20090912033249.GA6889@discord.disaster> References: <20090827231558.057467775@bombadil.infradead.org> <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF3@cf--amer001e--3.americas.sgi.com> <20090903154551.GA16715@infradead.org> <20090911192904.GA2746@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090911192904.GA2746@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: bld-mail19.adl2.internode.on.net[150.101.137.104] X-Barracuda-Start-Time: 1252726375 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8775 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Sep 11, 2009 at 03:29:04PM -0400, Christoph Hellwig wrote: > On Thu, Sep 03, 2009 at 11:45:52AM -0400, Christoph Hellwig wrote: > > > > FYI: I found some nasty deadlock in this on a large machine, please > > hold back until I've sorted it out. > > Turns out it's the following: > > Thread A is in xfs_sync_fsdata from sys_sync, flushing the workqueues while > holding b_sema of the superblock: > > [78901.232282] Call Trace: > [78901.232282] [] schedule_timeout+0x155/0x190 > [78901.232282] [] wait_for_common+0x101/0x120 > [78901.232282] [] wait_for_completion+0x12/0x20 > [78901.232282] [] flush_cpu_workqueue+0x3c/0x70 > [78901.232282] [] flush_workqueue+0x7e/0xa0 > [78901.232282] [] xfs_flush_buftarg+0x19/0x170 > [78901.232282] [] xfs_sync_fsdata+0xb8/0x150 > [78901.232282] [] xfs_quiesce_data+0x45/0x70 > [78901.232282] [] xfs_fs_sync_fs+0x20/0xd0 > [78901.232282] [] __sync_filesystem+0x39/0x60 > [78901.232282] [] sync_filesystems+0xdb/0x110 > [78901.232282] [] sys_sync+0x1b/0x40 > > > This causes a wakeup of xfsconvertd > performing outstanding unwritten extent conversions: > > [32160.551805] Call Trace: > [32160.553843] [] schedule_timeout+0x155/0x190 > [32160.556965] [] __down+0x50/0x80 > [32160.557838] [] down+0x3e/0x40 > [32160.559675] [] xfs_buf_lock+0x32/0xe0 > [32160.560795] [] xfs_getsb+0x45/0x90 > [32160.561700] [] xfs_trans_getsb+0x91/0x180 > [32160.562723] [] xfs_trans_apply_sb_deltas+0x15/0x450 > [32160.564995] [] _xfs_trans_commit+0xe1/0x410 > [32160.570459] [] xfs_iomap_write_unwritten+0x1cc/0x300 > [32160.571678] [] xfs_end_bio_unwritten+0x62/0x70 > [32160.573007] [] worker_thread+0x18d/0x280 > [32160.577650] [] ? worker_thread+0x0/0x280 > [32160.578666] [] kthread+0x7c/0x90 > > Which we already hold in the Thread A. > > I don't really see why we have to do these waits at all - xfsdatad and > xfsconvertd are for data I/O completion and not buffers, and we already > track their completion for data integrity syncs using the per-inode > iocount that we wait for during the data writeout. Basically the log covering code should only do anything if the filesystem is otherwise idle - if a sync is running with concurrent changes then we're not going to be able to cover the log, nor do we need to because the concurrent transactions have the same effect as covering the log - writing another record that ensures the log head and tail are up to date on disk. The issue here is that some other data IO completion not covered by the sync() call is running a new transaction that modifies the superblock, and it can't get the lock. I'd suggest that the xfs_flush_buftarg() cal needs to be moved until after the superblock write but before the cover check. That way the superblock will be unlocked (due to IO completion) and the above xfsconvertd stack will make progress and prevent the deadlock. Cheers, Dave. -- Dave Chinner david@fromorbit.com From f.oste@kpnplanet.nl Sat Sep 12 14:52:17 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_57 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8CJqGee139939 for ; Sat, 12 Sep 2009 14:52:17 -0500 X-ASG-Debug-ID: 1252785206-7a0e03d80000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from cpsmtpb-ews06.kpnxchange.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3DC711315C12 for ; Sat, 12 Sep 2009 12:53:26 -0700 (PDT) Received: from cpsmtpb-ews06.kpnxchange.com (cpsmtpb-ews06.kpnxchange.com [213.75.39.9]) by cuda.sgi.com with ESMTP id 3zXZ4MA9CdmC7EMq for ; Sat, 12 Sep 2009 12:53:26 -0700 (PDT) Received: from cpbrm-ews22.kpnxchange.com ([10.94.84.153]) by cpsmtpb-ews06.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 12 Sep 2009 21:53:26 +0200 Received: from CPSMTPM-EML03.kpnxchange.com ([213.75.39.73]) by cpbrm-ews22.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 12 Sep 2009 21:53:26 +0200 Received: from localhost ([10.94.77.200]) by CPSMTPM-EML03.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Sat, 12 Sep 2009 21:53:18 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA33E2.AA31F43F" X-MIMEOLE: Produced By Microsoft Exchange V6.5 X-ASG-Orig-Subj: Ref:ES/9420X2/68 Subject: Ref:ES/9420X2/68 Date: Sat, 12 Sep 2009 21:53:14 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ES/9420X2/68 Thread-Index: Acoz4qjTAdBrFXIeTya2oKgYPb4qOQ== From: To: X-OriginalArrivalTime: 12 Sep 2009 19:53:18.0928 (UTC) FILETIME=[ACDD2500:01CA33E2] X-RecipientDomain: oss.sgi.com X-Barracuda-Connect: cpsmtpb-ews06.kpnxchange.com[213.75.39.9] X-Barracuda-Start-Time: 1252785208 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0630 1.0000 -1.6188 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.12 X-Barracuda-Spam-Status: No, SCORE=-1.12 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA_TO_FROM_ADDR_MATCH, HTML_MESSAGE, NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8841 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.00 HTML_MESSAGE BODY: HTML included in message 0.50 BSF_SC0_SA_TO_FROM_ADDR_MATCH Sender Address Matches Recipient Address X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean This is a multi-part message in MIME format. ------_=_NextPart_001_01CA33E2.AA31F43F Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Your Email have Won 1,500,000.00 Euros. lucky number 736-22575993-86, Ref:ES/9420X2/68 Send your Full names,Address,Age,Occupation,Phone/no, Tel: +34-693-572-703 Fax: +1-801-858-5741 All response send to: microword_coperations@yahoo.com.hk ------_=_NextPart_001_01CA33E2.AA31F43F Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ref:ES/9420X2/68

Your Email have Won 1,500,000.00 Euros.
lucky number 736-22575993-86, Ref:ES/9420X2/68
Send your Full names,Address,Age,Occupation,Phone/no,
Tel: +34-693-572-703 Fax: +1-801-858-5741
All response send to: microword_coperations@yahoo.com.hk

------_=_NextPart_001_01CA33E2.AA31F43F-- From info@mail.com Sun Sep 13 01:44:08 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,J_CHICKENPOX_34, J_CHICKENPOX_56,J_CHICKENPOX_57,UPPERCASE_50_75 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8D6i8nA169672 for ; Sun, 13 Sep 2009 01:44:08 -0500 X-ASG-Debug-ID: 1252824317-03d902ed0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from poltekpos.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id BBAA8447C2B for ; Sat, 12 Sep 2009 23:45:18 -0700 (PDT) Received: from poltekpos.net (net-104-174.jasatel.net.id [202.69.104.174]) by cuda.sgi.com with SMTP id zmLONbcEsWIxfvii for ; Sat, 12 Sep 2009 23:45:18 -0700 (PDT) Received: (qmail 10053 invoked by uid 89); 12 Sep 2009 02:40:48 -0000 Received: from unknown (HELO mail.poltekpos.ac.id) (127.0.0.1) by localhost.jasatel.net.id with SMTP; 12 Sep 2009 02:40:48 -0000 Received: from 41.220.75.3 (SquirrelMail authenticated user dini_hamidin@poltekpos.ac.id); by mail.poltekpos.ac.id with HTTP; Sat, 12 Sep 2009 09:40:48 +0700 (WIT) Message-ID: <37299.41.220.75.3.1252723248.squirrel@41.220.75.3> Date: Sat, 12 Sep 2009 09:40:48 +0700 (WIT) X-ASG-Orig-Subj: Money Transfer Control Number Subject: Money Transfer Control Number From: "WESTERN UNION TEAM" To: info@mail.com Reply-To: westernunioncustomerscare1977@gmail.com User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Barracuda-Connect: net-104-174.jasatel.net.id[202.69.104.174] X-Barracuda-Start-Time: 1252824320 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5039 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.74 X-Barracuda-Spam-Status: No, SCORE=1.74 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA_TO_FROM_ADDR_MATCH, MAILTO_TO_SPAM_ADDR, UPPERCASE_50_75, UPPERCASE_50_75_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8884 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email 0.00 UPPERCASE_50_75 message body is 50-75% uppercase 0.49 UPPERCASE_50_75_2 message body is 50-75% uppercase 0.50 BSF_SC0_SA_TO_FROM_ADDR_MATCH Sender Address Matches Recipient Address X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean JUST TO LET YOU KNOW THAT I HAVE PAID THE MONEY VIA WESTERN UNION.PLEASE KINDLY KNOW YOU HAVE TO GET A WESTERN UNION GOLD CARD TO COLLECT THE FUNDS. AND I WILL BE ON OUR COMPANY ASSIGNMENT FOR THE NEXT TWO MONTH,PLEASE HERE ARE THE PAYMENT INFORMATION Money Transfer Control Number (MTCN): 876-843-0922 Amount Sent: $187,000 USD,Text Question: Favourite Colour? Answer: White,Contact the office below for your Western Union card: Contact Person: Bill Anthony Email:westernunioncustomerscare1977@gmail.com Head Avrc From SRS0+E4OJ+11+fromorbit.com=david@internode.on.net Sun Sep 13 19:36:31 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8E0aU4K000979 for ; Sun, 13 Sep 2009 19:36:31 -0500 X-ASG-Debug-ID: 1252888661-4bd7004a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A80BD1319755 for ; Sun, 13 Sep 2009 17:37:42 -0700 (PDT) Received: from mail.internode.on.net (bld-mail16.adl2.internode.on.net [150.101.137.101]) by cuda.sgi.com with ESMTP id zAWsP6ASDKAvx04n for ; Sun, 13 Sep 2009 17:37:42 -0700 (PDT) Received: from discord (unverified [121.44.141.236]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 5092903-1927428 for multiple; Mon, 14 Sep 2009 10:07:41 +0930 (CST) Received: from dave by discord with local (Exim 4.69) (envelope-from ) id 1MmzZb-00060T-Ed; Mon, 14 Sep 2009 10:37:39 +1000 Date: Mon, 14 Sep 2009 10:37:39 +1000 From: Dave Chinner To: Alex Elder Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] [PATCH 5/5] xfs: fix xfs_quiesce_data Subject: Re: [PATCH 4/4] [PATCH 5/5] xfs: fix xfs_quiesce_data Message-ID: <20090914003739.GB6889@discord.disaster> References: <20090827231558.701516609@bombadil.infradead.org> <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF5@cf--amer001e--3.americas.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABF5@cf--amer001e--3.americas.sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: bld-mail16.adl2.internode.on.net[150.101.137.101] X-Barracuda-Start-Time: 1252888663 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8955 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Aug 28, 2009 at 06:18:45PM -0500, Alex Elder wrote: > Christoph Hellwig wrote: > > From: Dave Chinner > > > > We need to do a synchronous xfs_sync_fsdata to make sure the superblock > > actually is on disk when we return. > > > > Also remove SYNC_BDFLUSH flag to xfs_sync_inodes because that particular > > flag is never checked. > > > > Move xfs_filestream_flush call later [hch: why? seems unrelated]. > > I concur with your question. Why not release the inode references early? Because if you drop the filestreams references before you write the data, the data doesn't get put where the filestreams allocator decided it should go when it created the reference.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From riku.paananen@helsinki.fi Mon Sep 14 00:07:39 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8E57cIk022188 for ; Mon, 14 Sep 2009 00:07:39 -0500 X-ASG-Debug-ID: 1252904929-1307007a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp-rs1.it.helsinki.fi (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 90AF7131A122 for ; Sun, 13 Sep 2009 22:08:49 -0700 (PDT) Received: from smtp-rs1.it.helsinki.fi (smtp-rs1.it.helsinki.fi [128.214.148.199]) by cuda.sgi.com with ESMTP id P8kEFIfIcGmmb9oE for ; Sun, 13 Sep 2009 22:08:49 -0700 (PDT) Received: from [127.0.0.1] (mli105.lib.helsinki.fi [193.166.183.105]) by smtp-rs1.it.helsinki.fi (8.13.1/8.13.1) with ESMTP id n8E58jGA029357; Mon, 14 Sep 2009 08:08:45 +0300 Message-ID: <4AADCFDD.3020302@helsinki.fi> Date: Mon, 14 Sep 2009 08:08:45 +0300 From: Riku Paananen User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Eric Sandeen CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_repair hangs at Phase 6 Subject: Re: xfs_repair hangs at Phase 6 References: <4AAA15A6.8070700@helsinki.fi> <4AAA71FF.3060706@sandeen.net> In-Reply-To: <4AAA71FF.3060706@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp-rs1.it.helsinki.fi[128.214.148.199] X-Barracuda-Start-Time: 1252904931 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8973 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean >> I have a 39TB xfs filesystem in a SAN that got corrupted. The reasons >> for the corruption are unclear. I've been trying to fix it using >> xfs_repair but the repair operation always hangs at Phase 6 >> "traversing filesystem ...". > Can you try again with -P? > If that fails can you try again with -P -o bhashsize=1024 ? With -P -o bhashsize=1024 it finally finished. Thanks a lot. Riku Paananen From jbarton@redhat.com Mon Sep 14 01:45:35 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8E6jY5d030198 for ; Mon, 14 Sep 2009 01:45:34 -0500 X-ASG-Debug-ID: 1252910806-2aa101920000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 636F9163B26C for ; Sun, 13 Sep 2009 23:46:46 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ocDtelRfej1pCXiU for ; Sun, 13 Sep 2009 23:46:46 -0700 (PDT) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8E6kjSu014334 for ; Mon, 14 Sep 2009 02:46:45 -0400 Received: from loki.usersys.redhat.com (dhcp-lab-108.englab.brq.redhat.com [10.34.33.108]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8E6kilL007011 for ; Mon, 14 Sep 2009 02:46:45 -0400 From: Jaroslav Barton Organization: Red Hat Czech To: xfs@oss.sgi.com X-ASG-Orig-Subj: [xfstests]: add-reiserfs-specific-_check_reiserfs_filesystem patch Subject: [xfstests]: add-reiserfs-specific-_check_reiserfs_filesystem patch Date: Mon, 14 Sep 2009 08:46:52 +0200 User-Agent: KMail/1.12.0 (Linux/2.6.31-0.32.rc7.fc11.x86_64; KDE/4.3.0; x86_64; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_cberKRcYC4qt/nD" Message-Id: <200909140846.52217.jbarton@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1252910807 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.8978 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean --Boundary-00=_cberKRcYC4qt/nD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, I was on vacation last week. I am using xfstests in my project and testing reiserfs filesystem. Reiserfsck waits for confirmation before fsck is runned. This patch runs reiserfsck with --yes parameter and confirmation is not needed. Thanks --Boundary-00=_cberKRcYC4qt/nD Content-Type: text/x-patch; charset="UTF-8"; name="0001-add-reiserfs-specific-_check_reiserfs_filesystem-fun.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-add-reiserfs-specific-_check_reiserfs_filesystem-fun.patch" =46rom f34d69cbbcdde9fa973e8c3ddb7fa3e9b17c7305 Mon Sep 17 00:00:00 2001 =46rom: Jaroslav Barton Date: Fri, 4 Sep 2009 11:09:32 +0200 Subject: [PATCH] add reiserfs specific _check_reiserfs_filesystem function The _check_generic_filesystem function doesn't start reiserfsck correctly. Reiserfsck waits for user answer (user must write Yes, but question is not visible). This specific function runs reiserfsck with --yes parameter to awoid waiting for answer. =2D-- common.rc | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/common.rc b/common.rc index da5f99e..8b990ba 100644 =2D-- a/common.rc +++ b/common.rc @@ -911,6 +911,50 @@ _check_extN_filesystem() return 0 } =20 +_check_reiserfs_filesystem() +{ + device=3D$1 + + # If type is set, we're mounted + type=3D`_fs_type $device` + ok=3D1 + + if [ "$type" =3D "$FSTYP" ] + then + # mounted ... + mountpoint=3D`_umount_or_remount_ro $device` + fi +=09 + reiserfsck --yes $device >$tmp.fsck 2>&1 + if [ $? -ne 0 ] + then + echo "_check_reiserfs_filesystem: filesystem on $device is inconsi= stent (see $seq.full)" + + echo "_check_reiserfs_filesystem: filesystem on $device is inconsi= stent" >>$here/$seq.full + echo "*** reiserfsck output ***" >>$here/= $seq.full + cat $tmp.fsck >>$here/$seq= =2Efull + echo "*** end reiserfsck output" >>$here/= $seq.full + + ok=3D0 + fi + rm -f $tmp.fsck + + if [ $ok -eq 0 ] + then + echo "*** mount output ***" >>$here/$seq= =2Efull + _mount >>$here/$seq= =2Efull + echo "*** end mount output" >>$here/$seq= =2Efull + elif [ "$type" =3D "$FSTYP" ] + then + # was mounted ... + _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint + ok=3D$? + fi + + [ $ok -eq 0 ] && exit 1 + return 0 +} + # run xfs_check and friends on a FS. =20 _check_xfs_filesystem() @@ -1082,6 +1126,9 @@ _check_test_fs() ext2|ext3|ext4) _check_extN_filesystem $TEST_DEV ;; + reiserfs) + _check_reiserfs_filesystem $TEST_DEV + ;; *) _check_generic_filesystem $TEST_DEV ;; =2D-=20 1.6.2.5 --Boundary-00=_cberKRcYC4qt/nD-- From Steffen.Knauf@gmx.net Mon Sep 14 05:04:38 2009 X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-rupdated Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n8EA4c0a041155 for ; Mon, 14 Sep 2009 05:04:38 -0500 X-ASG-Debug-ID: 1252922750-507603cc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.gmx.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 47E6344B9DF for ; Mon, 14 Sep 2009 03:05:50 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by cuda.sgi.com with SMTP id 7uMF8DKk22wgkFLB for ; Mon, 14 Sep 2009 03:05:50 -0700 (PDT) Received: (qmail 32730 invoked by uid 0); 14 Sep 2009 10:05:49 -0000 Received: from 195.122.130.2 by www061.gmx.net with HTTP; Mon, 14 Sep 2009 12:05:48 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Mon, 14 Sep 2009 12:05:48 +0200 From: "Steffen Knauf" Message-ID: <20090914100548.45440@gmx.net> MIME-Version: 1.0 X-ASG-Orig-Subj: xfs_log_force: error 5 returend Subject: xfs_log_force: error 5 returend To: xfs@oss.sgi.com X-Au