From owner-xfs@oss.sgi.com Thu Mar 1 08:16:46 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 08:16:53 -0800 (PST) X-Spam-oss-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_50, J_CHICKENPOX_45,SUBJECT_FUZZY_TION autolearn=no version=3.2.0-pre1-r499012 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l21GGj6p017391 for ; Thu, 1 Mar 2007 08:16:46 -0800 Received: by nz-out-0506.google.com with SMTP id m22so431561nzf for ; Thu, 01 Mar 2007 08:16:45 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=MGFqqYjrGGgO5GbhGLwJU/JeflSFm7x7xpSr0VYQU51WDwQON+I4plRiKrnVZsKSzR7DCFACEKrqzOuiodEIoUCBWMxTq0QhZxJa9wHySw67GJDQpeukuyH6PtSB5skhqrpl135kLsxwsa6FaZUuqQ/NYEqsjRvat9r+j8HtPzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=dgemHtZbXWQ7Qp+dK5xzzFXvwsRj29/H2s2wEYZQGKshZMywO6gODmGiuI2Ze7OcuZMS6L4JYGwDYWT6XdcVwmF/lNTlm8uNBdu8U3TSa13Mu6sdO4Ln2L9xpJi5X3k/P3PVTN/m7kei6zmvsrwdYtzAwUHLMjO9tk0vUk5ByMI= Received: by 10.65.53.3 with SMTP id f3mr2933459qbk.1172764121946; Thu, 01 Mar 2007 07:48:41 -0800 (PST) Received: by 10.64.148.7 with HTTP; Thu, 1 Mar 2007 07:48:41 -0800 (PST) Message-ID: <29a617af0703010748g51ef81b1x9c0467602d09793@mail.gmail.com> Date: Thu, 1 Mar 2007 16:48:41 +0100 From: "M Kili" To: xfs@oss.sgi.com Subject: can't mount xfs partition MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-archive-position: 10738 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: m0kili@gmail.com Precedence: bulk X-list: xfs Content-Length: 3485 Lines: 104 Background: Windows XP installation overwrote the MBR with broken partition layout. I used gpart to figure out the partition table. Primary partitions were detected correctly and can be mounted, unfortunately all important data are in logical partitions, most of which are XFS. The beginings of the partitions were found, but the ends might be a little off, I don't know. If I try to mount any of the XFS partitions, I get this message: mount: /dev/hda5: can't read superblock I dded this partition to a file and run xfs_repair with this result: # xfs_repair -f hda5.img Phase 1 - find and verify superblock... Phase 2 - using internal log - zero log... - 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 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - clear lost+found (if it exists) ... - 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 Phase 5 - rebuild AG headers and trees... - reset superblock... Phase 6 - check inode connectivity... - resetting contents of realtime bitmap and summary inodes - ensuring existence of lost+found directory - traversing filesystem starting at / ... - traversal finished ... - traversing all unattached subtrees ... - traversals finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify and correct link counts... done ------------------------------------------------ xfs_check doesn't give any message, and still, the image can't be mounted, with the same error: # mount -o loop hda5.img /mnt/ mount: /dev/loop0: can't read superblock Output of fdisk print partition table (5, 6, 7, and 9 are XFS): Disk /dev/hda: 320.0 GB, 320072933376 bytes 86 heads, 15 sectors/track, 484606 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/hda1 63 37752742 18876340 83 Linux /dev/hda2 37752750 37833073 40162 83 Linux /dev/hda3 37833075 48323504 5245215 83 Linux /dev/hda4 48323505 625142447 288409471+ 5 Extended /dev/hda5 48323521 87389120 19532800 83 Linux /dev/hda6 87409666 560228673 236409504 83 Linux /dev/hda7 560459656 581660935 10600640 83 Linux /dev/hda8 581681521 582741795 530137+ 82 Linux swap / Solaris /dev/hda9 582741811 625116634 21187412 83 Linux Is there any help? Another question: I'm running now on one older hd, however, it has some read errors. Is it possible to use the already discovered Thanks, Marek From owner-xfs@oss.sgi.com Thu Mar 1 08:42:25 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 08:42:30 -0800 (PST) X-Spam-oss-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00, SPF_HELO_PASS,SUBJECT_FUZZY_TION autolearn=no version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l21GgN6p027191 for ; Thu, 1 Mar 2007 08:42:24 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l21GgGNJ032120; Thu, 1 Mar 2007 11:42:16 -0500 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l21GgGVZ031645; Thu, 1 Mar 2007 11:42:16 -0500 Received: from [10.15.80.10] (neon.msp.redhat.com [10.15.80.10]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l21GgDYi027082; Thu, 1 Mar 2007 11:42:14 -0500 Message-ID: <45E701A2.1020304@sandeen.net> Date: Thu, 01 Mar 2007 10:38:58 -0600 From: Eric Sandeen User-Agent: Thunderbird 1.5.0.9 (X11/20070212) MIME-Version: 1.0 To: M Kili CC: xfs@oss.sgi.com Subject: Re: can't mount xfs partition References: <29a617af0703010748g51ef81b1x9c0467602d09793@mail.gmail.com> In-Reply-To: <29a617af0703010748g51ef81b1x9c0467602d09793@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-archive-position: 10740 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Content-Length: 260 Lines: 12 M Kili wrote: > xfs_check doesn't give any message, and still, the image can't be > mounted, with the same error: > # mount -o loop hda5.img /mnt/ > mount: /dev/loop0: can't read superblock look at dmesg output, see what it says. Does "-t xfs" help? -Eric From owner-xfs@oss.sgi.com Thu Mar 1 11:04:05 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 11:04:09 -0800 (PST) X-Spam-oss-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from lab41.emea.sgi.com (lab41.emea.sgi.com [144.253.75.41]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l21J446p020323 for ; Thu, 1 Mar 2007 11:04:05 -0800 Received: by lab41.emea.sgi.com (Postfix, from userid 1000) id E9CE752AC0; Thu, 1 Mar 2007 18:56:55 +0000 (GMT) To: xfs@oss.sgi.com Subject: TAKE 961693 - The last argument "lsn" of xfs_trans_commit() is always called with NULL. Message-Id: <20070301185655.E9CE752AC0@lab41.emea.sgi.com> Date: Thu, 1 Mar 2007 18:56:55 +0000 (GMT) From: lachlan@lab41.emea.sgi.com (Lachlan McIlroy) X-archive-position: 10746 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@lab41.emea.sgi.com Precedence: bulk X-list: xfs Content-Length: 3771 Lines: 67 The last argument "lsn" of xfs_trans_commit() is always called with NULL. Patch provided by Eric Sandeen. Signed-off-by: Eric Sandeen Date: Fri Mar 2 05:02:20 AEDT 2007 Workarea: vpn-emea-sw-emea-160-20.emea.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: tes sandeen@sandeen.net Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:28199a fs/xfs/xfs_rw.c - 1.398 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rw.c.diff?r1=text&tr1=1.398&r2=text&tr2=1.397&f=h fs/xfs/xfs_vnodeops.c - 1.690 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.690&r2=text&tr2=1.689&f=h fs/xfs/xfs_rtalloc.c - 1.106 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rtalloc.c.diff?r1=text&tr1=1.106&r2=text&tr2=1.105&f=h fs/xfs/xfs_log_recover.c - 1.316 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.316&r2=text&tr2=1.315&f=h fs/xfs/xfs_vfsops.c - 1.516 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.516&r2=text&tr2=1.515&f=h fs/xfs/xfs_dfrag.c - 1.58 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.58&r2=text&tr2=1.57&f=h fs/xfs/xfs_mount.c - 1.393 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.393&r2=text&tr2=1.392&f=h fs/xfs/xfs_inode.c - 1.461 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.461&r2=text&tr2=1.460&f=h fs/xfs/xfs_qmops.c - 1.15 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_qmops.c.diff?r1=text&tr1=1.15&r2=text&tr2=1.14&f=h fs/xfs/xfs_attr_leaf.c - 1.107 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.c.diff?r1=text&tr1=1.107&r2=text&tr2=1.106&f=h fs/xfs/xfs_trans.c - 1.178 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.c.diff?r1=text&tr1=1.178&r2=text&tr2=1.177&f=h fs/xfs/xfs_trans.h - 1.144 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.h.diff?r1=text&tr1=1.144&r2=text&tr2=1.143&f=h fs/xfs/xfs_utils.c - 1.73 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_utils.c.diff?r1=text&tr1=1.73&r2=text&tr2=1.72&f=h fs/xfs/xfs_fsops.c - 1.122 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_fsops.c.diff?r1=text&tr1=1.122&r2=text&tr2=1.121&f=h fs/xfs/xfs_bmap.c - 1.365 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.365&r2=text&tr2=1.364&f=h fs/xfs/xfs_rename.c - 1.70 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rename.c.diff?r1=text&tr1=1.70&r2=text&tr2=1.69&f=h fs/xfs/xfs_attr.c - 1.143 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr.c.diff?r1=text&tr1=1.143&r2=text&tr2=1.142&f=h fs/xfs/quota/xfs_qm_syscalls.c - 1.31 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm_syscalls.c.diff?r1=text&tr1=1.31&r2=text&tr2=1.30&f=h fs/xfs/quota/xfs_dquot.c - 1.29 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.29&r2=text&tr2=1.28&f=h fs/xfs/quota/xfs_qm.c - 1.47 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.47&r2=text&tr2=1.46&f=h fs/xfs/xfs_iomap.c - 1.51 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iomap.c.diff?r1=text&tr1=1.51&r2=text&tr2=1.50&f=h fs/xfs/dmapi/xfs_dm.c - 1.33 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.33&r2=text&tr2=1.32&f=h - The last argument "lsn" of xfs_trans_commit() is always called with NULL. Signed-off-by: Eric Sandeen From owner-xfs@oss.sgi.com Thu Mar 1 15:27:02 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 15:27:07 -0800 (PST) X-Spam-oss-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l21NQx6p014519 for ; Thu, 1 Mar 2007 15:27:00 -0800 Received: from [134.14.55.84] (shark.melbourne.sgi.com [134.14.55.84]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA20336; Fri, 2 Mar 2007 10:26:51 +1100 Message-ID: <45E76138.2020202@sgi.com> Date: Fri, 02 Mar 2007 10:26:48 +1100 From: Donald Douwsma User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: Utako Kusaka CC: xfs@oss.sgi.com Subject: Re: [PATCH] repquota does't report correct space usage References: <200702280733.AA05017@TNESG9305.tnes.nec.co.jp> In-Reply-To: <200702280733.AA05017@TNESG9305.tnes.nec.co.jp> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-archive-position: 10750 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Content-Length: 1513 Lines: 38 Utako Kusaka wrote: > Hi, > > repquota may report incorrect space usage when the filesystem is mounted > repeatedly with different quota options. > The cause of the problem is that xfs_qm_quotacheck() is not called because > the `CHKD' flag in mp->m_qflags is not cleared until it is mounted with > no quota option. This patch fixes it. Good find, I've heard of some problems with quota 'corruption' that may actually be caused by this. > --- linux-2.6.20-orgn/fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 > +++ linux-2.6.20/fs/xfs/xfs_qm.c 2007-02-22 17:30:58.000000000 +0900 > @@ -1175,8 +1175,6 @@ xfs_qm_init_quotainfo( > qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); > do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); > > - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); > - > /* > * We try to get the limits from the superuser's limits fields. > * This is quite hacky, but it is standard quota practice. This disables the optimization that skips the quota check for the normal case where mount options have not been changed. I don't have any quota check performance figures handy but I don't think we can loose this optimization for people with large filesystems/machines. I think instead we need to clear the individual quota bit when a filesystem is mounted without a particular quota type. This will force a quota check but only when the filesystem is again mounted with that quota type. Donald From owner-xfs@oss.sgi.com Thu Mar 1 16:13:18 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 16:13:25 -0800 (PST) X-Spam-oss-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS, SUBJECT_FUZZY_TION autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l220DH6p022444 for ; Thu, 1 Mar 2007 16:13:18 -0800 Received: from [10.0.0.4] (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5B20218030AC3; Thu, 1 Mar 2007 18:13:16 -0600 (CST) Message-ID: <45E76C1C.4040903@sandeen.net> Date: Thu, 01 Mar 2007 18:13:16 -0600 From: Eric Sandeen User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) MIME-Version: 1.0 To: M Kili , xfs@oss.sgi.com Subject: Re: can't mount xfs partition References: <29a617af0703010748g51ef81b1x9c0467602d09793@mail.gmail.com> <45E701A2.1020304@sandeen.net> <29a617af0703011611p4ed51bb4g63b1ec0da42143bc@mail.gmail.com> In-Reply-To: <29a617af0703011611p4ed51bb4g63b1ec0da42143bc@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 10751 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Content-Length: 970 Lines: 36 M Kili wrote: > On 3/1/07, Eric Sandeen wrote: >> M Kili wrote: >> > xfs_check doesn't give any message, and still, the image can't be >> > mounted, with the same error: >> > # mount -o loop hda5.img /mnt/ >> > mount: /dev/loop0: can't read superblock >> >> look at dmesg output, see what it says. > > [17206988.072000] SGI XFS with ACLs, security attributes, realtime, > large block numbers, no debug enabled > [17206988.072000] SGI XFS Quota Management subsystem > [17206988.080000] attempt to access beyond end of device > [17206988.080000] hda5: rw=0, want=39086080, limit=39065600 > [17206988.080000] I/O error in filesystem ("hda5") meta-data dev hda5 > block 0x25467ff ("xfs_read_buf") error 5 buf count 512 > [17206988.080000] XFS: size check 2 failed > > I guess I must repartition, am I right? Yep, looks like your partition endpoint is just slightly too small. -Eric >> >> Does "-t xfs" help? > > no > >> >> -Eric >> >> > From owner-xfs@oss.sgi.com Thu Mar 1 19:03:07 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 19:03:12 -0800 (PST) X-Spam-oss-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from tyo200.gate.nec.co.jp (TYO200.gate.nec.co.jp [210.143.35.50]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l223366p023490 for ; Thu, 1 Mar 2007 19:03:07 -0800 Received: from tyo201.gate.nec.co.jp ([10.7.69.201]) by tyo200.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id l22330QB029427 for ; Fri, 2 Mar 2007 12:03:04 +0900 (JST) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.162]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id l222xpsK002231 for ; Fri, 2 Mar 2007 11:59:51 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id l222xpx05901 for xfs@oss.sgi.com; Fri, 2 Mar 2007 11:59:51 +0900 (JST) Received: from secsv3.tnes.nec.co.jp (tnesvc2.tnes.nec.co.jp [10.1.101.15]) by mailsv4.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id l222xpg16589 for ; Fri, 2 Mar 2007 11:59:51 +0900 (JST) Received: from tnesvc2.tnes.nec.co.jp ([10.1.101.15]) by secsv3.tnes.nec.co.jp (ExpressMail 5.10) with SMTP id 20070302.105937.51502548 for ; Fri, 2 Mar 2007 10:59:37 +0900 Received: FROM tnessv1.tnes.nec.co.jp BY tnesvc2.tnes.nec.co.jp ; Fri Mar 02 10:59:37 2007 +0900 Received: from rifu.bsd.tnes.nec.co.jp (rifu.bsd.tnes.nec.co.jp [10.1.104.1]) by tnessv1.tnes.nec.co.jp (Postfix) with ESMTP id CDD6AAE4B3; Fri, 2 Mar 2007 11:59:45 +0900 (JST) Received: from TNESG9305.tnes.nec.co.jp (TNESG9305.bsd.tnes.nec.co.jp [10.1.104.199]) by rifu.bsd.tnes.nec.co.jp (8.12.11/3.7W/BSD-TNES-MX01) with SMTP id l222xoJP030334; Fri, 2 Mar 2007 11:59:50 +0900 Message-Id: <200703020259.AA05023@TNESG9305.tnes.nec.co.jp> From: Utako Kusaka Date: Fri, 02 Mar 2007 11:59:44 +0900 To: Donald Douwsma Cc: xfs@oss.sgi.com Subject: Re: [PATCH] repquota does't report correct space usage In-Reply-To: <45E76138.2020202@sgi.com> References: <45E76138.2020202@sgi.com> MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Content-Type: text/plain; charset=iso-2022-jp X-archive-position: 10752 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: utako@tnes.nec.co.jp Precedence: bulk X-list: xfs Content-Length: 1697 Lines: 45 Hi, Donald I understand your explanation. I'll think a new patch for this. Thanks. Fri, 02 Mar 2007 10:26:48 +1100 Donald Douwsma wrote: >Utako Kusaka wrote: >> Hi, >> >> repquota may report incorrect space usage when the filesystem is mounted >> repeatedly with different quota options. >> The cause of the problem is that xfs_qm_quotacheck() is not called because >> the `CHKD' flag in mp->m_qflags is not cleared until it is mounted with >> no quota option. This patch fixes it. > >Good find, I've heard of some problems with quota 'corruption' that may >actually be caused by this. > >> --- linux-2.6.20-orgn/fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 >> +++ linux-2.6.20/fs/xfs/xfs_qm.c 2007-02-22 17:30:58.000000000 +0900 >> @@ -1175,8 +1175,6 @@ xfs_qm_init_quotainfo( >> qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); >> do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); >> >> - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); >> - >> /* >> * We try to get the limits from the superuser's limits fields. >> * This is quite hacky, but it is standard quota practice. > >This disables the optimization that skips the quota check for the normal case where mount >options have not been changed. > >I don't have any quota check performance figures handy but I don't think we can loose this >optimization for people with large filesystems/machines. > >I think instead we need to clear the individual quota bit when a filesystem is mounted >without a particular quota type. This will force a quota check but only when the filesystem >is again mounted with that quota type. > >Donald > > From owner-xfs@oss.sgi.com Thu Mar 1 22:34:50 2007 Received: with ECARTIS (v1.0.0; list xfs); Thu, 01 Mar 2007 22:34:56 -0800 (PST) X-Spam-oss-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l226Yl6p028373 for ; Thu, 1 Mar 2007 22:34:50 -0800 Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.192]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id l226YlD1008695 for ; Fri, 2 Mar 2007 15:34:47 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id l226Yk015713 for xfs@oss.sgi.com; Fri, 2 Mar 2007 15:34:46 +0900 (JST) Received: from secsv3.tnes.nec.co.jp (tnesvc2.tnes.nec.co.jp [10.1.101.15]) by mailsv3.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id l226YkL00734 for ; Fri, 2 Mar 2007 15:34:46 +0900 (JST) Received: from tnesvc2.tnes.nec.co.jp ([10.1.101.15]) by secsv3.tnes.nec.co.jp (ExpressMail 5.10) with SMTP id 20070302.143432.87504704 for ; Fri, 2 Mar 2007 14:34:32 +0900 Received: FROM tnessv1.tnes.nec.co.jp BY tnesvc2.tnes.nec.co.jp ; Fri Mar 02 14:34:32 2007 +0900 Received: from rifu.bsd.tnes.nec.co.jp (rifu.bsd.tnes.nec.co.jp [10.1.104.1]) by tnessv1.tnes.nec.co.jp (Postfix) with ESMTP id 071E3AE4B3; Fri, 2 Mar 2007 15:34:42 +0900 (JST) Received: from TNESG9305.tnes.nec.co.jp (TNESG9305.bsd.tnes.nec.co.jp [10.1.104.199]) by rifu.bsd.tnes.nec.co.jp (8.12.11/3.7W/BSD-TNES-MX01) with SMTP id l226YiA0015886; Fri, 2 Mar 2007 15:34:44 +0900 Message-Id: <200703020634.AA05027@TNESG9305.tnes.nec.co.jp> Date: Fri, 02 Mar 2007 15:34:34 +0900 To: donaldd@sgi.com, xfs@oss.sgi.com Subject: [PATCH] repquota doesn't report correct space usage #2 From: Utako Kusaka In-Reply-To: <45E76138.2020202@sgi.com> References: <45E76138.2020202@sgi.com> MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Content-Type: text/plain; charset=iso-2022-jp X-archive-position: 10753 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: utako@tnes.nec.co.jp Precedence: bulk X-list: xfs Content-Length: 2573 Lines: 64 Hi, This new patch skips the quota check when the filesystem is mounted with the same quota option. Signed-off-by: Utako Kusaka --- --- fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 +++ fs/xfs/quota/xfs_qm.c 2007-03-02 15:01:44.000000000 +0900 @@ -1175,7 +1175,12 @@ xfs_qm_init_quotainfo( qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); + if (XFS_IS_UQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT)) + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD); + if (XFS_IS_GQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT)) + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); + if (XFS_IS_PQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT)) + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); /* * We try to get the limits from the superuser's limits fields. Fri, 02 Mar 2007 10:26:48 +1100 Donald Douwsma wrote: >Utako Kusaka wrote: >> Hi, >> >> repquota may report incorrect space usage when the filesystem is mounted >> repeatedly with different quota options. >> The cause of the problem is that xfs_qm_quotacheck() is not called because >> the `CHKD' flag in mp->m_qflags is not cleared until it is mounted with >> no quota option. This patch fixes it. > >Good find, I've heard of some problems with quota 'corruption' that may >actually be caused by this. > >> --- linux-2.6.20-orgn/fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 >> +++ linux-2.6.20/fs/xfs/xfs_qm.c 2007-02-22 17:30:58.000000000 +0900 >> @@ -1175,8 +1175,6 @@ xfs_qm_init_quotainfo( >> qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); >> do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); >> >> - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); >> - >> /* >> * We try to get the limits from the superuser's limits fields. >> * This is quite hacky, but it is standard quota practice. > >This disables the optimization that skips the quota check for the normal case where mount >options have not been changed. > >I don't have any quota check performance figures handy but I don't think we can loose this >optimization for people with large filesystems/machines. > >I think instead we need to clear the individual quota bit when a filesystem is mounted >without a particular quota type. This will force a quota check but only when the filesystem >is again mounted with that quota type. > >Donald > > From owner-xfs@oss.sgi.com Fri Mar 2 09:42:55 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 02 Mar 2007 09:43:02 -0800 (PST) X-Spam-oss-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from lab41.emea.sgi.com (lab41.emea.sgi.com [144.253.75.41]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l22Hgr6p016941 for ; Fri, 2 Mar 2007 09:42:54 -0800 Received: by lab41.emea.sgi.com (Postfix, from userid 1000) id A48CF52AD5; Fri, 2 Mar 2007 18:01:46 +0000 (GMT) To: xfs@oss.sgi.com Subject: TAKE 961694 - the "aendp" arg to xfs_dir2_data_freescan is always NULL, remove it. Message-Id: <20070302180146.A48CF52AD5@lab41.emea.sgi.com> Date: Fri, 2 Mar 2007 18:01:46 +0000 (GMT) From: lachlan@lab41.emea.sgi.com (Lachlan McIlroy) X-archive-position: 10754 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@lab41.emea.sgi.com Precedence: bulk X-list: xfs Content-Length: 1333 Lines: 34 the "aendp" arg to xfs_dir2_data_freescan is always NULL, remove it. Patch provided by Eric Sandeen. Signed-off-by: Eric Sandeen Date: Sat Mar 3 04:40:38 AEDT 2007 Workarea: vpn-emea-sw-emea-160-1.emea.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: lachlan sandeen@sandeen.net Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:28204a fs/xfs/xfs_dir2_block.c - 1.54 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_block.c.diff?r1=text&tr1=1.54&r2=text&tr2=1.53&f=h fs/xfs/xfs_dir2_data.c - 1.37 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_data.c.diff?r1=text&tr1=1.37&r2=text&tr2=1.36&f=h fs/xfs/xfs_dir2_data.h - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_data.h.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h fs/xfs/xfs_dir2_leaf.c - 1.57 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_leaf.c.diff?r1=text&tr1=1.57&r2=text&tr2=1.56&f=h fs/xfs/xfs_dir2_node.c - 1.58 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2_node.c.diff?r1=text&tr1=1.58&r2=text&tr2=1.57&f=h - the "aendp" arg to xfs_dir2_data_freescan is always NULL, remove it. Signed-off-by: Eric Sandeen From owner-xfs@oss.sgi.com Fri Mar 2 10:10:14 2007 Received: with ECARTIS (v1.0.0; list xfs); Fri, 02 Mar 2007 10:10:17 -0800 (PST) X-Spam-oss-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from lab41.emea.sgi.com (lab41.emea.sgi.com [144.253.75.41]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l22IAC6p021194 for ; Fri, 2 Mar 2007 10:10:14 -0800 Received: by lab41.emea.sgi.com (Postfix, from userid 1000) id 43F8D52AEA; Fri, 2 Mar 2007 18:29:06 +0000 (GMT) To: xfs@oss.sgi.com Subject: TAKE 961695 - remove more misc. unused args Message-Id: <20070302182906.43F8D52AEA@lab41.emea.sgi.com> Date: Fri, 2 Mar 2007 18:29:06 +0000 (GMT) From: lachlan@lab41.emea.sgi.com (Lachlan McIlroy) X-archive-position: 10755 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@lab41.emea.sgi.com Precedence: bulk X-list: xfs Content-Length: 961 Lines: 31 remove more misc. unused args Patch provided by Eric Sandeen. Signed-off-by: Eric Sandeen Date: Sat Mar 3 04:58:03 AEDT 2007 Workarea: vpn-emea-sw-emea-160-1.emea.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: lachlan sandeen@sandeen.net Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:28205a fs/xfs/xfs_vnodeops.c - 1.691 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.691&r2=text&tr2=1.690&f=h fs/xfs/xfs_log_recover.c - 1.317 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.317&r2=text&tr2=1.316&f=h fs/xfs/xfs_bmap.c - 1.366 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.366&r2=text&tr2=1.365&f=h - remove more misc. unused args Signed-off-by: Eric Sandeen From owner-xfs@oss.sgi.com Sun Mar 4 22:18:33 2007 Received: with ECARTIS (v1.0.0; list xfs); Sun, 04 Mar 2007 22:18:37 -0800 (PST) X-Spam-oss-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l256IT6p022537 for ; Sun, 4 Mar 2007 22:18:31 -0800 Received: from [134.14.55.84] (shark.melbourne.sgi.com [134.14.55.84]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06027; Mon, 5 Mar 2007 17:18:18 +1100 Message-ID: <45EBB613.5040803@sgi.com> Date: Mon, 05 Mar 2007 17:17:55 +1100 From: Donald Douwsma User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: Utako Kusaka CC: xfs@oss.sgi.com Subject: Re: [PATCH] repquota doesn't report correct space usage #2 References: <45E76138.2020202@sgi.com> <200703020634.AA05027@TNESG9305.tnes.nec.co.jp> In-Reply-To: <200703020634.AA05027@TNESG9305.tnes.nec.co.jp> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-archive-position: 10759 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Content-Length: 2045 Lines: 61 Hi Utako, That's closer to what I was thinking of but I'd prefer to do the manipulation separate to init. Putting it in xfs_qm_mount_quotas() minimizes the number of places changes are made to the superblock. We dont need to worry about group/project differences as a quotacheck is forced by XFS_QM_NEED_QUOTACHECK() if there are incompatibilities. Signed-off-by: Donald Douwsma --- a/fs/xfs/quota/xfs_qm.c 2007-03-05 16:50:11.000000000 +1100 +++ b/fs/xfs/quota/xfs_qm.c 2007-03-05 15:36:12.000000000 +1100 @@ -388,6 +388,17 @@ xfs_qm_mount_quotas( return XFS_ERROR(error); } } + /* + * If one type of quotas is off, then it will lose its + * quotachecked status, since we won't be doing accounting for + * that type anymore. + */ + if (!XFS_IS_UQUOTA_ON(mp)) { + mp->m_qflags &= ~XFS_UQUOTA_CHKD; + } + if (!(XFS_IS_GQUOTA_ON(mp) || XFS_IS_PQUOTA_ON(mp))) { + mp->m_qflags &= ~XFS_OQUOTA_CHKD; + } write_changes: /* Utako Kusaka wrote: > Hi, > > This new patch skips the quota check when the filesystem is mounted > with the same quota option. > > Signed-off-by: Utako Kusaka > --- > > --- fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 > +++ fs/xfs/quota/xfs_qm.c 2007-03-02 15:01:44.000000000 +0900 > @@ -1175,7 +1175,12 @@ xfs_qm_init_quotainfo( > qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); > do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); > > - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); > + if (XFS_IS_UQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT)) > + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD); > + if (XFS_IS_GQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT)) > + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); > + if (XFS_IS_PQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT)) > + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); > > /* > * We try to get the limits from the superuser's limits fields. From owner-xfs@oss.sgi.com Mon Mar 5 00:37:05 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 00:37:09 -0800 (PST) X-Spam-oss-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l258b26p028680 for ; Mon, 5 Mar 2007 00:37:05 -0800 Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.193]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id l258b0Nm012708 for ; Mon, 5 Mar 2007 17:37:00 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id l258axE05458 for xfs@oss.sgi.com; Mon, 5 Mar 2007 17:36:59 +0900 (JST) Received: from secsv3.tnes.nec.co.jp (tnesvc2.tnes.nec.co.jp [10.1.101.15]) by mailsv5.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id l258ax222741 for ; Mon, 5 Mar 2007 17:36:59 +0900 (JST) Received: from tnesvc2.tnes.nec.co.jp ([10.1.101.15]) by secsv3.tnes.nec.co.jp (ExpressMail 5.10) with SMTP id 20070305.163650.35902140 for ; Mon, 5 Mar 2007 16:36:50 +0900 Received: FROM tnessv1.tnes.nec.co.jp BY tnesvc2.tnes.nec.co.jp ; Mon Mar 05 16:36:50 2007 +0900 Received: from rifu.bsd.tnes.nec.co.jp (rifu.bsd.tnes.nec.co.jp [10.1.104.1]) by tnessv1.tnes.nec.co.jp (Postfix) with ESMTP id 9C692AE4B3; Mon, 5 Mar 2007 17:36:55 +0900 (JST) Received: from TNESG9305.tnes.nec.co.jp (TNESG9305.bsd.tnes.nec.co.jp [10.1.104.199]) by rifu.bsd.tnes.nec.co.jp (8.12.11/3.7W/BSD-TNES-MX01) with SMTP id l258awb4003280; Mon, 5 Mar 2007 17:36:58 +0900 Message-Id: <200703050836.AA05033@TNESG9305.tnes.nec.co.jp> Date: Mon, 05 Mar 2007 17:36:50 +0900 To: donaldd@sgi.com Cc: xfs@oss.sgi.com Subject: Re: [PATCH] repquota doesn't report correct space usage #2 From: Utako Kusaka In-Reply-To: <45EBB613.5040803@sgi.com> References: <45EBB613.5040803@sgi.com> MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Content-Type: text/plain; charset=iso-2022-jp X-archive-position: 10760 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: utako@tnes.nec.co.jp Precedence: bulk X-list: xfs Content-Length: 2229 Lines: 66 Hi Donald, I see. I tested your patch and it was no problem. Mon, 05 Mar 2007 17:17:55 +1100 Donald Douwsma wrote: >Hi Utako, > >That's closer to what I was thinking of but I'd prefer to do the >manipulation separate to init. Putting it in xfs_qm_mount_quotas() >minimizes the number of places changes are made to the superblock. > >We dont need to worry about group/project differences as a >quotacheck is forced by XFS_QM_NEED_QUOTACHECK() if there are >incompatibilities. > > >Signed-off-by: Donald Douwsma > >--- a/fs/xfs/quota/xfs_qm.c 2007-03-05 16:50:11.000000000 +1100 >+++ b/fs/xfs/quota/xfs_qm.c 2007-03-05 15:36:12.000000000 +1100 >@@ -388,6 +388,17 @@ xfs_qm_mount_quotas( > return XFS_ERROR(error); > } > } >+ /* >+ * If one type of quotas is off, then it will lose its >+ * quotachecked status, since we won't be doing accounting for >+ * that type anymore. >+ */ >+ if (!XFS_IS_UQUOTA_ON(mp)) { >+ mp->m_qflags &= ~XFS_UQUOTA_CHKD; >+ } >+ if (!(XFS_IS_GQUOTA_ON(mp) || XFS_IS_PQUOTA_ON(mp))) { >+ mp->m_qflags &= ~XFS_OQUOTA_CHKD; >+ } > > write_changes: > /* > > >Utako Kusaka wrote: >> Hi, >> >> This new patch skips the quota check when the filesystem is mounted >> with the same quota option. >> >> Signed-off-by: Utako Kusaka >> --- >> >> --- fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900 >> +++ fs/xfs/quota/xfs_qm.c 2007-03-02 15:01:44.000000000 +0900 >> @@ -1175,7 +1175,12 @@ xfs_qm_init_quotainfo( >> qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); >> do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t)); >> >> - mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); >> + if (XFS_IS_UQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT)) >> + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD); >> + if (XFS_IS_GQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT)) >> + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); >> + if (XFS_IS_PQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT)) >> + mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD); >> >> /* >> * We try to get the limits from the superuser's limits fields. From owner-xfs@oss.sgi.com Mon Mar 5 06:45:18 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 06:45:26 -0800 (PST) X-Spam-oss-Status: No, score=3.1 required=5.0 tests=AWL,BAYES_99,SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25EjG6p009021 for ; Mon, 5 Mar 2007 06:45:18 -0800 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HOEQw-0005Qh-A2 for linux-xfs@oss.sgi.com; Mon, 05 Mar 2007 15:45:02 +0100 Received: from pool-71-163-240-183.washdc.fios.verizon.net ([71.163.240.183]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Mar 2007 15:45:02 +0100 Received: from chaweber by pool-71-163-240-183.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Mar 2007 15:45:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: linux-xfs@oss.sgi.com From: Chuck Weber Subject: xfs partial dismount issue Date: Mon, 5 Mar 2007 13:13:28 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.163.240.183 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061027 Firefox/2.0) X-archive-position: 10761 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chaweber@gmail.com Precedence: bulk X-list: xfs Content-Length: 4494 Lines: 110 Hi everyone, I have a long running problem perhaps you can help with. I will include as much detail as I can. I can set up a spare server-disk set for testing if you have any bright ideas. We use XFS for samba and nfs on x86_64 Fedora Proliant DL585/385 servers. Our busiest server has disk partitions go away. The other servers do not show this behavior ever. The partitions show as mounted, but access to the partition just hangs. Open file count, process count and load average rise until the server becomes very unresponsive. Even if we catch it before the high load average, because it cannot unmount the partition, it must be powered off and back on to restart. Upon restart all partitions mount properly and everything is fine for days or months. There is nothing in log files that I have noticed. With sar, I can track the files open and process count rise. I believed this to be a hardware issue and embarked on replacing parts along the partition chain. I recently replaced the actual server and saw the same issue the next week, so I don't think it is hardware. The problem is related to XFS/Samba/acl/load usage I think, as I have 2-8 directories set up as samba shares in a given partition. When the problem occurs, first I cannot access a directory, shortly afterward I cannot access the entire partition. This problem has affected 3 partitions so far. Over the last 3 months this has occurred every week or 2. Configuration: Proliant DL585, 8GB ram, 2 proc with 3 smartarray 6404 4 channel U320 raid cards. 6 MSA30 dual channel disk carriers with 14 drives each in raid with 2 parity stripes. We started with 72 GB drives and have updated 1 carrier each with 146 GB and 300 GB drives. Each disk carrier is mounted as a single partition, store1 through store6. Example of last mounting problem partition below: /dev/cciss/c3d0p1 on /share/store3 type xfs (rw,logbufs=8) /dev/cciss/c3d0p1 814G 677G 138G 84% /share/store3 meta-data=/dev/cciss/c3d0p1 isize=2048 agcount=32, agsize=6668186 blks = sectsz=512 data = bsize=4096 blocks=213381952, 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 realtime =none extsz=65536 blocks=0, rtextents=0 I have added nobarrier and noatime mount options recently from the list but don't see that they affect the problem. For the 300 Gb disk carrier I am using LVM as it runs into a 6404 2TB limit but I only am using 3-400 GB on it so far. All servers are running x86_64 Fedora so I hope not to have the stack issue. The Dl585/3raid controllers/6 disk chassis without problems runs Fedora Core 2 and acts as an NFS server to some computational computers. Another DL585 with only 1 raid controller acts as windows home directory and mail store server. It runs Fedora Core 4/ samba 3.023a. These servers would show the same xfs_info as above on their raid partitions. Both of these servers have no problems and very long uptimes. Our problem server started as Fedora Core 2 and whatever samba we used then. When it first had problems, I upgraded to FC 4 and then to FC5 with samba 3.0.24. I have applied all current HP firmware throughout this process. I have changed out power, disks, disk carriers, scsi cables, and raid controllers. I finally swapped the DL585 for a DL385 with 4 processors and 16 GB ram. None of this made a difference. Fedora core 5 2.6.18 and 19 kernels dumped within 1 day of booting with a spinlock error, so I am now running the latest FC5 2.6.17 kernel, which does include the 17.13 patch. I have run HP diagnostics for hours with no results. I have taken the active server offline and run xfs_repair on the partitions. I have reformatted one of the partitions. I have been formatting the partitions with an inode size of 2k and no other options. Current rpms, but note that I have used different versions on this server from FC2 to present and downloaded/built acl/attr/xfsprogs at times all with no difference in my problem: acl-2.2.34-1.2 attr-2.4.28-1.2 samba-3.0.24-1.fc5 xfsprogs-2.7.3-1.2.1 kernel-2.6.17-1.2187_FC5 I could move to ext3, but in my one recent test it ran into trouble just copying acled files from an XFS partition to it. XFS performance seems quite good, with my limiting factor being AD user/group id times. All I can think of now is some resource/tuning/formatting/kernel change. I would appreciate any suggestions you can come up with. Thanks, Chuck From owner-xfs@oss.sgi.com Mon Mar 5 08:01:53 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 08:01:59 -0800 (PST) X-Spam-oss-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_50, SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25G1q6p025206 for ; Mon, 5 Mar 2007 08:01:53 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l25G1asf005842; Mon, 5 Mar 2007 11:01:37 -0500 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l25G1WHW003104; Mon, 5 Mar 2007 11:01:32 -0500 Received: from [10.15.80.10] (neon.msp.redhat.com [10.15.80.10]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l25G1US4022337; Mon, 5 Mar 2007 11:01:31 -0500 Message-ID: <45EC3DEA.3000105@sandeen.net> Date: Mon, 05 Mar 2007 09:57:30 -0600 From: Eric Sandeen User-Agent: Thunderbird 1.5.0.9 (X11/20070212) MIME-Version: 1.0 To: Chuck Weber CC: linux-xfs@oss.sgi.com Subject: Re: xfs partial dismount issue References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-archive-position: 10762 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Content-Length: 1196 Lines: 27 Chuck Weber wrote: > Hi everyone, I have a long running problem perhaps you can help with. I > will include as much detail as I can. I can set up a spare server-disk > set for testing if you have any bright ideas. > > We use XFS for samba and nfs on x86_64 Fedora Proliant DL585/385 > servers. Our busiest server has disk partitions go away. What do you mean by this, exactly? The partitions themselves go away, or are you talking about the problem described below where processes start hanging? > The other > servers do not show this behavior ever. The partitions show as mounted, > but access to the partition just hangs. Open file count, process count > and load average rise until the server becomes very unresponsive. Even > if we catch it before the high load average, because it cannot unmount > the partition, it must be powered off and back on to restart. Upon > restart all partitions mount properly and everything is fine for days or > months. There is nothing in log files that I have noticed. With sar, I > can track the files open and process count rise. Maybe try sysrq-t, to capture all backtraces when it's in this state, and see where the various threads are at. -Eric From owner-xfs@oss.sgi.com Mon Mar 5 08:28:45 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 08:28:51 -0800 (PST) X-Spam-oss-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.0-pre1-r499012 Received: from lab41.emea.sgi.com (lab41.emea.sgi.com [144.253.75.41]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25GSi6p002278 for ; Mon, 5 Mar 2007 08:28:44 -0800 Received: by lab41.emea.sgi.com (Postfix, from userid 1000) id 38B2552AEE; Mon, 5 Mar 2007 16:47:48 +0000 (GMT) To: xfs@oss.sgi.com Subject: TAKE 961696 - reducing the number of random number functions. Message-Id: <20070305164748.38B2552AEE@lab41.emea.sgi.com> Date: Mon, 5 Mar 2007 16:47:48 +0000 (GMT) From: lachlan@lab41.emea.sgi.com (Lachlan McIlroy) X-archive-position: 10763 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@lab41.emea.sgi.com Precedence: bulk X-list: xfs Content-Length: 1271 Lines: 32 reducing the number of random number functions. Patch provided by Joe Perches Signed-off-by: Joe Perches Date: Tue Mar 6 03:25:54 AEDT 2007 Workarea: vpn-emea-sw-emea-160-34.emea.sgi.com:/home/lachlan/isms/2.6.x-xfs Inspected by: lachlan joe@perches.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:28209a fs/xfs/xfs_error.c - 1.56 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_error.c.diff?r1=text&tr1=1.56&r2=text&tr2=1.55&f=h fs/xfs/xfs_alloc.c - 1.185 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_alloc.c.diff?r1=text&tr1=1.185&r2=text&tr2=1.184&f=h fs/xfs/support/debug.h - 1.17 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/support/debug.h.diff?r1=text&tr1=1.17&r2=text&tr2=1.16&f=h fs/xfs/support/debug.c - 1.37 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/support/debug.c.diff?r1=text&tr1=1.37&r2=text&tr2=1.36&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.56 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.56&r2=text&tr2=1.55&f=h - reducing the number of random number functions. Signed-off-by: Joe Perches From owner-xfs@oss.sgi.com Mon Mar 5 10:26:20 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 10:26:28 -0800 (PST) X-Spam-oss-Status: No, score=0.0 required=5.0 tests=BAYES_50,SPF_HELO_PASS autolearn=ham version=3.2.0-pre1-r499012 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25IQI6p022416 for ; Mon, 5 Mar 2007 10:26:19 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HOHsf-0007SD-KE for linux-xfs@oss.sgi.com; Mon, 05 Mar 2007 19:25:53 +0100 Received: from fernwood-arbiter-b.net.nih.gov ([128.231.88.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Mar 2007 19:25:53 +0100 Received: from chaweber by fernwood-arbiter-b.net.nih.gov with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Mar 2007 19:25:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: linux-xfs@oss.sgi.com From: Charles Weber Subject: Re: xfs partial dismount issue Date: Mon, 5 Mar 2007 18:25:03 +0000 (UTC) Message-ID: References: <45EC3DEA.3000105@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 128.231.88.7 (Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1) Gecko/20061027 Firefox/2.0) X-archive-position: 10764 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chaweber@gmail.com Precedence: bulk X-list: xfs Content-Length: 1836 Lines: 44 Eric Sandeen sandeen.net> writes: > > Chuck Weber wrote: > > Hi everyone, I have a long running problem perhaps you can help with. I > > will include as much detail as I can. I can set up a spare server-disk > > set for testing if you have any bright ideas. > > > > We use XFS for samba and nfs on x86_64 Fedora Proliant DL585/385 > > servers. Our busiest server has disk partitions go away. > > What do you mean by this, exactly? The partitions themselves go away, > or are you talking about the problem described below where processes > start hanging? > Here is an example partition (1 of 6 or more xfs storage only). /share/store3 with samba shares on /share/store3/lls, lds, lxs and so on. I will get a call saying my groups share (lxs) is no longer accessable. I ssh into server and can ls /share/store3 but ls will hang when I ls /share/store3/lxs. Shortly there after ls will hang for the root or any directory on the partition. Other partitions will be fine and other samba shares will be fine until the queued up process load bogs the server down. > > The other > > servers do not show this behavior ever. The partitions show as mounted, > > but access to the partition just hangs. Open file count, process count > > and load average rise until the server becomes very unresponsive. Even > > if we catch it before the high load average, because it cannot unmount > > the partition, it must be powered off and back on to restart. Upon > > restart all partitions mount properly and everything is fine for days or > > months. There is nothing in log files that I have noticed. With sar, I > > can track the files open and process count rise. > > Maybe try sysrq-t, to capture all backtraces when it's in this state, > and see where the various threads are at. > OK I'll look over sysrq > -Eric > > From owner-xfs@oss.sgi.com Mon Mar 5 12:47:03 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 12:47:07 -0800 (PST) X-Spam-oss-Status: No, score=2.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_PSBL autolearn=no version=3.2.0-pre1-r499012 Received: from smtp2.mundo-r.com (smtp6.mundo-r.com [212.51.32.153]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25Kl16p019638 for ; Mon, 5 Mar 2007 12:47:02 -0800 Received: from cm44039.red83-165.mundo-r.com (HELO [192.168.1.36]) ([83.165.44.39]) by smtp2.mundo-r.com with ESMTP; 05 Mar 2007 21:36:55 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADoO7EVTpSwn/2dsb2JhbAAN X-IronPort-AV: i="4.14,251,1170630000"; d="scan'208"; a="62726853:sNHT15148644" Message-ID: <45EC7F67.3050308@mundo-r.com> Date: Mon, 05 Mar 2007 21:36:55 +0100 From: Antonio Trueba User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: xfs@oss.sgi.com Subject: Spanish and Galician translation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 10765 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: atrueba@mundo-r.com Precedence: bulk X-list: xfs Content-Length: 148 Lines: 8 Hello, I'd like to know if someone is already translating XFS to Spanish (es) or Galician (gl). If not, I'd like to do both myself. Regards. -- From owner-xfs@oss.sgi.com Mon Mar 5 13:19:34 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 13:19:41 -0800 (PST) X-Spam-oss-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_50, FH_HOST_EQ_D_D_D_D,FH_HOST_EQ_D_D_D_DB,RDNS_DYNAMIC autolearn=no version=3.2.0-pre1-r499012 Received: from mail.atipa.com (125.14.124.24.cm.sunflower.com [24.124.14.125]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l25LJU6p024539 for ; Mon, 5 Mar 2007 13:19:33 -0800 Received: from [192.168.100.181] ([192.168.100.181]) by mail.atipa.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 5 Mar 2007 15:09:20 -0600 Message-ID: <45EC868A.4060607@atipa.com> Date: Mon, 05 Mar 2007 15:07:22 -0600 From: Roger Heflin User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: Charles Weber CC: linux-xfs@oss.sgi.com Subject: Re: xfs partial dismount issue References: <45EC3DEA.3000105@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Mar 2007 21:09:20.0046 (UTC) FILETIME=[8AA304E0:01C75F6A] X-archive-position: 10766 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: rheflin@atipa.com Precedence: bulk X-list: xfs Content-Length: 2097 Lines: 43 Charles Weber wrote: > Eric Sandeen sandeen.net> writes: > >> Chuck Weber wrote: >>> Hi everyone, I have a long running problem perhaps you can help with. I >>> will include as much detail as I can. I can set up a spare server-disk >>> set for testing if you have any bright ideas. >>> >>> We use XFS for samba and nfs on x86_64 Fedora Proliant DL585/385 >>> servers. Our busiest server has disk partitions go away. >> What do you mean by this, exactly? The partitions themselves go away, >> or are you talking about the problem described below where processes >> start hanging? >> > Here is an example partition (1 of 6 or more xfs storage only). > /share/store3 with samba shares on /share/store3/lls, lds, lxs and so on. > I will get a call saying my groups share (lxs) is no longer accessable. I ssh > into server and can ls /share/store3 but ls will hang when I ls > /share/store3/lxs. Shortly there after ls will hang for the root or any > directory on the partition. Other partitions will be fine and other samba shares > will be fine until the queued up process load bogs the server down. > Charles, I have seen what may be a similar issue on SLES9SP2, we had 1 xfs partition, and under certain conditions it would stop responding, all non-xfs partitions were ok, and everything was fine after a reboot. Under sysrq-t it appeared to me that 2 separate processes were calling fsync and were causing each other to deadlock (and locking all others out of changing the xfs partition). I was not able to determine exactly what the underlying bug was, but all of the hung processes were waiting on locks in at least several widely different parts of the xfs and kernel code, and adjusting the application to not fsync has apparently resulted in the deadlock not occuring. In this case there were multiple (2-4) different instances of the application calling fsync apparently sometimes at close to the same time. With the given application the failure was almost a certainly on one machine (of 100) running the application overnight. Roger From owner-xfs@oss.sgi.com Mon Mar 5 18:09:37 2007 Received: with ECARTIS (v1.0.0; list xfs); Mon, 05 Mar 2007 18:09:43 -0800 (PST) X-Spam-oss-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50, DATE_IN_FUTURE_06_12 autolearn=no version=3.2.0-pre1-r499012 Received: from postoffice.aconex.com (mail.app.aconex.com [203.89.192.138]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l2629a6p026087 for ; Mon, 5 Mar 2007 18:09:37 -0800 Received: from edge (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 7B413AAC319; Tue, 6 Mar 2007 12:50:24 +1100 (EST) Subject: Re: Spanish and Galician translation From: Nathan Scott Reply-To: nscott@aconex.com To: Antonio Trueba Cc: xfs@oss.sgi.com In-Reply-To: <45EC7F67.3050308@mundo-r.com> References: <45EC7F67.3050308@mundo-r.com> Content-Type: text/plain Organization: Aconex Date: Tue, 06 Mar 2007 23:06:24 +1100 Message-Id: <1173182784.5051.7.camel@edge> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-archive-position: 10767 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs Content-Length: 591 Lines: 19 On Mon, 2007-03-05 at 21:36 +0100, Antonio Trueba wrote: > Hello, > > I'd like to know if someone is already translating XFS to Spanish (es) > or Galician (gl). If not, I'd like to do both myself. Go for it, noone else if working on those AFAIK. You should probably rebuild the translation database ("cd xfsprogs/po && make xfsprogs.pot" IIRC) first, its probably not been updated in awhile, and there's new strings in xfs_repair at least. Let me know if theres any issues getting it working - I know a little bit about the build system in this area, so can help. cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Mar 6 03:10:46 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 06 Mar 2007 03:10:50 -0800 (PST) X-Spam-oss-Status: No, score=1.0 required=5.0 tests=BAYES_60,HTML_MESSAGE autolearn=ham version=3.2.0-pre1-r499012 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l26BAh6p018947 for ; Tue, 6 Mar 2007 03:10:45 -0800 Received: by ug-out-1314.google.com with SMTP id a2so138217ugf for ; Tue, 06 Mar 2007 03:10:43 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=T8qN4YwWbuyH9Uzh210YVY25zD5LuHjZlS1YcqS0h0ExD5ydzyClEsCCIfC7OnLrnE3ybZWOrLS+4YV5nzJK2gToEm0LzBs71q63MfBImDDsTUsxpGJ7AWahCsFD3dXgk9EjG9A3YnebfgKzoBGtKiHBe5/y/cAZswPBzNNUUyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=rJmS/SfwhBh8POc7SoA6POkvp4bjA3O4vrvOADAVXgIMKDyNnBHqorKuDQa+Z99BcX5uSxRmWz8/h8zzosPF8hD4LxTY3hcpO05FnZn0wwTtU4NmjNYoQnD0bCuDSnLnCA6tRU3xxZKp7DOj5k3V/LjxEylLWFFg0x+EM0bRCoY= Received: by 10.114.166.1 with SMTP id o1mr1649849wae.1173176087391; Tue, 06 Mar 2007 02:14:47 -0800 (PST) Received: by 10.114.13.6 with HTTP; Tue, 6 Mar 2007 02:14:47 -0800 (PST) Message-ID: <5d96567b0703060214n45838ceh9375545613a1557c@mail.gmail.com> Date: Tue, 6 Mar 2007 12:14:47 +0200 From: "Raz Ben-Jehuda(caro)" To: linux-xfs@oss.sgi.com Subject: xfs_repair and extents size MIME-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit X-archive-position: 10768 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: raziebe@gmail.com Precedence: bulk X-list: xfs Content-Length: 517 Lines: 18 Hello. I am having some problems with extents sizes and xfs_repair. Problem is that my files and directories are not real time files and i am setting the extent size to 1MB. I have managed to set the extent size to 1M by setting parent directory extent to 1M and setting the inherit flag on. But if I am running xfs_repair all extents on all directories in the file system are being reset to zero. I am using last xfsprogs 2.8.18 downloaded from sgi web site. thank you -- Raz [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Mar 6 15:59:41 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 06 Mar 2007 15:59:45 -0800 (PST) X-Spam-oss-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l26Nxc6p004839 for ; Tue, 6 Mar 2007 15:59:39 -0800 Received: from pcbnaujok (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA13317; Wed, 7 Mar 2007 10:48:00 +1100 Message-Id: <200703062348.KAA13317@larry.melbourne.sgi.com> From: "Barry Naujok" To: "'Raz Ben-Jehuda\(caro\)'" , Subject: RE: xfs_repair and extents size Date: Wed, 7 Mar 2007 10:54:24 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <5d96567b0703060214n45838ceh9375545613a1557c@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acdf4FGeYt1jC7C8RiOyziv7RZ2ISQAalszQ X-archive-position: 10770 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@melbourne.sgi.com Precedence: bulk X-list: xfs Content-Length: 947 Lines: 35 Hi Raz, It's quite possible xfs_repair hasn't been updated to handle extent hints on directories and files. I will investigate this. Regards, Barry. > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] > On Behalf Of Raz Ben-Jehuda(caro) > Sent: Tuesday, 6 March 2007 9:15 PM > To: linux-xfs@oss.sgi.com > Subject: xfs_repair and extents size > > Hello. > I am having some problems with extents sizes and xfs_repair. > Problem is that my files and directories are not real time files > and i am setting the extent size to 1MB. I have managed to > set the extent size to 1M by setting parent directory extent > to 1M and setting the inherit flag on. > But if I am running xfs_repair all extents on all directories in > the file system are being reset to zero. > I am using last xfsprogs 2.8.18 downloaded from sgi web > site. > > thank you > -- > Raz > > > [[HTML alternate version deleted]] > > From owner-xfs@oss.sgi.com Tue Mar 6 19:18:16 2007 Received: with ECARTIS (v1.0.0; list xfs); Tue, 06 Mar 2007 19:18:23 -0800 (PST) X-Spam-oss-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50, J_CHICKENPOX_45,J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_63, J_CHICKENPOX_65,SPF_HELO_PASS autolearn=no version=3.2.0-pre1-r499012 Received: from sandeen.net (sandeen.net [209.173.210.139]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l273ID6p018016 for ; Tue, 6 Mar 2007 19:18:15 -0800 Received: from [10.0.0.4] (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 525101807DECF for ; Tue, 6 Mar 2007 21:18:12 -0600 (CST) Message-ID: <45EE2EF3.8090707@sandeen.net> Date: Tue, 06 Mar 2007 21:18:11 -0600 From: Eric Sandeen User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: xfs@oss.sgi.com Subject: [PATCH] get rid of fname[] for tracing functions Content-Type: multipart/mixed; boundary="------------040201070004000506070208" X-archive-position: 10771 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Content-Length: 50903 Lines: 1385 This is a multi-part message in MIME format. --------------040201070004000506070208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit this gets rid of the #ifdef XFS_BMAP_TRACE static char fname[] = "xfs_iextents_copy"; #endif ugliness littered in the bmap code for tracing, and instead just uses gcc's __FUNCTION__, which never gets out of sync with the actual function name.... It also makes some of this tracing more consistently use the #define XFS_BMBT_TRACE_ARGBI(c,b,i) \ xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__) type constructs, to automatically pick up the gcc extensions. the vn tracing could probably get a similar treatment, so that every call to vn_trace_foo wouldn't have to include a function name and a __builtin_return_address, but could be done via macros... it's currently a mishmash of __FUNCTION__ and "function" *shrug* what do you think? -Eric --------------040201070004000506070208 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="no_fname.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="no_fname.patch" Get rid of fname[] arrays for tracing code, and just use gcc's __FUNCTION__ instead. xfs_alloc.c | 53 ++-------- xfs_bmap.c | 266 +++++++++++++++++++++++-------------------------------- xfs_bmap.h | 6 - xfs_bmap_btree.c | 88 +++--------------- xfs_inode.c | 8 - 5 files changed, 149 insertions(+), 272 deletions(-) Signed-off-by: Eric Sandeen Index: linux/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux.orig/fs/xfs/xfs_bmap_btree.c +++ linux/fs/xfs/xfs_bmap_btree.c @@ -76,7 +76,7 @@ static char EXIT[] = "exit"; */ STATIC void xfs_bmbt_trace_enter( - char *func, + const char *func, xfs_btree_cur_t *cur, char *s, int type, @@ -117,7 +117,7 @@ xfs_bmbt_trace_enter( */ STATIC void xfs_bmbt_trace_argbi( - char *func, + const char *func, xfs_btree_cur_t *cur, xfs_buf_t *b, int i, @@ -134,7 +134,7 @@ xfs_bmbt_trace_argbi( */ STATIC void xfs_bmbt_trace_argbii( - char *func, + const char *func, xfs_btree_cur_t *cur, xfs_buf_t *b, int i0, @@ -153,7 +153,7 @@ xfs_bmbt_trace_argbii( */ STATIC void xfs_bmbt_trace_argfffi( - char *func, + const char *func, xfs_btree_cur_t *cur, xfs_dfiloff_t o, xfs_dfsbno_t b, @@ -172,7 +172,7 @@ xfs_bmbt_trace_argfffi( */ STATIC void xfs_bmbt_trace_argi( - char *func, + const char *func, xfs_btree_cur_t *cur, int i, int line) @@ -188,7 +188,7 @@ xfs_bmbt_trace_argi( */ STATIC void xfs_bmbt_trace_argifk( - char *func, + const char *func, xfs_btree_cur_t *cur, int i, xfs_fsblock_t f, @@ -206,7 +206,7 @@ xfs_bmbt_trace_argifk( */ STATIC void xfs_bmbt_trace_argifr( - char *func, + const char *func, xfs_btree_cur_t *cur, int i, xfs_fsblock_t f, @@ -235,7 +235,7 @@ xfs_bmbt_trace_argifr( */ STATIC void xfs_bmbt_trace_argik( - char *func, + const char *func, xfs_btree_cur_t *cur, int i, xfs_bmbt_key_t *k, @@ -255,7 +255,7 @@ xfs_bmbt_trace_argik( */ STATIC void xfs_bmbt_trace_cursor( - char *func, + const char *func, xfs_btree_cur_t *cur, char *s, int line) @@ -274,21 +274,21 @@ xfs_bmbt_trace_cursor( } #define XFS_BMBT_TRACE_ARGBI(c,b,i) \ - xfs_bmbt_trace_argbi(fname, c, b, i, __LINE__) + xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__) #define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ - xfs_bmbt_trace_argbii(fname, c, b, i, j, __LINE__) + xfs_bmbt_trace_argbii(__FUNCTION__, c, b, i, j, __LINE__) #define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ - xfs_bmbt_trace_argfffi(fname, c, o, b, i, j, __LINE__) + xfs_bmbt_trace_argfffi(__FUNCTION__, c, o, b, i, j, __LINE__) #define XFS_BMBT_TRACE_ARGI(c,i) \ - xfs_bmbt_trace_argi(fname, c, i, __LINE__) + xfs_bmbt_trace_argi(__FUNCTION__, c, i, __LINE__) #define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ - xfs_bmbt_trace_argifk(fname, c, i, f, s, __LINE__) + xfs_bmbt_trace_argifk(__FUNCTION__, c, i, f, s, __LINE__) #define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ - xfs_bmbt_trace_argifr(fname, c, i, f, r, __LINE__) + xfs_bmbt_trace_argifr(__FUNCTION__, c, i, f, r, __LINE__) #define XFS_BMBT_TRACE_ARGIK(c,i,k) \ - xfs_bmbt_trace_argik(fname, c, i, k, __LINE__) + xfs_bmbt_trace_argik(__FUNCTION__, c, i, k, __LINE__) #define XFS_BMBT_TRACE_CURSOR(c,s) \ - xfs_bmbt_trace_cursor(fname, c, s, __LINE__) + xfs_bmbt_trace_cursor(__FUNCTION__, c, s, __LINE__) #else #define XFS_BMBT_TRACE_ARGBI(c,b,i) #define XFS_BMBT_TRACE_ARGBII(c,b,i,j) @@ -318,9 +318,6 @@ xfs_bmbt_delrec( xfs_fsblock_t bno; /* fs-relative block number */ xfs_buf_t *bp; /* buffer for block */ int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_delrec"; -#endif int i; /* loop counter */ int j; /* temp state */ xfs_bmbt_key_t key; /* bmap btree key */ @@ -694,9 +691,6 @@ xfs_bmbt_insrec( xfs_bmbt_block_t *block; /* bmap btree block */ xfs_buf_t *bp; /* buffer for block */ int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_insrec"; -#endif int i; /* loop index */ xfs_bmbt_key_t key; /* bmap btree key */ xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */ @@ -881,9 +875,6 @@ xfs_bmbt_killroot( #ifdef DEBUG int error; #endif -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_killroot"; -#endif int i; xfs_bmbt_key_t *kp; xfs_inode_t *ip; @@ -973,9 +964,6 @@ xfs_bmbt_log_keys( int kfirst, int klast) { -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_log_keys"; -#endif xfs_trans_t *tp; XFS_BMBT_TRACE_CURSOR(cur, ENTRY); @@ -1012,9 +1000,6 @@ xfs_bmbt_log_ptrs( int pfirst, int plast) { -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_log_ptrs"; -#endif xfs_trans_t *tp; XFS_BMBT_TRACE_CURSOR(cur, ENTRY); @@ -1055,9 +1040,6 @@ xfs_bmbt_lookup( xfs_daddr_t d; xfs_sfiloff_t diff; int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_lookup"; -#endif xfs_fsblock_t fsbno=0; int high; int i; @@ -1195,9 +1177,6 @@ xfs_bmbt_lshift( int *stat) /* success/failure */ { int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_lshift"; -#endif #ifdef DEBUG int i; /* loop counter */ #endif @@ -1331,9 +1310,6 @@ xfs_bmbt_rshift( int *stat) /* success/failure */ { int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_rshift"; -#endif int i; /* loop counter */ xfs_bmbt_key_t key; /* bmap btree key */ xfs_buf_t *lbp; /* left buffer pointer */ @@ -1492,9 +1468,6 @@ xfs_bmbt_split( { xfs_alloc_arg_t args; /* block allocation args */ int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_split"; -#endif int i; /* loop counter */ xfs_fsblock_t lbno; /* left sibling block number */ xfs_buf_t *lbp; /* left buffer pointer */ @@ -1641,9 +1614,6 @@ xfs_bmbt_updkey( #ifdef DEBUG int error; #endif -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_updkey"; -#endif xfs_bmbt_key_t *kp; int ptr; @@ -1712,9 +1682,6 @@ xfs_bmbt_decrement( xfs_bmbt_block_t *block; xfs_buf_t *bp; int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_decrement"; -#endif xfs_fsblock_t fsbno; int lev; xfs_mount_t *mp; @@ -1785,9 +1752,6 @@ xfs_bmbt_delete( int *stat) /* success/failure */ { int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_delete"; -#endif int i; int level; @@ -2000,9 +1964,6 @@ xfs_bmbt_increment( xfs_bmbt_block_t *block; xfs_buf_t *bp; int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_increment"; -#endif xfs_fsblock_t fsbno; int lev; xfs_mount_t *mp; @@ -2080,9 +2041,6 @@ xfs_bmbt_insert( int *stat) /* success/failure */ { int error; /* error return value */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_insert"; -#endif int i; int level; xfs_fsblock_t nbno; @@ -2142,9 +2100,6 @@ xfs_bmbt_log_block( int fields) { int first; -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_log_block"; -#endif int last; xfs_trans_t *tp; static const short offsets[] = { @@ -2181,9 +2136,6 @@ xfs_bmbt_log_recs( { xfs_bmbt_block_t *block; int first; -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_log_recs"; -#endif int last; xfs_bmbt_rec_t *rp; xfs_trans_t *tp; @@ -2245,9 +2197,6 @@ xfs_bmbt_newroot( xfs_bmbt_key_t *ckp; /* child key pointer */ xfs_bmbt_ptr_t *cpp; /* child ptr pointer */ int error; /* error return code */ -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_newroot"; -#endif #ifdef DEBUG int i; /* loop counter */ #endif @@ -2630,9 +2579,6 @@ xfs_bmbt_update( xfs_bmbt_block_t *block; xfs_buf_t *bp; int error; -#ifdef XFS_BMBT_TRACE - static char fname[] = "xfs_bmbt_update"; -#endif xfs_bmbt_key_t key; int ptr; xfs_bmbt_rec_t *rp; Index: linux/fs/xfs/xfs_alloc.c =================================================================== --- linux.orig/fs/xfs/xfs_alloc.c +++ linux/fs/xfs/xfs_alloc.c @@ -55,17 +55,17 @@ xfs_alloc_search_busy(xfs_trans_t *tp, ktrace_t *xfs_alloc_trace_buf; #define TRACE_ALLOC(s,a) \ - xfs_alloc_trace_alloc(fname, s, a, __LINE__) + xfs_alloc_trace_alloc(__FUNCTION__, s, a, __LINE__) #define TRACE_FREE(s,a,b,x,f) \ - xfs_alloc_trace_free(fname, s, mp, a, b, x, f, __LINE__) + xfs_alloc_trace_free(__FUNCTION__, s, mp, a, b, x, f, __LINE__) #define TRACE_MODAGF(s,a,f) \ - xfs_alloc_trace_modagf(fname, s, mp, a, f, __LINE__) -#define TRACE_BUSY(fname,s,ag,agb,l,sl,tp) \ - xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__) -#define TRACE_UNBUSY(fname,s,ag,sl,tp) \ - xfs_alloc_trace_busy(fname, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__) -#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp) \ - xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__) + xfs_alloc_trace_modagf(__FUNCTION__, s, mp, a, f, __LINE__) +#define TRACE_BUSY(__FUNCTION__,s,ag,agb,l,sl,tp) \ + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__) +#define TRACE_UNBUSY(__FUNCTION__,s,ag,sl,tp) \ + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__) +#define TRACE_BUSYSEARCH(__FUNCTION__,s,ag,agb,l,sl,tp) \ + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__) #else #define TRACE_ALLOC(s,a) #define TRACE_FREE(s,a,b,x,f) @@ -420,7 +420,7 @@ xfs_alloc_read_agfl( */ STATIC void xfs_alloc_trace_alloc( - char *name, /* function tag string */ + const char *name, /* function tag string */ char *str, /* additional string */ xfs_alloc_arg_t *args, /* allocation argument structure */ int line) /* source line number */ @@ -453,7 +453,7 @@ xfs_alloc_trace_alloc( */ STATIC void xfs_alloc_trace_free( - char *name, /* function tag string */ + 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 */ @@ -479,7 +479,7 @@ xfs_alloc_trace_free( */ STATIC void xfs_alloc_trace_modagf( - char *name, /* function tag string */ + 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 */ @@ -507,7 +507,7 @@ xfs_alloc_trace_modagf( STATIC void xfs_alloc_trace_busy( - char *name, /* function tag string */ + 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 */ @@ -549,9 +549,6 @@ xfs_alloc_ag_vextent( xfs_alloc_arg_t *args) /* argument structure for allocation */ { int error=0; -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_ag_vextent"; -#endif ASSERT(args->minlen > 0); ASSERT(args->maxlen > 0); @@ -635,9 +632,6 @@ xfs_alloc_ag_vextent_exact( xfs_agblock_t fbno; /* start block of found extent */ xfs_agblock_t fend; /* end block of found extent */ xfs_extlen_t flen; /* length of found extent */ -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_ag_vextent_exact"; -#endif int i; /* success/failure of operation */ xfs_agblock_t maxend; /* end of maximal extent */ xfs_agblock_t minend; /* end of minimal extent */ @@ -737,9 +731,6 @@ xfs_alloc_ag_vextent_near( xfs_btree_cur_t *bno_cur_gt; /* cursor for bno btree, right side */ xfs_btree_cur_t *bno_cur_lt; /* cursor for bno btree, left side */ xfs_btree_cur_t *cnt_cur; /* cursor for count btree */ -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_ag_vextent_near"; -#endif xfs_agblock_t gtbno; /* start bno of right side entry */ xfs_agblock_t gtbnoa; /* aligned ... */ xfs_extlen_t gtdiff; /* difference to right side entry */ @@ -1270,9 +1261,6 @@ xfs_alloc_ag_vextent_size( int error; /* error result */ xfs_agblock_t fbno; /* start of found freespace */ xfs_extlen_t flen; /* length of found freespace */ -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_ag_vextent_size"; -#endif int i; /* temp status variable */ xfs_agblock_t rbno; /* returned block number */ xfs_extlen_t rlen; /* length of returned extent */ @@ -1427,9 +1415,6 @@ xfs_alloc_ag_vextent_small( int error; xfs_agblock_t fbno; xfs_extlen_t flen; -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_ag_vextent_small"; -#endif int i; if ((error = xfs_alloc_decrement(ccur, 0, &i))) @@ -1515,9 +1500,6 @@ xfs_free_ag_extent( xfs_btree_cur_t *bno_cur; /* cursor for by-block btree */ xfs_btree_cur_t *cnt_cur; /* cursor for by-size btree */ int error; /* error return value */ -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_free_ag_extent"; -#endif xfs_agblock_t gtbno; /* start of right neighbor block */ xfs_extlen_t gtlen; /* length of right neighbor block */ int haveleft; /* have a left neighbor block */ @@ -1998,9 +1980,6 @@ xfs_alloc_get_freelist( xfs_buf_t *agflbp;/* buffer for a.g. freelist structure */ xfs_agblock_t bno; /* block number returned */ int error; -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_get_freelist"; -#endif xfs_mount_t *mp; /* mount structure */ xfs_perag_t *pag; /* per allocation group data */ @@ -2112,9 +2091,6 @@ xfs_alloc_put_freelist( xfs_agfl_t *agfl; /* a.g. free block array */ __be32 *blockp;/* pointer to array entry */ int error; -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_put_freelist"; -#endif xfs_mount_t *mp; /* mount structure */ xfs_perag_t *pag; /* per allocation group data */ @@ -2235,9 +2211,6 @@ xfs_alloc_vextent( xfs_agblock_t agsize; /* allocation group size */ int error; int flags; /* XFS_ALLOC_FLAG_... locking flags */ -#ifdef XFS_ALLOC_TRACE - static char fname[] = "xfs_alloc_vextent"; -#endif xfs_extlen_t minleft;/* minimum left value, temp copy */ xfs_mount_t *mp; /* mount structure pointer */ xfs_agnumber_t sagno; /* starting allocation group number */ Index: linux/fs/xfs/xfs_bmap.c =================================================================== --- linux.orig/fs/xfs/xfs_bmap.c +++ linux/fs/xfs/xfs_bmap.c @@ -277,7 +277,7 @@ xfs_bmap_isaeof( STATIC void xfs_bmap_trace_addentry( int opcode, /* operation */ - char *fname, /* function name */ + const char *fname, /* function name */ char *desc, /* operation description */ xfs_inode_t *ip, /* incore inode pointer */ xfs_extnum_t idx, /* index of entry(ies) */ @@ -291,7 +291,7 @@ xfs_bmap_trace_addentry( */ STATIC void xfs_bmap_trace_delete( - char *fname, /* function name */ + 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 */ @@ -304,7 +304,7 @@ xfs_bmap_trace_delete( */ STATIC void xfs_bmap_trace_insert( - char *fname, /* function name */ + 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 */ @@ -318,7 +318,7 @@ xfs_bmap_trace_insert( */ STATIC void xfs_bmap_trace_post_update( - char *fname, /* function name */ + const char *fname, /* function name */ char *desc, /* operation description */ xfs_inode_t *ip, /* incore inode pointer */ xfs_extnum_t idx, /* index of entry updated */ @@ -329,17 +329,25 @@ xfs_bmap_trace_post_update( */ STATIC void xfs_bmap_trace_pre_update( - char *fname, /* function name */ + 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(__FUNCTION__,d,ip,i,c,w) +#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) \ + xfs_bmap_trace_insert(__FUNCTION__,d,ip,i,c,r1,r2,w) +#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) \ + xfs_bmap_trace_post_update(__FUNCTION__,d,ip,i,w) +#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) \ + xfs_bmap_trace_pre_update(__FUNCTION__,d,ip,i,w) #else -#define xfs_bmap_trace_delete(f,d,ip,i,c,w) -#define xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w) -#define xfs_bmap_trace_post_update(f,d,ip,i,w) -#define xfs_bmap_trace_pre_update(f,d,ip,i,w) +#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 */ /* @@ -531,9 +539,6 @@ xfs_bmap_add_extent( xfs_filblks_t da_new; /* new count del alloc blocks used */ xfs_filblks_t da_old; /* old count del alloc blocks used */ int error; /* error return value */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_add_extent"; -#endif xfs_ifork_t *ifp; /* inode fork ptr */ int logflags; /* returned value */ xfs_extnum_t nextents; /* number of extents in file now */ @@ -551,8 +556,8 @@ xfs_bmap_add_extent( * already extents in the list. */ if (nextents == 0) { - xfs_bmap_trace_insert(fname, "insert empty", ip, 0, 1, new, - NULL, whichfork); + XFS_BMAP_TRACE_INSERT("insert empty", ip, 0, 1, new, NULL, + whichfork); xfs_iext_insert(ifp, 0, 1, new); ASSERT(cur == NULL); ifp->if_lastex = 0; @@ -710,9 +715,6 @@ xfs_bmap_add_extent_delay_real( int diff; /* temp value */ xfs_bmbt_rec_t *ep; /* extent entry for idx */ int error; /* error return value */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_add_extent_delay_real"; -#endif int i; /* temp state */ xfs_ifork_t *ifp; /* inode fork pointer */ xfs_fileoff_t new_endoff; /* end offset of new entry */ @@ -808,15 +810,14 @@ 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(fname, "LF|RF|LC|RC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LF|RF|LC|RC", ip, idx - 1, - XFS_DATA_FORK); - xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2, + 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); xfs_iext_remove(ifp, idx, 2); ip->i_df.if_lastex = idx - 1; ip->i_d.di_nextents--; @@ -855,15 +856,14 @@ 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(fname, "LF|RF|LC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LF|RF|LC", ip, idx - 1, + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; - xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); xfs_iext_remove(ifp, idx, 1); if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -892,16 +892,13 @@ 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(fname, "LF|RF|RC", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_startblock(ep, new->br_startblock); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount + RIGHT.br_blockcount); - xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; - xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); xfs_iext_remove(ifp, idx + 1, 1); if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -931,11 +928,9 @@ xfs_bmap_add_extent_delay_real( * Neither the left nor right neighbors are contiguous with * the new one. */ - xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_startblock(ep, new->br_startblock); - xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; ip->i_d.di_nextents++; if (cur == NULL) @@ -963,17 +958,14 @@ 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(fname, "LF|LC", ip, idx - 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_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(fname, "LF|LC", ip, idx - 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); temp = PREV.br_blockcount - new->br_blockcount; - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, temp); ip->i_df.if_lastex = idx - 1; if (cur == NULL) @@ -995,8 +987,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(fname, "LF|LC", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ temp = LEFT.br_startoff; @@ -1009,11 +1000,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(fname, "LF", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_startoff(ep, new_endoff); temp = PREV.br_blockcount - new->br_blockcount; xfs_bmbt_set_blockcount(ep, temp); - xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL, + XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL, XFS_DATA_FORK); xfs_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; @@ -1046,8 +1037,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(fname, "LF", ip, idx + 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ temp = PREV.br_startoff; @@ -1060,17 +1050,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(fname, "RF|RC", ip, idx, - XFS_DATA_FORK); - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1, - XFS_DATA_FORK); + 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); 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(fname, "RF|RC", ip, idx + 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx + 1; if (cur == NULL) rval = XFS_ILOG_DEXT; @@ -1091,8 +1078,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(fname, "RF|RC", ip, idx, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ temp = PREV.br_startoff; @@ -1106,10 +1092,10 @@ xfs_bmap_add_extent_delay_real( * The right neighbor is not contiguous. */ temp = PREV.br_blockcount - new->br_blockcount; - xfs_bmap_trace_pre_update(fname, "RF", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, temp); - xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, - new, NULL, XFS_DATA_FORK); + XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL, + XFS_DATA_FORK); xfs_iext_insert(ifp, idx + 1, 1, new); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents++; @@ -1141,7 +1127,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(fname, "RF", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ temp = PREV.br_startoff; @@ -1155,7 +1141,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(fname, "0", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, temp); r[0] = *new; r[1].br_state = PREV.br_state; @@ -1163,7 +1149,7 @@ 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(fname, "0", ip, idx + 1, 2, &r[0], &r[1], + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], XFS_DATA_FORK); xfs_iext_insert(ifp, idx + 1, 2, &r[0]); ip->i_df.if_lastex = idx + 1; @@ -1222,13 +1208,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(fname, "0", ip, idx, XFS_DATA_FORK); - xfs_bmap_trace_pre_update(fname, "0", ip, idx + 2, - XFS_DATA_FORK); + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_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(fname, "0", ip, idx + 2, - XFS_DATA_FORK); + XFS_BMAP_TRACE_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; @@ -1287,9 +1271,6 @@ xfs_bmap_add_extent_unwritten_real( xfs_btree_cur_t *cur; /* btree cursor */ xfs_bmbt_rec_t *ep; /* extent entry for idx */ int error; /* error return value */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_add_extent_unwritten_real"; -#endif int i; /* temp state */ xfs_ifork_t *ifp; /* inode fork pointer */ xfs_fileoff_t new_endoff; /* end offset of new entry */ @@ -1390,15 +1371,14 @@ 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(fname, "LF|RF|LC|RC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LF|RF|LC|RC", ip, idx - 1, - XFS_DATA_FORK); - xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2, + 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); xfs_iext_remove(ifp, idx, 2); ip->i_df.if_lastex = idx - 1; ip->i_d.di_nextents -= 2; @@ -1441,15 +1421,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(fname, "LF|RF|LC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LF|RF|LC", ip, idx - 1, + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; - xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); xfs_iext_remove(ifp, idx, 1); ip->i_d.di_nextents--; if (cur == NULL) @@ -1484,16 +1463,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(fname, "LF|RF|RC", ip, idx, + XFS_BMAP_TRACE_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(fname, "LF|RF|RC", ip, idx, + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; - xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, - XFS_DATA_FORK); + XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); xfs_iext_remove(ifp, idx + 1, 1); ip->i_d.di_nextents--; if (cur == NULL) @@ -1529,10 +1507,10 @@ xfs_bmap_add_extent_unwritten_real( * Neither the left nor right neighbors are contiguous with * the new one. */ - xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx, + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_state(ep, newext); - xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx, + XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; if (cur == NULL) @@ -1559,21 +1537,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(fname, "LF|LC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LF|LC", ip, idx - 1, + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx, + XFS_BMAP_TRACE_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(fname, "LF|LC", ip, idx, + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; if (cur == NULL) @@ -1610,15 +1588,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(fname, "LF", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_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(fname, "LF", ip, idx, XFS_DATA_FORK); - xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL, + 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_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; @@ -1653,18 +1631,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(fname, "RF|RC", ip, idx, + XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1, + XFS_BMAP_TRACE_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(fname, "RF|RC", ip, idx, + XFS_BMAP_TRACE_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(fname, "RF|RC", ip, idx + 1, + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx + 1; if (cur == NULL) @@ -1700,12 +1678,12 @@ 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(fname, "RF", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, PREV.br_blockcount - new->br_blockcount); - xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK); - xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, - new, NULL, XFS_DATA_FORK); + 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_iext_insert(ifp, idx + 1, 1, new); ip->i_df.if_lastex = idx + 1; ip->i_d.di_nextents++; @@ -1744,17 +1722,17 @@ xfs_bmap_add_extent_unwritten_real( * newext. Contiguity is impossible here. * One extent becomes three extents. */ - xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); xfs_bmbt_set_blockcount(ep, new->br_startoff - PREV.br_startoff); - xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_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(fname, "0", ip, idx + 1, 2, &r[0], &r[1], + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], XFS_DATA_FORK); xfs_iext_insert(ifp, idx + 1, 2, &r[0]); ip->i_df.if_lastex = idx + 1; @@ -1845,9 +1823,6 @@ xfs_bmap_add_extent_hole_delay( int rsvd) /* OK to allocate reserved blocks */ { xfs_bmbt_rec_t *ep; /* extent record for idx */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_add_extent_hole_delay"; -#endif xfs_ifork_t *ifp; /* inode fork pointer */ xfs_bmbt_irec_t left; /* left neighbor extent entry */ xfs_filblks_t newlen=0; /* new indirect size */ @@ -1919,7 +1894,7 @@ xfs_bmap_add_extent_hole_delay( */ temp = left.br_blockcount + new->br_blockcount + right.br_blockcount; - xfs_bmap_trace_pre_update(fname, "LC|RC", ip, idx - 1, + XFS_BMAP_TRACE_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) + @@ -1928,10 +1903,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(fname, "LC|RC", ip, idx - 1, - XFS_DATA_FORK); - xfs_bmap_trace_delete(fname, "LC|RC", ip, idx, 1, + XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, XFS_DATA_FORK); + XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK); xfs_iext_remove(ifp, idx, 1); ip->i_df.if_lastex = idx - 1; /* DELTA: Two in-core extents were replaced by one. */ @@ -1946,7 +1920,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(fname, "LC", ip, idx - 1, + XFS_BMAP_TRACE_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) + @@ -1954,7 +1928,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(fname, "LC", ip, idx - 1, + XFS_BMAP_TRACE_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. */ @@ -1968,14 +1942,14 @@ xfs_bmap_add_extent_hole_delay( * on the right. * Merge the new allocation with the right neighbor. */ - xfs_bmap_trace_pre_update(fname, "RC", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_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(fname, "RC", ip, idx, XFS_DATA_FORK); + XFS_BMAP_TRACE_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; @@ -1989,7 +1963,7 @@ xfs_bmap_add_extent_hole_delay( * Insert a new entry. */ oldlen = newlen = 0; - xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL, + XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, XFS_DATA_FORK); xfs_iext_insert(ifp, idx, 1, new); ip->i_df.if_lastex = idx; @@ -2039,9 +2013,6 @@ xfs_bmap_add_extent_hole_real( { xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */ int error; /* error return value */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_add_extent_hole_real"; -#endif int i; /* temp state */ xfs_ifork_t *ifp; /* inode fork pointer */ xfs_bmbt_irec_t left; /* left neighbor extent entry */ @@ -2118,15 +2089,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(fname, "LC|RC", ip, idx - 1, + XFS_BMAP_TRACE_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(fname, "LC|RC", ip, idx - 1, + XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, whichfork); - xfs_bmap_trace_delete(fname, "LC|RC", ip, - idx, 1, whichfork); + XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, whichfork); xfs_iext_remove(ifp, idx, 1); ifp->if_lastex = idx - 1; XFS_IFORK_NEXT_SET(ip, whichfork, @@ -2168,10 +2138,10 @@ xfs_bmap_add_extent_hole_real( * on the left. * Merge the new allocation with the left neighbor. */ - xfs_bmap_trace_pre_update(fname, "LC", ip, idx - 1, whichfork); + XFS_BMAP_TRACE_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(fname, "LC", ip, idx - 1, whichfork); + XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, whichfork); ifp->if_lastex = idx - 1; if (cur == NULL) { rval = XFS_ILOG_FEXT(whichfork); @@ -2202,11 +2172,11 @@ xfs_bmap_add_extent_hole_real( * on the right. * Merge the new allocation with the right neighbor. */ - xfs_bmap_trace_pre_update(fname, "RC", ip, idx, whichfork); + XFS_BMAP_TRACE_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(fname, "RC", ip, idx, whichfork); + XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, whichfork); ifp->if_lastex = idx; if (cur == NULL) { rval = XFS_ILOG_FEXT(whichfork); @@ -2237,8 +2207,7 @@ xfs_bmap_add_extent_hole_real( * real allocation. * Insert a new entry. */ - xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL, - whichfork); + XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, whichfork); xfs_iext_insert(ifp, idx, 1, new); ifp->if_lastex = idx; XFS_IFORK_NEXT_SET(ip, whichfork, @@ -3051,9 +3020,6 @@ xfs_bmap_del_extent( xfs_bmbt_rec_t *ep; /* current extent entry pointer */ int error; /* error return value */ int flags; /* inode logging flags */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_del_extent"; -#endif xfs_bmbt_irec_t got; /* current extent entry */ xfs_fileoff_t got_endoff; /* first offset past got */ int i; /* temp state */ @@ -3147,7 +3113,7 @@ xfs_bmap_del_extent( /* * Matches the whole extent. Delete the entry. */ - xfs_bmap_trace_delete(fname, "3", ip, idx, 1, whichfork); + XFS_BMAP_TRACE_DELETE("3", ip, idx, 1, whichfork); xfs_iext_remove(ifp, idx, 1); ifp->if_lastex = idx; if (delay) @@ -3168,7 +3134,7 @@ xfs_bmap_del_extent( /* * Deleting the first part of the extent. */ - xfs_bmap_trace_pre_update(fname, "2", ip, idx, whichfork); + XFS_BMAP_TRACE_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); @@ -3177,13 +3143,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(fname, "2", ip, idx, + XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); da_new = temp; break; } xfs_bmbt_set_startblock(ep, del_endblock); - xfs_bmap_trace_post_update(fname, "2", ip, idx, whichfork); + XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); if (!cur) { flags |= XFS_ILOG_FEXT(whichfork); break; @@ -3199,19 +3165,19 @@ xfs_bmap_del_extent( * Deleting the last part of the extent. */ temp = got.br_blockcount - del->br_blockcount; - xfs_bmap_trace_pre_update(fname, "1", ip, idx, whichfork); + XFS_BMAP_TRACE_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(fname, "1", ip, idx, + XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); da_new = temp; break; } - xfs_bmap_trace_post_update(fname, "1", ip, idx, whichfork); + XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); if (!cur) { flags |= XFS_ILOG_FEXT(whichfork); break; @@ -3228,7 +3194,7 @@ xfs_bmap_del_extent( * Deleting the middle of the extent. */ temp = del->br_startoff - got.br_startoff; - xfs_bmap_trace_pre_update(fname, "0", ip, idx, whichfork); + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, whichfork); xfs_bmbt_set_blockcount(ep, temp); new.br_startoff = del_endoff; temp2 = got_endoff - del_endoff; @@ -3315,8 +3281,8 @@ xfs_bmap_del_extent( } } } - xfs_bmap_trace_post_update(fname, "0", ip, idx, whichfork); - xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 1, &new, NULL, + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, whichfork); + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 1, &new, NULL, whichfork); xfs_iext_insert(ifp, idx + 1, 1, &new); ifp->if_lastex = idx + 1; @@ -3556,9 +3522,6 @@ xfs_bmap_local_to_extents( { int error; /* error return value */ int flags; /* logging flags returned */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_local_to_extents"; -#endif xfs_ifork_t *ifp; /* inode fork pointer */ /* @@ -3613,7 +3576,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(fname, "new", ip, 0, whichfork); + XFS_BMAP_TRACE_POST_UPDATE("new", ip, 0, whichfork); XFS_IFORK_NEXT_SET(ip, whichfork, 1); ip->i_d.di_nblocks = 1; XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip, @@ -3736,7 +3699,7 @@ ktrace_t *xfs_bmap_trace_buf; STATIC void xfs_bmap_trace_addentry( int opcode, /* operation */ - char *fname, /* function name */ + const char *fname, /* function name */ char *desc, /* operation description */ xfs_inode_t *ip, /* incore inode pointer */ xfs_extnum_t idx, /* index of entry(ies) */ @@ -3795,7 +3758,7 @@ xfs_bmap_trace_addentry( */ STATIC void xfs_bmap_trace_delete( - char *fname, /* function name */ + 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 */ @@ -3817,7 +3780,7 @@ xfs_bmap_trace_delete( */ STATIC void xfs_bmap_trace_insert( - char *fname, /* function name */ + 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 */ @@ -3846,7 +3809,7 @@ xfs_bmap_trace_insert( */ STATIC void xfs_bmap_trace_post_update( - char *fname, /* function name */ + const char *fname, /* function name */ char *desc, /* operation description */ xfs_inode_t *ip, /* incore inode pointer */ xfs_extnum_t idx, /* index of entry updated */ @@ -3864,7 +3827,7 @@ xfs_bmap_trace_post_update( */ STATIC void xfs_bmap_trace_pre_update( - char *fname, /* function name */ + 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 */ @@ -4478,9 +4441,6 @@ xfs_bmap_read_extents( xfs_buf_t *bp; /* buffer for "block" */ int error; /* error return value */ xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */ -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_bmap_read_extents"; -#endif xfs_extnum_t i, j; /* index into the extents list */ xfs_ifork_t *ifp; /* fork structure */ int level; /* btree level, for checking */ @@ -4597,7 +4557,7 @@ xfs_bmap_read_extents( } ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t))); ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork)); - xfs_bmap_trace_exlist(fname, ip, i, whichfork); + XFS_BMAP_TRACE_EXLIST(ip, i, whichfork); return 0; error0: xfs_trans_brelse(tp, bp); @@ -4625,7 +4585,7 @@ 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(fname, "exlist", ip, idx, 1, &s, NULL, + XFS_BMAP_TRACE_INSERT("exlist", ip, idx, 1, &s, NULL, whichfork); } } Index: linux/fs/xfs/xfs_bmap.h =================================================================== --- linux.orig/fs/xfs/xfs_bmap.h +++ linux/fs/xfs/xfs_bmap.h @@ -144,12 +144,14 @@ extern ktrace_t *xfs_bmap_trace_buf; */ void xfs_bmap_trace_exlist( - char *fname, /* function name */ + const char *fname, /* function name */ struct xfs_inode *ip, /* incore inode pointer */ xfs_extnum_t cnt, /* count of entries in list */ int whichfork); /* data or attr fork */ +#define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ + xfs_bmap_trace_exlist(__FUNCTION__,ip,c,w) #else -#define xfs_bmap_trace_exlist(f,ip,c,w) +#define XFS_BMAP_TRACE_EXLIST(ip,c,w) #endif /* Index: linux/fs/xfs/xfs_inode.c =================================================================== --- linux.orig/fs/xfs/xfs_inode.c +++ linux/fs/xfs/xfs_inode.c @@ -642,8 +642,7 @@ xfs_iformat_extents( ep->l1 = INT_GET(get_unaligned((__uint64_t*)&dp->l1), ARCH_CONVERT); } - xfs_bmap_trace_exlist("xfs_iformat_extents", ip, nex, - whichfork); + XFS_BMAP_TRACE_EXLIST(ip, nex, whichfork); if (whichfork != XFS_DATA_FORK || XFS_EXTFMT_INODE(ip) == XFS_EXTFMT_NOSTATE) if (unlikely(xfs_check_nostate_extents( @@ -2845,9 +2844,6 @@ xfs_iextents_copy( int copied; xfs_bmbt_rec_t *dest_ep; xfs_bmbt_rec_t *ep; -#ifdef XFS_BMAP_TRACE - static char fname[] = "xfs_iextents_copy"; -#endif int i; xfs_ifork_t *ifp; int nrecs; @@ -2858,7 +2854,7 @@ xfs_iextents_copy( ASSERT(ifp->if_bytes > 0); nrecs = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); - xfs_bmap_trace_exlist(fname, ip, nrecs, whichfork); + XFS_BMAP_TRACE_EXLIST(ip, nrecs, whichfork); ASSERT(nrecs > 0); /* --------------040201070004000506070208-- From owner-xfs@oss.sgi.com Wed Mar 7 00:54:07 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 07 Mar 2007 00:54:11 -0800 (PST) X-Spam-oss-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.0-pre1-r499012 Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l278s46p017851 for ; Wed, 7 Mar 2007 00:54:06 -0800 Received: from hch by pentafluge.infradead.org with local (Exim 4.63 #1 (Red Hat Linux)) id 1HOrV3-0001YG-Db; Wed, 07 Mar 2007 08:27:53 +0000 Date: Wed, 7 Mar 2007 08:27:53 +0000 From: Christoph Hellwig To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: Re: [PATCH] get rid of fname[] for tracing functions Message-ID: <20070307082753.GA5469@infradead.org> References: <45EE2EF3.8090707@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45EE2EF3.8090707@sandeen.net> User-Agent: Mutt/1.4.2.2i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-archive-position: 10772 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs Content-Length: 1279 Lines: 35 On Tue, Mar 06, 2007 at 09:18:11PM -0600, Eric Sandeen wrote: > this gets rid of the > > #ifdef XFS_BMAP_TRACE > static char fname[] = "xfs_iextents_copy"; > #endif > > ugliness littered in the bmap code for tracing, and instead just uses > gcc's __FUNCTION__, which never gets out of sync with the actual > function name.... > > It also makes some of this tracing more consistently use the > > #define XFS_BMBT_TRACE_ARGBI(c,b,i) \ > xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__) > > type constructs, to automatically pick up the gcc extensions. Very nice. I might hear some people to scream that we should use the C99 __func__ and not the __FUNCTION__ gccism, but __FUNCTION__ is what the rest of the Linux kernel uses, and can be emulated with a trivial #define __func__ __FUNCTION__ on any non-gcc C99 system. > the vn tracing could probably get a similar treatment, so that every > call to vn_trace_foo wouldn't have to include a function name and a > __builtin_return_address, but could be done via macros... it's currently > a mishmash of __FUNCTION__ and "function" *shrug* what do you think? It should probably use __FUNCTION__ and hide use of both __FUNCTION__ and __builtin_return_address behind a macro. From owner-xfs@oss.sgi.com Wed Mar 7 02:13:21 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 07 Mar 2007 02:13:24 -0800 (PST) X-Spam-oss-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l27ADJ6p031368 for ; Wed, 7 Mar 2007 02:13:21 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l27ADEb2030938 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 7 Mar 2007 11:13:14 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l27ADE9l030936; Wed, 7 Mar 2007 11:13:14 +0100 Date: Wed, 7 Mar 2007 11:13:14 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com, ecashin@coraid.com, akpm@osdl.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] xfs: use xfs_get_buf_noaddr for iclogs Message-ID: <20070307101314.GB30587@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 10774 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Content-Length: 2443 Lines: 66 Currently xlog_alloc allocates memory for the iclogs first, then allocates a buffer using xfs_buf_get_empty and finally assigns the memory to the buffer. We don't really want to do this, but rather allocate a buffer with memory attached to it using xfs_buf_get_noaddr. There's a subtile change because xfs_buf_get_empty returns the buffer locked, but xfs_buf_get_noaddr returns it unlocked. From my auditing and testing nothing in the log I/O code cares about this distincition, but I'd be happy if someone could try to prove this independently. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/xfs/xfs_log.c =================================================================== --- linux-2.6.orig/fs/xfs/xfs_log.c 2007-03-06 17:26:40.000000000 +0100 +++ linux-2.6/fs/xfs/xfs_log.c 2007-03-06 17:28:03.000000000 +0100 @@ -1199,11 +1199,16 @@ *iclogp = (xlog_in_core_t *) kmem_zalloc(sizeof(xlog_in_core_t), KM_SLEEP); iclog = *iclogp; - iclog->hic_data = (xlog_in_core_2_t *) - kmem_zalloc(iclogsize, KM_SLEEP | KM_LARGE); - iclog->ic_prev = prev_iclog; prev_iclog = iclog; + + bp = xfs_buf_get_noaddr(log->l_iclog_size, mp->m_logdev_targp); + XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); + XFS_BUF_SET_BDSTRAT_FUNC(bp, xlog_bdstrat_cb); + XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); + iclog->ic_bp = bp; + iclog->hic_data = bp->b_addr; + log->l_iclog_bak[i] = (xfs_caddr_t)&(iclog->ic_header); head = &iclog->ic_header; @@ -1216,11 +1221,6 @@ INT_SET(head->h_fmt, ARCH_CONVERT, XLOG_FMT); memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t)); - bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp); - XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); - XFS_BUF_SET_BDSTRAT_FUNC(bp, xlog_bdstrat_cb); - XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); - iclog->ic_bp = bp; iclog->ic_size = XFS_BUF_SIZE(bp) - log->l_iclog_hsize; iclog->ic_state = XLOG_STATE_ACTIVE; @@ -1229,7 +1229,6 @@ iclog->ic_datap = (char *)iclog->hic_data + log->l_iclog_hsize; ASSERT(XFS_BUF_ISBUSY(iclog->ic_bp)); - ASSERT(XFS_BUF_VALUSEMA(iclog->ic_bp) <= 0); sv_init(&iclog->ic_forcesema, SV_DEFAULT, "iclog-force"); sv_init(&iclog->ic_writesema, SV_DEFAULT, "iclog-write"); @@ -1528,7 +1527,6 @@ } #endif next_iclog = iclog->ic_next; - kmem_free(iclog->hic_data, log->l_iclog_size); kmem_free(iclog, sizeof(xlog_in_core_t)); iclog = next_iclog; } From owner-xfs@oss.sgi.com Wed Mar 7 02:13:32 2007 Received: with ECARTIS (v1.0.0; list xfs); Wed, 07 Mar 2007 02:13:35 -0800 (PST) X-Spam-oss-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.2.0-pre1-r499012 Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l27ADT6p031427 for ; Wed, 7 Mar 2007 02:13:31 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id l27ADOb2030971 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 7 Mar 2007 11:13:24 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id l27ADOQi030969; Wed, 7 Mar 2007 11:13:24 +0100 Date: Wed, 7 Mar 2007 11:13:24 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com, ecashin@coraid.com, akpm@osdl.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] xfs: stop using kmalloc in xfs_buf_get_noaddr Message-ID: <20070307101324.GC30587@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 10775 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Content-Length: 4209 Lines: 128 Currently xfs_buf_get_noaddr allocates memory using kmem_alloc which can end up either in kmalloc or vmalloc and assigns it to the buffer. This patch changes it to allocate individual pages and if there is more then one maps it into kernel virtual space using vmap. This means the minimum buffer allocation is PAGE_SIZE now. For two of the three caller (log buffers, log recovery) that is perfectly fine, because they always allocate buffers that are a power of two of the page size anyway. For xfs_zero_remaining_bytes the minimum allocation goes up from blocksize to pagesize and thus there is a potential waste of memory for blocksize < pagesize allocations, which is unfortunate but not directly solveable when block drivers expect reference countable pages. To fix this waste xfs_zero_remaining_bytes could be rewritten to zero more than a single block at a time, which sounds like a good idea in general. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-03-05 15:54:40.000000000 +0100 +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c 2007-03-05 15:54:47.000000000 +0100 @@ -314,7 +314,7 @@ ASSERT(list_empty(&bp->b_hash_list)); - if (bp->b_flags & _XBF_PAGE_CACHE) { + if (bp->b_flags & (_XBF_PAGE_CACHE|_XBF_PAGES)) { uint i; if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) @@ -323,18 +323,11 @@ for (i = 0; i < bp->b_page_count; i++) { struct page *page = bp->b_pages[i]; - ASSERT(!PagePrivate(page)); + if (bp->b_flags & _XBF_PAGE_CACHE) + ASSERT(!PagePrivate(page)); page_cache_release(page); } _xfs_buf_free_pages(bp); - } else if (bp->b_flags & _XBF_KMEM_ALLOC) { - /* - * XXX(hch): bp->b_count_desired might be incorrect (see - * xfs_buf_associate_memory for details), but fortunately - * the Linux version of kmem_free ignores the len argument.. - */ - kmem_free(bp->b_addr, bp->b_count_desired); - _xfs_buf_free_pages(bp); } xfs_buf_deallocate(bp); @@ -764,41 +757,41 @@ size_t len, xfs_buftarg_t *target) { - size_t malloc_len = len; + unsigned long page_count = PAGE_ALIGN(len) >> PAGE_SHIFT; + int error, i; xfs_buf_t *bp; - void *data; - int error; bp = xfs_buf_allocate(0); if (unlikely(bp == NULL)) goto fail; _xfs_buf_initialize(bp, target, 0, len, 0); - try_again: - data = kmem_alloc(malloc_len, KM_SLEEP | KM_MAYFAIL | KM_LARGE); - if (unlikely(data == NULL)) + error = _xfs_buf_get_pages(bp, page_count, 0); + if (error) goto fail_free_buf; - /* check whether alignment matches.. */ - if ((__psunsigned_t)data != - ((__psunsigned_t)data & ~target->bt_smask)) { - /* .. else double the size and try again */ - kmem_free(data, malloc_len); - malloc_len <<= 1; - goto try_again; - } - - error = xfs_buf_associate_memory(bp, data, len); - if (error) + for (i = 0; i < page_count; i++) { + bp->b_pages[i] = alloc_page(GFP_KERNEL); + if (!bp->b_pages[i]) + goto fail_free_mem; + } + bp->b_flags |= _XBF_PAGES; + + error = _xfs_buf_map_pages(bp, XBF_MAPPED); + if (unlikely(error)) { + printk(KERN_WARNING "%s: failed to map pages\n", + __FUNCTION__); goto fail_free_mem; - bp->b_flags |= _XBF_KMEM_ALLOC; + } xfs_buf_unlock(bp); XB_TRACE(bp, "no_daddr", data); return bp; + fail_free_mem: - kmem_free(data, malloc_len); + for ( ; i >= 0; i++) + __free_page(bp->b_pages[i]); fail_free_buf: xfs_buf_free(bp); fail: Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.h 2007-03-05 15:54:40.000000000 +0100 +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.h 2007-03-05 15:55:06.000000000 +0100 @@ -63,7 +63,7 @@